An attacker pulls the cluster admin kubeconfig with an Azure role, or enters through an exposed workload. The attacker then binds an account to cluster-admin, reads Kubernetes secrets, and runs pods that request tokens for the kubelet identity or a workload identity, which reach Azure resources outside the cluster. Close the API server and remove the attacker's bindings first, then revoke the credentials and tokens the attacker could still use.
Look here
Log
Search for
AKSAuditAdmin (category kube-audit-admin)
Role bindings, service accounts, pods, daemon sets and exec sessions created or changed: AKSAuditAdmin | where ObjectRef.resource in ("clusterrolebindings", "rolebindings", "serviceaccounts", "pods", "daemonsets") or ObjectRef.subresource == "exec" | project TimeGenerated, User, SourceIps, Verb, ObjectRef, UserAgent
AKSAudit (category kube-audit)
Secret reads by user and source address. In Azure diagnostics mode, the same events are in AzureDiagnostics with the category kube-audit, in the log_s column: AKSAudit | where ObjectRef.resource == "secrets" and Verb in ("get", "list") | summarize count() by tostring(User.username), tostring(SourceIps)
AzureActivity
Credential downloads, Run Command, role assignments and federated credentials. Check that role assignment writes target the cluster scope: AzureActivity | where OperationNameValue in~ ("Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action", "Microsoft.ContainerService/managedClusters/listClusterUserCredential/action", "Microsoft.ContainerService/managedClusters/runCommand/action", "Microsoft.Authorization/roleAssignments/write", "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write") | project TimeGenerated, Caller, CallerIpAddress, OperationNameValue, _ResourceId
Cluster configuration
Entra integration, local accounts, the OpenID Connect (OIDC) issuer and the kubelet identity: az aks show -g <rg> -n <cluster> --query "{aad:aadProfile, localDisabled:disableLocalAccounts, oidc:oidcIssuerProfile, kubelet:identityProfile.kubeletidentity}"
AADManagedIdentitySignInLogs
Token requests by the kubelet identity and by user-assigned identities federated with the cluster, then their calls, as in the managed identity playbook
SecurityAlert
Defender for Containers alerts on the cluster: SecurityAlert | where ResourceId has "<cluster>" | project TimeGenerated, AlertName, AlertType, CompromisedEntity, Entities
Contain
#
Item
1
Export the audit tables for the window, and snapshot the OS disks of affected nodes in the node resource group
2
Limit API server access on a public cluster: az aks update -g <rg> -n <cluster> --api-server-authorized-ip-ranges <cidr>
3
List Azure role assignments on the cluster. Repeat with --scope <cluster-id>/namespaces/<ns> for each namespace: az role assignment list --scope <cluster-id>
4
Remove the attacker's role assignments on the cluster and its namespaces: az role assignment delete --ids <assignment-id>
5
Disable local accounts on an Entra-integrated cluster: az aks update -g <rg> -n <cluster> --disable-local-accounts
6
Save each binding and workload the attacker created: kubectl get clusterrolebinding <name> -o yaml
7
Delete the attacker's bindings and workloads destructive: kubectl delete clusterrolebinding <name>
8
Delete federated credentials that trust the attacker's service accounts destructive: az identity federated-credential delete --name <fic> --identity-name <identity> -g <rg>
9
Rotate the OIDC issuer signing keys. Run the command twice, then restart pods that use projected tokens: az aks oidc-issuer rotate-signing-keys -g <rg> -n <cluster>
10
Revoke client certificates and service account tokens destructive, recreates nodes and disks: az aks rotate-certs -g <rg> -n <cluster>
11
Have each operator download new credentials after the rotation: az aks get-credentials -g <rg> -n <cluster>
Eradicate and recover
#
Item
1
Review the kubelet identity's roles and remove anything beyond image pull: az role assignment list --assignee <kubelet-object-id> --all
2
Move workloads from pod-managed identity, deprecated in 2022 with add-on support through September 2025, to Microsoft Entra Workload ID
3
Block pod access to the Instance Metadata Service (IMDS). The flag is in preview and needs the aks-preview extension, and host network pods keep access: az aks update -g <rg> -n <cluster> --enable-imds-restriction
4
Enable Azure RBAC for Kubernetes with --enable-azure-rbac, and keep local accounts disabled on every cluster
Send kube-audit-admin and guard to the workspace in resource-specific mode, and keep kube-audit on while the case is open
Watch out
kube-audit-admin drops get and list events, so secret reads appear only in kube-audit. Neither category exists until you create a diagnostic setting.
Disabling local accounts leaves downloaded admin certificates valid until az aks rotate-certs, which recreates all nodes and disks with up to 30 minutes of downtime. Snapshot node disks first.
After an OIDC key rotation, old and new keys stay valid for 24 hours. Rotate twice and restart pods to cut off stolen service account tokens at once.
Every pod reaches IMDS by default, which exposes the node's managed identity tokens. Namespace-scoped Azure RBAC assignments are hidden in the portal, and new assignments take up to five minutes to apply.
Microsoft Learn: monitor AKS; AKS local accounts; certificate rotation and rotate certificates in AKS; Microsoft Entra ID authorization for AKS; workload identity overview; OIDC issuer; block pod access to IMDS; Microsoft Entra pod-managed identity; control kubeconfig access; supported logs for managedClusters; AKSAudit and AKSAuditAdmin tables; Azure permissions for Containers; Azure CLI reference for az aks and the aks-preview extension. Checked October 2026.