By Kirk Rogers — iCapSolutions | Published September 9, 2026 | Updated October 24, 2026
Kubernetes is the default way teams run containers in 2026, and that popularity makes every cluster a target. These Kubernetes security best practices are the controls we check first on any production cluster, in roughly the order they pay off. Each one includes the command or manifest to verify it, so you can audit your own cluster as you read.
Kubernetes Security Best Practices at a Glance
| Practice | What it stops | Typical tooling |
|---|---|---|
| Least-privilege RBAC | One leaked token taking over the cluster | Native RBAC, kubectl auth can-i |
| Pod Security Standards | Privileged containers escaping to the node | Pod Security Admission |
| Default-deny network policies | Lateral movement after one pod is compromised | Calico, Cilium, cloud CNI policy support |
| Secrets encryption and external secrets | Credentials readable from etcd or Git | KMS envelope encryption, External Secrets Operator |
| Image scanning and signing | Known CVEs and tampered images reaching production | Trivy, cosign, Kyverno or OPA Gatekeeper |
| Locked-down API server and audit logs | Anonymous or untracked access to the control plane | Private endpoints, managed audit logging |
| Runtime threat detection | Attacks that a clean YAML file can’t prevent | Falco, GuardDuty EKS Runtime Monitoring, GKE threat detection |
1. Enforce Least-Privilege RBAC
Role-Based Access Control is the foundation. The most common finding in a cluster audit is cluster-admin handed out as a shortcut: to a CI pipeline, a monitoring agent, or every developer. Start by listing who has it:
kubectl get clusterrolebindings -o json \
| jq -r '.items[] | select(.roleRef.name=="cluster-admin") | .metadata.name + ": " + ([.subjects[]?.name] | join(", "))'Then check what any given service account can actually do:
kubectl auth can-i --list --as=system:serviceaccount:payments:api -n payments- Prefer namespaced
Roles overClusterRoles, and never grant wildcard verbs or resources to workloads. - Give each workload its own service account, and set
automountServiceAccountToken: falsefor pods that never call the Kubernetes API. - Map human access to your identity provider (IAM, Entra ID, Google groups) with short-lived credentials, so leaving the company actually removes access.
2. Apply Pod Security Standards
Kubernetes ships with three Pod Security Standards: privileged, baseline and restricted. Pod Security Admission enforces them per namespace with a label, no extra software required:
kubectl label namespace payments \
pod-security.kubernetes.io/enforce=restricted \
pod-security.kubernetes.io/warn=restrictedWorkloads in a restricted namespace need a security context like this:
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefaultRoll it out with warn first, fix what it reports, then switch to enforce. Only system namespaces that genuinely need host access should stay on baseline or privileged.
3. Default-Deny Network Policies
By default every pod can reach every other pod in the cluster. A default-deny policy per namespace flips that to an allow-list:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
namespace: payments
spec:
podSelector: {}
policyTypes: ["Ingress", "Egress"]Then add narrow policies for the traffic each service really needs, including DNS egress to kube-system. Network policies only work if your CNI enforces them: Calico and Cilium do, and on managed clusters you may need to turn policy support on (for example in the Amazon VPC CNI on EKS). For service-to-service encryption and identity, a mesh or CNI with mutual TLS adds a second layer.
4. Protect Secrets
Kubernetes Secrets are only base64-encoded by default. Three steps make them meaningfully safer:
- Encrypt Secrets at rest in etcd with a KMS key. EKS, GKE and AKS all support envelope encryption with the cloud provider’s key service.
- Keep secret values out of Git. Use the External Secrets Operator or the Secrets Store CSI driver to sync from AWS Secrets Manager, Google Secret Manager or Azure Key Vault.
- Restrict
getandliston Secrets in RBAC. Read access to Secrets in a namespace is effectively access to everything those credentials unlock.
5. Secure the Image Supply Chain
Vulnerable base images are still one of the most common ways known CVEs reach production. Fail the build before a bad image is ever pushed:
trivy image --exit-code 1 --severity HIGH,CRITICAL registry.example.com/payments/api:1.8.2- Use minimal or distroless base images. Fewer packages means fewer CVEs to triage.
- Sign images in CI with cosign, and pin deployments to digests or immutable tags instead of
:latest. - Use an admission controller (Kyverno or OPA Gatekeeper) as the second line of defense: reject unsigned images, images from unknown registries, and pods that break your security-context rules.
6. Lock Down the Control Plane
- Make the API server endpoint private, or restrict it to known CIDR ranges. A public endpoint with anonymous access disabled is the minimum.
- Turn on audit logging. On EKS, control plane audit logs are off until you enable them. Without them you can’t answer “who deleted that deployment?”
- Stay inside the supported version window. Kubernetes supports roughly the three most recent minor releases. Patch add-ons, ingress controllers and CNI plugins on a schedule, not after an incident.
- Use managed or regularly replaced node images so OS patches arrive without anyone SSHing into nodes.
7. Detect Threats at Runtime
Static hardening only covers half the picture. Runtime tools watch what containers actually do: unexpected shells, writes to sensitive paths, outbound connections to unknown hosts, privilege escalation. Falco is the common open-source choice, and the major clouds offer managed equivalents such as GuardDuty EKS Runtime Monitoring and GKE’s threat detection. Route alerts somewhere a person actually looks.
Kubernetes Compliance: CIS Benchmark and Hardening Guides
If you need to show auditors a standard, the CIS Kubernetes Benchmark is the usual reference, and kube-bench checks a cluster against it automatically. The NSA/CISA Kubernetes Hardening Guide and the official Kubernetes security checklist cover the same ground from a different angle. Most of their findings map directly onto the seven practices above.
Shift Left and Shield Right
You’ll hear “shift left” (catch problems in code and CI) and “shield right” (protect and detect in production) presented as competing strategies. They aren’t. Image scanning, signing and policy checks in CI stop most problems cheaply; admission control, network policy and runtime detection catch what gets through. A secure cluster needs both.
Where to Start
For a small team with one or two production clusters, this order gives the most risk reduction per hour:
- Remove unnecessary
cluster-adminbindings and enable audit logs. - Label namespaces with Pod Security Standards in warn mode, then enforce.
- Add default-deny network policies to the namespaces that handle customer data.
- Add image scanning to CI with a failing threshold.
- Move secrets to an external store with encryption at rest.
- Add runtime detection and a CIS benchmark scan to your regular cadence.
None of this needs a large team; it needs consistency. Teams that treat Kubernetes security as an ongoing discipline, not a one-time hardening pass, are the ones that scale safely. If you want a second set of eyes on your cluster, our cloud and DevSecOps services start with exactly this audit. And if serverless runs alongside Kubernetes in your stack, our serverless security best practices guide covers the equivalent controls on that side.