Azure AKS Attempted User Exec into Pod

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

About

Detects an AKS (Azure Kubernetes Service) identity establishing an exec session into a pod. Interactive command execution inside a workload via kubectl exec is a common post-compromise technique used to access secrets, run tooling, and expand access from a foothold container. Node, control-plane, and kube-system service account identities are excluded, so workload service accounts and users, the identities an adversary is most likely to abuse, remain in scope.
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
Administrators routinely exec into pods for troubleshooting. Baseline expected users and target pods, then exclude known break-glass or operator 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" and azure.platformlogs.properties.log.objectRef.resource:"pods" and azure.platformlogs.properties.log.objectRef.subresource:"exec" and azure.platformlogs.properties.log.verb:("create" or "get") 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 Attempted User Exec into 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).