Potential Kubeletctl Execution on Linux Hosts
This rule detects the execution of kubeletctl, a command-line tool used to interact with the Kubelet API, on Linux hosts, potentially leading to discovery and lateral movement within Kubernetes environments.
The kubeletctl tool simplifies access to Kubelet endpoints, potentially allowing attackers to perform discovery and lateral movement within Kubernetes environments. The tool can be used to enumerate pods and nodes, and attempt actions such as exec/attach/portForward. Attackers may run kubeletctl scan to find reachable Kubelet endpoints, then use pods or exec/attach for follow-on access. This activity is typically observed on Linux hosts within containerized environments. Defenders should monitor for the execution of kubeletctl with suspicious arguments or connections to Kubelet ports (commonly 10250/10255).
Attack Chain
- Attacker gains initial access to a compromised host within the Kubernetes environment.
- Attacker downloads or transfers the
kubeletctlbinary to the compromised host. - Attacker executes
kubeletctl scanto identify accessible Kubelet API endpoints by scanning for open ports 10250 and 10255. - Attacker uses
kubeletctl podsto enumerate running pods on a targeted node based on the scan results. - Attacker leverages
kubeletctl execorkubeletctl attachto gain shell access to a pod. - Attacker uses the compromised pod to move laterally within the Kubernetes cluster, potentially accessing sensitive data or resources.
- Attacker may attempt to access Kubernetes credentials, such as service account tokens or kubeconfigs, for further privilege escalation.
Impact
Successful exploitation can allow attackers to enumerate pods and nodes, execute commands within containers, and potentially move laterally within the Kubernetes cluster. This could lead to unauthorized access to sensitive data, resource hijacking, or complete compromise of the Kubernetes environment. The CyberArk research cited in the references describes how kubeletctl can be leveraged to attack Kubernetes clusters.
Recommendation
- Deploy the Sigma rule
Potential Kubeletctl Executionto detect suspicious execution of thekubeletctlbinary on Linux hosts, focusing on command-line arguments such asscan,pods,exec, andattach. - Monitor host and container telemetry for connections to Kubelet ports (10250/10255) using a network connection rule and look for scanning patterns across multiple nodes.
- Restrict access to Kubelet ports at the network layer and harden Kubelet authentication/authorization based on the recommendations in the provided references.
- Rotate/revoke any exposed Kubernetes credentials (service account tokens, kubeconfigs, client certs) and investigate for follow-on discovery or execution attempts.
Detection coverage 2
Potential Kubeletctl Execution
mediumDetects the execution of kubeletctl, a command-line tool for interacting with the Kubelet API.
Kubeletctl Execution with Sensitive Arguments
highDetects the execution of kubeletctl with arguments that could be used for discovery or execution.
Detection queries are kept inside the platform. Get full rules →