Verify Permissions on /etc/audit/rules.d/*.rules

Classification:

compliance

Framework:

Control:

Description

To properly set the permissions of /etc/audit/rules.d/*.rules, run the command:

$ sudo chmod 0640 /etc/audit/rules.d/*.rules

Rationale

Without the capability to restrict the roles and individuals that can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. Misconfigured audits may degrade the system’s performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.

Remediation

Shell script

The following script can be run on the host to remediate the issue.

find -H /etc/audit/rules.d/ -maxdepth 1 -perm /u+xs,g+xws,o+xwrt -type f -regex '^.\*rules$' -exec chmod u-xs,g-xws,o-xwrt {} \;

Ansible playbook

The following playbook can be run with Ansible to remediate the issue.

- name: Find /etc/audit/rules.d/ file(s)
 command: find -H /etc/audit/rules.d/ -maxdepth 1 -perm /u+xs,g+xws,o+xwrt -type
 f -regex "^.\*rules$"
 register: files\_found
 changed\_when: false
 failed\_when: false
 check\_mode: false
 tags:
 - NIST-800-53-AU-12(b)
 - configure\_strategy
 - file\_permissions\_etc\_audit\_rulesd
 - low\_complexity
 - low\_disruption
 - medium\_severity
 - no\_reboot\_needed

- name: Set permissions for /etc/audit/rules.d/ file(s)
 file:
 path: '{{ item }}'
 mode: u-xs,g-xws,o-xwrt
 state: file
 with\_items:
 - '{{ files\_found.stdout\_lines }}'
 tags:
 - NIST-800-53-AU-12(b)
 - configure\_strategy
 - file\_permissions\_etc\_audit\_rulesd
 - low\_complexity
 - low\_disruption
 - medium\_severity
 - no\_reboot\_needed