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

Simplify use of ansible_ensure_pam_module_option macro #12159

Merged

Conversation

marcusburghardt
Copy link
Member

Description:

No need to escape special characters anymore for the control parameter in ansible_ensure_pam_module_option macro.
It is treated within the macro.

Rationale:

Simplification.

Review Hints:

./build_product rhel9
./tests/automatus.py rule --libvirt qemu:///session rhel9 --datastream build/ssg-rhel9-ds.xml --dontclean --remediate-using ansible sssd_enable_smartcards

No need to escape special characters anymore for the control parameter
in ansible_ensure_pam_module_option macro. It is treated within the
macro.

Signed-off-by: Marcus Burghardt <[email protected]>
@marcusburghardt marcusburghardt added the Ansible Ansible remediation update. label Jul 16, 2024
@marcusburghardt marcusburghardt added this to the 0.1.74 milestone Jul 16, 2024
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

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

Click here to see the full diff
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_sssd_enable_smartcards' differs.
--- xccdf_org.ssgproject.content_rule_sssd_enable_smartcards
+++ xccdf_org.ssgproject.content_rule_sssd_enable_smartcards
@@ -300,7 +300,7 @@
   - name: Enable Smartcards in SSSD - Define a fact for control already filtered in
       case filters are used
     ansible.builtin.set_fact:
-      pam_module_control: \[success=done authinfo_unavail=ignore ignore=ignore default=die\]
+      pam_module_control: '[success=done authinfo_unavail=ignore ignore=ignore default=die]'
 
   - name: Enable Smartcards in SSSD - Check if expected PAM module line is present
       in /etc/pam.d/system-auth
@@ -361,7 +361,7 @@
   - name: Enable Smartcards in SSSD - Define a fact for control already filtered in
       case filters are used
     ansible.builtin.set_fact:
-      pam_module_control: \[success=done authinfo_unavail=ignore ignore=ignore default=die\]
+      pam_module_control: '[success=done authinfo_unavail=ignore ignore=ignore default=die]'
 
   - name: Enable Smartcards in SSSD - Check if the required PAM module option is present
       in /etc/pam.d/system-auth

@marcusburghardt marcusburghardt requested a review from a team July 16, 2024 08:37
Copy link

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12159
This image was built from commit: 068e6e7

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12159

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12159 make deploy-local

Copy link

codeclimate bot commented Jul 16, 2024

Code Climate has analyzed commit 068e6e7 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 59.4% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Jul 16, 2024
Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

I have checked build/rhel9/fixes/ansible/sssd_enable_smartcards.yml. Also, I have run the Automatus test scenarios for this rule.

@jan-cerny jan-cerny merged commit 754da0c into ComplianceAsCode:master Jul 16, 2024
90 of 95 checks passed
@marcusburghardt marcusburghardt deleted the sssd_enable_smartcards branch July 16, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants