-
We’re Here to Help!
Kubernetes has become the standard platform for running containerised applications, but its flexibility comes with a large and complex attack surface. A single over-privileged service account, an exposed dashboard or a container running as root can give attackers a path from one compromised application to your entire cluster and cloud account.
This guide covers the Kubernetes security best practices that matter most, from access control and pod security to network policies, secrets and supply chain security, plus a checklist your team can act on.
cluster-admin to people, CI/CD tools or workloads that do not need it.PodSecurityPolicy was removed in Kubernetes v1.25. The built-in replacement is Pod Security Admission, which enforces the Pod Security Standards at namespace level:
| Level | Purpose |
|---|---|
| Privileged | Unrestricted; only for trusted system workloads |
| Baseline | Prevents known privilege escalations while staying broadly compatible |
| Restricted | Follows current hardening best practice; recommended for most application workloads |
In practice, aim for the restricted level: run containers as non-root, drop Linux capabilities, block privilege escalation, avoid host networking and host paths, and use read-only root filesystems where possible.
By default, pods can usually talk to every other pod in the cluster. Use network policies to allow only the traffic each workload needs, starting with a default-deny policy per namespace. Restrict access to the cloud metadata service from pods, and keep the Kubernetes API server off the public internet or limit it to trusted IP ranges.
Our container security service covers image and runtime reviews in detail.
If your clusters run on AWS, also review our guide to common AWS security misconfigurations, since cloud IAM and Kubernetes permissions are often linked.
Managed services secure the control plane infrastructure, but you remain responsible for most cluster and workload settings, including RBAC, network policies, pod security, secrets, node configuration and the security of your container images. Default settings are designed for compatibility, not maximum security.
PodSecurityPolicy was removed in Kubernetes v1.25. It was replaced by Pod Security Admission, a built-in admission controller that enforces the Pod Security Standards (privileged, baseline and restricted) at namespace level. Many teams also use policy engines such as Kyverno or OPA Gatekeeper for more detailed rules.
Combine continuous scanning of images and configurations in your CI/CD pipeline with an in-depth manual review or penetration test at least once a year and after major changes, such as new clusters, upgrades or multi-tenant workloads.
Kubernetes security depends on getting many details right: tight RBAC, enforced pod security, network segmentation, protected secrets, a trusted supply chain, hardened nodes and good monitoring. Working through these best practices removes the easiest paths attackers use to move from one container to your whole environment.
Want an expert review of your clusters? Explore our cloud security and container security services, or contact the Offensium Vault team.
Free 30-minute consultation
Talk to our ISO 27001 certified team about penetration testing, cloud security or compliance. No obligation, and we are happy to sign an NDA.