diff --git a/extension-attributes/Charger Wattage.sh b/extension-attributes/Charger Wattage.sh new file mode 100644 index 0000000..2115711 --- /dev/null +++ b/extension-attributes/Charger Wattage.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +### +# +# Name: Charger Wattage.sh +# Description: Reports the wattage of the power adapter (if connected). +# Created: 2022-10-05 +# Last Modified: 2024-11-15 +# Version: 1.0.2 +# +# +# Copyright 2022 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +### + + + +########## main process ########## + + + +# Report results. +echo "$(/usr/sbin/system_profiler SPPowerDataType | /usr/bin/awk '/Wattage/ {print $NF}')" + + + +exit 0 diff --git a/extension-attributes/Kernel Extensions (Third-Party).sh b/extension-attributes/Kernel Extensions (Third-Party).sh index a432ce9..3e4095b 100755 --- a/extension-attributes/Kernel Extensions (Third-Party).sh +++ b/extension-attributes/Kernel Extensions (Third-Party).sh @@ -3,10 +3,10 @@ ### # # Name: Kernel Extensions (Third-Party).sh -# Description: Displays all third-party kernel extensions installed. +# Description: Displays all enabled third-party kernel extensions. # Created: 2016-08-17 -# Last Modified: 2024-05-30 -# Version: 2.0 +# Last Modified: 2024-11-15 +# Version: 2.0.0.1 # # # Copyright 2016 Palantir Technologies, Inc. diff --git a/extension-attributes/Remote Login.sh b/extension-attributes/Remote Login.sh new file mode 100755 index 0000000..af1bfcf --- /dev/null +++ b/extension-attributes/Remote Login.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +### +# +# Name: Remote Login.sh +# Description: Reports whether Remote Login is On or Off. +# Created: 2021-08-02 +# Last Modified: 2024-11-15 +# Version: 1.0.1 +# +# +# Copyright 2021 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +### + + + +########## main process ########## + + + +# Report result. +echo "$(/usr/sbin/systemsetup -getremotelogin | /usr/bin/awk '{print $NF}')" + + + +exit 0 diff --git a/extension-attributes/Startup Volume.sh b/extension-attributes/Startup Volume.sh new file mode 100755 index 0000000..ed9d6fa --- /dev/null +++ b/extension-attributes/Startup Volume.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +### +# +# Name: Startup Volume.sh +# Description: Reports the name of the startup volume. +# Created: 2024-02-27 +# Last Modified: 2024-11-15 +# Version: 1.0.1 +# +# +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +### + + + +########## main process ########## + + + +echo "$(/usr/sbin/diskutil info -plist "$(bless --getBoot)" | /usr/bin/plutil -extract VolumeName raw -- -)" + + + +exit 0 diff --git a/extension-attributes/System Extensions.sh b/extension-attributes/System Extensions.sh index d24f85a..b8cdf28 100755 --- a/extension-attributes/System Extensions.sh +++ b/extension-attributes/System Extensions.sh @@ -3,10 +3,10 @@ ### # # Name: System Extensions.sh -# Description: Lists all system extensions by running systemextensionsctl list. +# Description: Lists all enabled system extensions. # Created: 2024-02-06 -# Last Modified: 2024-05-30 -# Version: 1.0.1 +# Last Modified: 2024-11-15 +# Version: 1.0.2 # # # Copyright 2024 Palantir Technologies, Inc. @@ -33,7 +33,7 @@ # Report results. -echo "$(/usr/bin/systemextensionsctl list)" +echo "$(/usr/bin/systemextensionsctl list | /usr/bin/awk '/ enabled/ {print $4}' | /usr/bin/sort)" diff --git a/extension-attributes/VirtualBox Extension Packs.sh b/extension-attributes/VirtualBox Extension Packs.sh new file mode 100755 index 0000000..f83256f --- /dev/null +++ b/extension-attributes/VirtualBox Extension Packs.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +### +# +# Name: VirtualBox Extension Packs.sh +# Description: Reports whether any VirtualBox extension packs are installed. +# Created: 2019-12-17 +# Last Modified: 2024-11-15 +# Version: 1.0.3 +# +# +# Copyright 2019 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +### + + + +########## variable-ing ########## + + + +VBoxManagePath="/Applications/VirtualBox.app/Contents/MacOS/VBoxManage" +extpackCheck="" + + + +########## main process ########## + + + +if [ -e "$VBoxManagePath" ]; then + if [ "$("$VBoxManagePath" list extpacks | /usr/bin/awk '/Extension Packs/ {print $NF}')" -gt 0 ]; then + extpackCheck="installed" + fi +fi + + + + +echo "${extpackCheck}" + + + +exit 0 diff --git a/extension-attributes/Wi-Fi Network.sh b/extension-attributes/Wi-Fi Network.sh new file mode 100755 index 0000000..0ec3126 --- /dev/null +++ b/extension-attributes/Wi-Fi Network.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +### +# +# Name: Wi-Fi Network.sh +# Description: Displays the current Wi-Fi network for the default network adapter (en0). +# Created: 2024-10-17 +# Last Modified: 2024-11-15 +# Version: 1.0.1 +# +# +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +### + + + +########## main process ########## + + + +# Report results. +echo "$(/usr/sbin/networksetup -getairportnetwork en0 2>"/dev/null" | /usr/bin/awk -F 'Current Wi-Fi Network: ' '{print $2}')" + + + +exit 0 diff --git a/extension-attributes/dotnet Runtime Versions.sh b/extension-attributes/dotnet Runtime Versions.sh new file mode 100755 index 0000000..38ae526 --- /dev/null +++ b/extension-attributes/dotnet Runtime Versions.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +### +# +# Name: dotnet Runtime Versions.sh +# Description: Reports versions of all .NET runtimes installed. +# Created: 2021-08-04 +# Last Modified: 2024-11-15 +# Version: 1.1.2 +# +# +# Copyright 2021 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +### + + + +########## variable-ing ########## + + + +loggedInUser=$(/usr/bin/stat -f%Su "/dev/console") +version="" + + + +########## function-ing ########## + + + +# Exits if root is the currently logged-in user, or no logged-in user is detected. +check_logged_in_user () { + if [ "$loggedInUser" = "root" ] || [ -z "$loggedInUser" ]; then + echo "Nobody is logged in, no action required." + exit 0 + fi +} + + + +########## main process ########## + + + +# Check script prerequisites. +check_logged_in_user + + +# List .NET runtimes and get version strings. +if [ -e "/usr/local/share/dotnet/dotnet" ]; then + version=$(sudo -u "$loggedInUser" /usr/local/share/dotnet/dotnet --list-runtimes | /usr/bin/awk '/.NETCore.App/ {print $2}') +fi + + +# Report results. +echo "${version}" + + + +exit 0 diff --git a/scripts/Reset Osquery Database.sh b/scripts/Reset Osquery Database.sh new file mode 100755 index 0000000..2bddb21 --- /dev/null +++ b/scripts/Reset Osquery Database.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +### +# +# Name: Reset Osquery Database.sh +# Description: Runs osqueryctl clean to reset the local database, then restarts the service. +# Created: 2020-08-19 +# Last Modified: 2024-11-15 +# Version: 1.0.1 +# +# +# Copyright 2020 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +### + + + +########## variable-ing ########## + + + +binaryPath="/usr/local/bin/osqueryctl" + + + +########## main process ########## + + + +# Reset Osquery database. +if [ -e "$binaryPath" ]; then + "$binaryPath" stop + "$binaryPath" clean + "$binaryPath" start + echo "Ran osqueryctl clean to reset the local database and restarted the service." +else + echo "❌ ERROR: osqueryctl binary not found at ${binaryPath}, unable to proceed." + exit 1 +fi + + + +exit 0