pkg/subscriptions: Modernize FIPS mounts #2174
Open
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.
/etc/system-fips
is deprecated in CentOS Stream 9 and has been removed from CentOS Stream 10. UBI8 containers still contain/etc/system-fips -> /run/secrets/system-fips
, but UBI9 containers do not, so creating/run/secrets/system-fips
on UBI9 (or later) does not serve a useful purpose. See [1, 2].Instead of checking
/etc/system-fips
to determine whether FIPS mode is enabled on the host, read/proc/sys/crypto/fips_enabled
, which works for all supported RHEL versions and likely even earlier.In CentOS 10 Stream, the crypto-policies package does now contain
/usr/share/crypto-policies/default-fips-config
, which is meant to serve as a file to bind-mount over/etc/crypto-policies/config
when in FIPS mode [3]. Manual creation of this file is thus no longer required in containers/common for modern containers. Using this file as a source also enables improvements in crypto-policies tooling which will nowupdate-crypto-policies --set
, something which was previously broken in containers because/etc/crypto-policies/config
was a read-only bind-mount, and/usr/share/crypto-policies/default-fips-config
file as source, so it makes sense for containers/common to switch to that.
Closes: #2130
Related: https://issues.redhat.com/browse/CRYPTO-13556