iCapSolutions

Cloud Computing – DevSecOps – IT Services

Kubernetes Security Best Practices for 2026

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

PracticeWhat it stopsTypical tooling
Least-privilege RBACOne leaked token taking over the clusterNative RBAC, kubectl auth can-i
Pod Security StandardsPrivileged containers escaping to the nodePod Security Admission
Default-deny network policiesLateral movement after one pod is compromisedCalico, Cilium, cloud CNI policy support
Secrets encryption and external secretsCredentials readable from etcd or GitKMS envelope encryption, External Secrets Operator
Image scanning and signingKnown CVEs and tampered images reaching productionTrivy, cosign, Kyverno or OPA Gatekeeper
Locked-down API server and audit logsAnonymous or untracked access to the control planePrivate endpoints, managed audit logging
Runtime threat detectionAttacks that a clean YAML file can’t preventFalco, 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 over ClusterRoles, and never grant wildcard verbs or resources to workloads.
  • Give each workload its own service account, and set automountServiceAccountToken: false for 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=restricted

Workloads in a restricted namespace need a security context like this:

securityContext:
  runAsNonRoot: true
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop: ["ALL"]
  seccompProfile:
    type: RuntimeDefault

Roll 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 get and list on 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:

  1. Remove unnecessary cluster-admin bindings and enable audit logs.
  2. Label namespaces with Pod Security Standards in warn mode, then enforce.
  3. Add default-deny network policies to the namespaces that handle customer data.
  4. Add image scanning to CI with a failing threshold.
  5. Move secrets to an external store with encryption at rest.
  6. 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.

Related Reading