Checks that a mobile device management (MDM) solution configures the Mac to prevent guest access to shared folders.
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>guestAccess</key>
<false/>
<key>PayloadDisplayName</key>
<string>File Server</string>
<key>PayloadIdentifier</key>
<string>com.apple.AppleFileServer.0C0C0FED-098F-4BAA-8917-3313A8A1F3A1</string>
<key>PayloadType</key>
<string>com.apple.AppleFileServer</string>
<key>PayloadUUID</key>
<string>0C0C0FED-098F-4BAA-8917-3313A8A1F3A1</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Disable guest access to shared folders</string>
<key>PayloadIdentifier</key>
<string>com.fleetdm.disableGuestAccessToSharedFolders.819D93D8-E078-43A5-9661-F5E96F84F384</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>819D93D8-E078-43A5-9661-F5E96F84F384</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.AppleFileServer' AND name='guestAccess' AND value='0' LIMIT 1;