Techniques
Sample rules
GKE Pod Exec with Curl or Wget to HTTPS
- source: elastic
- technicques:
- T1105
- T1609
Description
Detects successful GKE pod exec sessions where the executed command implies curl or wget fetching an HTTPS URL. Attackers with pods/exec often run one-liners to stage tooling, pull scripts or binaries, or exfiltrate data over HTTPS—activity that should be rare compared to shells, debuggers, or expected health checks. Common cluster health, localhost, and OIDC/JWKS endpoint patterns are excluded to reduce benign automation noise. GKE records the command in gcp.audit.labels.command.gke.io/command when an explicit command is passed to exec.
Detection logic
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:(
(*curl*https* or *wget*https*) and not (
*/.well-known/jwks.json* or */.well-known/openid-configuration* or
*/api/v1/health* or */healthz* or */livez* or */readyz* or
*/openid-connect/certs* or */openid/v1/jwks* or
*127.0.0.1* or *kubernetes.default.svc* or *localhost*
)
)