-
Notifications
You must be signed in to change notification settings - Fork 711
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
RHEL FIPS Clean Up #12946
RHEL FIPS Clean Up #12946
Changes from all commits
1a2d048
3331dd0
0674d9e
2a9885b
0cbb36d
79cdcf5
e345d9e
42fbc27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,7 @@ | ||
# platform = multi_platform_all | ||
{{{ bash_instantiate_variables("var_system_crypto_policy") }}} | ||
|
||
if {{{ bash_bootc_build() }}}; then | ||
crypto_policies_no_reload="--no-reload" | ||
cat > /usr/lib/bootc/kargs.d/01-fips.toml << EOF | ||
kargs = ["fips=1"] | ||
EOF | ||
else | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove also lines 2 and 5 in this file. |
||
fips-mode-setup --enable | ||
fi | ||
|
||
stderr_of_call=$(update-crypto-policies $crypto_policies_no_reload --set ${var_system_crypto_policy} 2>&1 > /dev/null) | ||
rc=$? | ||
|
||
if test "$rc" = 127; then | ||
echo "$stderr_of_call" >&2 | ||
echo "Make sure that the script is installed on the remediated system." >&2 | ||
echo "See output of the 'dnf provides update-crypto-policies' command" >&2 | ||
echo "to see what package to (re)install" >&2 | ||
|
||
false # end with an error code | ||
elif test "$rc" != 0; then | ||
echo "Error invoking the update-crypto-policies script: $stderr_of_call" >&2 | ||
false # end with an error code | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,19 @@ documentation_complete: true | |
title: Enable FIPS Mode | ||
|
||
description: |- | ||
{{% if product != "rhcos4" %}} | ||
{{% if product == "rhcos4" %}} | ||
OpenShift has an installation-time flag that can enable FIPS mode | ||
for the cluster. The flag <pre>fips: true</pre> must be enabled | ||
at install time in the <pre>install-config.yaml</pre> file. If | ||
this rule fails on an installed cluster, then this is a permanent | ||
finding and cannot be fixed. | ||
{{% elif 'rhel' in product %}} | ||
{{{ full_name }}} has an installation-time kernel flag that can enable FIPS mode. | ||
The installer must be booted with <tt>fips=1</tt> for the system to have FIPS mode | ||
enabled. Enabling FIPS mode on a preexisting system is not supported. If | ||
this rule fails on an installed system, then this is a permanent | ||
finding and cannot be fixed. | ||
{{% else %}} | ||
To enable FIPS mode, run the following command: | ||
<pre>fips-mode-setup --enable</pre> | ||
<br /> | ||
|
@@ -15,19 +27,14 @@ description: |- | |
<li>Setting the system crypto policy in <tt>/etc/crypto-policies/config</tt> to <tt>{{{ xccdf_value("var_system_crypto_policy") }}}</tt></li> | ||
<li>Loading the Dracut <tt>fips</tt> module</li> | ||
</ul> | ||
|
||
{{% endif %}} | ||
{{% if bootable_containers_supported == "true" %}} | ||
<br /> | ||
To enable FIPS mode at bootable container build time configure <tt>fips=1</tt> kernel argument | ||
in <tt>/usr/lib/bootc/kargs.d/01-fips.toml</tt>: | ||
<pre>kargs = ["fips=1"]</pre> | ||
Then set the cryptographic policy to <tt>{{{ xccdf_value("var_system_crypto_policy") }}}</tt>: | ||
<pre>update-crypto-policies --no-reload --set {{{ xccdf_value("var_system_crypto_policy") }}}</pre> | ||
{{% else %}} | ||
OpenShift has an installation-time flag that can enable FIPS mode | ||
for the cluster. The flag <pre>fips: true</pre> must be enabled | ||
at install time in the <pre>install-config.yaml</pre> file. If | ||
this rule fails on an installed cluster, then this is a permanent | ||
finding and cannot be fixed. | ||
{{% endif %}} | ||
|
||
rationale: |- | ||
|
@@ -58,35 +65,23 @@ ocil_clause: 'FIPS mode is not enabled' | |
|
||
ocil: |- | ||
To verify that FIPS mode is enabled properly, run the following command: | ||
<pre>fips-mode-setup --check</pre> | ||
The output should contain the following: | ||
<pre>FIPS mode is enabled.</pre> | ||
To verify that the cryptographic policy has been configured correctly, run the | ||
following command: | ||
<pre>$ update-crypto-policies --show</pre> | ||
The output should return <pre>{{{ xccdf_value("var_system_crypto_policy") }}}</pre>. | ||
<pre>cat /proc/sys/crypto/fips_enabled</pre> | ||
The output be must: | ||
<pre>1</pre> | ||
warnings: | ||
- general: |- | ||
The system needs to be rebooted for these changes to take effect. | ||
To configure {{{ full_name }}} to run in FIPS 140 mode, the kernel parameter "fips=1" needs to be added during its installation. | ||
Only enabling FIPS 140 mode during the {{{ full_name }}} installation ensures that the system generates all keys with FIPS-approved algorithms and continuous monitoring tests in place. | ||
Enabling FIPS mode on a preexisting system involves a number of modifications to it and therefore is not supported. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add: Only enabling FIPS mode during the RHEL installation ensures that the system generates all keys with FIPS-approved algorithms and continuous monitoring tests in place. |
||
- regulatory: |- | ||
This rule DOES NOT CHECK if the components of the operating system are FIPS certified. | ||
You can find the list of FIPS certified modules at {{{ weblink(link="https://csrc.nist.gov/projects/cryptographic-module-validation-program/validated-modules/search") }}}. | ||
This rule checks if the system is running in FIPS mode. See the rule description for more information about what it means. | ||
This rule checks if the system is running in FIPS mode. | ||
fixtext: |- | ||
Configure {{{ full_name }}} to run in FIPS mode. | ||
Run the following commands: | ||
$ sudo fips-mode-setup --enable | ||
$ sudo update-crypto-policies --set {{{ xccdf_value("var_system_crypto_policy") }}} | ||
The system needs to be rebooted for these changes to take effect. | ||
To enable FIPS mode at bootable container build time, add the following commands in Containerfile: | ||
RUN echo 'kargs = ["fips=1"]' > /usr/lib/bootc/kargs.d/01-fips.toml | ||
RUN update-crypto-policies --no-reload --set {{{ xccdf_value("var_system_crypto_policy") }}} | ||
The installer for the system must be booted with kernel parameter <tt>fips=1</tt>. | ||
srg_requirement: '{{{ full_name }}} must implement NIST FIPS-validated cryptography for the following: to provision digital signatures, to generate cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.' |
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.
missing endif