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

change hardcoded value to variable in ansible of accounts_password_set_min_life_existing #10885

Conversation

vojtapolasek
Copy link
Collaborator

Description:

  • the value for the chage command was hardcoded to 1, change it to use the variable

Rationale:

Review Hints:

  1. setup a RHEL 8 VM
  2. ./build_product rhel8
  3. scan the VM with the datastream - the rule accounts_password_set_min_life_existing should fail
  4. ansible-playbook -u root -i , --tags accounts_password_set_min_life_existing build/ansible/rhel8-playbook-cis_workstation_l2.yml
  5. Scan the VM again - the rule should pass

@vojtapolasek vojtapolasek added bugfix Fixes to reported bugs. Ansible Ansible remediation update. labels Jul 20, 2023
@vojtapolasek vojtapolasek added this to the 0.1.70 milestone Jul 20, 2023
@github-actions
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

@github-actions
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_accounts_password_set_min_life_existing' differs.
--- xccdf_org.ssgproject.content_rule_accounts_password_set_min_life_existing
+++ xccdf_org.ssgproject.content_rule_accounts_password_set_min_life_existing
@@ -23,7 +23,7 @@
 
 - name: Change the minimum time period between password changes
   command: |
-    chage -m 1 {{ item }}
+    chage -m {{ var_accounts_minimum_age_login_defs }} {{ item }}
   with_items: '{{ user_names.stdout_lines }}'
   when: user_names.stdout_lines | length > 0
   tags:

@Mab879 Mab879 self-assigned this Jul 20, 2023
@codeclimate
Copy link

codeclimate bot commented Jul 20, 2023

Code Climate has analyzed commit 78a9818 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 53.2% (0.0% change).

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update. bugfix Fixes to reported bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

accounts_password_set_min_life_existing rule fails after Ansible remediation
2 participants