Chapter 8. Enabling FIPS mode in a bootc image build
The Federal Information Processing Standard (FIPS) 140 defines requirements for cryptographic modules. To fulfill these requirements, you must enable FIPS mode. You can enable FIPS mode during the bootc container image build.
8.1. Creating a bootable disk image for a FIPS-enabled system
You can create a disk image and enable FIPS mode when performing an Anaconda installation. You must add the fips=1
kernel argument when booting the disk image.
Prerequisites
- You have Podman installed on your host machine.
-
You have
virt-install
installed on your host machine. -
You have root access to run the
bootc-image-builder
tool, and run the containers in--privileged
mode, to build the images.
Procedure
Create a
01-fips.toml
to configure FIPS enablement, for example:Enable FIPS
# Enable FIPS kargs = ["fips=1"]
Copy to Clipboard Copied! Create a Containerfile with the following instructions to enable the
fips=1
kernel argument and adjust the cryptographic policies:FROM registry.redhat.io/rhel10/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 crypto policy RUN dnf install -y crypto-policies-scripts && update-crypto-policies --no-reload --set FIPS
FROM registry.redhat.io/rhel10/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 crypto policy RUN dnf install -y crypto-policies-scripts && update-crypto-policies --no-reload --set FIPS
Copy to Clipboard Copied! Create your bootc
<image>
compatible base disk image by usingContainerfile
in the current directory:sudo podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v $(pwd)/config.toml:/config.toml:ro \ -v $(pwd)/output:/output \ -v /var/lib/containers/storage:/var/lib/containers/storage \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --local
$ sudo podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v $(pwd)/config.toml:/config.toml:ro \ -v $(pwd)/output:/output \ -v /var/lib/containers/storage:/var/lib/containers/storage \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --local --type qcow2 \ --type iso \ quay.io/<namespace>/<image>:<tag>
Copy to Clipboard Copied! 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=1
kernel 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 FIPS
Copy to Clipboard Copied!