GKE Certificate Signing Request for Privileged Identity
Description
Detects creation of a GKE CertificateSigningRequest (CSR) whose decoded subject requests a highly privileged Kubernetes identity in the Common Name (CN), such as system:masters, system:kube-controller-manager, or system:admin. This rule is scoped to identities with cluster-admin-equivalent or control-plane impersonation value. Attackers who can create and approve CSRs can use this technique to clone credentials for powerful identities and obtain durable cluster access. This signal applies to any actor, including compromised node identities that use legitimate kubelet signers but request a privileged CN.
Query · esql
from logs-gcp.audit-* metadata _id, _index, _version, _source
| where data_stream.dataset == "gcp.audit"
and service.name == "k8s.io"
and event.outcome == "success"
and event.action == "io.k8s.certificates.v1.certificatesigningrequests.create"
| eval Esql.csr_request = json_extract(_source, "$.gcp.audit.request.spec.request")
| where Esql.csr_request is not null
| eval Esql.csr_pem = from_base64(Esql.csr_request)
| eval Esql.csr_body_b64 = replace(
replace(
replace(
replace(Esql.csr_pem, "-----BEGIN CERTIFICATE REQUEST-----", ""),
"-----END CERTIFICATE REQUEST-----", ""),
"\r", ""),
"\n", "")
| eval Esql.csr_der = from_base64(Esql.csr_body_b64)
| where Esql.csr_der like "*system:masters*"
or Esql.csr_der like "*system:kube-controller-manager*"
or Esql.csr_der like "*system:admin*"
| keep _id, _index, _version, @timestamp, client.user.email, gcp.audit.resource_name, source.ip, user_agent.original, Esql.*, event.*, gcp.audit.request, gcp.audit.response, data_stream.namespace
Investigation fields
Pivot points the source recommends for triage.
@timestampclient.user.emailsource.ipuser_agent.originalevent.actionevent.outcomegcp.audit.resource_nameEsql.csr_requestEsql.csr_pemEsql.csr_derdata_stream.namespace
Implementation guide
The GCP Fleet integration with GKE audit logs enabled is required. Request body capture for CSR create events (gcp.audit.request.spec.request) typically requires RequestResponse audit level on CertificateSigningRequest resources.
Known false positives
- Legitimate GKE automation does not request certificates for system:masters, system:kube-controller-manager, or system:admin as the CSR subject. Node bootstrap and kubelet rotation use system:node:* identities instead. Alerts should be rare; tune exclusions only for documented custom PKI workflows that intentionally mint these identities.
Analyst notes
Investigating GKE Certificate Signing Request for Privileged Identity
This rule uses JSON_EXTRACT(_source, "$.gcp.audit.request.spec.request") to read the outer base64 CSR from CSR
create events, double-decodes it to DER in Esql.csr_der, and matches privileged Common Names. It is scoped to
identities with cluster-admin-equivalent or control-plane impersonation value (system:masters, system:kube-controller-manager,
and system:admin). The alert includes Esql.csr_pem and Esql.csr_der so the requested identity is visible without
manual decoding.
To validate manually from the create event:
# Full decoded PEM block
echo "<gcp.audit.request.spec.request>" | base64 -d
# Parsed CSR details (subject, key type/size, extensions, signature)
echo "<gcp.audit.request.spec.request>" | base64 -d | openssl req -noout -text
# Subject only
echo "<gcp.audit.request.spec.request>" | base64 -d | openssl req -noout -subject
Matched privileged identities:
system:masters(cluster-admin group)system:kube-controller-managersystem:admin
Possible investigation steps
- Identify
client.user.email,source.ip, and whether the actor is expected to request certificates for these identities. - Review
gcp.audit.request.spec.signerNameto determine which certificate authority would sign the request. - Check for self-approval or controller approval on the same
gcp.audit.resource_namewithin a short window. - Correlate with secret reads, RBAC changes, or TokenRequest activity from the same actor.
False positive analysis
- Known control-plane and kube-system identities do not legitimately create CSRs for these subjects in GKE; any match warrants review.
Related rules
- GKE Certificate Signing Request API Client Signer Requested - 1e344fba-a2f7-462b-aaec-d6c8f80d5a28
- GKE Certificate Signing Request Self-Approved - e155e658-3dcd-4d27-a4e5-1d8da6704b0e
- GKE Client Certificate Signing Request Created or Approved - ec67ab57-945a-4edb-84f8-1d7a51f46544
Response and remediation
- Deny or delete the CSR, revoke issued credentials if already signed, and tighten CSR create/approval RBAC.