Skip to content

Commit c26da2a

Browse files
authored
Merge pull request #2042 from jan-cerny/autotailor_doc
Update documentation of autotailor
2 parents 03a6568 + fce4223 commit c26da2a

File tree

2 files changed

+57
-5
lines changed

2 files changed

+57
-5
lines changed

docs/manual/manual.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ and {usgcb}[USGCB].
7777
You can also generate your own SCAP content if you have an understanding of at
7878
least XCCDF or OVAL. XCCDF content is also frequently published online under
7979
open source licenses, and you can customize this content to suit your needs
80-
instead. SCAP Workbench is a great tool to do the customization.
80+
instead.
8181

8282
== Installing OpenSCAP
8383

@@ -2210,10 +2210,17 @@ OSCAP_REMEDIATE_VERBOSE_LEVEL=INFO
22102210

22112211
The downloaded guidance contains rule descriptions, but it doesn't contain OVAL checks which could be used for evaluation by OpenSCAP. You can find guidances with implemented OVAL checks and also with remediations at https://github.com/ComplianceAsCode/content[ComplianceAsCode] project, which contains wide range of profiles.
22122212

2213+
*How can I create a tailoring file if I can't install SCAP Workbench?*
2214+
2215+
Use the `autotailor` tool which allows you to create tailoring files using command line options.
2216+
For more information, please refer to section <<_tailoring,Tailoring>>.
2217+
22132218
*I try to apply a tailoring file, but OpenSCAP still evaluates rules that I have unselected. How can I enforce my changes of the profile?*
22142219

22152220
Make sure that you provide the ID of the customized profile in `--profile` option instead of the ID of the original profile.
2216-
If you created the tailoring file using SCAP Workbench, you were prompted to choose the ID of the customized profile. You can display the ID of the customized profile by running `oscap info <your_tailoring_file>`. By default, the ID of the customized profile ends with `_customized` suffix.
2221+
If you created the tailoring file using `autotailor` and you haven't used the `-p` or `--new-profile-id` option, the ID of the customized profile is the original profile ID with `_customized` suffix appended.
2222+
If you created the tailoring file using SCAP Workbench, you were prompted to choose the ID of the customized profile. By default, the ID of the customized profile is the original profile ID with `_customized` suffix appended.
2223+
You can find the ID of the customized profile with `oscap info <your_tailoring_file>` command.
22172224

22182225
*My SCAP source data stream contains rule `security_patches_up_to_date` which needs to download some data from the internet to work.*
22192226
*But I'm in an air gapped environment so it can't download it.*

utils/autotailor.8

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH autotailor "8" "April 2020" "Red Hat, Inc." "System Administration Utilities"
1+
.TH autotailor "8" "October 2023" "Red Hat, Inc." "System Administration Utilities"
22
.SH NAME
33
autotailor \- CLI tool for tailoring of SCAP data streams.
44
.SH DESCRIPTION
@@ -11,6 +11,53 @@ The tool requires data stream location and ID of the base profile as inputs.
1111
Note however, that the referenced data stream is not opened, and the validity of tailoring is not checked against it.
1212
The tool doesn't prevent you from extending non-existent profiles, selecting non-existent rules, and so on.
1313

14+
.SH SYNOPSIS
15+
autotailor [OPTION...] DATASTREAM_FILE BASE_PROFILE_ID
16+
17+
.SH OPTIONS
18+
.TP
19+
\fB--title TITLE\fR
20+
.RS
21+
Title of the new profile.
22+
.RE
23+
.TP
24+
\fB--id-namespace ID_NAMESPACE\fR
25+
.RS
26+
The reverse-DNS style string that is part of entities IDs in the corresponding data stream. If left out, the default value 'org.ssgproject.content' is used.
27+
.RE
28+
.TP
29+
\fB-v VAR=VALUE, --var-value VAR=VALUE\fR
30+
.RS
31+
Specify modification of the XCCDF value in form <varname>=<value>. Name of the variable can be either its full name, or the suffix, in which case the 'xccdf_<id-namespace>_value' prefix will be prepended internally. Specify the argument multiple times if needed.
32+
.RE
33+
.TP
34+
\fB-r RULE=ROLE, --rule-role RULE=ROLE\fR
35+
.RS
36+
Specify refinement of the XCCDF rule role in form <rule_id>=<role>. Name of the rule can be either its full name, or the suffix, in which case the 'xccdf_<id-namespace>_rule_' prefix will be prepended internally.
37+
The value of <role> can be one of full, unscored, unchecked. Specify the argument multiple times if needed.
38+
.RE
39+
.TP
40+
\fB-e RULE=SEVERITY, --rule-severity RULE=SEVERITY\fR
41+
.RS
42+
Specify refinement of the XCCDF rule severity in form <rule_id>=<severity>. Name of the rule can be either its full name, or the suffix, in which case the 'xccdf_<id-namespace>_rule_' prefix will be prepended internally. The value of <severity> can be one of unknown, info, low, medium, high. Specify the argument multiple times if needed.
43+
.RE
44+
.TP
45+
\fB-s RULE_ID, --select RULE_ID\fR
46+
.RS
47+
Specify the rule to select. The rule ID can be either full, or just the suffix, in which case the 'xccdf_<id-namespace>_rule' prefix will be prepended internally. Specify the argument multiple times if needed.
48+
.RE
49+
.TP
50+
\fB-u RULE_ID, --unselect RULE_ID\fR
51+
.RS
52+
Specify the rule to unselect. The argument works the same way as the --select argument.
53+
.RE
54+
.TP
55+
\fB-p NEW_PROFILE_ID, --new-profile-id NEW_PROFILE_ID\fR
56+
.RS
57+
Specify the ID of the tailored profile. The ID of the new profile can be either its full ID, or the suffix, in which case the 'xccdf_<id-namespace>_profile_' prefix will be prepended internally.
58+
If left out, the new ID will be obtained by appending '_customized' to the tailored profile ID.
59+
.RE
60+
1461
.SH USAGE
1562
.SS Modify a variable value
1663
$ autotailor --var-value xccdf_org.ssgproject.content_value_var_screensaver_lock_delay=120 -o tailoring.xml ssg-rhel8-ds.xml xccdf_org.ssgproject.content_profile_pci_dss
@@ -27,8 +74,6 @@ The tailoring tailoring_file defines a new profile, xccdf_org.ssgproject.content
2774
.SS Perform more modifications
2875
$ autotailor --var-value var_screensaver_lock_delay=120 --select gconf_gnome_screensaver_idle_delay --var-value inactivity_timeout_value=600 ssg-rhel8-ds.xml pci_dss
2976

30-
Use the --help option to learn about other options and their usage.
31-
3277
.SH REPORTING BUGS
3378
.nf
3479
Please report bugs using https://github.com/OpenSCAP/openscap/issues

0 commit comments

Comments
 (0)