第 7 章 在构建 bootc 镜像时启用 FIPS 模式


FIPS 包括加密操作的标准。您可以在 bootc 镜像构建期间启用 FIPS 模式,在构建 bootc 镜像时启用 FIPS 模式,以将系统配置为只使用 FIPS 批准的模块。启用 FIPS 模式有两个选项:

  • 使用 bootc-image-builder 工具: 您必须将 FIPS 加密策略启用到 Containerfile 中。
  • 当执行 Anaconda 安装时:除了在 Containerfile 中启用 FIPS 加密策略外,还必须在引导时添加 fips=1 内核参数。

FIPS dracut 模块内置了基础镜像。默认为 boot=UUID= karg in bootc install-to-filesystem

7.1. 使用 bootc-image-builder 启用 FIPS 模式

使用 bootc-image-builderbootc install to-disk 创建磁盘镜像,并通过在构建镜像时将自定义 Containerfile 作为参数传递来启用 FIPS 模式。

先决条件

  • 您已在主机机器上安装了 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/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/
    # Enable the FIPS crypto policy
    # crypto-policies-scripts is not installed by default in RHEL-10
    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> 兼容基本磁盘镜像:

    $ podman build -t quay.io/<namespace>/<image>:<tag> .
    Copy to Clipboard Toggle word wrap

验证

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

    $ *fips-mode-setup --check*
    FIPS mode is enabled.
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat