Checks that a mobile device management (MDM) solution configures the Mac to prevent the use of a guest account.
Create or edit a configuration profile with the following information:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>DisableGuestAccount</key>
<true/>
<key>PayloadDisplayName</key>
<string>Energy Saver, FileVault, Time Server, Mobile Accounts and Guest Account</string>
<key>PayloadIdentifier</key>
<string>com.apple.MCX.87E0D7FE-FDEF-4B61-8505-C009C975AFD4</string>
<key>PayloadType</key>
<string>com.apple.MCX</string>
<key>PayloadUUID</key>
<string>87E0D7FE-FDEF-4B61-8505-C009C975AFD4</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Disable guest account</string>
<key>PayloadIdentifier</key>
<string>com.fleetdm.disableGuestAccount.E29C0490-83B0-4AD1-AD50-AC9B63D1DD96</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>E29C0490-83B0-4AD1-AD50-AC9B63D1DD96</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
Create or edit the following script and configure it to run when the check fails:
Use the policy below to verify
SELECT 1 FROM managed_policies WHERE domain='com.apple.MCX' AND name='DisableGuestAccount' AND value='1' LIMIT 1;