Kubernetes: Potential unauthorized Kubelet API access from containers
Adversaries are leveraging compromised containers to interact directly with the Kubelet API on ports 10250 and 10255 to perform enumeration, log extraction, and remote command execution.
Triage facts
Revision 1- Applicability
- Kubelet
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 4 public sources
- Freshness
- Revision 1Nov 3, 21:48 UTC
- Source quality
- B2Roughly even chance
Adversaries may attempt to interact with the Kubelet API from within a container to gain visibility into the node, enumerate pods, or execute commands on the host. This behavior is typically observed when command-line utilities such as curl or wget are invoked from an interactive container shell to reach the Kubelet API port. Unauthorized access to the Kubelet API facilitates lateral movement and potential privilege escalation within a Kubernetes cluster.
Attack Chain
- Initial access to a container via exploitation or misconfiguration.
- Execution of an interactive shell within the container.
- Reconnaissance of the local node or cluster network to identify Kubelet API endpoints.
- Execution of HTTP/WSS requests directed at the node Kubelet API (port 10250 or 10255).
- Enumeration of cluster resources, pod logs, or execution of commands via API endpoints such as /exec, /run, or /containerLogs.
- Escalation of privileges or lateral movement to other cluster resources.
Impact
Successful unauthorized access to the Kubelet API can lead to full cluster compromise, unauthorized pod execution, and exposure of sensitive container logs or environment variables.
Recommendation
- Deploy the provided detection rule to monitor for process executions involving Kubelet port access from containers.
- Implement network policies to block egress traffic from container namespaces to node-local Kubelet ports (10250/10255).
- Harden Kubelet configurations by disabling anonymous access and requiring authenticated, authorized webhook requests.
- Remove administrative tooling (e.g., curl, wget, shell access) from production container images.
- Rotate sensitive credentials, including service account tokens and client certificates, if unauthorized Kubelet API requests are detected.
Immediate actions
Deploy process-creation monitoring to identify curl or wget requests to Kubelet ports
Threat Hunt
Search for shell process execution inside containers involving arguments with destination ports 10250 or 10255
Data: Linux process audit logs, Container process execution telemetry
Mitigations
Implement network policies to restrict container egress to Kubelet ports 10250 and 10255
Unauthorized Kubelet access