Container Administration Command
This detection identifies adversaries abusing container administration services such as the Docker daemon, Kubernetes API server, or kubelet to execute commands within running containers. Attackers leverage tools like 'docker exec', 'kubectl exec', or direct kubelet API calls to achieve code execution in containerized environments, often for lateral movement, cryptomining deployment, or establishing persistence. This detection monitors process creation events on container host nodes for suspicious invocations of container management binaries with exec sub-commands, privileged flags, or interactive shell spawning, as well as anomalous kubelet API activity patterns associated with threat actors like TeamTNT and malware families including Kinsing, Hildegard, and Siloscape.
What is T1609 Container Administration Command?
Container Administration Command (T1609) maps to the Execution tactic — the adversary is trying to run malicious code in MITRE ATT&CK.
This page provides production-ready detection logic for Container Administration Command, covering the data sources and telemetry it touches: Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Execution
- Technique
- T1609 Container Administration Command
- Canonical reference
- https://attack.mitre.org/techniques/T1609/
let ContainerExecPatterns = dynamic(["exec", "run", "attach"]);
let SuspiciousShells = dynamic(["sh", "bash", "ash", "zsh", "/bin/sh", "/bin/bash"]);
let PrivilegedFlags = dynamic(["--privileged", "--cap-add", "--security-opt label=disable", "--pid=host", "--net=host", "--ipc=host"]);
DeviceProcessEvents
| where TimeGenerated > ago(1d)
| where FileName in~ ("docker", "kubectl", "crictl", "ctr", "nerdctl", "podman")
or InitiatingProcessFileName in~ ("docker", "kubectl", "crictl", "ctr", "nerdctl", "podman")
| where ProcessCommandLine has_any (ContainerExecPatterns)
| extend IsInteractiveShell = ProcessCommandLine has "-it" or ProcessCommandLine has "--tty" or ProcessCommandLine has "-i "
| extend SpawnsShell = ProcessCommandLine has_any (SuspiciousShells)
| extend UsesPrivilegedFlag = ProcessCommandLine has_any (PrivilegedFlags)
| extend IsKubectlExec = FileName =~ "kubectl" and ProcessCommandLine has "exec"
| extend IsCurlKubelet = (FileName =~ "curl" or FileName =~ "wget") and
(ProcessCommandLine has ":10250" or ProcessCommandLine has "/exec" or ProcessCommandLine has "/run")
| extend RiskScore = toint(0)
+ iif(IsInteractiveShell, 30, 0)
+ iif(SpawnsShell, 25, 0)
+ iif(UsesPrivilegedFlag, 35, 0)
+ iif(IsKubectlExec, 20, 0)
+ iif(IsCurlKubelet, 40, 0)
+ iif(InitiatingProcessFileName in~ ("python", "python3", "ruby", "perl", "php", "node"), 30, 0)
| where RiskScore >= 25
| project
TimeGenerated,
DeviceName,
AccountName,
AccountDomain,
FileName,
ProcessCommandLine,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
InitiatingProcessParentFileName,
IsInteractiveShell,
SpawnsShell,
UsesPrivilegedFlag,
IsKubectlExec,
IsCurlKubelet,
RiskScore
| sort by RiskScore desc, TimeGenerated desc Detects container administration command execution via docker exec, kubectl exec, crictl, and direct kubelet API calls on container host nodes. Scores events based on interactive shell spawning, privileged flags, scripting language parent processes, and direct kubelet API invocations (port 10250). High-score events indicate likely malicious container command execution consistent with cryptominer deployment or lateral movement.
Data Sources
Required Tables
False Positives
- Legitimate DevOps engineers running 'kubectl exec' or 'docker exec' for container debugging and troubleshooting during business hours
- CI/CD pipeline agents (Jenkins, GitLab Runner, GitHub Actions self-hosted) executing docker run or kubectl exec as part of automated build, test, or deployment workflows
- Container health check scripts or monitoring agents (Datadog, Dynatrace, Prometheus node exporter installers) that use crictl or docker exec to inspect running container state
Sigma rule & cross-platform mapping
The detection logic for Container Administration Command (T1609) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1609
References (6)
- https://attack.mitre.org/techniques/T1609/
- https://unit42.paloaltonetworks.com/hildegard-malware-teamtnt/
- https://aquasecurity.github.io/kube-hunter/
- https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#exec
- https://docs.docker.com/engine/reference/commandline/exec/
- https://kubernetes.io/docs/reference/access-authn-authz/kubelet-authn-authz/
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Docker Exec Interactive Shell in Running Container
Expected signal: Sysmon EventCode=1 or Linux process creation event showing docker process with CommandLine containing 'exec -it atomic-test-container /bin/sh'. DeviceProcessEvents will show FileName=docker, ProcessCommandLine containing 'exec' and '/bin/sh'.
- Test 2Kubectl Exec Command Execution in Pod
Expected signal: DeviceProcessEvents showing FileName=kubectl, ProcessCommandLine containing 'exec atomic-exec-test -- /bin/sh'. Kubernetes API server audit log entry with verb=create, objectRef.subresource=exec, objectRef.name=atomic-exec-test. Linux audit log execve records for kubectl.
- Test 3Direct Kubelet API Exec Bypassing API Server
Expected signal: DeviceProcessEvents showing FileName=curl, ProcessCommandLine containing ':10250' and '/exec/' or '/pods'. Linux process creation audit records for curl with kubelet API endpoint arguments. Network connection to port 10250 in DeviceNetworkEvents.
Unlock Pro Content
Get the full detection package for T1609 including response playbook, investigation guide, and atomic red team tests.