Skip to content

Commit 520d129

Browse files
authored
Merge pull request #40735 from kmccarron-rh/tailored
OSDOCS-3168: Fix steps in Using tailored profiles procedure
2 parents bc049c2 + 014632a commit 520d129

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

modules/compliance-tailored-profiles.adoc

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@ The `ComplianceSuite` object contains an optional `TailoringConfigMap` attribute
1414
+
1515
[source,terminal]
1616
----
17-
$ oc get rules.compliance -l compliance.openshift.io/profile-bundle=rhcos4
17+
$ oc get rules.compliance -n openshift-compliance -l compliance.openshift.io/profile-bundle=rhcos4
1818
----
1919

2020
. Browse the available variables in the same `ProfileBundle`:
2121
+
2222
[source,terminal]
2323
----
24-
$ oc get variables.compliance -l compliance.openshift.io/profile-bundle=rhcos4
24+
$ oc get variables.compliance -n openshift-compliance -l compliance.openshift.io/profile-bundle=rhcos4
2525
----
2626

27-
. Choose which rules you want to add to the `TailoredProfile`. This `TailoredProfile` example disables two rules and changes one value. Use the `rationale` value to describe why these changes were made:
27+
. Create a tailored profile named `nist-moderate-modified`:
28+
.. Choose which rules you want to add to the `nist-moderate-modified` tailored profile. This example extends the `rhcos4-moderate` profile by disabling two rules and changing one value. Use the `rationale` value to describe why these changes were made:
2829
+
29-
.Example output
30+
.Example `new-profile-node.yaml`
3031
[source,yaml]
3132
----
3233
apiVersion: compliance.openshift.io/v1alpha1
@@ -35,20 +36,18 @@ metadata:
3536
name: nist-moderate-modified
3637
spec:
3738
extends: rhcos4-moderate
39+
description: NIST moderate profile
3840
title: My modified NIST moderate profile
3941
disableRules:
40-
- name: rhcos4-file-permissions-node-config
41-
rationale: This breaks X application.
42+
- name: rhcos4-file-permissions-var-log-messages
43+
rationale: The file contains logs of error messages in the system
4244
- name: rhcos4-account-disable-post-pw-expiration
4345
rationale: No need to check this as it comes from the IdP
4446
setValues:
4547
- name: rhcos4-var-selinux-state
4648
rationale: Organizational requirements
4749
value: permissive
4850
----
49-
+
50-
51-
5251
+
5352
.Attributes for spec variables
5453
[cols="1,2a",options="header"]
@@ -74,15 +73,24 @@ spec:
7473
|`setValues`
7574
| A list of name, rationale, and value groupings. Each name refers to a name of the value set. The rationale is human-readable text describing the set. The value is the actual setting.
7675
|===
77-
+
78-
. Add the profile to the `ScanSettingsBinding` object:
76+
77+
.. Create the `TailoredProfile` object:
7978
+
8079
[source,terminal]
8180
----
82-
$ cat nist-moderate-modified.yaml
81+
$ oc create -n openshift-compliance -f new-profile-node.yaml <1>
8382
----
83+
<1> The `TailoredProfile` object is created in the default `openshift-compliance` namespace.
8484
+
8585
.Example output
86+
[source,terminal]
87+
----
88+
tailoredprofile.compliance.openshift.io/nist-moderate-modified created
89+
----
90+
91+
. Define the `ScanSettingBinding` object to bind the new `nist-moderate-modified` tailored profile to the default `ScanSetting` object.
92+
+
93+
.Example `new-scansettingbinding.yaml`
8694
[source,yaml]
8795
----
8896
apiVersion: compliance.openshift.io/v1alpha1
@@ -102,11 +110,11 @@ settingsRef:
102110
name: default
103111
----
104112

105-
. Create the `TailoredProfile`:
113+
. Create the `ScanSettingBinding` object:
106114
+
107115
[source,terminal]
108116
----
109-
$ oc create -n <namespace> -f <file-name>.yaml
117+
$ oc create -n openshift-compliance -f new-scansettingbinding.yaml
110118
----
111119
+
112120
.Example output

0 commit comments

Comments
 (0)