Skip to content

Add missing tests for rules selected in RHEL 10 STIG profile - #14957

Merged
Mab879 merged 4 commits into
ComplianceAsCode:masterfrom
matusmarhefka:rhel_10_stig_tests
Aug 7, 2026
Merged

Add missing tests for rules selected in RHEL 10 STIG profile#14957
Mab879 merged 4 commits into
ComplianceAsCode:masterfrom
matusmarhefka:rhel_10_stig_tests

Conversation

@matusmarhefka

Copy link
Copy Markdown
Member

Introducing test scenarios for the following rules:

audit_rules_dac_modification_umount
ssh_keys_passphrase_protected
sysctl_kernel_exec_shield

Related to https://redhat.atlassian.net/browse/OPENSCAP-7022

The rule has only SCE check, no remediation. The testing VM needs
`openscap-engine-sce` and `openscap-utils` packages to be installed
for SCE check to work.
The OVAL check for the 64-bit ExecShield rule was looking at
/boot/grub2/grub.cfg for noexec=off, but on RHEL 9+ and other BLS
platforms kernel arguments are in /boot/loader/entries/*.conf.
This caused the rule to always pass regardless of actual state.

Update the OVAL to check BLS entries on products that use them,
matching the grub2_bootloader_argument template's product list.

Also add pass and fail test scenarios for RHEL.
@matusmarhefka matusmarhefka added the RHEL10 Red Hat Enterprise Linux 10 product related. label Aug 3, 2026
@Mab879 Mab879 self-assigned this Aug 3, 2026
@jan-cerny jan-cerny added this to the 0.1.82 milestone Aug 4, 2026
<ind:textfilecontent54_object id="object_nx_disabled_grub" version="1">
{{% if product in ['ol9'] %}}
<ind:filepath>/etc/default/grub</ind:filepath>
{{% if product in ["fedora", "ol8", "ol9", "rhel8", "rhel9", "rhel10"] %}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we change this to 'rhel' in product?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wanted to align with grub2_bootloader_argument template OVAL which uses this exact products list, see https://github.com/ComplianceAsCode/content/blob/master/shared/templates/grub2_bootloader_argument/oval.template#L276

Should I change both to rather use 'rhel' in product or product in ["fedora", "ol8", "ol9"] ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe 'rhel' in product is preferred because it will include future RHEL versions, removing the need to update the code when a new RHEL version arrives.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated in ead8f33

Update the grub2_bootloader_argument OVAL template and the
sysctl_kernel_exec_shield OVAL to use `'rhel' in product` instead
of listing individual RHEL versions. This avoids needing to update
the product list when a new RHEL version is added.
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

@matusmarhefka: The following test 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-openshift-node-compliance ead8f33 link false /test e2e-aws-openshift-node-compliance

Full PR test history. Your PR dashboard.

Details

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

@Mab879
Mab879 merged commit 2a1f3a5 into ComplianceAsCode:master Aug 7, 2026
70 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RHEL10 Red Hat Enterprise Linux 10 product related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants