Container and Kubernetes security, topic 38 of 70
Hardening workloads
A container is a process on a shared kernel; what it may do if compromised is set when it starts. Run as a non-root user, make the root file system read-only, drop all Linux capabilities and add back only what is needed, forbid privilege escalation, and set resource limits.
In Kubernetes these are the securityContext fields, and the Pod Security Standards' restricted profile enforces them for a whole namespace.
On Opsfolk
- Kubernetes clusterPlayground, 60 minutesPremium members