The attacker gets code running in a pod, or a credential for the Kubernetes API, then reads Kubernetes secrets, runs commands in other pods and launches privileged workloads. From the metadata server the attacker takes the credentials of the node or workload identity, so the attack reaches the Google Cloud project. Save the cluster state, then cut API server access and isolate the pods.
Look here
Log
Search for
GKE audit logs, Kubernetes API calls
Exec into pods, secret reads and RBAC changes. API server entries use resource type k8s_cluster and method names such as io.k8s.core.v1.pods.exec.create. Admin Activity is always on. Data Access (reads such as get and list of secrets) is off by default and must be enabled for the Kubernetes Engine API before the incident: gcloud logging read 'resource.type="k8s_cluster" AND resource.labels.cluster_name="<cluster>" AND (protoPayload.methodName:"io.k8s.core.v1.pods.exec" OR protoPayload.methodName:"io.k8s.core.v1.secrets" OR protoPayload.methodName:"io.k8s.authorization.rbac.v1")' --project=<project> --freshness=30d
GKE audit logs, who and from where
Who made each call and from where. A request from a pod that uses the node or a workload identity shows that service account or a Kubernetes service account principal. Anonymous requests show system:anonymous. Add these fields to the output: protoPayload.authenticationInfo.principalEmail, protoPayload.requestMetadata.callerIp
Admin Activity audit log, cluster configuration
Cluster and node pool changes on service container.googleapis.com: google.container.v1.ClusterManager.UpdateCluster, SetLegacyAbac, SetMasterAuth, SetNetworkPolicy, StartIPRotation, CompleteIPRotation, CreateNodePool, UpdateNodePool
Data Access audit log, cluster reads
Who fetched cluster details. The get-credentials command calls this method, and Data Access must be enabled for container.googleapis.com: google.container.v1.ClusterManager.GetCluster
Cluster configuration
Legacy attribute-based access control (ABAC), open control plane access, and node pools on the Compute Engine default service account. That account gives every pod without Workload Identity Federation for GKE its permissions. Check legacyAbac, masterAuthorizedNetworksConfig, privateClusterConfig, workloadIdentityConfig and each node pool's config.serviceAccount: gcloud container clusters describe <cluster> --location=<location>
Security Command Center (Event Threat Detection, control plane findings)
Role-based access control (RBAC) abuse, secret reads, privileged workloads and webhooks: Privilege Escalation: Changes to sensitive Kubernetes RBAC objectsPrivilege Escalation: Creation of sensitive Kubernetes bindingsPrivilege Escalation: Launch of privileged Kubernetes containerPrivilege Escalation: ClusterRoleBinding to Privileged RoleCredential Access: Secrets Accessed In Kubernetes NamespaceExecution: Suspicious Exec or Attach to a System PodInitial Access: Anonymous GKE Resource Created from the InternetPersistence: GKE Webhook Configuration DetectedDiscovery: Can get sensitive Kubernetes object check
Security Command Center (Container Threat Detection, node runtime findings)
Escapes, attack tools and credential searches on nodes. Container Threat Detection needs the Premium or Enterprise tier. The Enterprise tier is deprecated and shuts down May 21, 2027: Execution: Container Escape, Execution: Kubernetes Attack Tool ExecutionReverse Shell, Execution: Added Malicious Binary ExecutedCredential Access: Find Google Cloud CredentialsCredential Access: Access Sensitive Files On Nodes
Contain
#
Item
1
Save the cluster configuration and the audit entries for the window before any change: gcloud container clusters describe <cluster> --location=<location> --format=json
2
Record the pods, service accounts and RBAC bindings: kubectl get pods,serviceaccounts,clusterrolebindings,rolebindings -A -o yaml
3
Record the webhook configurations: kubectl get mutatingwebhookconfigurations,validatingwebhookconfigurations -o yaml
4
Cut network access to the API server for everyone but responders: gcloud container clusters update <cluster> --location=<location> --enable-master-authorized-networks --master-authorized-networks=<responder-cidr>
5
Isolate the suspect pods. Change their labels so they leave Service selectors, apply a NetworkPolicy that denies all traffic to them, and keep them running so memory and files stay available
6
Turn on network policy enforcement if it is off. A NetworkPolicy takes effect only when enforcement is on: gcloud container clusters update <cluster> --location=<location> --enable-network-policy
7
Cordon the nodes that ran the pods with kubectl cordon <node>, and snapshot their disks before any drain or delete
8
Remove bindings and roles the attacker created destructive, starting with any that grant cluster-admin or bind system:anonymous or system:unauthenticated: kubectl delete clusterrolebinding <name>
9
Turn off legacy ABAC if it is on: gcloud container clusters update <cluster> --location=<location> --no-enable-legacy-authorization
10
Disable the Google Cloud service account that the pod or node used. Open stolen workload credentials for its tokens: gcloud iam service-accounts disable <sa-email>
Eradicate and recover
#
Item
1
Rotate cluster credentials if the attacker had cluster-admin or read secrets. The rotation covers the control plane IP address, the cluster root certificate authority (CA), the Kubernetes service account signing keys and the aggregation layer CA: gcloud container clusters update <cluster> --location=<location> --start-credential-rotation
2
Update every API client outside the cluster to the new credentials and IP address, then finish the rotation: gcloud container clusters update <cluster> --location=<location> --complete-credential-rotation
3
Rotate every Kubernetes secret, database password and API key the attacker could read, working from the audit entries for io.k8s.core.v1.secrets and the scope in Scope
4
Replace compromised nodes. Recreate the node pool from a known-good image, save the evidence, then delete the old pool destructive: gcloud container node-pools delete <pool> --cluster=<cluster> --location=<location>
5
Enable Workload Identity Federation for GKE and move workloads off the node service account: gcloud container clusters update <cluster> --location=<location> --workload-pool=<project-id>.svc.id.goog
6
Give node pools a custom service account with only the roles GKE needs
7
Remove attacker persistence: mutating and validating webhooks, static pods, CronJobs, DaemonSets, and service accounts in system namespaces. Restore images from the registry after checking digests in registry tampering
8
Enable Data Access audit logs for container.googleapis.com, and keep the control plane authorized networks and a private endpoint where the cluster does not need public access
Watch out
Pods that run with hostNetwork: true bypass Workload Identity Federation for GKE and reach the Compute Engine metadata server, so they obtain the node service account. A compromise of one such pod exposes that account to the project.
A pod on a cluster without Workload Identity Federation for GKE gets the node service account from the metadata server. Its calls appear in Cloud Audit Logs as that service account, without the pod name. Match the time and the node to identify the pod.
Credential rotation causes brief API server downtime on zonal Standard clusters, and nodes are recreated while it runs. Update kubectl and CI clients after the start and before the completion.
Read access to Kubernetes secrets appears only in Data Access logs. If they were off, use the Security Command Center finding and the workload's own logs, and treat every secret in the namespace as read.
Google Cloud documentation: GKE audit logging and the GKE audit method list; Workload Identity Federation for GKE; GKE cluster hardening; GKE credential rotation; gcloud reference for container clusters update; GKE threat findings in Security Command Center; Container Threat Detection overview. Checked September 2026. Re-checked October 2026: Security Command Center service tiers.