1.4. 为启用了 FIPS 的系统创建可引导磁盘镜像


您可以在执行 Anaconda 安装时创建磁盘镜像并启用 FIPS 模式。在引导磁盘镜像时,您必须添加 fips=1 内核参数。

先决条件

  • 您已在主机机器上安装了 Podman。
  • 您已在主机机器上安装了 virt-install
  • 您有运行 bootc-image-builder 工具的 root 访问权限,并在 --privileged 模式下运行容器,以构建镜像。

流程

  1. 创建一个 01-fips.toml 来配置 FIPS 启用,例如:

    # Enable FIPS
    kargs = ["fips=1"]
    Copy to Clipboard Toggle word wrap
  2. 使用以下说明创建 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
    Copy to Clipboard Toggle word wrap
  3. 使用当前目录中的 Containerfile 创建 bootc & lt;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/rhel10/bootc-image-builder:latest \
        --local
        --type qcow2 \
        --type iso \
        quay.io/<namespace>/<image>:<tag>
    Copy to Clipboard Toggle word wrap
  4. 在系统安装过程中启用 FIPS 模式:

    1. 引导 RHEL Anaconda 安装程序时,在安装屏幕上,按 TAB 键并添加 fips=1 内核参数。

      安装后,系统会自动以 FIPS 模式启动。

验证

  • 登录到系统后,检查是否启用了 FIPS 模式:

    $ cat /proc/sys/crypto/fips_enabled
    1
    $ update-crypto-policies --show
    FIPS
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat