5.2.8 Minimize the admission of containers with added capabilities - allowedCapabilities

Information

Do not generally permit containers with capabilities assigned beyond the default set.

Rationale:

Containers run with a default set of capabilities as assigned by the Container Runtime. Capabilities outside this set can be added to containers which could expose them to risks of container breakout attacks.

There should be at least one Security Context Constraint (SCC) defined which prevents containers with capabilities beyond the default set from launching.

If you need to run containers with additional capabilities, this should be defined in a separate SCC and you should carefully check RBAC controls to ensure that only limited service accounts and users are given permission to access that SCC.

Impact:

Pods with containers which require capabilities outside the default set will not be permitted.

NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.

Solution

Ensure that Allowed Capabilities is set to an empty array for every SCC in the cluster except for the privileged SCC.

Default Value:

By default, OpenShift 4 clusters include the following SCCs:

anyuid Allowed Capabilities: <none>

hostaccess Allowed Capabilities: <none>

hostmount-anyuid Allowed Capabilities: <none>

hostnetwork Allowed Capabilities: <none>

node-exporter Allowed Capabilities: <none>

non-root Allowed Capabilities: <none>

privileged Allowed Capabilities: *

restricted Allowed Capabilities: <none>

anyuid Default Add Capabilities: <none>

hostaccess Default Add Capabilities: <none>

hostmount-anyuid Default Add Capabilities: <none>

hostnetwork Default Add Capabilities: <none>

node-exporter Default Add Capabilities: <none>

non-root Default Add Capabilities: <none>

privileged Default Add Capabilities: <none>

restricted Default Add Capabilities: <none>

See Also

https://workbench.cisecurity.org/files/3980