macOS
TMA-MACOS-5.2.8
Ensure Password History Is Set to at least 24
说明
Over time, passwords can be captured by third parties through mistakes, phishing attacks, third-party breaches, or merely brute-force attacks. To reduce the risk of exposure and to decrease the incentives of password reuse (passwords that are not forced to be changed periodically generally are not ever changed), users must reset passwords periodically. Audit: policyAttributePasswordHistoryDepth must be >= 24 (the benchmark script only tests >= 1; the title value of 24 is enforced here).
检查方式
审计方法: Shell 命令
out=$(/usr/bin/pwpolicy -getaccountpolicies 2>/dev/null) || exit 1
p=$(printf '%s\n' "$out" | /usr/bin/grep -A1 policyAttributePasswordHistoryDepth | /usr/bin/tail -1 | /usr/bin/cut -d'>' -f2 | /usr/bin/cut -d'<' -f1)
case "$p" in ''|*[!0-9]*) echo "history=${p:-unset}";; *) if [ "$p" -ge 24 ]; then echo true; else echo "history=$p"; fi;; esac- 预期输出
true
修复方式
修复方法: 操作指南或基础设施补丁
Profile (preferred): com.apple.mobiledevice.passwordpolicy pinHistory = <integer><value≥24></integer>. Terminal: sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "usingHistory=<value≥24>" ; sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "usingHistory=24".
属性
- 操作系统
- macos-26
- 标签
- macossystem-access
- 参考
- CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 5.2.8 Ensure Password History Is Set to at least 24
检查本机
请在您有权审计的机器上运行此命令。扫描为只读操作。
tmaegis scan --target macos