[New] GKE Kubernetes Rules#6357
Merged
Merged
Conversation
Convert some of our existing K8 rules https://github.com/elastic/detection-rules/tree/1e00f52d419d677ac52794e31ea1a63c97fd239b/rules/integrations/kubernetes to GCP K8 Audit logs. All queries validated against Zocalo dataset.
Contributor
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new set of GKE-focused detection rules built on GCP Kubernetes audit logs (ported from existing Kubernetes audit rules), plus the necessary schema updates to support new non-ECS fields.
Changes:
- Introduces multiple new GKE detection rules covering privilege escalation, persistence, discovery, execution, and credential access scenarios using
logs-gcp.audit-*. - Adds an ES|QL aggregation rule to detect bursts of failed Kubernetes API requests.
- Extends
non-ecs-schema.jsonwith GCP audit field mappings used by the new rules.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rules/integrations/gcp/privilege_escalation_gcp_gke_sensitive_hostpath_volume.toml | Detects pod specs mounting sensitive hostPath paths in GKE audit logs. |
| rules/integrations/gcp/privilege_escalation_gcp_gke_privileged_pod_created.toml | Detects pods created with allowPrivilegeEscalation: true. |
| rules/integrations/gcp/privilege_escalation_gcp_gke_pod_host_pid.toml | Detects HostPID enablement on pod create/update/patch events. |
| rules/integrations/gcp/privilege_escalation_gcp_gke_pod_host_network.toml | Detects HostNetwork enablement on pod create/update/patch events. |
| rules/integrations/gcp/privilege_escalation_gcp_gke_pod_host_ipc.toml | Detects HostIPC enablement on pod create/update/patch events. |
| rules/integrations/gcp/privilege_escalation_gcp_gke_excessive_linux_capabilities.toml | Detects dangerous Linux capability additions in pod create events. |
| rules/integrations/gcp/persistence_gcp_gke_cluster_admin_role_binding.toml | Detects modifications to a cluster-admin-related ClusterRoleBinding (logic/description mismatch flagged in comments). |
| rules/integrations/gcp/persistence_gcp_gke_admission_webhook_created_or_modified.toml | Detects admission webhook config changes; exclusion scoping issue flagged in comments. |
| rules/integrations/gcp/execution_gcp_gke_user_exec_into_pod.toml | New-terms rule for first-time user exec into pods. |
| rules/integrations/gcp/discovery_gcp_gke_suspicious_self_subject_review.toml | Detects service account/node self-subject review activity. |
| rules/integrations/gcp/discovery_gcp_gke_api_request_failure_burst.toml | ES |
| rules/integrations/gcp/credential_access_gcp_gke_secrets_list_unusual_source_asn.toml | New-terms rule for first-time secret listing from unusual ASN orgs; scoping tweak flagged in comments. |
| rules/integrations/gcp/credential_access_gcp_gke_secret_access_suspicious_user_agent.toml | Detects secrets get/list with suspicious user-agent fingerprints. |
| detection_rules/etc/non-ecs-schema.json | Adds logs-gcp.audit-* field mappings referenced by the new rules. |
…on-rules into k8_other_sources
Aegrah
approved these changes
Jul 6, 2026
Aegrah
left a comment
Contributor
There was a problem hiding this comment.
Amazing work, great effort. 🚀
…_suspicious_user_agent.toml Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
…urst.toml Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
…urst.toml Co-authored-by: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com>
imays11
approved these changes
Jul 6, 2026
terrancedejesus
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert some of our existing K8 rules https://github.com/elastic/detection-rules/tree/1e00f52d419d677ac52794e31ea1a63c97fd239b/rules/integrations/kubernetes to GCP K8 Audit logs. All queries validated against Zocalo dataset.