Azure AKS Ephemeral Container Added to Pod

Last updated 20 days ago on 2026-07-09
Created 20 days ago on 2026-07-09

About

Detects an identity injecting an ephemeral (debug) container into a running AKS (Azure Kubernetes Service) pod via the pods/ephemeralcontainers subresource, excluding known AKS control-plane and platform identities. Ephemeral containers share the target pod's namespaces and give stealthy interactive access to its processes and mounted secrets without creating a new pod. Coverage includes workload service accounts (system:serviceaccount:*), so a compromised in-cluster token used to attach a debug container is not excluded.
Tags
Domain: CloudDomain: KubernetesData Source: AzureData Source: Azure Platform LogsData Source: KubernetesUse Case: Threat DetectionTactic: ExecutionLanguage: kuery
Severity
medium
Risk Score
47
MITRE ATT&CK™

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

False Positive Examples
Operators and support tooling use ephemeral containers (kubectl debug) for legitimate troubleshooting. Baseline expected users and exclude verified break-glass or platform identities after review.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Query (Kibana Query Language)
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-azure.platformlogs-*
Related Integrations

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

Query
text code block:
data_stream.dataset:azure.platformlogs and event.action:"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read" and azure.platformlogs.category:("kube-audit" or "kube-audit-admin") and azure.platformlogs.properties.log.stage:"ResponseComplete" and azure.platformlogs.properties.log.objectRef.resource:"pods" and azure.platformlogs.properties.log.objectRef.subresource:"ephemeralcontainers" and azure.platformlogs.properties.log.verb:("update" or "patch") and not azure.platformlogs.properties.log.user.username:( system\:node\:* or "aksService" or "hcpService" or "readinessChecker" or system\:serviceaccount\:kube-system\:* )

Install detection rules in Elastic Security

Detect Azure AKS Ephemeral Container Added to Pod 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).