GKE Pod Exec Potential Reverse Shell

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

About

Detects successful GKE pod exec sessions whose command resembles reverse-shell or bind-shell one-liner patterns, including /dev/tcp and /dev/udp redirection, netcat/ncat exec-style flags, socat shell handoff, mkfifo pipelines, and common language socket idioms. Legitimate debug sessions sometimes use similar building blocks, but together these patterns align with post-exploitation interactive access and command-and-control. Common localhost /dev/tcp health-check ports are excluded. 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: ExecutionTactic: Command and ControlLanguage: kuery
Severity
high
Risk Score
73
MITRE ATT&CK™

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

Command and Control (TA0011)(external, opens in a new tab or window)

False Positive Examples
Security training, CTF-style images, or vendor diagnostics may include bash redirection or /dev/tcp examples. Baseline approved images then expand 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:( ( */dev/tcp/* or */dev/udp/* or */inet/tcp/* or *0\\\>&1* or *IO*Socket*INET* or *TCPSocket.new* or *bash*-i* or *fsockopen* or *import*pty* or *import*socket* or *mkfifo* or *nc*-c* or *nc*-e* or *netcat*-e* or *socat*exec* or *socat*pty* or *socket.socket* or *zsh/net/tcp* or *zsh/net/udp* ) and not ( *127.0.0.1* or *localhost* ) )

Install detection rules in Elastic Security

Detect GKE Pod Exec Potential Reverse Shell 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).