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

Add "is_substring" variable to grub2_bootloader_argument template #12308

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

Xeicker
Copy link
Contributor

@Xeicker Xeicker commented Aug 15, 2024

Description:

  • Add the is_substring variable to grub2_bootloader_argument template. And set it to False as default
    • This argument only applies to OVAL, as a robust remediation could be tricky to handle any case
  • Set is_substring to true in grub2_slub_debug_argument rule for OL8

Rationale:

  • With OL8 STIG v1R10 update the requirement OL08-00-010423 allows P to be a sub string of the configuration

If "slub_debug" does not contain "P", is missing, or is commented out, this is a finding.

Note: @ComplianceAsCode/red-hatters This could also be applicable to RHEL8, please let me know if I should make the update for RHEL8 also

Review Hints:

  • Added automatus tests to validate this change

With this variable the template accept a correct configuration if the
expected value can be a substring of the set value

Signed-off-by: Edgar Aguilar <[email protected]>
Validate substring scenarios

Signed-off-by: Edgar Aguilar <[email protected]>
Allow the  value to only contain 'P' but not necesarily be an exact
match as per the update in STIG OL08-00-010423

Signed-off-by: Edgar Aguilar <[email protected]>
@Xeicker Xeicker added OVAL OVAL update. Related to the systems assessments. Oracle Linux Oracle Linux product related. Update Template Issues or pull requests related to Templates updates. labels Aug 15, 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

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

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:12308

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

Copy link

codeclimate bot commented Aug 16, 2024

Code Climate has analyzed commit d7f142c 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 added this to the 0.1.75 milestone Aug 19, 2024
@jan-cerny jan-cerny self-assigned this Aug 19, 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 extended this patch to RHEL 9 and then tried to run the test scenarios with it.

@jan-cerny jan-cerny merged commit d0b210e into ComplianceAsCode:master Aug 19, 2024
93 of 97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Oracle Linux Oracle Linux product related. OVAL OVAL update. Related to the systems assessments. Update Template Issues or pull requests related to Templates updates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants