Skip to content

[Rule Tunings] Kubernetes/GKE Sensitive RBAC Change Followed by Workload Modification - #6699

Merged
imays11 merged 2 commits into
mainfrom
tune_gws_k8s_weekly_packet_fps
Sep 1, 2026
Merged

imays11 merged 2 commits into
mainfrom
tune_gws_k8s_weekly_packet_fps

Conversation

@imays11

@imays11 imays11 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Issue link(s):

Summary - What I changed

These two rules fire when the same identity writes a Role/ClusterRole and then modifies a Deployment/DaemonSet/CronJob within five minutes. Over 30d on latest versions, Kubernetes rule had 105367 hits / 5 licenses / 6 clusters; 103688 were system:serviceaccount:flux-system:kustomize-controller and 1228 were helm-controller (plus 343 alerts that omitted kubernetes.audit.user.username on the alert doc but still had the kustomize-controller user agent so those should drop as well) - accounted for 99.9% of alerts.

The GKE rule had much less volume (324 / 2 license / 4 clusters), but to keep parity I'm tuning it as well. Alert docs do not show client.user.email, so after is estimated from Esql.user_agent_original_values: 208 kustomize-controller and 22 flux-operator (230, 71% alert reduction).

The rule is meant to catch a person or stolen credential that first widens Role/ClusterRole permissions, then immediately creates or patches a Deployment/DaemonSet/CronJob as the payload. Flux’s kustomize-controller, helm-controller, and source-controller (and on GKE, flux-operator) are the in-cluster accounts Flux uses to apply whatever is in Git. If that Git path includes both a ClusterRole and a Deployment, the controller will write RBAC and then update the workload in the same sync. That is Flux applying declared config, not an attacker granting themselves cluster rights and shipping a malicious pod.

I also updated tags

…oad Modification

These two rules fire when the same identity writes a Role/ClusterRole and then modifies a Deployment/DaemonSet/CronJob within five minutes. Over 30d on latest versions, Kubernetes rule had 105367 hits / 5 licenses / 6 clusters; 103688 were `system:serviceaccount:flux-system:kustomize-controller` and 1228 were `helm-controller` (plus 343 alerts that omitted `kubernetes.audit.user.username` on the alert doc but still had the `kustomize-controller` user agent so those should drop as well) - accounted for 99.9% of alerts.

The GKE rule had much less volume (324 / 2 license / 4 clusters), but to keep parity I'm tuning it as well. Alert docs do not show `client.user.email`, so after is estimated from `Esql.user_agent_original_values`: 208 `kustomize-controller` and 22 `flux-operator` (230, 71% alert reduction).

The rule is meant to catch a person or stolen credential that first widens Role/ClusterRole permissions, then immediately creates or patches a Deployment/DaemonSet/CronJob as the payload. Flux’s kustomize-controller, helm-controller, and source-controller (and on GKE, flux-operator) are the in-cluster accounts Flux uses to apply whatever is in Git. If that Git path includes both a ClusterRole and a Deployment, the controller will write RBAC and then update the workload in the same sync. That is Flux applying declared config, not an attacker granting themselves cluster rights and shipping a malicious pod.

I also updated tags

@terrancedejesus terrancedejesus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@imays11
imays11 merged commit fd96052 into main Sep 1, 2026
12 of 13 checks passed
@imays11
imays11 deleted the tune_gws_k8s_weekly_packet_fps branch September 1, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants