Detection of Insecure Curl Execution in Kubernetes Clusters
Threat actors may leverage curl with insecure flags within Kubernetes environments to bypass TLS certificate verification, facilitating man-in-the-middle attacks and unauthorized tool ingress.
Monitoring of Kubernetes environments reveals that curl commands are frequently executed with insecure flags, such as -k or --insecure, to circumvent SSL/TLS verification during file transfers. This activity is often associated with the ingress of unauthorized tools or payloads into containerized environments. Within the Cisco Isovalent platform, defenders can monitor process execution logs to identify these commands. This behavior is notable because bypassing certificate validation exposes the infrastructure to man-in-the-middle attacks, potentially leading to sensitive data interception, service disruption, or unauthorized access to the cluster. SOC teams should investigate such executions to determine if they originate from legitimate administrative scripts or indicate malicious activity.
Attack Chain
- Attacker gains initial access to a Kubernetes pod, possibly via compromised container applications.
- Attacker attempts to download external malicious tools or configuration files using curl.
- The target server uses self-signed or invalid certificates, preventing standard curl requests.
- Attacker executes curl with the -k or --insecure flag to force the connection despite certificate validation errors.
- The insecure connection is established, potentially allowing an interceptor to perform a man-in-the-middle attack.
- The attacker successfully pulls the secondary stage payload or configuration into the container.
- The attacker executes the downloaded payload to conduct further malicious actions, such as lateral movement or data exfiltration.
Impact
Successful exploitation allows attackers to bypass infrastructure security controls, leading to the ingress of unauthorized payloads, potential interception of sensitive communications, and unauthorized access to the Kubernetes control plane or pod secrets. This impacts security posture by weakening the transport layer security required for cloud-native workloads.
Recommendation
- Deploy detection logic to monitor process execution logs within the Cisco Isovalent environment for curl commands containing insecure flags.
- Audit administrative scripts and container entrypoints that utilize curl to ensure certificate verification is enforced where feasible.
- Use the provided Sigma rule to detect these command-line arguments in process monitoring telemetry.
- Investigate triggered alerts by cross-referencing with pod activity and established cron jobs to reduce noise from legitimate administrative tasks.
Immediate actions
Deploy Sigma rule to monitor for insecure curl flags in CI/CD and runtime environments.
Threat Hunt
Search historical logs for curl commands with -k or --insecure.
Data: Process execution telemetry
Mitigations
Enforce TLS certificate validation for all outbound connections in cluster network policies.
T1105
Detection coverage 1
Detect Curl Execution With Insecure Flags
mediumDetects the use of curl command-line arguments that bypass SSL/TLS verification, which may indicate malicious tool ingress.
Detection queries are available on the platform. Get full rules →