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'