1.32 APPL-26-000190

Information

The macOS system must configure sudo to log events.

GROUP ID: V-277059
RULE ID: SV-277059r1148629

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.

Solution

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

See Also

https://workbench.cisecurity.org/benchmarks/26538