Skip to content

Commit

Permalink
Merge pull request #12071 from Vincent056/scc_fix
Browse files Browse the repository at this point in the history
OCPBUGS-17828 Improve scc-limit-container-allowed-capabilities OCIL
  • Loading branch information
yuumasato authored Jun 25, 2024
2 parents 9758517 + 24624e6 commit a3d0799
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ description: |-
spec:
description: Allows an additional scc
setValues:
- name: upstream-ocp4-var-sccs-with-allowed-capabilities-regex
- name: ocp4-var-sccs-with-allowed-capabilities-regex
rationale: Allow our own custom SCC
value: ^privileged$|^hostnetwork-v2$|^restricted-v2$|^nonroot-v2$|^additional$
extends: upstream-ocp4-cis
extends: ocp4-cis
title: Modified CIS allowing one more SCC
</pre>
<p>
Finally, reference this <tt>TailoredProfile</tt> in a <tt>ScanSettingBinding</tt>
For more information on Tailoring the Compliance Operator, please consult the
OpenShift documentation:
{{{ weblink(link="https://docs.openshift.com/container-platform/4.12/security/compliance_operator/compliance-operator-tailor.html") }}}
{{{ weblink(link="https://docs.openshift.com/container-platform/latest/security/compliance_operator/co-scans/compliance-operator-tailor.html") }}}
</p>
rationale: |-
Expand Down Expand Up @@ -66,7 +66,7 @@ ocil: |-
check the variable value, e.g:
<pre>$ oc get variable ocp4-var-sccs-with-allowed-capabilities-regex -ojsonpath='{.value}' </pre>
Then use following command to list the SCCs that would fail the test:
<pre>$ oc get scc -o json | jq '{{{ jqfilter }}}'</pre>
<tt>{{{ ocil_oc_pipe_jq_filter('scc', jqfilter) }}}</tt>
Please replace the regular expression in the test command with the value read from the variable
<pre>ocp4-var-sccs-with-allowed-capabilities-regex</pre>. You can read the variable
value with:
Expand Down
2 changes: 1 addition & 1 deletion shared/macros/10-ocil.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#}}
{{% macro ocil_oc_pipe_jq_filter(object, jqfilter, namespace=none, all_namespaces=false) -%}}
oc get {{% if all_namespaces %}}--all-namespaces{{% elif namespace %}}-n {{{ namespace }}}{{% endif %}} {{{ object }}} -o json | jq '{{{ jqfilter }}}'
$ oc get {{% if all_namespaces %}}--all-namespaces{{% elif namespace %}}-n {{{ namespace }}}{{% endif %}} {{{ object }}} -o json | jq '{{{ jqfilter }}}'
{{%- endmacro %}}


Expand Down

0 comments on commit a3d0799

Please sign in to comment.