-
Notifications
You must be signed in to change notification settings - Fork 744
OPENSCAP-4951: Support modern watches in audit_rules_sysadmin_actions #13242
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
OPENSCAP-4951: Support modern watches in audit_rules_sysadmin_actions #13242
Conversation
This datastream diff is auto generated by the check Click here to see the full diffNew content has different text for rule 'xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions'.
--- xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions
+++ xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions
@@ -3,17 +3,35 @@
Ensure auditd Collects System Administrator Actions
[description]:
-At a minimum, the audit system should collect administrator actions
-for all users and root. If the auditd daemon is configured to use the
-augenrules program to read audit rules during daemon startup (the default),
-add the following line to a file with suffix .rules in the directory
-/etc/audit/rules.d:
+If the auditd daemon is configured to use the augenrules
+program to read audit rules during daemon startup (the default), add the
+following lines to a file with suffix .rules in the
+directory /etc/audit/rules.d:
+
-w /etc/sudoers -p wa -k actions
+
+If the auditd daemon is configured to use the auditctl
+utility to read audit rules during daemon startup, add the following lines to
+/etc/audit/audit.rules:
+
+-w /etc/sudoers -p wa -k actions
+
+
+
+
+
+
+If the auditd daemon is configured to use the augenrules
+program to read audit rules during daemon startup (the default), add the
+following lines to a file with suffix .rules in the
+directory /etc/audit/rules.d:
+
-w /etc/sudoers.d/ -p wa -k actions
+
If the auditd daemon is configured to use the auditctl
-utility to read audit rules during daemon startup, add the following line to
-/etc/audit/audit.rules file:
--w /etc/sudoers -p wa -k actions
+utility to read audit rules during daemon startup, add the following lines to
+/etc/audit/audit.rules:
+
-w /etc/sudoers.d/ -p wa -k actions
[reference]:
OVAL for rule 'xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions' differs.
--- oval:ssg-audit_rules_sysadmin_actions:def:1
+++ oval:ssg-audit_rules_sysadmin_actions:def:1
@@ -1,9 +1,3 @@
-criteria OR
criteria AND
-extend_definition oval:ssg-audit_rules_augenrules:def:1
-criterion oval:ssg-test_audit_rules_sysadmin_actions_sudoers_augenrules:tst:1
-criterion oval:ssg-test_audit_rules_sysadmin_actions_sudoers_d_augenrules:tst:1
-criteria AND
-extend_definition oval:ssg-audit_rules_auditctl:def:1
-criterion oval:ssg-test_audit_rules_sysadmin_actions_sudoers_auditctl:tst:1
-criterion oval:ssg-test_audit_rules_sysadmin_actions_sudoers_d_auditctl:tst:1
+extend_definition oval:ssg-audit_rules_sudoers:def:1
+extend_definition oval:ssg-audit_rules_sudoers_d:def:1
OCIL for rule 'xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions' differs.
--- ocil:ssg-audit_rules_sysadmin_actions_ocil:questionnaire:1
+++ ocil:ssg-audit_rules_sysadmin_actions_ocil:questionnaire:1
@@ -1,4 +1,16 @@
-To verify that auditing is configured for system administrator actions, run the following command:
-$ sudo auditctl -l | grep "watch=/etc/sudoers\|watch=/etc/sudoers.d\|-w /etc/sudoers\|-w /etc/sudoers.d"
+
+Verify Red Hat Enterprise Linux 8 generates audit records for all events that affect "/etc/sudoers" with the following command:
+
+$ sudo auditctl -l | grep /etc/sudoers
+
+-w /etc/sudoers -p wa -k actions
+
+
+
+Verify Red Hat Enterprise Linux 8 generates audit records for all events that affect "/etc/sudoers.d/" with the following command:
+
+$ sudo auditctl -l | grep /etc/sudoers.d/
+
+-w /etc/sudoers.d/ -p wa -k actions
Is it the case that there is not output?
bash remediation for rule 'xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions' differs.
--- xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions
+++ xccdf_org.ssgproject.content_rule_audit_rules_sysadmin_actions
@@ -2,6 +2,7 @@
if rpm --quiet -q audit && rpm --quiet -q kernel; then
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
+
# Create a list of audit *.rules files that should be inspected for presence and correctness
# of a particular audit rule. The scheme is as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@jan-cerny this PR needs as rebase well. |
OVAL is done by reusing existing OVAL form other rules audit_rules_sudoers and audit_rules_sudoers_d that are templated. Remediations will reuse macros.
24b6d97
to
9d3b448
I have rebased this PR on the top of the latest upstream master branch. |
Code Climate has analyzed commit 9d3b448 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 62.0% (0.0% change). View more on Code Climate. |
/packit retest-failed |
/retest |
1 similar comment
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatus tests pass locally.
Description:
OVAL is done by reusing existing OVAL form other rules audit_rules_sudoers and audit_rules_sudoers_d that are templated. Remediations will reuse macros.