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

Change rule platforms - Part 3: Individual rules in the "services" group #12507

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

jan-cerny
Copy link
Collaborator

Many rules currently marked with the machine platform should be applicable also to bootable containers. The reason is that often these rules check configuration that should be applied if the bootable container is deployed and booted on a real system. The applicability of these rules needs to be extended by marking them with the system_with_kernel platform instead.

We change the platforms carefully, we don't perform a blind mass platform replacement because not every rule that is currently marked as machine should be applicable to bootable containers, for example partition rules should be evaluated as "not applicable" when scanning a bootable container.

For more details, please read commit messages of all commits.

Review hints

For normal (non-bootable) containers, run a scan and verify that the rules affected by this change are still evaluated as notapplicable as they were before this change. For example: sudo oscap-podman centos:stream9 xccdf eval --profile stig --report /tmp/report.html build/ssg-cs9-ds.xml

The rules that enable or disable systemd services should
be applicable also in bootable containers because once
a bootable container is booted it can run systemd services.
Therefore we will extend the applicability of the rule to bootable
containers by assigning it the system_with_kernel platform
which is a broader platform than machine.
When a bootable container is booted it can run sssd and connect
to ldap.
Therefore we will extend the applicability of the rule to bootable
containers by assigning it the system_with_kernel platform
which is a broader platform than machine.
The reason that is mentioned in the comment is outdated. The checks
in the OVAL don't use on an OVAL systemdunitdependency check.
They use mostly textfilecontent check. Therefore we don't need
to mark them with the machine platform.
@jan-cerny jan-cerny added CPE-AL CPE Applicability Language Image Mode Bootable containers and Image Mode RHEL labels Oct 17, 2024
@jan-cerny jan-cerny added this to the 0.1.75 milestone Oct 17, 2024
@jan-cerny jan-cerny changed the title Change rule platforms - Part 3: Individual rules in the "system" group Change rule platforms - Part 3: Individual rules in the "services" group Oct 17, 2024
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@Mab879 Mab879 self-assigned this Oct 17, 2024
Copy link

codeclimate bot commented Oct 17, 2024

Code Climate has analyzed commit 26aa2c9 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 61.0% (0.0% change).

View more on Code Climate.

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Automatus failure is not related, waving.

Thanks!

@Mab879 Mab879 merged commit a11711d into ComplianceAsCode:master Oct 17, 2024
103 of 104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CPE-AL CPE Applicability Language Image Mode Bootable containers and Image Mode RHEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants