GKE Forbidden Request from Unusual User Agent

Detects the first occurrence of a failed GKE API request from a previously unseen user agent. Adversary tooling often uses non-standard clients; combined with authorization failures this can indicate RBAC probing or exploitation attempts.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/07/16"
  3integration = ["gcp"]
  4maturity = "production"
  5updated_date = "2026/07/16"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Detects the first occurrence of a failed GKE API request from a previously unseen user agent. Adversary tooling often
 11uses non-standard clients; combined with authorization failures this can indicate RBAC probing or exploitation attempts.
 12"""
 13false_positives = [
 14    """
 15    New internal tools, SDKs, or CI runners introduce novel user agents. Baseline expected clients, then exclude stable
 16    automation UAs after review.
 17    """,
 18]
 19from = "now-6m"
 20index = ["logs-gcp.audit-*"]
 21language = "kuery"
 22license = "Elastic License v2"
 23name = "GKE Forbidden Request from Unusual User Agent"
 24note = """## Triage and analysis
 25
 26### Investigating GKE Forbidden Request from Unusual User Agent
 27
 28A novel user agent with failed API calls may be scanner or post-compromise tooling probing RBAC.
 29
 30### Investigation steps
 31
 32- Review `user_agent.original`, `client.user.email`, `event.action`, `gcp.audit.resource_name`, and `source.ip`.
 33- Determine whether the client is expected (new SDK, CI image) or external reconnaissance.
 34- Hunt for successful requests from the same UA or source after the failures.
 35
 36### False positives
 37
 38- First use of a legitimate new client library; add a scoped UA exception after validation.
 39
 40"""
 41references = [
 42    "https://kubernetes.io/docs/reference/access-authn-authz/authorization/",
 43    "https://cloud.google.com/kubernetes-engine/docs/how-to/audit-logging",
 44]
 45risk_score = 47
 46rule_id = "e1147459-a3e1-4bdc-bab9-965807801774"
 47severity = "medium"
 48tags = [
 49    "Domain: Cloud",
 50    "Domain: Kubernetes",
 51    "Data Source: GCP",
 52    "Data Source: Google Cloud Platform",
 53    "Use Case: Threat Detection",
 54    "Tactic: Execution",
 55    "Tactic: Discovery",
 56    "Resources: Investigation Guide",
 57]
 58timestamp_override = "event.ingested"
 59type = "new_terms"
 60setup = "The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule."
 61
 62query = '''
 63data_stream.dataset:gcp.audit and service.name:k8s.io and event.outcome:failure and
 64user_agent.original:(* and not (*kubernetes/$Format or kube-probe* or gke-exec-auth-plugin*)) and
 65not client.user.email:(
 66  "system:addon-manager" or system\:*controller* or system\:gke-* or
 67  "system:apiserver" or "system:kube-scheduler" or "system:metrics-server-nanny" or
 68  "system:kube-proxy" or "system:clustermetrics" or "system:vpa-recommender" or
 69  "system:cluster-autoscaler" or "system:kubestore-collector" or
 70  "system:konnectivity-server" or
 71  "system:serviceaccount:kube-system:pod-garbage-collector" or
 72  "system:serviceaccount:kube-system:generic-garbage-collector" or system\:node\:* or
 73  "gcp:kube-bootstrap" or *container-engine-robot*
 74)
 75'''
 76
 77[rule.new_terms]
 78field = "new_terms_fields"
 79value = ["user_agent.original"]
 80
 81[[rule.new_terms.history_window_start]]
 82field = "history_window_start"
 83value = "now-7d"
 84
 85[[rule.threat]]
 86framework = "MITRE ATT&CK"
 87
 88[rule.threat.tactic]
 89id = "TA0002"
 90name = "Execution"
 91reference = "https://attack.mitre.org/tactics/TA0002/"
 92
 93[[rule.threat]]
 94framework = "MITRE ATT&CK"
 95
 96[[rule.threat.technique]]
 97id = "T1613"
 98name = "Container and Resource Discovery"
 99reference = "https://attack.mitre.org/techniques/T1613/"
100
101[rule.threat.tactic]
102id = "TA0007"
103name = "Discovery"
104reference = "https://attack.mitre.org/tactics/TA0007/"
105
106[rule.investigation_fields]
107field_names = [
108    "@timestamp",
109    "client.user.email",
110    "source.ip",
111    "user_agent.original",
112    "event.action",
113    "event.outcome",
114    "gcp.audit.resource_name",
115    "orchestrator.resource.name",
116    "orchestrator.namespace",
117]

Triage and analysis

Investigating GKE Forbidden Request from Unusual User Agent

A novel user agent with failed API calls may be scanner or post-compromise tooling probing RBAC.

Investigation steps

  • Review user_agent.original, client.user.email, event.action, gcp.audit.resource_name, and source.ip.
  • Determine whether the client is expected (new SDK, CI image) or external reconnaissance.
  • Hunt for successful requests from the same UA or source after the failures.

False positives

  • First use of a legitimate new client library; add a scoped UA exception after validation.

References

Related rules

to-top