TMAegis
Aturan lainnya untuk macos

TMA-MACOS-3.5

Ensure Access to Audit Records Is Controlled

TinggiLevel 1Otomatismacos

Deskripsi

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-----.

Cara pemeriksaan

Metode audit: Perintah 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
Output yang diharapkan
compliant

Cara perbaikan

Metode perbaikan: Panduan atau patch infrastruktur

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}').

Properti

Sistem operasi
macos-26
Tag
macoslogging-auditing
Referensi
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 3.5 Ensure Access to Audit Records Is Controlled

Periksa host ini

Jalankan ini pada mesin yang diizinkan untuk Anda audit. Pemindaian bersifat hanya baca.

shell
tmaegis scan --target macos