A vulnerability in Microsoft Azure Kubernetes Services allowed attackers with pod execution privileges to escalate privileges and access cluster service credentials.
It enabled unauthorized access to sensitive information, potentially leading to data exfiltration, financial loss, and reputational damage, while Microsoft has addressed the underlying issue.
An attacker with pod execution could exploit this to download cluster node configuration, extract TLS bootstrap tokens, and perform a TLS bootstrap attack, gaining access to all cluster secrets without requiring host network or root privileges.
Kubernetes clusters often lack network policies, leaving them vulnerable to lateral movement by compromised pods. Without these policies, an attacker can potentially access any network resource visible to other pods, including sensitive databases, internal services, and even on-premises systems.
Cloud metadata servers, accessible at 169.254.169.254, provide critical machine configuration and credentials, granting equivalent permissions to the underlying instance.
While cloud providers employ network policies, privilege limitations, and alternative credentialing to mitigate risks, metadata server attacks remain a threat. Compromising this service can grant attackers extensive control over the compromised machine and, potentially, the broader cloud environment.
Bootstrapping Kubernetes nodes securely requires establishing trust between the node and the control plane, while early methods using metadata tokens faced vulnerabilities like token theft. To mitigate this, GKE introduced shielded nodes, leveraging vTPM for cryptographic attestation.
Instead of relying on possession of a static token, the node requests a vTPM-backed attestation, which is verified by the control plane before issuing Kubelet certificates, which significantly raises the bar for attackers, requiring physical access to the node to compromise its security.
Azure WireServer, an internal Azure component, manages Linux instance provisioning and interacts with Azure Fabric.
CyberCX research revealed that by exploiting undocumented endpoints on WireServer and HostGAPlugin, an attacker can retrieve and decrypt settings. for extensions like the Custom Script Extension, which provides critical configuration details, potentially compromising system integrity and exposing sensitive information.
Google outlines recovering TLS Bootstrap tokens on an Azure Kubernetes Service (AKS) node. By exploiting a vulnerability in the Host Guest Agent Plugin (HostGAPlugin), an attacker can first generate a key (wireserver.key) to decrypt a protected settings blob.
This blob contains the provisioning script used for the Kubernetes nodes, including several environment variables, including TLS_BOOTSTRAP_TOKEN, which allows the attacker to perform a TLS bootstrap attack, similar to one described in 2018 for the Google Kubernetes Engine (GKE).
An attacker can exploit certificates embedded in a script (cse_cmd.sh) to list cluster nodes and request certificates for them, which provides the necessary information to generate a Certificate Signing Request (CSR), which is then submitted to the Kubernetes API using a TLS bootstrap token.
Azure Kubernetes Services automatically signs the CSR and issues a new certificate, which grants the attacker access to the Kubernetes API, allowing them to list all secrets used by running workloads on the nodes.
Implementing restrictive network policies that limit access to only the required services can prevent this attack by stopping the attacker from reaching the vulnerable script.