8000 OPENSCAP-4951: Support modern watches in audit_rules_sysadmin_actions by jan-cerny · Pull Request #13242 · ComplianceAsCode/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged

Conversation

jan-cerny
Copy link
Collaborator
@jan-cerny jan-cerny commented Mar 27, 2025

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.

@jan-cerny jan-cerny added Ansible Ansible remediation update. Bash Bash remediation update. Update Rule Issues or pull requests related to Rules updates. RHEL10 Red Hat Enterprise Linux 10 product related. labels Mar 27, 2025
@jan-cerny jan-cerny added this to the 0.1.77 milestone Mar 27, 2025
@jan-cerny jan-cerny requested review from a team as code owners March 27, 2025 14:51
@jan-cerny jan-cerny changed the title Support modern watches in audit_rules_sysadmin_actions OPENSCAP-4951: Support modern watches in audit_rules_sysadmin_actions Mar 27, 2025
Copy link
github-actions bot commented Mar 27, 2025

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
New 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:

@Mab879 Mab879 self-assigned this Mar 27, 2025
Copy link
Contributor
@teacup-on-rockingchair teacup-on-rockingchair left a comment

Choose a reason for hiding this comment

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

👍

@Mab879
Copy link
Member
Mab879 commented Mar 28, 2025

@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.
@jan-cerny jan-cerny force-pushed the audit_rules_sysadmin_actions branch from 24b6d97 to 9d3b448 Compare March 28, 2025 14:58
@jan-cerny
Copy link
Collaborator Author

I have rebased this PR on the top of the latest upstream master branch.

Copy link
codeclimate bot commented Mar 28, 2025

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.

@Mab879
Copy link
Member
Mab879 commented Mar 28, 2025

/packit retest-failed

@Mab879
Copy link
Member
Mab879 commented Mar 28, 2025

/retest

1 similar comment
@Mab879
Copy link
Member
Mab879 commented Mar 28, 2025

/retest

Copy link
Member
@Mab879 Mab879 left a 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.

@Mab879 Mab879 merged commit c0eb401 into ComplianceAsCode:master Mar 28, 2025
108 of 110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update. Bash Bash remediation update. RHEL10 Red Hat Enterprise Linux 10 product related. Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0