Last active
April 25, 2019 18:11
-
-
Save AndrewWCarson/0025d862725dd223e7efd0e533f60bf9 to your computer and use it in GitHub Desktop.
Snippet for checking kernel extension whitelisting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KEXT_TEAM_ID="ABCDEFG" | |
majorVersion=$(sw_vers -productVersion | awk -F. '{print $2}') | |
minorVersion=$(sw_vers -productVersion | awk -F. '{print $3}') | |
echo "Major macOS version: $majorVersion" | |
echo "Minor macOS version: $minorVersion" | |
if (( majorVersion > 13 )) || (( majorVersion == 13 && minorVersion > 2 )); then | |
if ! /usr/bin/sqlite3 /var/db/SystemPolicyConfiguration/KextPolicy "SELECT team_id FROM kext_policy_mdm;" | /usr/bin/grep "$KEXT_TEAM_ID"; then | |
echo 'Kernel extension not whitelisted.' | |
exit 1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment