1.4. 为启用了 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 FIPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用当前目录中的
Containerfile
创建 bootc&
lt;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 FIPS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow