6.3.3.18 Ensure discretionary access control permission modification events chmod,fchmod,fchmodat,fchmodat2 are collected

Information

Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The following commands and system calls effect the permissions, ownership and various attributes of files.

- chmod : changes the mode of the file
- fchmod : changes the mode of the file referred to by the open file descriptor
- fchmodat : change permissions of a file
- fchmodat2 : change permissions of a file relative to a directory file descriptor

In all cases, an audit record will only be written for non-system user ids and will ignore Daemon events. All audit records will be tagged with the identifier "perm_mod."

Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation.

Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210

Solution

Note: The -w option is deprecated and the rule should be updated in accordance with the Remediation Procedure.

- Edit or create a file in the /etc/audit/rules.d/ directory, ending inrules extension, with the relevant rules to monitor discretionary access control permission modification events.

Example:

# printf "
-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat,fchmodat2 -F auid>=1000 -F auid!=unset -F key=perm_mod
" >> /etc/audit/rules.d/50-perm_mod.rules

Note : The auid>= value should be set to the same value as UID_MIN value in /etc/login.defs

<xhtml:ol start="2"> - Merge and load the rules into active configuration:

# augenrules --load <xhtml:ol start="3"> - Check if reboot is required:

# if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi

See Also

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