Why it matters
Neither `runAsNonRoot` nor a non-zero `runAsUser` is set, so the container runs as whatever user its image names, which for most images is root.
How to fix it
Set `runAsNonRoot: true` on the pod or container, with a non-zero `runAsUser`.
What TrustIvan reads
Read through the Kubernetes API with the read-only role TrustIvan's install creates.
Benchmark controls
- CIS Kubernetes Benchmark 1.9.0, control
5.2.7: Root containers are minimised. Also checked for this control: Container runs as root - NSA/CISA Kubernetes Hardening Guidance 1.2, control
pod.non-root: Containers run as non-root users. Also checked for this control: Container runs with the root group, Container runs as root
Control numbers are the published ones; the titles are TrustIvan's own short descriptions. The benchmarks belong to their publishers, who do not endorse TrustIvan.
Related checks
- Container has no memory request
KubernetesSeverity: Low
k8s.container.no-memory-request - Container may escalate privileges
KubernetesSeverity: Medium
k8s.container.privilege-escalation - Container has no memory limit
KubernetesSeverity: Low
k8s.container.no-memory-limit - Container runs privileged
KubernetesSeverity: Critical
k8s.container.privileged - Container has no CPU request
KubernetesSeverity: Low
k8s.container.no-cpu-request - Container runs with the root group
KubernetesSeverity: Low
k8s.container.root-group
Terms: KSPM (Kubernetes security posture management), Kubernetes RBAC, NSA/CISA Kubernetes Hardening Guidance, CIS Benchmarks
All Kubernetes posture checks · The whole catalogue · How this works in TrustIvan · Documentation