A non-root user is an operating-system identity without root’s unrestricted administrative privileges. Running containers with the least required permissions limits host exposure after a container breakout. section 13.6.1
Use a non-root identity to:
- Avoid inheriting root as the default user from common container images such as busybox. section 13.6.1
- Set the container user, primary group, and filesystem group through a Kubernetes security context. section 13.6.1
- Reduce the impact of configurations that combine root execution with privileged access to host devices. section 13.4
Kubernetes deployment identity
Configure a Pod with runAsUser 1500, runAsGroup 1000, and fsGroup 1200. Confirm the effective identity and memberships with whoami and groups. IDs absent from a pulled image may produce unknown-ID warnings. section 13.6.1
spec: securityContext: runAsUser: 1500 runAsGroup: 1000 fsGroup: 1200
View the compact Pod securityContext manifest for assigning the non-root user and group identities. section 13.6.1
