How to Prevent Lateral Movement from Kubernetes to the Cloud

· Original article ↗

Summary

Wiz explains how attackers can move from compromised Kubernetes pods or nodes into cloud environments, reports exposure findings across managed clusters, and recommends controls to reduce the risk.

Key points

  • Attackers may query the Instance Metadata Service from compromised pods to obtain worker-node credentials and access cloud resources; the impact depends on the permissions assigned to those identities.
  • Wiz found about 40% of examined cloud environments with managed Kubernetes had at least one pod containing a cleartext, long-term cloud key in its image.
  • Wiz also found about 10% of such environments had a publicly exposed pod with exploitable critical or high-severity vulnerabilities and a highly privileged cloud identity.
  • Pod service-account identities, secrets containing long-term keys, and pod escapes can provide other paths to cloud credentials and privileges.
  • The article says kubelets across the three major cloud providers can read cluster resources, including secrets; AKS kubelet permissions may also allow certain Kubernetes objects to be changed.
  • Recommended controls include limiting metadata access, using workload identities with least privilege, enforcing pod security standards, tightening RBAC, removing long-term cloud keys, patching exposed containers, and restricting pod-to-pod traffic.

Article Details

Defense Focus
Prevent lateral movement from compromised Kubernetes pods or nodes into cloud identities and resources.
Detection Methods
  • Continuously scan publicly exposed container images and remediate critical vulnerabilities.
Data Sources
  • Kubernetes pods, service accounts, Secrets, and RBAC permissions
  • Cloud IAM identities, roles, and permissions assigned to worker nodes and pod service accounts
  • Container image scan findings
Rule Types
  • Kubernetes NetworkPolicy egress rules to block pod access to the IMDS endpoint
  • Pod Security Standards admission policies, with at least the baseline policy for sensitive namespaces
  • Kubernetes RBAC permissions for reading Secrets, creating workloads, and executing into pods
Platforms
  • EKS
  • GKE
  • AKS
  • Kubernetes
Defensive Actions
  • Use IAM Roles for Service Accounts, Workload Identity, or Azure AD workload identity with only the permissions each workload needs.
  • Restrict pod access to node IMDS endpoints; for EKS, the article recommends IMDSv2, a response hop limit of 1, and disabling hostNetwork where applicable.
  • Apply a Kubernetes NetworkPolicy to block metadata access from relevant pods, including access to 169.254.169.254/32.
  • Enforce at least the baseline Pod Security Standards policy in namespaces containing sensitive workloads.
  • Use strict Kubernetes RBAC; avoid granting non-admin subjects permission to read Secrets, create workloads, or exec into pods.
  • Avoid storing long-term cloud keys in Kubernetes Secrets or pods.
  • Continuously scan container images and remediate critical vulnerabilities in publicly exposed containers.
  • Use network policies to restrict pod-to-pod communication and limit the scope of a compromise.

MITRE ATT&CK

Threat Actors

Vendors

Products

Related Articles