5.2.1 Minimize the admission of privileged containers

Information

Do not generally permit containers to be run with the securityContext.privileged flag set to true.

Rationale:

Privileged containers have access to all Linux Kernel capabilities and devices. A container running with full privileges can do almost everything that the host can do. This flag exists to allow special use-cases, like manipulating the network stack and accessing devices.

There should be at least one Security Context Constraint (SCC) defined which does not permit privileged containers.

If you need to run privileged containers, 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 defined with spec.containers[].securityContext.privileged: true will not be permitted.

Solution

Create an SCC that sets allowPrivilegedContainer to false and take it into use by assigning it to applicable users and groups.

Default Value:

By default, the following SCCs do not allow users to create privileged containers:

'anyuid'

'hostaccess'

'hostmount-anyuid'

'hostnetwork'

'hostnetwork-v2'

'machine-api-termination-handler'

'nonroot'

'nonroot-v2'

'restricted'

'restricted-v2'

See Also

https://workbench.cisecurity.org/benchmarks/14166

Item Details

Category: ACCESS CONTROL, SYSTEM AND INFORMATION INTEGRITY

References: 800-53|AC-6(2), 800-53|AC-6(5), 800-53|AC-17(3), 800-53|SI-7, CSCv7|4.3

Plugin: OpenShift

Control ID: ea8d868fe9a413ec4f59c3359e9fad402929e76b8e6e7cb8a9258bf4cda125a1