macOS 15 - Sequoia

The macOS system must configure sudo to log events

STIG ID: APPL-15-000190 | SRG: SRG-OS-000064-GPOS-00033 | Severity: Medium | CCI: CCI-000172 | Vulnerability ID: V-268451

Description

Sudo must be configured to log privilege escalation.Without logging privilege escalation, it is difficult to identify attempted attacks because no audit trail is available for forensic investigation.

Check

C-268451r1034293_chk

Verify the macOS system is configured to log privilege escalation with the following command:/usr/bin/sudo /usr/bin/sudo -V | /usr/bin/grep -c "Log when a command is allowed by sudoers"If the result is not "1", this is a finding.

Fix

F-72382r1034292_fix

Configure the macOS system to log privilege escalation with the following command:/usr/bin/find /etc/sudoers* -type f -exec sed -i '' '/^Defaults[[:blank:]]*\!log_allowed/s/^/# /' '{}' \;/bin/echo "Defaults log_allowed" >> /etc/sudoers.d/mscp