lacework-global-337
This policy has been deprecated in favor of lacework-global-648.
See Adjusted Rules - CIS Amazon EKS 1.1.0 for further details.
Minimize the admission of privileged containers (Automated)
Profile Applicability
• Level 1
Description
Do not generally permit the running of containers 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 PodSecurityPolicy (PSP) defined which does not permit privileged containers.
If you need to run privileged containers, this should be defined in a separate PSP and you should carefully check RBAC controls to ensure that only limited service accounts and users are given permission to access that PSP.
Impact
Pods defined with spec.containers[].securityContext.privileged: true
will not be permitted.
Audit
Get the set of PSPs with the following command:
kubectl get psp
For each PSP, check whether privileged is enabled:
kubectl get psp -o json
Verify that there is at least one PSP which does not return true
.
kubectl get psp <name> -o=jsonpath='{.spec.privileged}'
Remediation
Create a Pod Security Policy (PSP) as described in the Kubernetes documentation, omitting the .spec.privileged
field or setting it to false
.
References
https://kubernetes.io/docs/concepts/policy/pod-security-policy/#enabling-pod-security-policies
https://aws.github.io/aws-eks-best-practices/pods/#restrict-the-containers-that-can-run-as-privileged