How the attack works
Azure Container Registry accepts two kinds of credentials that are not Microsoft Entra identities. Every registry has an admin user account. Microsoft documents that it is disabled by default, has full permissions to the registry and has two passwords that can be regenerated, and that everyone who uses it appears as one user with push and pull access. The second kind is the token: Microsoft describes tokens and scope maps as a way to manage repository permissions without Microsoft Entra, where a token together with a generated password lets its holder authenticate, limited to the actions of the scope map it is associated with. Some system-defined scope maps cover all repositories of the registry.
An attacker with a role on the registry resource collects or creates such a credential through Azure Resource Manager. Microsoft.ContainerRegistry/registries/listCredentials/action returns the admin user name and passwords, and regenerateCredential/action replaces one of them. tokens/write and scopeMaps/write create a token and decide what it may do, and generateCredentials/action generates its password. With push access the attacker replaces an image that a cluster, a container app or a pipeline pulls later, so that the attacker's code runs with the identity of that workload. The credential keeps working after the attacker's Azure access ends. Each of these operations is recorded in the Azure Activity log with its caller. Pushes and pulls made with the credential are not: they are in the resource logs of the registry, where a diagnostic setting collects them.
What an attacker needs
- A role with the credential actions on the registry. Owner and Contributor include them, and the built-in role Container Registry Contributor and Data Access Configuration Administrator lists
listCredentials,generateCredentialsandtokens/write. The reader role Container Registry Configuration Reader and Data Access Configuration Reader also listslistCredentials. - For the admin credentials: a registry whose admin user is enabled, or the right to update the registry and enable it.
- Network access to the registry to use the credential.
Impact
Push and pull access to the images in the registry with a password that no Conditional Access policy or sign-in log covers. Pulling exposes the software and any secrets baked into images. Pushing lets the attacker change what runs: a workload that pulls a replaced image executes the attacker's code with its own managed identity or service account. The admin passwords and token passwords stay valid until they are regenerated, disabled or expired.
Detection rules
Container Registry Admin Credentials Listed or Regenerated
Detects a successful listing of the login credentials of an Azure Container Registry (Microsoft.ContainerRegistry/registries/listCredentials/action) or the regeneration of one of them (regenerateCredential/action). The credentials belong to the admin user of the registry, a single account with push and pull access to every repository that works without a Microsoft Entra identity. Regeneration returns a new password and cuts off everyone who used the old one. Deployment tools that rely on the admin user read these values as well, so the rule is a starting point for a baseline of expected callers for each registry and not an alert on its own. The rule assumes that each listing is written to the Activity log like other action operations.
title: Container Registry Admin Credentials Listed or Regenerated
id: cd3a60b9-5381-4adb-9c56-104dde9056ce
status: experimental
description: >-
Detects a successful listing of the login credentials of an Azure
Container Registry
(Microsoft.ContainerRegistry/registries/listCredentials/action) or the
regeneration of one of them (regenerateCredential/action). The credentials
belong to the admin user of the registry, a single account with push and
pull access to every repository that works without a Microsoft Entra
identity. Regeneration returns a new password and cuts off everyone who
used the old one. Deployment tools that rely on the admin user read these
values as well, so the rule is a starting point for a baseline of expected
callers for each registry and not an alert on its own. The rule assumes
that each listing is written to the Activity log like other action
operations.
references:
- https://attack.mitre.org/techniques/T1552/
- https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/containers
- https://learn.microsoft.com/en-us/azure/azure-monitor/fundamentals/activity-log-schema
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1552
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue:
- MICROSOFT.CONTAINERREGISTRY/REGISTRIES/LISTCREDENTIALS/ACTION
- MICROSOFT.CONTAINERREGISTRY/REGISTRIES/REGENERATECREDENTIAL/ACTION
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Deployments to services that pull with the admin user, and administrators who open the access keys of a registry. Exclude their identities in a filter_ selection by Caller once confirmed, per registry where possible.
- Planned rotation of the admin passwords.
level: low
False positives
- Deployments to services that pull with the admin user, and administrators who open the access keys of a registry. Exclude their identities in a filter_ selection by Caller once confirmed, per registry where possible.
- Planned rotation of the admin passwords.
Container Registry Token or Scope Map Written or Token Password Generated
Detects a successful create or update of a token or of a scope map in an Azure Container Registry, or the generation of a password for a token (Microsoft.ContainerRegistry/registries/tokens/write, scopeMaps/write and generateCredentials/action). A token with its generated password is a credential of the registry that works without a Microsoft Entra identity, for the repositories and actions of its scope map, until the password expires or the token is disabled. Creating one, widening the scope map of an existing one or generating a new password gives lasting access to the images. The event does not say which actions the scope map grants, so read the token and its scope map.
title: Container Registry Token or Scope Map Written or Token Password Generated
id: 495dbbd7-9f36-49b4-b906-37e3bbb26777
status: experimental
description: >-
Detects a successful create or update of a token or of a scope map in an
Azure Container Registry, or the generation of a password for a token
(Microsoft.ContainerRegistry/registries/tokens/write, scopeMaps/write and
generateCredentials/action). A token with its generated password is a
credential of the registry that works without a Microsoft Entra identity,
for the repositories and actions of its scope map, until the password
expires or the token is disabled. Creating one, widening the scope map of
an existing one or generating a new password gives lasting access to the
images. The event does not say which actions the scope map grants, so read
the token and its scope map.
references:
- https://attack.mitre.org/techniques/T1098/001/
- https://learn.microsoft.com/en-us/azure/container-registry/container-registry-token-based-repository-permissions
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/containers
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.t1098.001
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue:
- MICROSOFT.CONTAINERREGISTRY/REGISTRIES/TOKENS/WRITE
- MICROSOFT.CONTAINERREGISTRY/REGISTRIES/SCOPEMAPS/WRITE
- MICROSOFT.CONTAINERREGISTRY/REGISTRIES/GENERATECREDENTIALS/ACTION
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Teams that issue repository-scoped tokens to devices, partners or build systems that cannot use Microsoft Entra ID, and the planned rotation of token passwords. Match each event to a request and check the scope map and the expiry.
level: medium
False positives
- Teams that issue repository-scoped tokens to devices, partners or build systems that cannot use Microsoft Entra ID, and the planned rotation of token passwords. Match each event to a request and check the scope map and the expiry.
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.
Registry updated and its admin credentials listed by the same caller shortly after
The admin user is disabled by default, so on a well-managed registry there is nothing to list. An attacker with write access first updates the registry to enable the admin user and then lists its credentials. A write to the registry followed by the listing by the same caller is that preparation and collection in order.
- In the Azure Activity log, the registry is updated with status Success:
MICROSOFT.CONTAINERREGISTRY/REGISTRIES/WRITE. Keep theCallerand the resource ID of the registry. - Within 60 minutes the same
CallerrunsMICROSOFT.CONTAINERREGISTRY/REGISTRIES/LISTCREDENTIALS/ACTIONon the same registry with status Success. - Read the admin user setting of the registry, because the write event does not say which property changed.
EventsMICROSOFT.CONTAINERREGISTRY/REGISTRIES/WRITEMICROSOFT.CONTAINERREGISTRY/REGISTRIES/LISTCREDENTIALS/ACTION
LimitsA deployment that creates a registry with the admin user enabled and reads the credentials in the same run 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 registry, and whether this identity reads registry credentials routinely. Some deployment tools do.
- Check whether the admin user of the registry is enabled, and whether it was enabled shortly before the listing by an update of the registry.
- For a token, read its scope map, its status and the expiry of its passwords, and find out who asked for it.
- Review the registry's resource logs, if they are collected, for logins and pushes with the admin user or the token after the event, and note which repositories and tags were pushed.
- List the workloads that pull from the affected repositories.
Response
Once the attack is confirmed:
- Regenerate both admin passwords, or disable the admin user if nothing legitimate depends on it. Disable or delete the tokens you cannot account for.
- Contain the caller. Revoke its sessions, rotate its credentials and remove its role on the registry until the event is explained.
- Compare the images and tags that were pushed after the event with the expected digests from your build pipeline, and remove or replace the ones that do not match.
- Redeploy the workloads that pulled an unverified image, and review what their managed identities and service accounts did while it ran.
- Rotate secrets that were stored in images the attacker could pull.
Mitigation
- Keep the admin user disabled, which is the default, and let people and workloads authenticate with Microsoft Entra identities and managed identities.
- Enforce the disabled admin user with Azure Policy, so that it cannot be switched on unnoticed.
- Limit Owner, Contributor and the registry contributor and configuration roles on registries, and remember that one reader role includes the credential listing.
- Where tokens are needed, give them a scope map limited to the repositories and actions required and set an expiry date on every token password.
- Deploy images by digest or from locked repositories for sensitive workloads, and create a diagnostic setting that collects the registry's login and repository events.
Frequently asked questions
Does the Activity log show pushes and pulls made with the listed credentials?
No. The Activity log records the Azure Resource Manager operations that list, regenerate or create credentials, with their caller. Logins, pushes and pulls go to the registry endpoint and are data-plane events. They appear in the resource logs of the registry, and only when a diagnostic setting collects them.
Why are registry tokens a persistence method?
A token is a credential of the registry and not a Microsoft Entra identity. Microsoft describes tokens as a way to manage repository permissions without Microsoft Entra. Its password works until it expires or the token is disabled, whatever happens to the Azure identity that created it. A token with a system-defined scope map can reach every repository.
Does disabling the attacker's account revoke the admin credentials?
No. The admin account belongs to the registry, and all users who authenticate with it appear as a single user. Its two passwords stay valid until they are regenerated or the admin user is disabled. Microsoft notes that changing or disabling the account ends registry access for everyone who uses its credentials, so plan the change with the teams that depend on it.
Is there a public incident report for this technique?
No public incident report describes this at the audit event level as far as this page's sources go. The page is based on Microsoft's documentation of the admin account, of tokens and scope maps and of the Resource Manager operations that return or create these credentials.