TMAegis
Thêm quy tắc cho macos

TMA-MACOS-3.5

Ensure Access to Audit Records Is Controlled

CaoCấp 1Tự độngmacos

Mô tả

The audit system on macOS writes important operational and security information that can be both useful for an attacker and a place for an attacker to attempt to obfuscate unwanted changes that were recorded. As part of defense-in-depth, the /etc/security/audit_control configuration and the files in /var/audit should be owned only by root with group wheel with read-only rights and no other access allowed. Audit: audit_control and the audit log directory must be owned by root:wheel (uid/gid 0) and mode -r--r-----.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
f=/etc/security/audit_control
[ -e "$f" ] || exit 1
d=$(/usr/bin/grep '^dir' "$f" | /usr/bin/awk -F: '{print $2}')
[ -n "$d" ] && [ -d "$d" ] || exit 1
r1=$(/bin/ls -n "$f" | /usr/bin/awk '{s+=$3} END {print s+0}')
r2=$(/bin/ls -n "$f" | /usr/bin/awk '{s+=$4} END {print s+0}')
r3=$(/bin/ls -n "$f" | /usr/bin/awk '!/-r--r-----|current|total/{print $1}' | /usr/bin/wc -l | /usr/bin/tr -d ' ')
r4=$(/bin/ls -n "$d" | /usr/bin/awk '{s+=$3} END {print s+0}')
r5=$(/bin/ls -n "$d" | /usr/bin/awk '{s+=$4} END {print s+0}')
r6=$(/bin/ls -n "$d" | /usr/bin/awk '!/-r--r-----|current|total/{print $1}' | /usr/bin/wc -l | /usr/bin/tr -d ' ')
if [ "$r1$r2$r3$r4$r5$r6" = 000000 ]; then echo compliant; else echo "owner/group/mode checks: $r1 $r2 $r3 $r4 $r5 $r6"; fi
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Terminal: sudo /usr/sbin/chown -R root:wheel /etc/security/audit_control ; sudo /bin/chmod -R 700 /etc/security/audit_control ; sudo /usr/sbin/chown -R root:wheel $(sudo /usr/bin/grep '^dir' /etc/security/audit_control | /usr/bin/awk -F: '{print $2}').

Thuộc tính

Hệ điều hành
macos-26
Thẻ
macoslogging-auditing
Tham chiếu
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 3.5 Ensure Access to Audit Records Is Controlled

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target macos