Chapter 9. Enabling the FIPS mode while building a bootc image
Federal Information Processing Standards (FIPS) include standards for cryptographic operations. You can enable FIPS mode when building a bootc image, to configure the system to use only FIPS-approved modules. You can use the following options to enable FIPS mode:
-
By using the
bootc-image-buildertool: You must enable the FIPS system-wide cryptographic policy in the Containerfile. -
When performing an Anaconda installation: You must enable the FIPS system-wide cryptographic policy in the Containerfile, and also add the
fips=1kernel argument during the boot time.
A FIPS dracut module is built-in to the base image. It defaults to a boot=UUID= karg in bootc install-to-filesystem.
9.1. Enabling FIPS mode by using bootc-image-builder Copy linkLink copied to clipboard!
Create a disk image by using bootc-image-builder or bootc install to-disk, and enable FIPS mode by passing the custom Containerfile as an argument when building the image.
Prerequisites
- Podman is installed on your host machine.
-
virt-installis installed on your host machine. -
You have root access to run the
bootc-image-buildertool, and run the containers in--privilegedmode, to build the images.
Procedure
Create a
01-fips.tomlto configure FIPS enablement, for example:Enable FIPS
# Enable FIPS kargs = ["fips=1"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Containerfile with the following instructions to enable the
fips=1kernel argument:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create your bootc
<image>compatible base disk image by usingContainerfilein the current directory:podman build -t quay.io/<namespace>/<image>:<tag> .
$ podman build -t quay.io/<namespace>/<image>:<tag> .Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
After login in to the system, check that FIPS mode is enabled:
cat /proc/sys/crypto/fips_enabled 1 $ update-crypto-policies --show FIPS
$ cat /proc/sys/crypto/fips_enabled 1 $ update-crypto-policies --show FIPSCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.2. Enabling FIPS mode to perform an Anaconda installation Copy linkLink copied to clipboard!
To create a disk image and enable FIPS mode when performing an Anaconda installation, use the following procedure:
Prerequisites
- Podman is installed on your host machine.
-
virt-installis installed on your host machine. -
You have root access to run the
bootc-image-buildertool, and run the containers in--privilegedmode, to build the images.
Procedure
Create a
01-fips.tomlto configure FIPS enablement, for example:Enable FIPS
# Enable FIPS kargs = ["fips=1"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Containerfile with the following instructions to enable the
fips=1kernel argument:FROM registry.redhat.io/rhel9/rhel-bootc:latest # Enable fips=1 kernel argument: https://bootc-dev.github.io/bootc/building/kernel-arguments.html COPY 01-fips.toml /usr/lib/bootc/kargs.d/ # Install and enable the FIPS system-wide cryptographic policy RUN dnf install -y crypto-policies-scripts && update-crypto-policies --no-reload --set FIPS
FROM registry.redhat.io/rhel9/rhel-bootc:latest # Enable fips=1 kernel argument: https://bootc-dev.github.io/bootc/building/kernel-arguments.html COPY 01-fips.toml /usr/lib/bootc/kargs.d/ # Install and enable the FIPS system-wide cryptographic policy RUN dnf install -y crypto-policies-scripts && update-crypto-policies --no-reload --set FIPSCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create your bootc
<image>compatible base disk image by usingContainerfilein the current directory:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable FIPS mode during the system installation:
When booting the RHEL Anaconda installer, on the installation screen, press the TAB key and add the
fips=1kernel argument.After the installation, the system starts in FIPS mode automatically.
Verification
After login in to the system, check that FIPS mode is enabled:
cat /proc/sys/crypto/fips_enabled 1 $ update-crypto-policies --show FIPS
$ cat /proc/sys/crypto/fips_enabled 1 $ update-crypto-policies --show FIPSCopy to Clipboard Copied! Toggle word wrap Toggle overflow