Kubernetes Controllers - The Perfect Backdoor for Attackers

Basically, attackers can use Kubernetes controllers to create hidden backdoors in cloud systems.
Kubernetes controllers are being exploited as backdoors, allowing attackers persistent access to cloud environments. This poses a significant risk to cloud security. Understanding this threat is crucial for effective defense.
What Happened
In the evolving landscape of cloud security, Kubernetes controllers have emerged as a significant vulnerability. Attackers are no longer limited to basic exploits; they are now leveraging the Kubernetes Controller Pattern to create persistent backdoors. By compromising or registering rogue controllers, adversaries can manipulate the cluster's automation, leading to self-healing backdoors that are challenging to detect. This shift in tactics highlights a critical blind spot in cloud-native security strategies.
Who's Behind It
Sophisticated threat actors, such as those behind the Siloscape malware campaign and TeamTNT group, have demonstrated the effectiveness of this approach. Siloscape targeted Windows containers and escaped to the underlying node, utilizing node credentials to spread through the API server. Similarly, TeamTNT exploited the kubelet API for persistence. These documented campaigns illustrate how attackers can weaponize the control plane, turning Kubernetes against its legitimate users.
Tactics & Techniques
Attackers can gain limited access to the cluster's API server through compromised CI/CD pipeline credentials or leaked kubeconfig files. With just enough permissions, they can register a MutatingAdmissionWebhook, which intercepts legitimate pod creation requests. This webhook modifies the pod specifications to inject a malicious sidecar container, effectively creating a backdoor. The hidden sidecar is often disguised and can survive pod deletions due to the self-healing nature of Kubernetes. This technique aligns with the Persistence (TA0003) tactic in the MITRE ATT&CK framework for containers, emphasizing its resilience compared to traditional methods.
Defensive Measures
To combat this emerging threat, organizations must enhance their security practices. Key actions include auditing MutatingWebhookConfigurations to identify any unauthorized webhooks, monitoring RoleBinding changes for elevated permissions, and checking for anomalous OwnerReferences in Kubernetes objects. Additionally, restricting webhook registration to only trusted administrators and implementing network policies for the control plane can significantly reduce the risk of such attacks. Signing container images with trusted keys can further ensure that only legitimate components are deployed within the cluster. By treating the API server as a critical component that requires scrutiny, organizations can better protect their Kubernetes environments from these sophisticated threats.