GKE Unusual Service Account Secret Access via New User Agent
Description
Detects the first successful GKE secrets.get by a pod service account from a previously unseen combination of service-account identity, user agent, and source IP. Controllers routinely read secrets with a stable client fingerprint; a new user agent or source for that service account could indicate a stolen token used outside the workload (for example curl, a custom script, or kubectl from an unexpected host).
Query · kuery
data_stream.dataset:gcp.audit and service.name:k8s.io and event.outcome:success and event.action:"io.k8s.core.v1.secrets.get" and client.user.email:system\:serviceaccount\:* and user_agent.original:(* and not *kubernetes/$Format*) and source.ip:(* and not (127.0.0.1 or "::1"))
Investigation fields
Pivot points the source recommends for triage.
@timestampclient.user.emailsource.ipuser_agent.originalevent.actionevent.outcomegcp.audit.resource_namedata_stream.namespace
Implementation guide
The GCP Fleet integration with GKE audit logs enabled is required to be compatible with this rule.
Known false positives
- Controller upgrades, sidecar replacements, or client library version bumps change user agents and can produce a first-seen alert for known service accounts. Confirm the new client is expected before treating as compromise.
- Newly deployed operators or workloads that change egress IP will alert once while the history window learns their client fingerprint.
Analyst notes
Investigating GKE Unusual Service Account Secret Access via New User Agent
This new-terms rule alerts when a system:serviceaccount:* identity successfully calls secrets.get with a
client.user.email + user_agent.original + source.ip combination not seen in the history window.
Possible investigation steps
- Confirm whether the service account normally uses this user agent or whether the client looks like an interactive
or scripting tool (
curl,python,kubectl, generic HTTP libraries). - Review
gcp.audit.resource_nameand namespace scope against the workload's expected secret mounts and RBAC. - Pivot on the same
client.user.emailorsource.ipfor secret list/get bursts, exec, or RBAC changes. - Compare to recent deployments or operator upgrades that would legitimately introduce a new client string.
False positive analysis
- Operator or library upgrades that change the user-agent string for an otherwise unchanged service account.
- First enablement of the rule will surface baseline controller clients until the history window fills.
Response and remediation
- If malicious, revoke the service-account token, rotate exposed secrets, isolate the originating workload or host, and tighten RBAC so the identity can only read required secrets.