macOS
TMA-MACOS14-5.2.1
Ensure Password Account Lockout Threshold Is Configured
说明
The account lockout threshold specifies the amount of times a user can enter an incorrect password before a lockout will occur. Ensure that a lockout threshold is part of the password policy on the computer. The account lockout feature mitigates brute-force password attacks on the system.
检查方式
审计方法: Shell 命令
v=$(/usr/bin/pwpolicy -getaccountpolicies 2>/dev/null | /usr/bin/tail -n +2 | /usr/bin/xmllint --xpath '//dict/key[text()="policyAttributeMaximumFailedAuthentications"]/following-sibling::integer[1]/text()' - 2>/dev/null) || exit 1
v=$(printf '%s\n' "$v" | /usr/bin/head -1)
if [ -n "$v" ] && [ "$v" -le 5 ]; then echo compliant; else echo "policyAttributeMaximumFailedAuthentications=${v:-unset}"; fi- 预期输出
compliant
修复方式
修复方法: 操作指南或基础设施补丁
Terminal Method: Run the following command to set the maximum number of failed login attempts to less than or equal to 5: % /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxFailedLoginAttempts=<value≤5>" example: % /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxFailedLoginAttempts=5" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is maxFailedAttempts 3. The key must be set to <integer><value≤5></integer> Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release. Note: This is for the login password only and does not affect the timeout of FileVault.
属性
- 操作系统
- macos-14
- 标签
- authmacossonoma
- 参考
- CIS Apple macOS 14.0 Sonoma Benchmark v3.1.0 - 5.2.1 Ensure Password Account Lockout Threshold Is Configured
检查本机
请在您有权审计的机器上运行此命令。扫描为只读操作。
tmaegis scan --target macos