Created on 2026-11-25
Kubernetes Hardening Layer by Layer: Managed Cloud vs Bare Metal (Series Overview)
TL;DR: Most Kubernetes security checklists treat an EKS cluster with Auto Mode and a self-hosted rack of Dell servers running kubeadm as the same problem. They are not. On a managed cloud provider, Layers 0 through 3 are mostly rented infrastructure where your job is flipping the right API toggles. On bare metal, you are the cloud provider - if you forget to isolate the BMC VLAN, seal LUKS2 partitions to a TPM, or build a workload identity federation root, Pod Security Admission will not save you. This 18-part series walks up the stack from hardware boot chains (Layer 0) to 50-team enterprise GitOps governance (Layer 12+), always comparing managed Kubernetes (EKS, GKE, AKS) against self-hosted bare metal and prioritizing CNCF-native tooling.
Why Most Kubernetes Security Checklists Fall Short
Standard hardening guides usually hand you a flat list of thirty items: enable RBAC, drop Linux capabilities, set runAsNonRoot: true, add a NetworkPolicy, and run a vulnerability scanner.
That flat list hides two structural realities that platform engineers hit in production:
- Trust is stacked, not flat. A strict
ValidatingAdmissionPolicyat Layer 5 means nothing if a developer's pod can query169.254.169.254at Layer 7 to steal the worker node's IAM role, or if a monitoring agent holdsnodes/proxy GETat Layer 4a and can open an un-audited WebSocket/execsession into every container on the node. - Managed Kubernetes and bare metal diverge sharply below Layer 5. From Layer 5 upward (admission control, container runtime sandboxing, pod network segmentation, mTLS, secrets, and supply chain), the YAML and architecture are nearly identical everywhere. Below Layer 5 (physical boot trust, perimeter routing, node OS, etcd/KMS, and workload identity roots), bare-metal engineers have to build from scratch what AWS Nitro, GKE Shielded Nodes, and cloud IAM provide behind an API call.
The 13-Layer Hardening Model
To make the dependencies explicit, this series organizes Kubernetes security into 10 stacked layers (L0 through L9, with L4 split into L4a for human identity and L4b for workload identity) across three planes (Foundation, Cluster, and Workload), plus 3 cross-cutting layers (L10 through L12) that enforce and audit every layer below them - 13 layers in total.

