All vulnerabilities
HIGHInfra

CLOUD-KUBELET-HILDEGARD-2021

Kubernetes · Kubernetes kubelet API

Summary

On February 3, 2021, Palo Alto Networks Unit 42 reported Hildegard, the first known TeamTNT campaign targeting Kubernetes, detected in January 2021. The attackers gained initial access through a misconfigured kubelet: the kubelet read-write API on port 10250 was reachable and accepted anonymous, unauthenticated requests because it was configured with --anonymous-auth set to true and --authorization-mode set to AlwaysAllow, the insecure legacy defaults shipped by some self-managed clusters. Anyone who could reach port 10250 could call the kubelet run-command API to execute commands inside running pods with no credentials. The attackers used this to exec into pods, move laterally across containers, scan for more exposed kubelets, and harvest cloud access keys, SSH keys, Docker credentials, and service-account tokens from the environment. They then deployed the XMRig Monero miner for cryptojacking, using a tmate reverse shell and IRC for command and control and LD_PRELOAD injection to hide processes. The misconfiguration class is missing authentication caused by an insecure default on an internet-reachable management port.

How to avoid it in your code

  • Set the kubelet flag --anonymous-auth=false so unauthenticated requests are rejected.
  • Set --authorization-mode=Webhook so the kubelet defers authorization to the API server.
  • Never expose kubelet ports 10250 or 10255 to the internet; restrict them with firewalls and NetworkPolicies.
  • Scope service accounts and instance IAM to least privilege so a compromised pod cannot harvest cloud keys.
  • Enforce IMDSv2 with hop limit 1 so workloads cannot trivially read instance role credentials.

References

Related vulnerabilities

All Infra →