Containers should not enable more capabilites than needed as this
opens the door for malicious use. To enable only the
required capabilities, the appropriate Security Context Constraints (SCCs)
should set capabilities as a list in allowedCapabilities
.
In case an SCC outside the default allow list in the variable
var-sccs-with-allowed-capabilities-regex
is being flagged,
create a TailoredProfile
and add the additional SCC to the
regular expression in the variable var-sccs-with-allowed-capabilities-regex
.
An example allowing an SCC named additional
follows:
apiVersion: compliance.openshift.io/v1alpha1
kind: TailoredProfile
metadata:
name: cis-additional-scc
spec:
description: Allows an additional scc
setValues:
- name: upstream-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
title: Modified CIS allowing one more SCC
Finally, reference this TailoredProfile
in a ScanSettingBinding
For more information on Tailoring the Compliance Operator, please consult the
OpenShift documentation:
https://docs.openshift.com/container-platform/4.12/security/compliance_operator/compliance-operator-tailor.html