Each lower layer is the cryptographic and operational substrate for the layers above it:
- Foundation Plane (L0 - L2): Establishes that the machine booted an unmodified kernel, its disk cannot be read if pulled from a rack, its management interfaces (BMC/IPMI, etcd, kubelet) are unreachable from workload networks, and its OS cannot be mutated via SSH.
- Cluster Plane (L3 - L5): Protects cluster state in
etcdwith envelope encryption (KMS v2), authenticates humans (L4a) and workloads (L4b) with short-lived bound tokens, scopes RBAC down to fine-grained subresources, and rejects non-compliant manifests in-process before they ever touchetcd. - Workload Plane (L6 - L9): Constrains what a running process can do if compromised - mapping container UID 0 to an unprivileged host UID via User Namespaces (or isolating the kernel in a Kata MicroVM), locking down east-west and DNS egress paths in eBPF, authenticating service-to-service calls with mTLS, and replacing static
Secretobjects with short-lived dynamic leases. - Cross-Cutting Planes (L10 - L12): Verifies artifact provenance before admission (L10), detects or kills anomalous kernel syscalls at runtime (L11), and continuously reconciles cluster state from Git while auditing against CIS and NSA/CISA benchmarks (L12).
Shared Responsibility: Managed vs Auto Tiers vs Bare Metal
Cloud providers have pushed the shared responsibility boundary further up the stack with hands-off tiers (Amazon EKS Auto Mode, Google Cloud GKE Autopilot, and Microsoft Azure AKS Automatic). Here is who actually owns each layer across all three operational models:
| Layer | Standard Managed (EKS / GKE / AKS) | Managed Auto Tiers (EKS Auto / GKE Autopilot / AKS Automatic) | Self-Hosted Bare Metal (Talos / Flatcar / kubeadm / RKE2) |
|---|---|---|---|
| L0: Physical, Firmware & Boot | Provider (Nitro, Shielded VMs, Trusted Launch) | Provider | You: UEFI Secure Boot, TPM 2.0 LUKS2, Keylime attestation, isolated BMC VLAN |
| L1: Infra Network & Perimeter | Shared (private endpoint toggles, security groups, VPC) | Shared (private endpoints, VPC) | You: VLAN/VRF separation, VIP (Talos VIP / kube-vip), ToR ACLs, authenticated BGP, zero-trust API proxy |
| L2: Node & OS | Shared (you pick AMI/OS and rotate nodes) | Provider (ephemeral nodes, no SSH; EKS Auto Mode enforces <=21-day max node lifetime; GKE Autopilot and AKS Automatic manage OS patching) | You: Talos Linux / Flatcar, kubelet flags, kernel sysctls, Cilium Host Firewall |
| L3: Control Plane & etcd | Provider runs processes; you enable KMS key and audit logs | Provider (hardened defaults and default audit logs; CMEK application-layer encryption remains opt-in) | You: Dedicated etcd mTLS + separate CA, KMS v2 (OpenBao Transit / HSM), Structured AuthN |
| L4a: Human AuthN & RBAC | You: OIDC / Access Entries / Entra ID + RBAC hygiene | You | You: Keycloak / Dex + Structured AuthN + RBAC hygiene |
| L4b: Workload Identity | Shared: Provider runs OIDC/agent; you bind SAs to IAM roles | Shared | You: Publish API server JWKS + deploy SPIFFE/SPIRE (k8s_psat / tpm_devid) + OpenBao |
| L5: Admission & Policy | You (PSA + VAP/MAP + Kyverno) | Shared (Autopilot pre-blocks privileged / hostPath; you own app rules) |
You (PSA + VAP/MAP + Kyverno) |
| L6: Runtime Isolation | You (User Namespaces, seccomp, GKE Sandbox / AKS Kata) | Shared (baseline enforced; you pick sandboxed RuntimeClass) |
You (User Namespaces, seccomp, Kata Containers over native KVM) |
| L7: Pod Network Segmentation | Shared (enable CNI policy engine; author policies) | Shared (dataplane pre-wired; you author policies) | You: Deploy Cilium/Calico, CCNP admin guardrails, default-deny, FQDN egress, WireGuard |
| L8: Service-to-Service Zero Trust | You (Istio Ambient / Linkerd / Cilium ztunnel [Beta] / VPC Lattice) | You | You (Istio Ambient / Linkerd / Cilium ztunnel [Beta]) |
| L9: Data & Secrets | You (ESO / CSI driver + Cloud Secret Manager / dynamic IAM) | You | You (ESO + OpenBao HA + dynamic database engines + SOPS) |
| L10: Supply Chain | You (Cosign, SLSA, SBOM, ECR/GAR/ACR, Kyverno) | You | You (Cosign, SLSA, SBOM, Harbor pull-through cache, Kyverno) |
| L11: Detection & Response | Shared (GuardDuty / Defender / SCC + Falco / Tetragon) | Shared | You (Audit sink + Hubble + Falco + Tetragon in-kernel enforcement) |
| L12: Posture & Governance | You (Kubescape, CIS benchmarks, Argo CD / Flux) | You | You (Kubescape, kube-bench, Argo CD / Flux, cert/etcd restore drills) |
Anatomy of a Cluster Compromise (and Where Each Layer Stops It)
Nearly every real-world Kubernetes breach follows one of four paths. Mapping those paths against the 13 layers shows why single-layer defenses fail and where you get the highest defensive return on investment:

Path 1: Pod RCE to Credential Theft (SA Token or IMDS)
An attacker exploits an application vulnerability (or SSRF) inside a pod. Their first move is reading /var/run/secrets/kubernetes.io/serviceaccount/token and curling http://169.254.169.254/latest/meta-data/iam/security-credentials/.
- How it succeeds: The pod uses a default ServiceAccount with
automountServiceAccountToken: true, its role is bound tocluster-adminorsecrets: ["*"], or the worker node's EC2 instance profile is reachable with IMDSv1 / hop-limit 2. - Which layers break the chain:
- L5 (Admission): A
ValidatingAdmissionPolicyrejects pods using thedefaultServiceAccount or leavingautomountServiceAccountTokenenabled without an explicit opt-in, backed by settingautomountServiceAccountToken: falseon namespacedefaultServiceAccounts. - L4b (Workload Identity): Pods that do need cloud access receive short-lived, audience-bound tokens via EKS Pod Identity, GKE Workload Identity Federation, AKS Entra Workload ID, or SPIRE SVIDs on bare metal.
- L7 (Network Segmentation): A cluster-wide
CiliumClusterwideNetworkPolicy(egressDeny) drops all pod traffic to169.254.169.254/32and10250/TCP(the kubelet API), backed by EC2 IMDSv2 hop-limit 1.
- L5 (Admission): A
Path 2: Pod RCE to Container Escape
The attacker runs as UID 0 inside the container and triggers a kernel vulnerability (such as a netfilter, io_uring, or filesystem flaw) or exploits an over-privileged mount (hostPath, CAP_SYS_ADMIN).
- How it succeeds: Container UID 0 is also host UID 0, the pod has no seccomp filter, and nothing monitors kernel-level privilege changes.
- Which layers break the chain:
- L5 (Admission): Pod Security Admission (
enforce: restricted) blocksprivileged: true,hostNetwork,hostPID,hostPath, and requirescapabilities.drop: ["ALL"]plusseccompProfile: RuntimeDefault. - L6 (Runtime Isolation): User Namespaces (
hostUsers: false, GA in Kubernetes 1.36) map container root to an unprivileged host UID (65536+), removingCAP_SYS_ADMINin the initial user namespace. For untrusted or AI-generated code, aRuntimeClassruns the pod inside a Kata Containers MicroVM or gVisor sandbox. - L11 (Detection & Response): Tetragon eBPF
TracingPolicydetects an unexpected namespace switch orsetuid(0)in-kernel and sendsSIGKILLbefore the syscall returns.
- L5 (Admission): Pod Security Admission (
Path 3: East-West Lateral Movement Across a Flat CNI
Once inside a frontend pod, the attacker scans the 10.244.0.0/16 pod CIDR, connects directly to an internal Redis or Postgres service, or calls an internal gRPC admin endpoint that trusts any caller inside the cluster network.
- How it succeeds: By default, Kubernetes allows every pod in every namespace to talk to every other pod (
allow-all), and internal services rely on network adjacency instead of cryptographic identity. - Which layers break the chain:
- L7 (Network Segmentation): Default-deny ingress and egress per namespace (auto-generated via Kyverno), Cilium identity-based policies, and L7 DNS Proxy (
toFQDNs) egress allowlists. - L8 (Service-to-Service Zero Trust): Strict mTLS via Istio Ambient Mode (
ztunnel+ Waypoint proxies) or Linkerd, paired with L7AuthorizationPolicyrules that verify the caller's SPIFFE identity (spiffe://cluster.local/ns/frontend/sa/checkout-api) on specific HTTP methods and paths.
- L7 (Network Segmentation): Default-deny ingress and egress per namespace (auto-generated via Kyverno), Cilium identity-based policies, and L7 DNS Proxy (
Path 4: Direct Infrastructure / Control-Plane Compromise (Bare Metal & Misconfigured Cloud)
An attacker skips the application entirely and targets an exposed kube-apiserver, an unauthenticated etcd client port (2379) or peer port (2380), an un-firewalled kubelet (10250), or an out-of-band BMC/iDRAC interface sitting on a routable corporate VLAN.
- Which layers break the chain:
- L0 (Boot & BMC): Out-of-band BMC interfaces live on an air-gapped management VLAN; disks are LUKS2-encrypted and sealed to TPM 2.0 PCR measurements verified by Keylime.
- L1 & L2 (Perimeter & Node): Private API endpoints fronted by an identity-aware proxy (Teleport / Pomerium), immutable OS (Talos Linux or Flatcar with no SSH daemon), and Cilium's eBPF Host Firewall locking down ports
2379,2380, and10250. - L3 & L4a (Control Plane & Kubelet AuthZ): KEP-4633 (GA in 1.34) restricts anonymous API requests exclusively to
/healthz,/livez, and/readyz; KEP-2862 (GA in 1.36) replaces broadnodes/proxypermissions with fine-grained kubelet subresources (nodes/metrics,nodes/stats,nodes/log).
The CNCF-First Hardening Toolchain
Throughout this series, we favor open-source projects under the Cloud Native Computing Foundation (CNCF) or the Linux Foundation / OpenSSF so your security architecture remains portable across EKS, GKE, AKS, and bare metal:
| Security Domain | Primary CNCF / Open-Source Tool | Maturity Status (Nov 2026) | Managed Cloud Counterpart |
|---|---|---|---|
| CNI, Network Policy & Host Firewall | Cilium (+ Hubble) | CNCF Graduated | GKE Dataplane V2, AKS Azure CNI Powered by Cilium (+ ACNS), EKS VPC CNI / Cilium chaining |
| Admission & Policy-as-Code | Upstream VAP / MAP (CEL) + Kyverno (or OPA Gatekeeper) | K8s GA (1.30 / 1.36) + CNCF Graduated (Kyverno, Gatekeeper) | GKE Autopilot constraints, AKS Azure Policy |
| Workload Identity & Attestation | SPIFFE / SPIRE + cert-manager | CNCF Graduated | EKS Pod Identity, GKE Workload Identity Federation, AKS Entra Workload ID |
| Human Identity & OIDC | Keycloak / Dex | CNCF Incubating / CNCF Sandbox | AWS IAM Identity Center, Google Cloud Identity, Microsoft Entra ID |
| Service Mesh & mTLS | Istio (Ambient Mode) / Linkerd / Cilium ztunnel | CNCF Graduated (Istio, Linkerd); Beta (Cilium ztunnel) | GKE Cloud Service Mesh, AKS Istio add-on, AWS VPC Lattice |
| Runtime Detection & Enforcement | Falco (+ Falco Talon) & Tetragon (Cilium) | CNCF Graduated | AWS GuardDuty EKS Runtime, Defender for Containers, GKE Security Command Center |
| Secrets & Encryption Broker | External Secrets Operator (ESO), SOPS, OpenBao | CNCF Sandbox (ESO, SOPS); OpenSSF Sandbox (OpenBao) | AWS Secrets Manager / KMS, GCP Secret Manager / KMS, Azure Key Vault |
| Supply Chain & Registry | Harbor, in-toto / TUF, Notary Project, Sigstore Cosign, Copacetic | CNCF Graduated (Harbor, in-toto, TUF); Incubating (Notary); Sandbox (Copacetic); OpenSSF (Sigstore) | ECR / GAR / ACR + GKE Binary Authorization |
| Node OS & Bare-Metal Provisioning | Flatcar Container Linux, Metal3, Keylime, Talos Linux | CNCF Incubating (Flatcar, Metal3); CNCF Sandbox (Keylime); OSS (Talos) | AWS Bottlerocket / AL2023, Google COS, Azure Linux |
| Sandboxing & Confidential Compute | Confidential Containers (CoCo), Kata Containers, gVisor | CNCF Incubating (CoCo); OpenInfra (Kata); OSS (gVisor) | GKE Sandbox (gVisor), AKS Pod Sandboxing (Kata), AWS Fargate |
| Posture & GitOps Governance | Kubescape, Argo CD, Flux | CNCF Incubating (Kubescape); CNCF Graduated (Argo CD, Flux) | Cloud Security Posture Management (CSPM) |
Where OpenBao / Vault Fits Across Five Layers
On bare metal and hybrid clusters, OpenBao (or HashiCorp Vault) acts as a portable cryptographic broker across five specific layers rather than every layer in the stack:
- Layer 3 (
etcdKMS v2): Out-of-cluster OpenBaotransitengine provides the external Key Encryption Key (KEK) root forkube-apiserverenvelope encryption. - Layer 4b (Workload Identity Consumer): Accepts short-lived projected ServiceAccount JWTs or SPIFFE JWT-SVIDs (
aud: openbao) so pods never hold static Vault tokens. - Layer 8 (Service Mesh PKI): Serves as an offline-backed Intermediate CA for
cert-managerto issue short-lived leaf certificates for Istio Ambientztunnelor Linkerd. - Layer 9 (Secrets & Dynamic Leases): Pairs with External Secrets Operator (ESO) for third-party API keys and issues short-lived, auto-expiring PostgreSQL, MySQL, and Redis credentials via database secrets engines.
- Layer 10 (Supply Chain Signing): Stores KMS-backed asymmetric signing keys (
hashivault://cosign-key) for Cosign image signing and SOPS GitOps encryption in air-gapped environments.
Complete Series Index
Every article in this series follows the same structure: threat model, architectural deep dive with diagrams, a side-by-side Managed (EKS / GKE / AKS) vs Bare Metal breakdown, production-ready manifests, and failure modes to watch for during rollout.
Foundation Plane (Layers 0 - 2)
- Kubernetes Hardening L0: Physical, Firmware, and Boot Trust on Bare Metal vs Cloud - UEFI Secure Boot, TPM 2.0 PCR sealing, LUKS2 disk encryption on Talos Linux, Keylime remote attestation, and BMC/IPMI network isolation.
- Kubernetes Hardening L1: Infrastructure Network, API Perimeter, and Zero-Trust Access - Private API endpoints on EKS/GKE/AKS, bare-metal VLAN/VRF separation, authenticated BGP, and replacing VPNs with Teleport/Pomerium identity-aware proxies.
- Kubernetes Hardening L2: Immutable Node OS, Kubelet Boundaries, and Host Firewalls - Talos Linux and Flatcar vs Bottlerocket/COS, locking down the kubelet API, kernel sysctl hardening, and Cilium's eBPF Host Firewall.
Cluster Plane (Layers 3 - 5)
- Kubernetes Hardening L3: Control Plane, etcd mTLS, KMS v2 Encryption, and Structured Auth (coming soon) - Structured Authentication Configuration, KEP-4633 health-only anonymous endpoints, KMS v2 envelope encryption with OpenBao/Cloud KMS, dedicated etcd mTLS, and audit policies.
- Kubernetes Hardening L4a: Human Identity, RBAC Pitfalls, and the nodes/proxy GET Escalation (coming soon) - OIDC SSO, EKS Access Entries, dangerous RBAC verbs, and fixing the
nodes/proxy GETcontainer RCE vector with KEP-2862 Fine-Grained Kubelet Authorization. - Kubernetes Hardening L4b: Pod and Workload Identity on Cloud vs Bare Metal with SPIFFE/SPIRE (coming soon) - Bound projected tokens, EKS Pod Identity vs IRSA, GKE WIF, AKS Entra Workload ID, API server OIDC federation, and SPIFFE/SPIRE + OpenBao on bare metal.
- Kubernetes Hardening L5: Admission Control in 2026 with CEL Policies and Kyverno (coming soon) - Pod Security Admission (
restricted), in-processValidatingAdmissionPolicyandMutatingAdmissionPolicy(CEL), Kyverno 1.16 CEL policy types, and webhook hardening after IngressNightmare.
Workload Plane (Layers 6 - 9)
- Kubernetes Hardening L6: Container Runtime Isolation, User Namespaces, and MicroVM Sandboxes (coming soon) - Hardened
securityContext, User Namespaces (hostUsers: falseGA in 1.36) with idmap mounts, seccomp, gVisor, Kata Containers, and Confidential Containers. - Kubernetes Hardening L7: Zero-Trust Network Segmentation, Admin Tiers, and FQDN Egress (coming soon) - Cilium
CiliumClusterwideNetworkPolicyadmin guardrails, upstreamClusterNetworkPolicy, label-identity boundaries, L7 DNS Proxy (toFQDNs), and WireGuard strict mode. - Kubernetes Hardening L8: Service-to-Service Zero Trust and mTLS Without Sidecar Sprawl (coming soon) - Istio Ambient Mode (
ztunnel+ Waypoints), Linkerd micro-proxies, Ciliumztunnel(Beta) encryption vs deprecated SPIRE mutual auth, and L7AuthorizationPolicy. - Kubernetes Hardening L9: Secrets Management with External Secrets, OpenBao, and Dynamic Credentials (coming soon) - External Secrets Operator vs Secrets Store CSI Driver, OpenBao on bare metal, SOPS for GitOps, and short-lived dynamic database credentials.
Cross-Cutting Planes (Layers 10 - 12) & Platform Deep Dives
- Kubernetes Hardening L10: Software Supply Chain Security with Cosign, SLSA, Harbor, and Kyverno (coming soon) - Distroless/Chainguard base images, Copacetic patching, Syft SBOMs, SLSA provenance, keyless Cosign signing, Harbor proxy-caching, and admission verification.
- Kubernetes Hardening L11: Runtime Threat Detection and eBPF Enforcement with Falco and Tetragon (coming soon) - Audit and Hubble telemetry pipelines, Falco + Falco Talon response playbooks, and Tetragon in-kernel synchronous
Sigkill/Overrideenforcement. - Kubernetes Hardening L12: Continuous Posture, CIS Benchmarks, GitOps Drift Control, and Rollout Roadmap (coming soon) - Kubescape,
kube-bench, Argo CD / Flux pull-only reconciliation, upgrade and CA rotation drills, and a 5-phase implementation roadmap. - Kubernetes Hardening Bonus: Cilium as an End-to-End eBPF Security Platform (coming soon) - How a single eBPF datapath spans L2 Host Firewalls, L7 segmentation, L8 encryption, Gateway API, and L11 runtime enforcement - plus how to harden Cilium itself.
- Kubernetes Hardening Bonus: The Multi-Tenancy Spectrum - Namespaces, Capsule, vCluster, Kamaji, and Kata (coming soon) - Architecting five tiers of tenant isolation across shared and dedicated control planes, kernels, and bare-metal hardware.
- Kubernetes Hardening Bonus: Operating EKS and GKE at Scale - Change Management for 1,000 Engineers and 50 Teams (coming soon) - Cellular cluster fleets, API Priority and Fairness, 3-tier federated GitOps (
AppProjectisolation + Rendered Manifests), Golden Path abstractions (Kro, Crossplane, Backstage), governedPolicyExceptions, and progressive delivery gated on Prometheus and Cilium Hubble telemetry.
Day-1 Verification & Operational Runbook
Before tightening any preventive control across your fleet, capture a quick baseline of the cluster's API capabilities, node OS/runtime versions, and existing administrative bindings:
# 1. Confirm Kubernetes version and whether CEL admission APIs are enabled
kubectl version --short 2>/dev/null || kubectl version
kubectl api-resources --api-group=admissionregistration.k8s.io
# 2. Audit node OS images, kernel versions, and container runtimes
kubectl get nodes -o custom-columns=NAME:.metadata.name,OS:.status.nodeInfo.osImage,KERNEL:.status.nodeInfo.kernelVersion,RUNTIME:.status.nodeInfo.containerRuntimeVersion
# 3. List every subject currently bound to cluster-admin
kubectl get clusterrolebindings -o json | jq -r '
.items[] | select(.roleRef.name == "cluster-admin") |
(.subjects // [])[] | "\(.kind):\(.namespace // "-")/\(.name)"'
- Start with visibility before enforcement: Enable API audit logging (
L3), Cilium Hubble flow telemetry (L7), Falco (L11), and Kubescape posture baselines (L12) in observe mode first so production traffic shows what will break before you flip policies toDeny. - Cover every attack path independently: Budget at least one preventive control per compromise chain (Admission
L5, Workload IdentityL4b, Runtime IsolationL6, Network SegmentationL7) rather than over-investing in a single scanner while leaving lateral movement wide open. - Remove standing human write access: Route production cluster state through pull-only GitOps (
L12) and gate emergency mutations behind time-bounded break-glass sessions (L1,L4a).