4.2.1 Ensure that the cluster enforces Pod Security Standard Baseline profile or stricter for all namespaces.

Information

The Pod Security Standard Baseline profile defines a baseline for container security. You can enforce this by using the built-in Pod Security Admission controller.

Rationale:

Without an active mechanism to enforce the Pod Security Standard Baseline profile, it is not possible to limit the use of containers with access to underlying cluster nodes, via mechanisms like privileged containers, or the use of hostPath volume mounts.

NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.

Solution

Ensure that Pod Security Admission is in place for every namespace which contains user workloads.
Run the following command to enforce the Baseline profile in a namespace:-

kubectl label namespace <namespace-name> pod-security.kubernetes.io/enforce=baseline

Default Value:

By default, Pod Security Admission is enabled but no policies are in place.

See Also

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