4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files
Audit#
Run the following command to verify log_group parameter is set to either adm or root in /etc/audit/auditd.conf:
Verify the output is:
Using the path of the directory containing the audit logs, determine if the audit log files are owned by the "root" or "adm" group by using the following command:
# stat -c "%n %G" "$(dirname $(awk -F"=" '/^\s*log_file\s*=\s*/ {print $2}' /etc/audit/auditd.conf | xargs))"/* | grep -Pv '^\h*\H+\h+(adm|root)\b'
Nothing should be returned
Remediation#
Run the following command to configure the audit log files to be owned by adm group:
# find $(dirname $(awk -F"=" '/^\s*log_file/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \( ! -group adm -a ! -group root \) -exec chgrp adm {} +
Run the following command to configure the audit log files to be owned by the adm group:
Run the following command to set the log_group parameter in the audit configuration file to log_group = adm:
Run the following command to restart the audit daemon to reload the configuration file: