TMA-MACOS-2.11.2
Ensure Require Password After Screen Saver Begins or Display Is Turned Off Is Enabled for 5 Seconds or Immediately
Description
Sleep and screen saver modes are low power modes that reduce electrical consumption while the system is not in use. Audit: Passes when sysadminctl reports immediate/5 seconds for the console user or a profile sets askForPassword with askForPasswordDelay <= 5.
Méthode de vérification
Méthode d'audit: Commande shell
s=$(/usr/sbin/sysadminctl -screenLock status 2>&1) || exit 1
p=$(/usr/bin/osascript -l JavaScript <<'EOS'
function run() {
let pref1 = ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.screensaver').objectForKey('askForPassword'))
let pref2 = ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.screensaver').objectForKey('askForPasswordDelay'))
if ( pref1 == 1 && pref2 <= 5 ) {
return("true")
} else {
return("false")
}
}
EOS
)
if printf '%s' "$s" | /usr/bin/grep -qE 'screenLock delay is (immediate|5 seconds)' || [ "$p" = true ]; then echo compliant; else echo "$s"; fi- Sortie attendue
compliant
Méthode de correction
Méthode de correction: Recommandation ou correctif d'infrastructure
Profile (preferred): com.apple.screensaver askForPassword = <true/>; com.apple.screensaver askForPasswordDelay = <integer><0,5></integer>. Terminal: sudo /usr/sbin/sysadminctl -screenLock immediate -password <administrator password> or ; sudo /usr/sbin/sysadminctl -screenLock 5 seconds -password <administrator password>. GUI: System Settings > Lock Screen > Set Require password after screensaver begins or display is turned off to either After 0 seconds or After 5 seconds.
Propriétés
- Systèmes d'exploitation
- macos-26
- Étiquettes
- macossystem-settings
- Référence
- CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 2.11.2 Ensure Require Password After Screen Saver Begins or Display Is Turned Off Is Enabled for 5 Seconds or Immediately
Vérifier cet hôte
Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.
tmaegis scan --target macos