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

U2404 5414 #12636

Merged
merged 4 commits into from
Dec 4, 2024
Merged

U2404 5414 #12636

merged 4 commits into from
Dec 4, 2024

Conversation

ericeberry
Copy link
Contributor

Description:

Implement CIS Ubuntu 24.02v1 - 5.4.1.4 Ensure strong password hashing algorithm is configured

Rationale:

  • Implement CIS Ubuntu 24.02v1

@ericeberry ericeberry requested a review from a team as a code owner November 25, 2024 23:58
Copy link

openshift-ci bot commented Nov 25, 2024

Hi @ericeberry. 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.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Nov 25, 2024
@ericeberry ericeberry marked this pull request as draft November 25, 2024 23:59
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Nov 25, 2024
Copy link

github-actions bot commented Nov 26, 2024

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
bash remediation for rule 'xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs' differs.
--- xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs
+++ xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs
@@ -2,6 +2,11 @@
 if rpm --quiet -q shadow-utils; then
 
 var_password_hashing_algorithm=''
+
+
+# Allow multiple algorithms, but choose the first one for remediation
+#
+var_password_hashing_algorithm="$(echo $var_password_hashing_algorithm | cut -d \| -f 1)"
 
 # Strip any search characters in the key arg so that the key can be replaced without
 # adding any search characters to the config file.

ansible remediation for rule 'xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs' differs.
--- xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs
+++ xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs
@@ -28,7 +28,7 @@
   lineinfile:
     dest: /etc/login.defs
     regexp: ^#?ENCRYPT_METHOD
-    line: ENCRYPT_METHOD {{ var_password_hashing_algorithm }}
+    line: ENCRYPT_METHOD {{ var_password_hashing_algorithm.split('|')[0] }}
     state: present
     create: true
   when: '"shadow-utils" in ansible_facts.packages'

@ericeberry ericeberry marked this pull request as ready for review November 26, 2024 22:26
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Nov 26, 2024
Copy link
Contributor

@mpurg mpurg left a comment

Choose a reason for hiding this comment

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

Please also add a test for the new functionality.

@dodys dodys self-assigned this Nov 28, 2024
@dodys dodys added Ubuntu Ubuntu product related. CIS CIS Benchmark related. labels Nov 28, 2024
@dodys dodys added this to the 0.1.76 milestone Nov 28, 2024
Copy link
Contributor

@mpurg mpurg left a comment

Choose a reason for hiding this comment

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

The tests should check for multiple values, e.g. "YESCRYPT|SHA512".

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.

need a few more tests, @mpurg found some issues with OVAL

Copy link

codeclimate bot commented Dec 3, 2024

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

View more on Code Climate.

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 merged commit edcb42a into ComplianceAsCode:master Dec 4, 2024
97 of 99 checks passed
@ericeberry ericeberry deleted the u2404-5414 branch December 4, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CIS CIS Benchmark related. needs-ok-to-test Used by openshift-ci bot. Ubuntu Ubuntu product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants