-
Notifications
You must be signed in to change notification settings - Fork 57
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
test: run oscap checks on images with oscap customizations (HMS-3710) #502
Conversation
511fe38
to
03a0300
Compare
03a0300
to
a971d18
Compare
The test is being migrated to osbuild/images. See osbuild/images#502 Signed-off-by: Achilleas Koutsou <[email protected]>
a971d18
to
e5101a6
Compare
e5101a6
to
fe7a795
Compare
The test is being migrated to osbuild/images. See osbuild/images#502 Signed-off-by: Achilleas Koutsou <[email protected]>
3df20c8
to
7901956
Compare
RHEL 8.10 boot test failing with:
which makes the |
Comparing the oscap version of the image with the base one,
which I assume is what causes the issue. Is this a bug in the oscap profile, adding an fstab option that the OS doesn't support, or did I configure it wrong? @kingsleyzissou do you know anything about this (from your oscap experience)? |
So this is technically a required mountpoint in the |
I have a strong suspicion that we are using an outdated datastream file from an older |
Interesting. Could it be an 8.10 issue since it's not released yet? I'm playing with the fstab on a live system and trying to get it to work but even with no options (just defaults) Not sure if any of this helps. |
7901956
to
09d3a2a
Compare
It's just a hunch. But up until last year the blueprints generated by the oscap tool were also trying to configure filesystem options for But I haven't seen an entry being added to the Edit: another thought is it could also be something from some of the |
@kingsleyzissou Unselecting |
We will be adding distro-specific oscap configs so let's rename this one to differentiate.
Add oscap test configs for RHEL 8 and RHEL 9 with the appropriate datastream option enabled. These replicate the test configs from the oscap test in osbuild-composer [1]. We enable these on ami to validate the config in the boot tests. [1] https://github.com/osbuild/osbuild-composer/blob/073e304978acade8bfa059f00a005402aa037c99/test/cases/oscap.sh
Currently does nothing with it, but the intention is to use in the boot test script.
The run subcommand uploads a local executable and runs it. Now we also support passing arguments to the executable. Any arguments that are paths to files are also uploaded to the image but only by their basename.
When booting AMIs in AWS, pass the config file name to the base-host-check.sh command.
Install necessary packages to run scans and check results.
Read the config if it's passed as an argument and detect if any openscap customizations are specified. If they are, run some oscap checks.
The oscap profile adds a /dev/shm mount to /etc/fstab which fails in RHEL 8.10. Disable the test for this distro version while we investigate the failure.
4ea40f9
to
4b99785
Compare
Disabling the test on RHEL 8.10 for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
That's very strange. I don't think we force |
Remediation log could be helpful (it is stored in |
@evgenyz it's really weird, if I disabled |
The test is being migrated to osbuild/images. See osbuild/images#502 Signed-off-by: Achilleas Koutsou <[email protected]>
Add oscap test configs for RHEL 8 and RHEL 9 with the appropriate datastream option enabled.
These replicate the test configs from the oscap test in osbuild-composer [1].
To fully replace the test in osbuild-composer, this PR also adds support for running the boot test script with the config file as argument. When an oscap config is detected, it runs some extra checks on the score of the system.
NOTE: This is a bit quick and dirty but should soon be replaced with a more comprehensive test of all customizations on images during boot
[1] https://github.com/osbuild/osbuild-composer/blob/073e304978acade8bfa059f00a005402aa037c99/test/cases/oscap.sh