Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new rules to replace audit_rules_mac_modification on Ubuntu #12828

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ rules:
- audit_rules_login_events_lastlog
- audit_rules_login_events_tallylog
- audit_rules_mac_modification
- audit_rules_mac_modification_etc_apparmor
- audit_rules_mac_modification_etc_apparmor_d
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down
3 changes: 2 additions & 1 deletion controls/cis_ubuntu2404.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,8 @@ controls:
- l2_server
- l2_workstation
rules:
- audit_rules_mac_modification
- audit_rules_mac_modification_etc_apparmor
- audit_rules_mac_modification_etc_apparmor_d
status: automated

- id: 6.2.3.15
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
documentation_complete: true

title: 'Record Events that Modify the System''s Mandatory Access Controls (/etc/apparmor)'

description: |-
If the <tt>auditd</tt> daemon is configured to use the
<tt>augenrules</tt> program to read audit rules during daemon startup (the
default), add the following line to a file with suffix <tt>.rules</tt> in the
directory <tt>/etc/audit/rules.d</tt>:
<pre>-w /etc/apparmor/ -p wa -k MAC-policy</pre>
If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt>
utility to read audit rules during daemon startup, add the following line to
<tt>/etc/audit/audit.rules</tt> file:
<pre>-w /etc/apparmor/ -p wa -k MAC-policy</pre>

rationale: |-
The system's mandatory access policy (Apparmor) should not be
arbitrarily changed by anything other than administrator action. All changes to
MAC policy should be audited.

severity: medium

ocil_clause: 'the system is not configured to audit attempts to change files within the /etc/apparmor directory'

ocil: |-
To determine if the system is configured to audit changes to its Apparmor
configuration files, run the following command:
<pre>$ sudo auditctl -l | grep "dir=/etc/apparmor"</pre>
If the system is configured to watch for changes to its Apparmor
configuration, a line should be returned (including
<tt>perm=wa</tt> indicating permissions that are watched).

template:
name: audit_rules_watch
vars:
path: /etc/apparmor
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
documentation_complete: true

title: 'Record Events that Modify the System''s Mandatory Access Controls (/etc/apparmor.d)'

description: |-
If the <tt>auditd</tt> daemon is configured to use the
<tt>augenrules</tt> program to read audit rules during daemon startup (the
default), add the following line to a file with suffix <tt>.rules</tt> in the
directory <tt>/etc/audit/rules.d</tt>:
<pre>-w /etc/apparmor.d/ -p wa -k MAC-policy</pre>
If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt>
utility to read audit rules during daemon startup, add the following line to
<tt>/etc/audit/audit.rules</tt> file:
<pre>-w /etc/apparmor.d/ -p wa -k MAC-policy</pre>

rationale: |-
The system's mandatory access policy (Apparmor) should not be
arbitrarily changed by anything other than administrator action. All changes to
MAC policy should be audited.

severity: medium

ocil_clause: 'the system is not configured to audit attempts to change files within the /etc/apparmor.d directory'

ocil: |-
To determine if the system is configured to audit changes to its Apparmor
configuration files, run the following command:
<pre>$ sudo auditctl -l | grep "dir=/etc/apparmor.d"</pre>
If the system is configured to watch for changes to its Apparmor
configuration, a line should be returned (including
<tt>perm=wa</tt> indicating permissions that are watched).

template:
name: audit_rules_watch
vars:
path: /etc/apparmor.d
Loading