7.2. 启用 FIPS 模式执行 Anaconda 安装
要创建磁盘镜像并在执行 Anaconda 安装时启用 FIPS 模式,请按照以下步骤执行:
先决条件
- 您已在主机机器上安装了 Podman。
-
您已在主机机器上安装了
virt-install。 -
您有运行
bootc-image-builder工具的 root 访问权限,并在--privileged模式下运行容器,以构建镜像。
流程
创建一个
01-fips.toml来配置 FIPS 启用,例如:# Enable FIPS kargs = ["fips=1"]使用以下说明创建 Containerfile,以启用
fips=1内核参数:FROM registry.redhat.io/rhel9/rhel-bootc:latest # Enable fips=1 kernel argument: https://containers.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使用当前目录中的
Containerfile创建 bootc<image> 兼容基本磁盘镜像:$ 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/rhel9/bootc-image-builder:latest \ --local --type qcow2 \ quay.io/<namespace>/<image>:<tag>在系统安装过程中启用 FIPS 模式:
引导 RHEL Anaconda 安装程序时,在安装屏幕上,按 TAB 键并添加
fips=1内核参数。安装后,系统会自动以 FIPS 模式启动。
验证
登录到系统后,检查是否启用了 FIPS 模式:
$ *fips-mode-setup --check* FIPS mode is enabled.