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

Conditional for Ansible remediation on RHEL7 #9440

Merged

Conversation

marcusburghardt
Copy link
Member

Description:

The Ansible remediation for the accounts_password_set_max_life_existing rule was recently updated to use the user module with the password_expire_max parameter. However, this parameter was introduced on Ansible 2.11 while RHEL7 uses Ansible 2.9. Therefore, the former remediation approach was kept for RHEL7 via a Jinja2 conditional.

Rationale:

@marcusburghardt marcusburghardt added bugfix Fixes to reported bugs. Ansible Ansible remediation update. RHEL7 Red Hat Enterprise Linux 7 product related. labels Aug 31, 2022
@marcusburghardt marcusburghardt added this to the 0.1.64 milestone Aug 31, 2022
@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

@openshift-ci
Copy link

openshift-ci bot commented Aug 31, 2022

@marcusburghardt: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-rhcos4-high a395254 link true /test e2e-aws-rhcos4-high
ci/prow/e2e-aws-rhcos4-moderate a395254 link true /test e2e-aws-rhcos4-moderate

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

ansible.builtin.user:
user: '{{ item }}'
password_expire_max: '{{ var_accounts_maximum_age_login_defs }}'
{{% else %}}
ansible.builtin.command: >
chage -M 60 {{ item }}
Copy link
Member

Choose a reason for hiding this comment

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

Should 60 be replaced with var_accounts_maximum_age_login_defs?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should. I will fix. Thanks.

The Ansible remediation for the accounts_password_set_max_life_existing
rule was recently updated to use the user module with the
password_expire_max parameter. However, this parameter was introduced
on Ansible 2.11 while RHEL7 uses Ansible 2.9. Therefore, the former
remediation approach was kept for RHEL7 via a Jinja2 conditional.
@codeclimate
Copy link

codeclimate bot commented Sep 1, 2022

Code Climate has analyzed commit d1fc78e 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 42.3% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 merged commit 77a4ddf into ComplianceAsCode:master Sep 1, 2022
@marcusburghardt marcusburghardt deleted the password_expire_max_rhel7 branch September 1, 2022 18:48
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. RHEL7 Red Hat Enterprise Linux 7 product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ansible remediation for the RHEL 7 STIG profile fails
2 participants