5.4. Performing a hardened installation of RHEL with Kickstart
If you need your system to be compliant with a specific security profile, such as DISA STIG, CIS, or ANSSI, you can prepare a Kickstart file that defines the hardened configuration, customize the configuration with a tailoring file, and start an automated installation of the hardened system.
Prerequisites
-
The
openscap-scanneris installed on your system. The
scap-security-guidepackage is installed on your system and the package version corresponds to the version of RHEL that you want to install. For more information, see Supported versions of the SCAP Security Guide in RHEL. Using a different version can cause conflicts.참고If your system has the same version of RHEL as the version you want to install, you can install the
scap-security-guidepackage directly.
Procedure
Find the ID of the security profile from the data stream file:
$ oscap info /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml Profiles: … Title: Australian Cyber Security Centre (ACSC) Essential Eight Id: xccdf_org.ssgproject.content_profile_e8 Title: Health Insurance Portability and Accountability Act (HIPAA) Id: xccdf_org.ssgproject.content_profile_hipaa Title: PCI-DSS v3.2.1 Control Baseline for Red Hat Enterprise Linux 10 Id: xccdf_org.ssgproject.content_profile_pci-dss …-
Optional: If you want to customize your hardening with XCCDF Tailoring file you can use the
autotailorcommand provided in theopenscap-utilspackage. For more information, see Customizing a security profile with autotailor. Generate the Kickstart file from the SCAP source data stream:
$ oscap xccdf generate fix --profile <profile_ID> --output <kickstart_file>.cfg --fix-type kickstart /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml+ Replace
<profile_ID>with the profile ID with which the system should comply, for example,hipaa.+ If you are using a tailoring file, embed the tailoring file into the generated Kickstart file by using the
--tailoring-file tailoring.xmloption and your custom profile ID, for example:+
$ *oscap xccdf generate fix --tailoring-file tailoring.xml --profile _<custom_profile_ID>_ --output _<kickstart_file>_.cfg --fix-type kickstart ./ssg-rhel10-ds.xml*
Review and, if necessary, manually modify the generated
<kickstart_file>.cfgto fit the needs of your deployment. Follow the instructions in the comments in the file.참고Some changes might affect the compliance of the systems installed by the Kickstart file. For example, some security policies require defined partitions or specific packages and services.
- Use the Kickstart file for your installation. For the installation program to use the Kickstart, the Kickstart can be served through a web server, provided in PXE, or embedded into the ISO image. For detailed steps, see the Semi-automated installations: Making Kickstart files available to the RHEL installer chapter in the Automatically installing RHEL document.
-
After the installation finishes, the system reboots automatically. After the reboot, log in and review the installation SCAP report saved in the
/rootdirectory.
Verification
Scan the system for compliance and save the report in a HTML file for review:
With the original profile:
# oscap xccdf eval --report report.html --profile <profile_ID> /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xmlWith the tailored profile:
# oscap xccdf eval --report report.html --tailoring-file tailoring.xml --profile <custom_profile_ID> /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml