5.11 Ensure Logging Is Enabled for Sudo

Information

In order to properly monitor the use of the sudo command, logs events for any use of sudo should be captured in the unified log.

Apple added sudo logging as part of the unified log in macOS 14.0 Sonoma. In macOS 15.0 Sequoia, it is now disabled by default but it should be enabled.

Solution

Terminal Method:

Run the following command to edit the sudo settings:

% /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers

Remove the line, or comment out with # before the line, Defaults !log_allowed

Impact:

Sensitive date (ex proprietary data, PII, etc) could be sent to the unified log with sudo logging enabled.

See Also

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