How can I detect if Secure Boot is enabled?

One of the main reasons customers contact our support center is because the wrong version of the driver is loading. This is a direct result of Secure Boot being enabled.

How can I detect if Secure Boot is enabled so we can warn users that they will encounter aberrant behavior until they disable it?
Apple Secure Boot state on Intel-based Macs can be obtained from NVRAM:
Code Block sh
nvram 94b73556-2197-4702-82a8-3e1337dafbfb:AppleSecureBootPolicy

If the variable is found, it can be one of the following:
  • %02 - Full Security Mode

  • %01 - Medium Security Mode

  • %00 - No Security Mode

If the variable is not found, Apple Secure Boot is not supported.



This is so awesome!!
Thank you so very much.
Is there a similar command to determine the the boot security settings on a Mac with Apple silicon? I understand that this is configured on a volume by volume basis but can't find any security settings reported by diskutil.
How can I detect if Secure Boot is enabled?
 
 
Q