8.3. Customizing a pre-hardened image with RHEL image builder


You can customize a security profile by changing parameters in certain rules, for example, minimum password length, removing rules that you cover differently, and selecting additional rules, to implement internal policies. You cannot define new rules by customizing a profile.

When you build an image from that blueprint, it creates a tailoring file with a new tailoring profile ID and saves it to the image as /usr/share/xml/oscap-tailoring/tailoring.xml. The new profile ID will have tailoring appended as a suffix to the base profile. For example, if you use the CIS (cis) base profile, the profile ID will be xccdf_org.ssgproject.content_profile_cis_tailoring.

Prerequisites

  • You are logged in as the root user or a user who is a member of the weldr group.
  • The openscap and scap-security-guide packages are installed.

Procedure

  1. Create a hardening blueprint in the TOML format from a selected profile. For example:

    # oscap xccdf generate fix --profile=<profileID> --fix-type=blueprint /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml > <profileID>tailored.toml
  2. Append the tailoring section with the customized rule set to the blueprint. Note that the tailoring customization will only affect the default selected or unselected state of the rules in the profile on which the customization is based, by selecting or deselecting a rule, without changing the state of other rules.

    # Blueprint for CIS Red Hat Enterprise Linux 10.0 Benchmark for Level 2 - Server
    # ...
    [customizations.openscap.tailoring]
    selected = [ "xccdf_org.ssgproject.content_bind_crypto_policy" ]
    unselected = [ "grub2_password" ]
  3. Start the build of a hardened image:

    # *image-builder build <image_type> --blueprint <blueprintProfileID> *

    Replace <image_type> with any image type, for example, qcow2.

    After the image build is ready, use your pre-hardened image on your deployments.

Verification

After you deploy your pre-hardened image, you can perform a configuration compliance scan to verify that the image is aligned with the selected security profile.

重要

Performing a configuration compliance scanning does not guarantee the system is compliant. For more information, see Configuration compliance scanning.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部