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

Enable accounts_password_set_warn_age_existing rule for RHEL #10284

Merged
merged 4 commits into from
Mar 3, 2023

Conversation

marcusburghardt
Copy link
Member

Description:

The accounts_password_set_warn_age_existing rule is is applicable for RHEL products and satisfies CIS requirements for RHEL7, RHEL8 and RHEL9.

This PR:

  • Increases robustness of OVAL check by filtering out users without a password.
  • Aligns test scenarios to the OVAL updates
  • Update the Ansible and Bash remediation to also ignore changes in users without a password.
  • Align the files to the Project Style Guide.

Rationale:

Better CIS coverage for RHEL

The requirement for password expiration warning is valid only for
accounts with a password defined. Accounts without a password should be
ignored from the list and a filter was included for this.
It was also included a test to cover cases where there is no user with
a password defined in the system. Besides the improvements in tests,
this commit also align the OVAL to the project Style Guide.
The test scenarios were updated to ignore users without a password
defined. A new test was included to test environments without any user
with password. Finally, it was ensured at least a user exists for some
tests in order to avoid failures caused by different test environments.
The remediations are now only updating accounts with a defined
password. The Ansible tasks names were also aligned to the project
Style Guide.
The accounts_password_set_warn_age_existing rule is applicable for RHEL
products and satisfies CIS requirements for RHEL7, RHEL8 and RHEL9.
Rule and CIS control files for RHEL were updated.
@marcusburghardt marcusburghardt added RHEL Red Hat Enterprise Linux product related. CIS CIS Benchmark related. labels Mar 3, 2023
@marcusburghardt marcusburghardt added this to the 0.1.67 milestone Mar 3, 2023
@marcusburghardt marcusburghardt requested a review from a team as a code owner March 3, 2023 09:57
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

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

@codeclimate
Copy link

codeclimate bot commented Mar 3, 2023

Code Climate has analyzed commit 2d3dca4 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 51.7% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 self-assigned this Mar 3, 2023
@Mab879 Mab879 merged commit a29f793 into ComplianceAsCode:master Mar 3, 2023
@Mab879 Mab879 added Update Rule Issues or pull requests related to Rules updates. Update Profile Issues or pull requests related to Profiles updates. labels Mar 3, 2023
@marcusburghardt marcusburghardt deleted the cis_pass_warn_age branch March 3, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CIS CIS Benchmark related. RHEL Red Hat Enterprise Linux product related. Update Profile Issues or pull requests related to Profiles updates. Update Rule Issues or pull requests related to Rules updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants