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

Audit rule contents are out of date compared to auditd examples #12321

Open
comps opened this issue Aug 21, 2024 · 6 comments · May be fixed by #12579
Open

Audit rule contents are out of date compared to auditd examples #12321

comps opened this issue Aug 21, 2024 · 6 comments · May be fixed by #12579
Assignees
Labels
OSPP OSPP benchmark related. productization-issue Issue found in upstream stabilization process. RHEL9 Red Hat Enterprise Linux 9 product related.

Comments

@comps
Copy link
Collaborator

comps commented Aug 21, 2024

Description of problem:

linux-audit/audit-userspace@614f7d1 brought it new changes to the example watcher rules shipped in RHEL RPMs, we should probably update our contents in linux_os/guide/auditing/**/rule.yml to match the updated examples.

SCAP Security Guide Version:

a2d0b11

Operating System Version:

RHEL-9.5

Additional Information/Debugging Steps:

Discovered by /CoreOS/scap-security-guide/Sanity/audit-sample-rules

@comps comps added the RHEL9 Red Hat Enterprise Linux 9 product related. label Aug 21, 2024
@mildas mildas added the productization-issue Issue found in upstream stabilization process. label Sep 6, 2024
@Mab879
Copy link
Member

Mab879 commented Sep 9, 2024

This also affects RHEL 8.8, this should also be checked.

@comps
Copy link
Collaborator Author

comps commented Sep 16, 2024

This also affects RHEL 8.8, this should also be checked.

While the same test fails on 8.8 as well, it is due to a different audit rules related issue.

The 9.5 issue is the addition of arch=, ie.

--- remediated-datastream/30-ospp-v42.rules
+++ shipped-with-audit/30-ospp-v42.rules
@@ -35,4 +35,8 @@
--a always,exit -F path=/etc/passwd -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
--a always,exit -F path=/etc/shadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
--a always,exit -F path=/etc/group -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
--a always,exit -F path=/etc/gshadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
+-a always,exit -F arch=b32 -F path=/etc/passwd -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
+-a always,exit -F arch=b64 -F path=/etc/passwd -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
+-a always,exit -F arch=b32 -F path=/etc/shadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
+-a always,exit -F arch=b64 -F path=/etc/shadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=user-modify
+-a always,exit -F arch=b32 -F path=/etc/group -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
+-a always,exit -F arch=b64 -F path=/etc/group -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
+-a always,exit -F arch=b32 -F path=/etc/gshadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
+-a always,exit -F arch=b64 -F path=/etc/gshadow -F perm=wa -F auid>=1000 -F auid!=unset -F key=group-modify
...
etc.
...

which happened quite recently, the 8.8 problem is likely not a recent regression and is of different nature:

--- remediated-datastream/30-ospp-v42.rules
+++ shipped-with-audit/30-ospp-v42.rules
@@ -57 +56,0 @@
--a always,exit -F path=/usr/sbin/grub2-set-bootflag -F perm=x -F auid>=1000 -F auid!=unset -F key=special-config-changes
@@ -60,5 +58,0 @@
-## Special case for systemd-run. It is not audit aware, specifically watch it
--a always,exit -F path=/usr/bin/systemd-run -F perm=x -F auid!=unset -F key=maybe-escalation
-## Special case for pkexec. It is not audit aware, specifically watch it
--a always,exit -F path=/usr/bin/pkexec -F perm=x -F key=maybe-escalation
-

@jan-cerny jan-cerny added the OSPP OSPP benchmark related. label Sep 16, 2024
@comps
Copy link
Collaborator Author

comps commented Sep 17, 2024

Note that the 8.8 problem also seems to occur on 9.0, 9.2 though weirdly not 9.4.

@comps
Copy link
Collaborator Author

comps commented Sep 17, 2024

Okay, so the issue with 8.8 / 9.0 / 9.2 is that they use older audit package versions, which have different sample rules compared to 9.4 and 8.10:

  • RHEL-8.8 has audit-3.0.7-4.el8
  • RHEL-9.0 has audit-3.0.7-101.el9_0.2
  • RHEL-9.2 has audit-3.0.7-103.el9
  • RHEL-8.10 has audit-3.1.2-1.el8
  • RHEL-9.4 has audit-3.1.2-2.el9
  • RHEL-9.5 has audit-3.1.5-1.el9

So the content needs to (upstream or downstream) contain 3 versions of the sample rules,

  • one for 8.8 / 9.0 / 9.2
  • one for 8.10 / 9.4
  • one for 9.5+

@vojtapolasek vojtapolasek self-assigned this Oct 24, 2024
@mildas
Copy link
Contributor

mildas commented Nov 4, 2024

@vojtapolasek Any plans or updates?

@vojtapolasek
Copy link
Collaborator

I will do my best to come up with a final PR this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OSPP OSPP benchmark related. productization-issue Issue found in upstream stabilization process. RHEL9 Red Hat Enterprise Linux 9 product related.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants