Attacking Kubernetes in the Cloud: Container Escape to Cluster Admin

Pwned Labs
  • July 17, 2026

Why Kubernetes Is the Next Frontier for Cloud Red Teams

Kubernetes has become a primary pivot point in cloud breaches: an attacker with code execution in a single pod can escalate to cluster-admin privileges and cloud account access within minutes due to pod identity integrations with EKS IAM roles, AKS Workload Identity, and GKE Workload Identity. Pwned Labs covers Kubernetes attack paths like container escape and cluster takeover, and their defenses, in hands-on labs.

Every major cloud provider now offers a managed Kubernetes service: EKS on AWS, AKS on Azure, and GKE on Google Cloud. Organizations are migrating production workloads into these clusters at pace, and the attack surface is expanding faster than most security teams can map it. Yet most cloud pentesting engagements still treat Kubernetes as an afterthought, focusing on IAM misconfigurations and storage exposure while ignoring the container orchestration layer entirely.

Key Takeaway: A single misconfigured Kubernetes service account with overprivileged IAM role annotations can escalate from pod compromise to full cloud account access across EKS, AKS, and GKE within minutes, making pod identity and RBAC the primary attack surface in managed Kubernetes environments.

This is a mistake. In real-world intrusions, Kubernetes has become a primary pivot point. An attacker who gains code execution inside a single pod can often escalate to cluster-admin privileges, exfiltrate secrets from every namespace, and pivot into the underlying cloud account, all within minutes.

The Attack Chain: From Pod to Cloud Account

Kubernetes attacks follow a predictable three-phase escalation: initial pod compromise, container escape to node-level access, then federation into cloud IAM through pod identity mechanisms, with each phase exploiting the intersection of Kubernetes RBAC and cloud service account bindings. Pwned Labs walks this chain in its Escalate from SSJI to EKS lab, from an application foothold to the EKS cluster and the AWS account behind it.

The typical Kubernetes exploitation chain in a cloud environment follows a predictable pattern that defenders need to understand intimately. It starts with initial access, usually through a vulnerable application running inside a pod, an exposed Kubernetes dashboard, or a misconfigured kubelet API. From there, the attacker moves through distinct phases that exploit the intersection of Kubernetes RBAC and cloud IAM.

Container escape is where things get interesting from a red team perspective. Privileged containers, hostPath mounts, and capabilities like SYS_PTRACE or SYS_ADMIN create escape vectors that are surprisingly common in production clusters. Once on the node, the attacker has access to the kubelet credentials, the instance metadata service, and potentially every secret mounted by pods on that node.

EKS-Specific Attack Paths

IRSA (IAM Roles for Service Accounts) misconfigurations are the highest-impact finding in EKS assessments: overprivileged service account annotations allow pods to assume IAM roles far beyond workload requirements, directly chaining Kubernetes compromise into S3, Secrets Manager, and EC2 API access.

Amazon EKS introduces unique attack vectors through its integration with AWS IAM. The aws-auth ConfigMap maps IAM roles to Kubernetes RBAC groups, and misconfigurations here are rampant. IRSA (IAM Roles for Service Accounts) was designed to limit blast radius, but in practice, overprivileged service account annotations allow pods to assume IAM roles far beyond what their workload requires.

The EKS Pod Identity Agent, introduced more recently, doesn't eliminate these risks. It shifts them. Attackers who can modify pod specifications or service account annotations can chain Kubernetes access into full AWS account compromise. A single over-permissioned service account annotation can chain Kubernetes access into S3 and the wider AWS account, which is the pattern the Pwned Labs Escalate from Prototype Pollution to EKS Takeover lab runs end to end.

AKS and the Entra ID Integration

Workload Identity Federation in AKS mirrors IRSA design but inherits Azure's cross-tenant trust model: attackers who modify service account annotations can federate into Azure resources protected by Conditional Access policies, a path the Pwned Labs Kubernetes Attack and Defense bootcamp covers hands-on.

Azure Kubernetes Service's integration with Entra ID creates attack paths that blend traditional Active Directory tradecraft with Kubernetes exploitation. AKS clusters using Azure AD authentication for RBAC are susceptible to token replay attacks if cluster role bindings are overly permissive. The managed identity assigned to the AKS cluster itself often has permissions to the broader Azure subscription that go unaudited.

Workload Identity Federation in AKS mirrors IRSA's design but inherits Azure's trust model. An attacker who can create or modify a Kubernetes ServiceAccount with the correct annotations can federate into any Azure resource the workload identity trusts. This cross-boundary movement from Kubernetes to the Azure control plane is a focus of the Pwned Labs Kubernetes Attack and Defense bootcamp, which covers workload identity federation across EKS, GKE and AKS.

GKE and Workload Identity

GKE Workload Identity's security depends entirely on Kubernetes RBAC isolation: if an attacker creates pods in a namespace with a privileged Workload Identity binding, they inherit GCP service account permissions without touching node-level credentials, making namespace isolation the critical control point.

Google Kubernetes Engine's Workload Identity binds Kubernetes service accounts to Google Cloud service accounts. The security improvement over node-level service accounts is significant, but the implementation creates its own risks. Namespace-level trust boundaries depend entirely on correct Kubernetes RBAC. If an attacker can create pods in a namespace with a privileged Workload Identity binding, they inherit those GCP permissions.

GKE Autopilot clusters restrict some escape vectors by enforcing security constraints, but they also limit the security team's ability to deploy detection tooling. This tradeoff between operational security and visibility is something practitioners need to evaluate case by case. Pwned Labs teaches GKE Workload Identity abuse alongside EKS and AKS in the Kubernetes Attack and Defense bootcamp.

Ingress-NGINX Configuration Injection: CVE-2026-3288

The pod-to-cloud chain above assumes an attacker already has a foothold in a pod. CVE-2026-3288, disclosed in 2026, is one way to reach that foothold from a low-privilege position. The ingress-nginx controller did not sanitize the nginx.ingress.kubernetes.io/rewrite-target annotation, so an attacker who can create or modify an Ingress resource could break out of the intended configuration context, inject arbitrary nginx directives, and reach code execution through nginx features such as Lua scripting. It carries a CVSS score of 8.8, and a companion issue, CVE-2026-24512, affects the same ingress-nginx configuration handling.

What makes this dangerous in practice is the controller's identity. The ingress-nginx controller pod usually runs with a service account that can read Secrets across the whole cluster, so code execution in that pod can expose every secret the cluster holds. That is the same pattern we work through in this attack chain: a workload identity with more access than the task needs turns a single component compromise into cluster-wide impact. The fix landed in ingress-nginx 1.13.8, 1.14.4, and 1.15.0, and until you can upgrade you can use admission control to block the rewrite-target annotation. You can practice this class of ingress and RBAC abuse in the Pwned Labs Kubernetes Attack and Defense Bootcamp (KRTP).

Detection Engineering for Kubernetes Attacks

Container escape and cloud credential theft appear across two separate audit streams: Kubernetes audit logs capture exec calls and API anomalies, while CloudTrail records the resulting cloud API calls, requiring correlation rules that link both sources to detect the full attack chain.

Detecting Kubernetes attacks in cloud environments requires correlation across two distinct telemetry sources: Kubernetes audit logs and cloud provider audit trails. A container escape won't appear in CloudTrail. It shows up in the Kubernetes audit log as an API call to exec into a pod. The subsequent IAM credential theft appears in CloudTrail but lacks the Kubernetes context explaining how the attacker got there.

Effective detection requires mapping the full attack chain: suspicious exec calls, anomalous API server requests, unexpected service account token usage, and the resulting cloud API calls. Building these detection rules is a core skill in the Pwned Labs Kubernetes Attack and Defense bootcamp, where participants trace complete attack chains from pod compromise to cloud account takeover.

Building the Skills That Matter

Kubernetes security requires fluency across container orchestration, cloud IAM, and penetration testing, three distinct skill domains that practitioners must integrate to identify critical attack paths. Organizations that invest in building these hybrid skills find the attack vectors that adversaries exploit in production environments.

Kubernetes security in cloud environments sits at the intersection of container orchestration knowledge, cloud IAM expertise, and traditional penetration testing skills. Practitioners who can bridge all three domains are exceptionally rare, and exceptionally valuable. The organizations that invest in building these hybrid skills are the ones that find the critical attack paths before adversaries do.

If you want to build exactly that combination, the Pwned Labs Kubernetes Attack and Defense Bootcamp, Professional Edition (KRTP) teaches these attack paths hands-on in live clusters. It starts on neutral ground in minikube, since most Kubernetes tradecraft is identical across providers, then moves through EKS, GKE and AKS to node identity and the route from a service account token into the cloud account behind the cluster.

For free practice alongside it, Pwned Labs keeps an open list of Kubernetes pentesting labs, tools and training on GitHub, from vulnerable-by-design clusters you run locally to hosted Kubernetes CTF challenges.

Practice this at Pwned Labs

Pwned Labs runs this pod-to-cloud chain as hands-on labs in live Kubernetes clusters.

  • Escalate from SSJI to EKS (Premium, Beginner): chain server-side JavaScript injection through IAM and IDOR weaknesses to reach the Amazon EKS cluster behind the application.
  • Escalate from Prototype Pollution to EKS Takeover (Premium, Intermediate): exploit prototype pollution in a Node.js app for code execution, break out of the container, and abuse RBAC to take over an EKS cluster.
  • Exploit Kubernetes Overly Permissive RBAC (Premium, Intermediate): from compromised credentials on an EC2 instance, abuse overly permissive Kubernetes RBAC to move laterally and gain root on the cluster.
  • Secure Kubernetes using OPA Gatekeeper (Premium, Intermediate): write and apply OPA Gatekeeper policies in Rego to enforce standards and block the misconfigurations attackers abuse.

Frequently asked questions

How do attackers escape a container to compromise a Kubernetes cluster?

Most escapes abuse a pod's configuration rather than a software bug: a privileged container, a hostPath mount of the node filesystem or the container runtime socket, host namespaces, or a dangerous Linux capability. Runtime flaws such as runc CVE-2024-21626 are the fallback. Once on the node, the kubelet credentials and the node's cloud identity turn one pod into the whole cluster and the cloud account behind it.

How does a Kubernetes pod compromise reach the cloud account?

Through pod identity. On EKS a pod can assume an IAM role with IRSA or EKS Pod Identity, and on GKE and AKS it can federate to a cloud identity through Workload Identity. An over-permissioned binding lets a compromised pod inherit cloud permissions far beyond the workload, which is how a container compromise becomes an account compromise. Pwned Labs runs this chain hands-on in its Escalate from SSJI to EKS lab.

What is IRSA and why is it a risk in EKS?

IAM Roles for Service Accounts (IRSA) binds a Kubernetes service account to an AWS IAM role so a pod can call AWS APIs. It is a risk when the annotated role is broader than the workload needs, because an attacker who can modify pod specs or service account annotations can assume that role and reach the account.

How do you detect Kubernetes-to-cloud attacks?

By correlating two telemetry sources: Kubernetes audit logs, which record exec calls and API server anomalies, and the cloud provider audit trail such as CloudTrail, which records the API calls the stolen identity then makes. Neither stream shows the full chain alone.

How do I practice Kubernetes attack and defense safely?

Use environments built for it and only test clusters you own or are authorized to assess. Pwned Labs provides live, intentionally vulnerable clusters as hands-on labs and the Kubernetes Attack and Defense bootcamp that leads to the KRTP certification.

Bottom Line

Kubernetes has emerged as the primary pivot point in cloud attacks, with pod identity mechanisms (IRSA, Workload Identity, Workload Identity Federation) enabling direct federation from container compromise to cloud account access. The attack chain of pod compromise, container escape, and cloud credential theft is repeatable across EKS, AKS, and GKE, making Kubernetes RBAC and cloud IAM integration the highest-value attack surface in managed Kubernetes environments. Detection requires correlating signals across Kubernetes audit logs and cloud provider audit trails to identify lateral movement before cloud APIs are abused. Pwned Labs teaches this full pod-to-cloud chain, attack and detection, in the Kubernetes Attack and Defense bootcamp.

About Pwned Labs

Pwned Labs is a hands-on cloud and AI offensive security training platform. It runs real-world attack labs and bootcamps for AWS, Azure, GCP, Kubernetes and AI systems, including the ACRTP, MCRTP, GCRTP, KRTP and AISRTP certifications. Free labs are at pwnedlabs.io/explore.

Related Articles

Climbing the Azure RBAC Ladder

December 10, 2024
Attackers escalate privileges and move laterally in Azure by abusing RBAC role assignments and identities:...

Azure Penetration Testing Training

July 17, 2026
Azure penetration testing targets identity first: Entra ID (formerly Azure AD) governs authentication and trust across...

Diving Deep into Azure VM Attack Vectors

March 4, 2024
Azure virtual machines are often attacked through their management features rather than software bugs: Custom Script...