GKE Pod Exec Sensitive File or Credential Path Access

Last updated 7 days ago on 2026-07-15
Created 7 days ago on 2026-07-15

About

Detects successful GKE pod exec sessions where the executed command references high-value host or in-cluster paths: mounted service account or platform tokens, kubelet and control-plane configuration areas, host identity stores, root or home credential directories, common private-key and keystore extensions, process environment dumps, and configuration filenames suggestive of embedded secrets. Attackers with pods/exec often use these one-liners to steal credentials before lateral movement or privilege escalation. A narrow exclusion ignores benign resolv.conf reads. GKE records the command in gcp.audit.labels.command.gke.io/command when an explicit command is passed to exec.
Tags
Domain: CloudDomain: KubernetesData Source: GCPData Source: GCP Audit LogsData Source: Google Cloud PlatformUse Case: Threat DetectionTactic: Credential AccessTactic: ExecutionLanguage: kuery
Severity
high
Risk Score
73
MITRE ATT&CK™

Credential Access (TA0006)(external, opens in a new tab or window)

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

False Positive Examples
Break-glass debugging or vendor diagnostics may cat credential-adjacent paths. Baseline approved operators and automation identities, then expand client.user.email exclusions as needed.
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-gcp.audit-*
Related Integrations

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

Query
text code block:
data_stream.dataset:gcp.audit and service.name:"k8s.io" and event.outcome:success and event.type:start and event.action:("io.k8s.core.v1.pods.exec.create" or "io.k8s.core.v1.pods.exec.get") and gcp.audit.labels.command.gke.io/command:( ( *.jks* or *.key* or *.keystore* or *.p12* or *.pem* or */etc/kubernetes/* or */etc/passwd* or */etc/shadow* or */etc/sudoers* or */home/*/.aws* or */home/*/.azure* or */home/*/.config/gcloud* or */home/*/.kube* or */home/*/.ssh* or */proc/*/environ* or */root/.aws* or */root/.azure* or */root/.config/gcloud* or */root/.kube* or */root/.ssh* or */var/lib/kubelet/* or */var/run/secrets/* or */etc/*.conf* and (*credential* or *key* or *password* or *secret* or *token*) ) and not */etc/resolv.conf* )

Install detection rules in Elastic Security

Detect GKE Pod Exec Sensitive File or Credential Path Access 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).