Checks that a mobile device management (MDM) solution configures the Mac to enabled secure keyboard entry for the Terminal application.
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>SecureKeyboardEntry</key>
<true/>
<key>PayloadDisplayName</key>
<string>Terminal</string>
<key>PayloadIdentifier</key>
<string>com.apple.Terminal.89C5FA0F-CA32-4CC7-99D9-931B13CB923B</string>
<key>PayloadType</key>
<string>com.apple.Terminal</string>
<key>PayloadUUID</key>
<string>89C5FA0F-CA32-4CC7-99D9-931B13CB923B</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Enable Terminal Secure Keyboard Entry</string>
<key>PayloadIdentifier</key>
<string>com.fleetdm.enableterminalsecurekeyboardentry.6E73E3DF-0D0A-4B17-BBCB-3E0906C78743</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>6E73E3DF-0D0A-4B17-BBCB-3E0906C78743</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.Terminal' AND name = 'SecureKeyboardEntry' AND value = 1 LIMIT 1;