-
Notifications
You must be signed in to change notification settings - Fork 383
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
Merge maint-1.3 to main #2176
Merged
Merged
Merge maint-1.3 to main #2176
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Accidentally, the GitHub CI started to build Perl bindings on Windows because the dependencies become available. However, the build fails because our code isn't ready to be built on Windows. This change will ensure the Perl bindings are kept disabled on Windows. See: https://github.com/OpenSCAP/openscap/actions/runs/8879756994/job/24378248762?pr=2104
Disable Perl bindings on Windows
If the document doesn't contain the xlink namespace, we need to define it before we create the `xlink:href` attribute. This situation happens if the `data-stream-collection` root element of the input SCAP source data stream doesn't have the xlink namespace defined. Resolves: RHEL-34104
Ensure xlink namespace exists
We don't need fresh fedoras or ubuntus. We keep that version only for older RHELs and Ubuntu LTSes.
Cleanup CI for maint-1.3 branch
The assumption that /var/lib/rpm is always a symlink to /usr/lib/sysimage/rpm was wrong. In bootc images, it isn't the case. As a result, all rules were evaluated as notapplicable when scanning a bootc image or container. We will fix it the following way: We will first try if the "new" location /usr/lib/sysimage/rpm exists, and use it only if it exists. If it doesn't exist, we will fall back to the "old" location /var/lib/rpm. Fixes: https://issues.redhat.com/browse/RHEL-55251 Fixes: OpenSCAP#2151
Improve RPM database path in RPM probes
This commit introduces a new environment variable `OSCAP_PREFERRED_ENGINE`. This variable allows users to set a preffered check engine for XCCDF rules. If a rule has multiple checks, the checks for the preffered check engine will be used. Allowed values: `SCE`, `OVAL`. If this variable is set to `SCE` and a rule has both SCE and OVAL checks the SCE check will be used. If this variable is set to `OVAL` and a rule has both SCE and OVAL checks the OVAL check will be used. If this environment variable isn't set, the standard XCCDF mechanism will be used for check selection. This will allow us to explicitely prefer SCE checks when executing `oscap` in Containerfile in the `podman build` process when building hardened bootc images. Also a small test is added to test this feature.
Allow preferring SCE
This will allow us in future to extend the code to support remediations for systems where a different package manager than "dnf" is used.
Introduce bootc remediation type
The `oscap-bootc` tool is a convenience script that makes building hardened bootable container images easier. This tool is designed to be used during the build of the bootable container image. Include `oscap-bootc` in your `Containerfile` that will be used to build your bootable container image.
Addressing: *** ERROR: ambiguous python shebang in /usr/bin/oscap-bootc: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
Introduce oscap-bootc
Starting with this commit, the OSCAP_BOOTC_BUILD environment variable will be passed down to the bash remediation. If this environment variable is set in the caller environment, the Bash remediations will be able to access it and read its value. This will be useful because the bash remediations will be able to contain a condition depending on this variable. Using this feature we can influence the behavior of our Bash remediations in the process of building bootable container images. The `oscap-bootc` utility will export the `OSCAP_BOOTC_BUILD` environment variable and the Bash remeditions will check this variable and for example they will not start systemd services. This commit also adds a small test.
Pass OSCAP_BOOTC_BUILD to remediations
Some SCE checks which are used instead of OVAL checks when building a bootable container require additional packages. This commit introduces `install_sce_dependencies` function in `oscap-bootc` script which will handle their installation.
Extend oscap-bootc to install SCE dependencies
matusmarhefka
approved these changes
Nov 13, 2024
8Z3737
approved these changes
Nov 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will bring useful changes from the maint-1.3 maintenance branch to the main branch. This includes oscap-bootc and changes supporting oscap-bootc.