-
Notifications
You must be signed in to change notification settings - Fork 686
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
align ospp audit rules with the latest upstream release #8152
align ospp audit rules with the latest upstream release #8152
Conversation
This datastream diff is auto generated by the check Click here to see the full diffOCIL for rule 'xccdf_org.ssgproject.content_rule_audit_access_failed' differs:
--- old datastream
+++ new datastream
@@ -2,9 +2,9 @@
cat /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
The output has to be exactly as follows:
## Unsuccessful file access (any other opens) This has to go last.
--a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
--a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
--a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
--a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
Is it the case that the file does not exist or the content differs?
bash remediation for rule 'xccdf_org.ssgproject.content_rule_audit_access_failed' differs:
--- old datastream
+++ new datastream
@@ -3,10 +3,10 @@
cat << 'EOF' > /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
## Unsuccessful file access (any other opens) This has to go last.
--a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
--a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
--a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
--a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
EOF
chmod o-rwx /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_audit_access_failed' differs:
--- old datastream
+++ new datastream
@@ -4,10 +4,10 @@
dest: /etc/audit/rules.d/30-ospp-v42-3-access-failed.rules
content: |
## Unsuccessful file access (any other opens) This has to go last.
- -a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
- -a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
- -a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
- -a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+ -a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+ -a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+ -a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
+ -a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -F key=unsuccessful-access
force: true
when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
tags:
OCIL for rule 'xccdf_org.ssgproject.content_rule_audit_access_success' differs:
--- old datastream
+++ new datastream
@@ -3,7 +3,7 @@
The output has to be exactly as follows:
## Successful file access (any other opens) This has to go last.
## These next two are likely to result in a whole lot of events
--a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
--a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
+-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
+-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
Is it the case that the file does not exist or the content differs?
bash remediation for rule 'xccdf_org.ssgproject.content_rule_audit_access_success' differs:
--- old datastream
+++ new datastream
@@ -4,8 +4,8 @@
cat << 'EOF' > /etc/audit/rules.d/30-ospp-v42-3-access-success.rules
## Successful file access (any other opens) This has to go last.
## These next two are likely to result in a whole lot of events
--a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
--a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
+-a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
+-a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
EOF
chmod o-rwx /etc/audit/rules.d/30-ospp-v42-3-access-success.rules
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_audit_access_success' differs:
--- old datastream
+++ new datastream
@@ -5,8 +5,8 @@
content: |
## Successful file access (any other opens) This has to go last.
## These next two are likely to result in a whole lot of events
- -a always,exit -F arch=b32 -S open,openat,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
- -a always,exit -F arch=b64 -S open,openat,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
+ -a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
+ -a always,exit -F arch=b64 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
force: true
when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
tags:
OCIL for rule 'xccdf_org.ssgproject.content_rule_audit_ospp_general' differs:
--- old datastream
+++ new datastream
@@ -60,6 +60,10 @@
## Privilege escalation via su or sudo. This is entirely handled by pam.
+## Watch for configuration changes to privilege escalation.
+-a always,exit -F path=/etc/sudoers -F perm=wa -F key=special-config-changes
+-a always,exit -F dir=/etc/sudoers.d/ -F perm=wa -F key=special-config-changes
+
## Audit log access
-a always,exit -F dir=/var/log/audit/ -F perm=r -F auid>=1000 -F auid!=unset -F key=access-audit-trail
## Attempts to Alter Process and Session Initiation Information
bash remediation for rule 'xccdf_org.ssgproject.content_rule_audit_ospp_general' differs:
--- old datastream
+++ new datastream
@@ -61,6 +61,10 @@
## Privilege escalation via su or sudo. This is entirely handled by pam.
+## Watch for configuration changes to privilege escalation.
+-a always,exit -F path=/etc/sudoers -F perm=wa -F key=special-config-changes
+-a always,exit -F dir=/etc/sudoers.d/ -F perm=wa -F key=special-config-changes
+
## Audit log access
-a always,exit -F dir=/var/log/audit/ -F perm=r -F auid>=1000 -F auid!=unset -F key=access-audit-trail
## Attempts to Alter Process and Session Initiation Information
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_audit_ospp_general' differs:
--- old datastream
+++ new datastream
@@ -61,6 +61,10 @@
## Privilege escalation via su or sudo. This is entirely handled by pam.
+ ## Watch for configuration changes to privilege escalation.
+ -a always,exit -F path=/etc/sudoers -F perm=wa -F key=special-config-changes
+ -a always,exit -F dir=/etc/sudoers.d/ -F perm=wa -F key=special-config-changes
+
## Audit log access
-a always,exit -F dir=/var/log/audit/ -F perm=r -F auid>=1000 -F auid!=unset -F key=access-audit-trail
## Attempts to Alter Process and Session Initiation Information |
@mildas @vojtapolasek @ggbecker The test scenarios are all notapplicable, that's a similar problem we hit in #8146. |
@vojtapolasek If executed locally, starting from which version of the audit rpm package will the test scenario rules_from_audit_package.pass.sh pass? |
Found the problem, newer versions of the build system is generating cpe name for machine as simply: content/tests/ssg_test_suite/xml_operations.py Lines 102 to 103 in 0d7ac62
I'm going to submit a PR for that, but I wonder if any other place should be updated as well. |
I will rebase to reflect the changes in the test suite. |
47ec298
to
ac8a9ce
Compare
The tests are now updated to be aligned with Audit 3.0.7 upstream version. I think these are final changes. |
/retest |
/retest |
Description:
Rationale:
Both rhel8 and rhel9 content of audit rules related to ospp got updated.