Direct Interactive Kubernetes API Request Detected via Defend for Containers

Last updated 7 days ago on 2026-01-27
Created 13 days ago on 2026-01-21

About

This rule detects the execution of direct interactive Kubernetes API requests inside a container. An adversary may need to execute direct interactive Kubernetes API requests to gain access to the Kubernetes API server or other resources within the cluster. These requests are often used to enumerate the Kubernetes API server or other resources within the cluster, and may indicate an attempt to move laterally within the cluster. Note that this rule may not trigger if the token is expanded within the process argument list, as the length of the "process.args" field may lead to the field being ignored.
Tags
Data Source: Elastic Defend for ContainersDomain: ContainerOS: LinuxUse Case: Threat DetectionTactic: ExecutionTactic: DiscoveryLanguage: eql
Severity
low
Risk Score
21
MITRE ATT&CK™

Execution (TA0002)(external, opens in a new tab or window)

Discovery (TA0007)(external, opens in a new tab or window)

False Positive Examples
There is a potential for false positives if the direct interactive Kubernetes API requests are used for legitimate purposes, such as debugging or troubleshooting. It is important to investigate any alerts generated by this rule to determine if they are indicative of malicious activity or part of legitimate container activity.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-cloud_defend.process*
Related Integrations

cloud_defend(external, opens in a new tab or window)

Query
text code block:
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and ( ( process.name == "curl" and process.args in ("-H", "--header") and process.args like "*Authorization: Bearer *" and ( /* CA-specified */ process.args in ("--cacert", "--capath") or /* insecure */ process.args in ("-k", "--insecure") ) ) or ( process.name == "wget" and process.args like "--header*" and process.args like "*Authorization: Bearer *" and ( /* CA-specified */ process.args == "--ca-certificate" or /* insecure */ process.args == "--no-check-certificate" ) ) or ( /* Account for tools that execute utilities as a subprocess, in this case the target utility name will appear as a process arg */ process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox") and process.args in ("wget", "/bin/wget", "/usr/bin/wget", "/usr/local/bin/wget") and process.args like "--header*" and process.args like "*Authorization: Bearer*" and process.args == "--no-check-certificate" ) or ( /* ssl_client is busybox-specific, so we need to handle it separately */ process.name == "busybox" and process.args == "ssl_client" and process.args like "*Authorization: Bearer*" ) or (process.name == "openssl" and process.args == "s_client" and process.args == "-connect") or (process.name == "socat" and process.args like~ "*ssl*") or (process.name == "ncat" and process.args like "--ssl*") or (process.name == "kubectl" and process.args in ("get", "list", "watch", "create", "patch", "update")) ) and process.interactive == true and container.id like "*"

Install detection rules in Elastic Security

Detect Direct Interactive Kubernetes API Request Detected via Defend for Containers in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).