TMAegisBeta
更多 macos 规则

macOS

TMA-MACOS-3.4

Ensure Security Auditing Logs Are Retained for 30 Days

中级别 1自动化macos

说明

The macOS audit capability contains important information to investigate security or operational issues. This resource is only completely useful if it is retained long enough to allow technical staff to find the root cause of anomalies in the records. Retention can be set to respect both size and longevity. Audit: Requires a day-based expire-after value of at least 30d.

检查方式

审计方法: Shell 命令

shell
l=$(/usr/bin/grep -e "^expire-after" /etc/security/audit_control 2>/dev/null) || exit 1
d=$(printf '%s' "$l" | /usr/bin/grep -oE '[0-9]+d' | /usr/bin/head -1 | /usr/bin/tr -d d)
if [ -n "$d" ] && [ "$d" -ge 30 ]; then echo compliant; else echo "$l"; fi
预期输出
compliant

修复方式

修复方法: 操作指南或基础设施补丁

Terminal: Edit the /etc/security/audit_control file so that expire-after: is at least 30d

属性

操作系统
macos-26
标签
macoslogging-auditing
参考
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 3.4 Ensure Security Auditing Logs Are Retained for 30 Days

检查本机

请在您有权审计的机器上运行此命令。扫描为只读操作。

shell
tmaegis scan --target macos