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

rhel10: use new rule for auditing of changes to selinux configuration #12826

Merged
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
1 change: 1 addition & 0 deletions components/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ rules:
- audit_rules_mac_modification
- audit_rules_mac_modification_etc_apparmor
- audit_rules_mac_modification_etc_apparmor_d
- audit_rules_mac_modification_etc_selinux
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down
4 changes: 4 additions & 0 deletions controls/anssi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,11 @@ controls:
- audit_rules_time_stime
- audit_rules_time_watch_localtime

{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}

- audit_rules_networkconfig_modification

Expand Down
2 changes: 1 addition & 1 deletion controls/cis_rhel10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@ controls:
- l2_workstation
status: automated
rules:
- audit_rules_mac_modification
- audit_rules_mac_modification_etc_selinux
- audit_rules_mac_modification_usr_share

- id: 6.3.3.15
Expand Down
28 changes: 28 additions & 0 deletions controls/hipaa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ controls:
- audit_rules_privileged_commands_unix_chkpwd
- audit_rules_privileged_commands_userhelper
- audit_rules_immutable
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule audit_rules_mac_modification is a part of multiple controls in this HIPAA control file. If you want to make sure this rule isn't present in the RHEL 10 data stream you need to take care of all occurrences of it in this control file.

{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down Expand Up @@ -277,7 +281,11 @@ controls:
- audit_rules_privileged_commands_unix_chkpwd
- audit_rules_privileged_commands_userhelper
- audit_rules_immutable
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down Expand Up @@ -469,7 +477,11 @@ controls:
- audit_rules_privileged_commands_unix_chkpwd
- audit_rules_privileged_commands_userhelper
- audit_rules_immutable
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down Expand Up @@ -1199,7 +1211,11 @@ controls:
- audit_rules_privileged_commands_unix_chkpwd
- audit_rules_privileged_commands_userhelper
- audit_rules_immutable
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down Expand Up @@ -1335,7 +1351,11 @@ controls:
- audit_rules_privileged_commands_unix_chkpwd
- audit_rules_privileged_commands_userhelper
- audit_rules_immutable
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down Expand Up @@ -1498,7 +1518,11 @@ controls:
- audit_rules_privileged_commands_unix_chkpwd
- audit_rules_privileged_commands_userhelper
- audit_rules_immutable
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down Expand Up @@ -1592,7 +1616,11 @@ controls:
- audit_rules_privileged_commands_unix_chkpwd
- audit_rules_privileged_commands_userhelper
- audit_rules_immutable
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_mac_modification_usr_share
- audit_rules_media_export
- audit_rules_networkconfig_modification
Expand Down
4 changes: 4 additions & 0 deletions controls/pcidss_4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2859,7 +2859,11 @@ controls:
- base
status: automated
rules:
{{% if product == "rhel10" %}}
- audit_rules_mac_modification_etc_selinux
{{% else %}}
- audit_rules_mac_modification
{{% endif %}}
- audit_rules_dac_modification_chmod
- audit_rules_dac_modification_chown
- audit_rules_dac_modification_fchmod
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
documentation_complete: true

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

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/selinux/ -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/selinux/ -p wa -k MAC-policy</pre>

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

severity: medium

identifiers:
cce@rhel10: CCE-90737-8


references:
hipaa: 164.308(a)(1)(ii)(D),164.308(a)(3)(ii)(A),164.308(a)(5)(ii)(C),164.312(a)(2)(i),164.312(b),164.312(d),164.312(e)
pcidss: Req-10.5.5

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

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

template:
name: audit_rules_watch
vars:
path: /etc/selinux
1 change: 0 additions & 1 deletion shared/references/cce-redhat-avail.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2576,4 +2576,3 @@ CCE-90727-9
CCE-90728-7
CCE-90732-9
CCE-90735-2
CCE-90737-8
Loading