8.2. Creating a pre-hardened image with RHEL image builder
RHEL image builder on-premise supports the OpenSCAP integration. This integration enables the production of pre-hardened RHEL images.
By setting up a blueprint, you can perform the following actions:
- Create images that are pre-hardened and compliant with a specific profile
- Deploy the pre-hardened images in a VM, or a bare-metal environment, for example.
Prerequisites
-
You are logged in as the root user or a user who is a member of the
weldrgroup. -
The
openscapandscap-security-guidepackages are installed.
Procedure
Create a hardening blueprint in the TOML format, using the
OpenSCAPtool andscap-security-guidecontent, and modify it if necessary:# oscap xccdf generate fix --profile=<profileID> --fix-type=<blueprint> /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml > cis.tomlReplace
<profileID>with the profile ID that the system should comply with, for example,cis.Start the build of hardened image:
# image-builder build <image_type> --blueprint <blueprint_name>Replace
<image_type>with any image type, for example,qcow2.After the image build is ready, you can use your pre-hardened image on your deployments. See Creating a virtual machine from a KVM guest image.
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.