8000 [Ubuntu] Drop pam config for faillock audit tests by alanmcanonical · Pull Request #13362 · ComplianceAsCode/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Ubuntu] Drop pam config for faillock audit tests #13362

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
merged 3 commits into from
Apr 22, 2025

Conversation

alanmcanonical
Copy link
Contributor
@alanmcanonical alanmcanonical commented Apr 18, 2025

Description:

  • Drop pam config for tests of accounts_passwords_pam_faillock_audit
  • Add package[pam] applicability to accounts_passwords_pam_faillock_audit

Rationale:

  • Delete the pam configs of faillock in case they affect the remediation.

Sorry, something went wrong.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Apr 18, 2025
Copy link
openshift-ci bot commented Apr 18, 2025

Hi @alanmcanonical. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

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

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
@@ -1,5 +1,5 @@
 # Remediation is applicable only in certain platforms
-if grep -qP "^ID=[\"']?rhel[\"']?$" "/etc/os-release" && { real="$(grep -P "^VERSION_ID=[\"']?[\w.]+[\"']?$" /etc/os-release | sed "s/^VERSION_ID=[\"']\?\([^\"']\+\)[\"']\?$/\1/")"; expected="8.2"; printf "%s\n%s" "$expected" "$real" | sort -VC; }; then
+if rpm --quiet -q pam; then
 
 if [ -f /usr/bin/authselect ]; then
     if ! authselect check; then

ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
@@ -1,9 +1,22 @@
+- name: Gather the package facts
+  package_facts:
+    manager: auto
+  tags:
+  - CCE-86099-9
+  - DISA-STIG-RHEL-08-020021
+  - NIST-800-53-AC-7 (a)
+  - accounts_passwords_pam_faillock_audit
+  - low_complexity
+  - low_disruption
+  - medium_severity
+  - no_reboot_needed
+  - restrict_strategy
+
 - name: Account Lockouts Must Be Logged - Check if system relies on authselect tool
   ansible.builtin.stat:
     path: /usr/bin/authselect
   register: result_authselect_present
-  when: ansible_distribution == 'RedHat' and ansible_distribution_version is version('8.2',
-    '>=')
+  when: '"pam" in ansible_facts.packages'
   tags:
   - CCE-86099-9
   - DISA-STIG-RHEL-08-020021
@@ -66,8 +79,7 @@
     - result_authselect_enable_feature_cmd is not skipped
     - result_authselect_enable_feature_cmd is success
   when:
-  - ansible_distribution == 'RedHat' and ansible_distribution_version is version('8.2',
-    '>=')
+  - '"pam" in ansible_facts.packages'
   - result_authselect_present.stat.exists
   tags:
   - CCE-86099-9
@@ -132,8 +144,7 @@
     when:
     - result_pam_faillock_is_enabled.found == 0
   when:
-  - ansible_distribution == 'RedHat' and ansible_distribution_version is version('8.2',
-    '>=')
+  - '"pam" in ansible_facts.packages'
   - not result_authselect_present.stat.exists
   tags:
   - CCE-86099-9
@@ -151,8 +162,7 @@
   ansible.builtin.stat:
     path: /etc/security/faillock.conf
   register: result_faillock_conf_check
-  when: ansible_distribution == 'RedHat' and ansible_distribution_version is version('8.2',
-    '>=')
+  when: '"pam" in ansible_facts.packages'
   tags:
   - CCE-86099-9
   - DISA-STIG-RHEL-08-020021
@@ -172,8 +182,7 @@
     line: audit
     state: present
   when:
-  - ansible_distribution == 'RedHat' and ansible_distribution_version is version('8.2',
-    '>=')
+  - '"pam" in ansible_facts.packages'
   - result_faillock_conf_check.stat.exists
   tags:
   - CCE-86099-9
@@ -552,8 +561,7 @@
     when:
     - result_pam_file_present.stat.exists
   when:
-  - ansible_distribution == 'RedHat' and ansible_distribution_version is version('8.2',
-    '>=')
+  - '"pam" in ansible_facts.packages'
   - result_faillock_conf_check.stat.exists
   tags:
   - CCE-86099-9
@@ -594,8 +602,7 @@
     when:
     - result_pam_faillock_audit_parameter_is_present.found == 0
   when:
-  - ansible_distribution == 'RedHat' and ansible_distribution_version is version('8.2',
-    '>=')
+  - '"pam" in ansible_facts.packages'
   - not result_faillock_conf_check.stat.exists
   tags:
   - CCE-86099-9

Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit'
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
@@ -1 +1 @@
-oval:ssg-os_linux_rhel_gt_or_eq_8_2:def:1
+oval:ssg-package_pam:def:1

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.

I will let @dodys do the final review.

8000 Copy link
codeclimate bot commented Apr 18, 2025

Code Climate has analyzed commit 8116fbe 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 61.9% (0.0% change).

View more on Code Climate.

@alanmcanonical
Copy link
Contributor Author

The failed ansible tests might be fixed by #13363

@dodys dodys self-assigned this Apr 22, 2025
@dodys dodys added Test Suite Update in Test Suite. Ubuntu Ubuntu product related. labels Apr 22, 2025
Copy link
Contributor
@dodys dodys left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

@dodys dodys added this to the 0.1.77 milestone Apr 22, 2025
@dodys dodys merged commit 1f7e1fd into ComplianceAsCode:master Apr 22, 2025
93 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Used by openshift-ci bot. Test Suite Update in Test Suite. Ubuntu Ubuntu product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0