5.5. Customizing a security profile with autotailor
You can customize a security profile to better adjust it to your specific needs, for example, to implement an internal policy that differs from the official profile. When customizing a profile, you can select additional rules, remove rules that you cover differently, and change parameters of certain rules such as minimum password length. You cannot define new rules when customizing a profile.
By using the autotailor utility, you create an XCCDF tailoring file that contains all of the modifications of the original profile. Then, when you are scanning, remediating, or installing a system in accordance to a SCAP profile, you pass this tailoring file to the oscap command-line utility.
Prerequisites
-
The
openscap-utilspackage is installed on your system. - You know the ID of the profile within the baseline which you want to customize. To find the ID, see the Viewing profiles for configuration compliance section.
Procedure
Create a tailoring file for your profile by using the
autotailorcommand, for example:$ autotailor \ --select=<rule_ID_1> \ --select=<rule_ID_2> \ --unselect=<rule_ID_3> \ --var-value=<value_ID_1>=<value_1> \ --var-value=<value_ID_2>=<value_2> \ --output=<tailoring.xml> \ --tailored-profile-id=<custom_profile_ID> \ /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml <profile_ID>Where:
<customization_options>are the modifications of the profile. Use one or more of the following options:--select=<rule_ID>- Add an existing rule to the profile.
--unselect=<rule_ID>- Remove a rule from the profile.
--var-value=<value_ID>=<value>-
Override a pre-set value. For example, to set
var_sshd_max_sessionsto10, use--var-value=var_sshd_max_sessions=10.
-
<tailoring.xml>is the file name whereautotailorsaves the tailoring. -
<custom_profile_ID>is the profile ID within which theautotailorsaves customizations, for example,custom_cis. -
<profile_ID>is the profile ID with which the system should comply, for example,cis.
참고For all profile, rule, and variable XCCDF IDs, you can use either a full namespaced identifier or a shortened ID that
autotailorautomatically augments with the namespace prefix. For example,cisis equivalent toxccdf_org.ssgproject.content_profile_cis.You can override the default namespace
org.ssgproject.contentby using the--id-namespaceoption.Optional: Create a tailoring file based on the customizations defined in the JSON Tailoring format:
$ autotailor --output=<tailoring.xml> --json-tailoring=<json_tailoring.json>Replace
<json_tailoring.json>with the file name with JSON Tailoring definitions.참고You can mix
--json-tailoringwith--select,--unselect, and--var-valuecommand-line customizations. In that case, command-line customizations have priority over JSON Tailoring.