第 8 章 在 bootc 镜像构建中启用 FIPS 模式
联邦信息处理标准(FIPS) 140 定义加密模块的要求。要满足这些要求,您必须启用 FIPS 模式。您可以在 bootc 容器镜像构建过程中启用 FIPS 模式。
8.1. 为启用了 FIPS 的系统创建可引导磁盘镜像 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
您可以在执行 Anaconda 安装时创建磁盘镜像并启用 FIPS 模式。在引导磁盘镜像时,您必须添加 fips=1 内核参数。
先决条件
- 您已在主机机器上安装了 Podman。
-
您已在主机机器上安装了
virt-install。 -
您有运行
bootc-image-builder工具的 root 访问权限,并在--privileged模式下运行容器,以构建镜像。
流程
创建一个
01-fips.toml来配置 FIPS 启用,例如:Enable FIPS
# Enable FIPS kargs = ["fips=1"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用以下说明创建 Containerfile,以启用
fips=1内核参数并调整加密策略: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 FIPSCopy to Clipboard Copied! Toggle word wrap Toggle overflow 使用当前目录中的
Containerfile创建 bootc<image> 兼容基本磁盘镜像:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在系统安装过程中启用 FIPS 模式:
引导 RHEL Anaconda 安装程序时,在安装屏幕上,按 TAB 键并添加
fips=1内核参数。安装后,系统会自动以 FIPS 模式启动。
验证
登录到系统后,检查是否启用了 FIPS 模式:
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