Skip to main content

Offensium Vault

Kubernetes Security Best Practices: A Practical Checklist

Kubernetes Security Best Practices: A Practical Checklist
Spread the love

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.

Why Kubernetes Security Is Hard

  • Many moving parts: the API server, etcd, kubelets, nodes, networking, storage and add-ons.
  • Defaults favour ease of use over strict security.
  • Workloads, permissions and configurations change constantly through CI/CD.
  • Responsibility is shared between the cloud provider, platform team and application developers.

1. Lock Down Access With RBAC

  • Follow least privilege: avoid granting cluster-admin to people, CI/CD tools or workloads that do not need it.
  • Prefer namespaced Roles over ClusterRoles where possible.
  • Use separate service accounts per workload and disable automatic token mounting when it is not needed.
  • Integrate cluster access with your identity provider and require MFA for administrators.
  • Review role bindings regularly and remove stale access.

2. Enforce Pod Security Standards

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.

3. Segment the Network

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.

4. Protect Secrets

  • Enable encryption at rest for Kubernetes Secrets in etcd.
  • Consider an external secrets manager such as AWS Secrets Manager or HashiCorp Vault.
  • Never bake credentials into container images or commit them to Git.
  • Limit which service accounts can read which secrets.

5. Secure the Supply Chain

  • Use minimal, trusted base images and keep them updated.
  • Scan images for vulnerabilities in CI/CD and block critical issues before deployment.
  • Sign images and verify signatures at admission time.
  • Pull only from approved registries.

Our container security service covers image and runtime reviews in detail.

6. Harden Nodes and the Control Plane

  • Keep Kubernetes and node operating systems patched and on supported versions.
  • Benchmark clusters against the CIS Kubernetes Benchmark.
  • Restrict access to the kubelet API and etcd.
  • Disable or tightly secure dashboards and other admin tools.

7. Log, Monitor and Respond

  • Enable Kubernetes audit logging and send logs to a central location.
  • Monitor for unusual activity, such as exec into pods, new privileged pods or unexpected role bindings.
  • Use runtime security tools to detect suspicious process and network behaviour.
  • Include Kubernetes scenarios in your incident response plan.

Kubernetes Security Checklist

  1. Restrict API server access and require strong authentication.
  2. Apply least-privilege RBAC and review bindings regularly.
  3. Enforce the restricted Pod Security Standard for application namespaces.
  4. Apply default-deny network policies.
  5. Encrypt secrets at rest and use an external secrets manager where possible.
  6. Scan, sign and verify container images.
  7. Patch clusters and nodes and follow the CIS Kubernetes Benchmark.
  8. Enable audit logs and runtime monitoring.
  9. Block pod access to cloud metadata endpoints.
  10. Test the cluster regularly with configuration reviews and penetration testing.

If your clusters run on AWS, also review our guide to common AWS security misconfigurations, since cloud IAM and Kubernetes permissions are often linked.

Frequently Asked Questions

Is a managed Kubernetes service like EKS, AKS or GKE secure by default?

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.

What replaced PodSecurityPolicy in Kubernetes?

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.

How often should Kubernetes clusters be security tested?

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.

Conclusion

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.

Where we work: Offensium Vault provides penetration testing for businesses in India, UAE, USA, UK, Australia and clients worldwide, delivered remotely from India.

Free 30-minute consultation

Want an expert view of your security?

Talk to our ISO 27001 certified team about penetration testing, cloud security or compliance. No obligation, and we are happy to sign an NDA.

Book a Free ConsultationExplore our services →
Penetration testing for businesses in India · UAE · USA · UK · Australia and clients worldwide — delivered remotely from Bhubaneswar, India.
Chat on WhatsApp