Posted on 06-13-2019 10:03 AM
Anyone have any luck creating an Extension Attribute to report on what Apps and Kexts are not Notarized? I started with this, but I'm not getting the information outputted into something useful. Ideally I'd like to only show rejected apps, but anything readable will be useful.
#!/bin/bash
# Check for macOS Mojave
sw_vers_Major=$(/usr/bin/sw_vers -productVersion | /usr/bin/cut -d. -f 1,2)
if [ $sw_vers_Major != 10.14 ];then
echo "Incompatible for Script"
else
FileName="/tmp/apps.csv"
# Check for Application Notarization
AppCheck=$( for app in /Applications/*.app;do
echo "$(basename "$app")"
spctl -v -a /Applications/"$(basename "$app")"
done )
# Check for Kext Notarization
KextCheck=$( for kext in /Library/Extensions/*.kext;do
echo "$(basename "$kext")"
kextutil -nt /Library/Extensions/"$(basename "$kext")"
done )
# Output Data to CSV
echo $AppCheck $KextCheck >> $FileName
fi