How the attack works
Azure Kubernetes Service (AKS) hands out kubeconfig files through listing actions of Azure Resource Manager. Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action returns the kubeconfig of the clusterAdmin role and listClusterUserCredential/action returns the one of the clusterUser role. Microsoft's own example of an admin kubeconfig holds a client certificate, its private key and a token, so it is a credential in a file and not a pointer to a sign-in. Microsoft documents that local accounts are enabled by default and that, even when Microsoft Entra integration is enabled, admin access "still exists as a non-auditable backdoor option". On a cluster that uses Microsoft Entra ID the user kubeconfig is empty and prompts a login, but on a cluster that does not, Microsoft states that the clusterUser role has the same effect as the clusterAdmin role.
An attacker who holds an Azure role with the listing action on the cluster uses it to turn control-plane access into cluster administrator access. With the admin kubeconfig the attacker reads Kubernetes Secrets, starts workloads on any node and uses the identities that workloads and nodes run with, and none of it depends on the attacker's Azure identity any more. The listing actions are action operations, so the Azure Activity log records each call with its caller. It does not record what is done with the kubeconfig afterwards: those requests go to the Kubernetes API server and appear only in the kube-audit resource logs of the cluster, where a diagnostic setting collects them.
What an attacker needs
- A role that includes the listing action on the cluster or on a scope above it. Microsoft documents that the Azure Kubernetes Service Cluster Admin Role allows
listClusterAdminCredential/action. The Azure Kubernetes Service Contributor Role, Contributor and Owner include it through wildcards. - A cluster with local accounts enabled, which is the default. With local accounts disabled, Microsoft documents that the request for the admin credential fails.
- Network access to the API server of the cluster to use the kubeconfig. For a private cluster that means a position inside the network.
Impact
Full control of the cluster with the built-in administrator identity: every Secret in every namespace, every workload, the nodes, and the managed identities and service accounts that workloads use to reach Azure and other systems. The credential keeps working after the attacker's Azure access is removed, until the cluster certificates are rotated.
Detection rules
AKS Cluster Admin Credential Listed
Detects a successful listing of the clusterAdmin credential of an Azure Kubernetes Service cluster through Azure Resource Manager (Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action). The call returns the admin kubeconfig, which holds a certificate of a local account and gives full control of the cluster with no Microsoft Entra sign-in. The rule also matches the older access profile operation (accessProfiles/listCredential/action), which Microsoft marks for deprecation and which returns the credential of the role named in the request, admin or user. The Activity log records the listing and its caller, not what is done with the kubeconfig afterwards.
title: AKS Cluster Admin Credential Listed
id: f6272abb-9a50-4225-b8c6-33395bba648d
status: experimental
description: >-
Detects a successful listing of the clusterAdmin credential of an Azure
Kubernetes Service cluster through Azure Resource Manager
(Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action).
The call returns the admin kubeconfig, which holds a certificate of a local
account and gives full control of the cluster with no Microsoft Entra
sign-in. The rule also matches the older access profile operation
(accessProfiles/listCredential/action), which Microsoft marks for
deprecation and which returns the credential of the role named in the
request, admin or user. The Activity log records the listing and its caller,
not what is done with the kubeconfig afterwards.
references:
- https://attack.mitre.org/techniques/T1552/
- https://learn.microsoft.com/en-us/azure/aks/control-kubeconfig-access
- https://learn.microsoft.com/en-us/azure/aks/manage-local-accounts-managed-azure-ad
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/containers
- https://learn.microsoft.com/en-us/rest/api/aks/managed-clusters/get-access-profile
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1552
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue:
- MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/LISTCLUSTERADMINCREDENTIAL/ACTION
- MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/ACCESSPROFILES/LISTCREDENTIAL/ACTION
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Deployment pipelines and platform engineers that fetch the admin kubeconfig to deploy into a cluster or to repair it. Exclude their identities in a filter_ selection by Caller once confirmed, per cluster where possible.
- Clusters without Microsoft Entra integration, where the admin credential is the normal way in. Baseline the callers for each cluster.
level: medium
False positives
- Deployment pipelines and platform engineers that fetch the admin kubeconfig to deploy into a cluster or to repair it. Exclude their identities in a filter_ selection by Caller once confirmed, per cluster where possible.
- Clusters without Microsoft Entra integration, where the admin credential is the normal way in. Baseline the callers for each cluster.
Kubernetes Cluster User or Monitoring Credential Listed
Detects a successful listing of the clusterUser or clusterMonitoringUser credential of an Azure Kubernetes Service cluster, of the user credentials of an Azure Kubernetes Fleet Manager hub, or of the clusterUser credential of an Azure Arc-enabled Kubernetes cluster, through Azure Resource Manager. On a cluster that uses Microsoft Entra ID the user kubeconfig is empty and prompts a login, so the event is routine. Microsoft states that on a cluster that does not use Microsoft Entra ID the clusterUser role has the same effect as the clusterAdmin role, so there the listing returns an administrator credential. Use the rule for a baseline of expected callers for each cluster and not as an alert on its own.
title: Kubernetes Cluster User or Monitoring Credential Listed
id: 4e2b0d30-295c-4905-987d-b0e09452aceb
status: experimental
description: >-
Detects a successful listing of the clusterUser or clusterMonitoringUser
credential of an Azure Kubernetes Service cluster, of the user credentials
of an Azure Kubernetes Fleet Manager hub, or of the clusterUser credential
of an Azure Arc-enabled Kubernetes cluster, through Azure Resource Manager.
On a cluster that uses Microsoft Entra ID the user kubeconfig is empty and
prompts a login, so the event is routine. Microsoft states that on a cluster
that does not use Microsoft Entra ID the clusterUser role has the same
effect as the clusterAdmin role, so there the listing returns an
administrator credential. Use the rule for a baseline of expected callers
for each cluster and not as an alert on its own.
references:
- https://attack.mitre.org/techniques/T1552/
- https://learn.microsoft.com/en-us/azure/aks/control-kubeconfig-access
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/containers
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/hybrid-multicloud
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1552
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue:
- MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/LISTCLUSTERUSERCREDENTIAL/ACTION
- MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/LISTCLUSTERMONITORINGUSERCREDENTIAL/ACTION
- MICROSOFT.CONTAINERSERVICE/FLEETS/LISTCREDENTIALS/ACTION
- MICROSOFT.KUBERNETES/CONNECTEDCLUSTERS/LISTCLUSTERUSERCREDENTIAL/ACTION
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Every person, tool and pipeline that connects to a cluster lists the user credential first. Exclude known identities in a filter_ selection by Caller, or limit the rule to the clusters that do not use Microsoft Entra integration.
level: low
False positives
- Every person, tool and pipeline that connects to a cluster lists the user credential first. Exclude known identities in a filter_ selection by Caller, or limit the rule to the clusters that do not use Microsoft Entra integration.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Cluster updated and its admin credential listed by the same caller shortly after
On a cluster with local accounts disabled the admin credential cannot be listed, so an attacker with write access first updates the cluster to allow local accounts again and then lists the credential. A write to the cluster followed by the admin listing by the same caller is that preparation and collection in order.
- In the Azure Activity log, the cluster is updated with status Success:
MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/WRITE. Keep theCallerand the resource ID of the cluster. - Within 60 minutes the same
CallerrunsMICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/LISTCLUSTERADMINCREDENTIAL/ACTIONon the same cluster with status Success. - Read the current
disableLocalAccountsproperty of the cluster, because the write event does not say which property changed.
EventsMICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/WRITEMICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/LISTCLUSTERADMINCREDENTIAL/ACTION
LimitsA pipeline that creates or upgrades a cluster and then fetches the admin credential to deploy into it looks the same, so pipeline identities have to be excluded by name. The 60 minutes are a starting point. An attacker who uses two identities for the two steps does not match.
Triage
- Identify the Caller, the caller's IP address and the cluster, and whether this identity fetches the admin credential routinely. Some deployment pipelines do.
- Check whether the cluster uses Microsoft Entra integration and whether local accounts are enabled. On a cluster without Microsoft Entra ID the user credential is as powerful as the admin credential.
- Review how the caller holds its role, and whether the role was assigned shortly before the listing.
- Look in the
kube-auditlogs of the cluster, if they are collected, for requests by the cluster admin user after the listing, especially reads of Secrets and new workloads or role bindings. - Look for other credential listings by the same caller in the same period, such as storage account keys or registry credentials.
Response
Once the attack is confirmed:
- Rotate the cluster certificates, which Microsoft documents as the way to revoke certificates that somebody may have obtained, and plan for the interruption this causes.
- Disable local accounts on the cluster if Microsoft Entra integration is in place, so that a new admin credential cannot be listed.
- Contain the caller. Revoke its sessions, rotate its credentials and remove the role that carries the listing action until the listing is explained.
- Review the cluster for what an administrator could have left behind, such as new workloads, role bindings, service accounts and service account tokens, and remove what cannot be explained.
- Rotate the secrets stored in the cluster and review the activity of the managed identities and workload identities that pods in the cluster can use.
Mitigation
- Disable local accounts on clusters that use Microsoft Entra integration (
disableLocalAccounts), so that no static admin credential can be issued, and rotate the cluster certificates afterwards as Microsoft instructs. - Enforce that setting with Azure Policy, so that a cluster cannot be created with local accounts or switched back unnoticed.
- Give people the Azure Kubernetes Service Cluster User Role and Kubernetes permissions through Microsoft Entra groups, and keep the Cluster Admin Role, the Azure Kubernetes Service Contributor Role, Contributor and Owner on clusters to a few identities.
- Create a diagnostic setting on every cluster that collects the
kube-auditorkube-audit-admincategory, so that use of a credential can be traced. - Limit the API server to authorized IP ranges or use a private cluster, so that a listed kubeconfig cannot be used from anywhere.
Frequently asked questions
Does the Activity log show what was done with the kubeconfig?
No. The Activity log records the Azure Resource Manager call that returned the kubeconfig, with its caller. Requests made with the kubeconfig go to the Kubernetes API server of the cluster. They appear in the kube-audit resource logs, and only when a diagnostic setting on the cluster collects that category.
Why does Microsoft Entra integration not stop the admin credential?
The admin credential belongs to a local account of the cluster and does not pass through Microsoft Entra ID. Microsoft documents that local accounts are enabled by default and that admin access still exists as a non-auditable backdoor option when Microsoft Entra integration is enabled. It ends only when local accounts are disabled on the cluster.
Does removing the attacker's Azure role revoke a kubeconfig that was already listed?
No. The admin kubeconfig holds a certificate that the cluster accepts on its own. Microsoft documents that after local accounts are disabled the administrator must rotate the cluster certificates to revoke certificates that users may have had access to. Removing the role only prevents a new listing.
Why is the rule on the user credential only low?
Listing the user credential is what every person and pipeline does to connect to a cluster, and on a cluster with Microsoft Entra ID the file is empty and prompts a login. The event matters on clusters without Microsoft Entra integration, where Microsoft states that the user role has the same effect as the admin role. Use the rule for a baseline of callers per cluster.
References
- MITRE ATT&CK T1552: Unsecured Credentials
- Use Azure role-based access control to define access to the Kubernetes configuration file in AKS
- Manage local accounts with Microsoft Entra integration in AKS
- Azure permissions for Containers
- Azure permissions for Hybrid + multicloud
- Azure built-in roles for Containers
- AKS monitoring data reference
- Azure Activity Log event schema