Join our Newsletter — 33% off our NHI Course
Home› Guides› Azure Container Registry Security Guide: Retire the Admin…
Guide Cloud Security

Azure Container Registry Security Guide: Retire the Admin User, Scope Every Pull

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 18 November 2026 15 min read
On this page

Azure Container Registry is only as safe as the machine identities that push and pull from it, and the admin user, unscoped tokens and anonymous pull are the three settings that most often turn a private registry into an open one. This guide covers the Azure-specific controls: how each authentication method behaves, how to replace the admin user, how to scope access per repository with tokens or ABAC roles, how to take the registry off the public internet with Private Link, and what to do about Docker Content Trust now that Microsoft has set its retirement dates.

It assumes you already know the general registry model of tags, digests, signing and scanning. For that vendor-neutral foundation, read the Container Registry Security Guide first. This page stays with the settings you change in Azure.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • The admin user is a single shared credential with full push and pull rights and no role-based control. It is disabled by default; keep it that way and treat any registry where it is on as a finding.
  • Managed identities are the right identity for Azure workloads that pull or push. Service principals are for systems outside Azure, ideally with federated credentials rather than client secrets.
  • Repository-scoped tokens are not Entra identities. Their passwords do not expire unless you set an expiry, so every token needs an owner, an expiry and a review date.
  • The ABAC permissions mode lets you scope Entra role assignments to repository names or prefixes. Switching to it stops honouring AcrPull, AcrPush and AcrDelete, so migrate deliberately.
  • Private endpoints and disabled public access are Premium tier features. Plan DNS for both the registry endpoint and each regional data endpoint before you switch public access off.
  • Anonymous pull overrides repository-level restrictions. If it is enabled, every repository in the registry is readable by anyone who can reach it.
  • Docker Content Trust can no longer be enabled on registries that have not used it from 31 May 2026 and is removed on 31 March 2028. Plan signing on the Notary Project path.

The six ways to authenticate to ACR

Microsoft documents six distinct authentication routes into a registry. They differ in whether they are Entra identities, whether Azure role assignments apply, and how long the credential lives. Knowing which one each client uses is the first inventory task.

MethodIntended useRole-based controlCredential lifetime facts
Individual Entra identity (az acr login)Interactive push and pull by developers and testersYesThe Entra token is valid for three hours
Entra service principalHeadless CI/CD and external servicesYesDefault password expiry is one year
Managed identityUnattended push from Azure CI/CD and pull by Azure servicesYesNo secret to hold; tokens issued by the platform
Admin userSome portal deployments to Container Instances or Container AppsNo, always full push and pullTwo passwords; regeneration takes about 60 seconds
Repository-scoped tokenScoped access for developers, systems or devicesNo, uses scope maps insteadTwo passwords that do not expire unless you set an expiry
Entra ABAC repository permissionsEntra identities scoped to repositoriesAttribute-based conditions on role assignmentsInherits the identity's own lifetime

The pattern that matters for non-human identity work is simple: three of the six routes (admin user, tokens, and service principals using client secrets) rely on a static secret someone has to store, rotate and eventually revoke. The other routes rely on platform-issued, short-lived tokens. Every registry hardening programme should move clients from the first group to the second.

Retiring the admin user

The admin user is the classic non-human identity anti-pattern in a single setting. Microsoft's documentation describes it as one account per registry, not recommended for multiple users, with full pull and push rights that role assignments cannot narrow. Everyone who uses it appears as the same user in the logs, and changing or disabling it cuts off every client at once. That last point is why it survives: teams know that turning it off will break something, but not what.

Because the account has two passwords, it can be rotated without downtime, and that same feature means a leaked password often stays valid because the rotation only ever touches the other one. If you find the admin user enabled, work through it in this order.

  1. Find the consumers. Search pipeline variables, Kubernetes image pull secrets, Container Instances and Container Apps definitions, and secret stores for the registry login server name together with the registry name as username. Check the registry's resource logs for authentication events using the admin identity.
  2. Give each consumer its own identity. Azure workloads get a managed identity with a pull role. External pipelines get a service principal with a federated credential, or a scoped token if Entra is not an option.
  3. Regenerate both passwords once consumers have moved, so any copy you did not find stops working, then watch for authentication failures.
  4. Disable the admin user with az acr update -n <acrName> --admin-enabled false and keep it disabled with an Azure Policy assignment. The Azure Policy and Management Groups Guide covers how to apply that at management group scope.

Where a portal deployment flow still asks for the admin user, deploy through infrastructure as code with a managed identity instead of accepting the portal default. The exception list for the admin user should be empty, or short, owned and dated.

Managed identities and service principals for pipelines and runtimes

For anything running in Azure, a managed identity removes the stored secret entirely. A Kubernetes cluster, a Container App or an App Service pulls using an identity the platform issues tokens for, and you grant that identity a pull role on the registry or on specific repositories. User-assigned identities are easier to reason about across many resources; system-assigned identities disappear with their resource, which helps offboarding. The Azure Managed Identities Security Guide covers the trade-offs and the over-privilege checks.

Service principals are for clients outside Azure. Microsoft notes that a service principal's password expires after one year by default, which is long for a credential that sits in a CI system. Two improvements apply:

  • Replace the client secret with a federated credential so the pipeline exchanges its own OIDC token for an Entra token. The How to federate GitHub Actions to Azure walkthrough shows the pattern, and the same approach works for other CI systems.
  • Use one service principal per pipeline or per team, never a shared one. Microsoft explicitly supports assigning several service principals to a registry, each with different roles, so separate push identities from pull identities.

A push identity is far more sensitive than a pull identity. Anyone holding push rights can replace an image tag that production trusts, which maps to ATT&CK T1525 Implant Internal Image. Keep push rights on build identities only, and keep the number of those identities small enough to list from memory.

Scoping access: tokens and scope maps

Repository-scoped tokens give per-repository control without Entra. A token is a username with generated passwords, and each token links to exactly one scope map. A scope map lists repositories and the actions allowed on each: content/read to pull, content/write to push, content/delete, metadata/read to list tags and manifests, and metadata/write to change metadata or untag. Tokens work in every service tier.

The properties that create risk are clear from Microsoft's documentation:

  • Token passwords do not expire unless you set an expiration date. Always generate them with an expiry, for example az acr token credential generate --name MyToken --registry myregistry --expiration-in-days 30 --password1.
  • Three system scope maps apply to every repository: _repositories_admin, _repositories_pull and _repositories_push. A token linked to one of them is a registry-wide credential. Reserve them for break-glass use, if at all.
  • Wildcards are additive and only allowed as a trailing /*. A scope map entry of * grants registry-wide access, which is the same as using a system scope map.
  • Changes to a scope map apply immediately to every token that uses it. One edit can widen many credentials at once, so review scope map changes the way you review role assignments.
  • Passwords cannot be retrieved after generation. Store them straight into a secret manager such as Key Vault; the Azure Key Vault Security Guide covers access to that store.

Use az acr token list and az acr scope-map list as the start of a quarterly review. For each token record the owner, the consuming system, the scope map, and the password expiry. A token with no named consumer should be disabled with az acr token update --status disabled, watched for failed logins, and then deleted.

Tokens suit devices, partner systems and edge locations where Entra identities are impractical. For anything that can use Entra, ABAC permissions give the same scoping without a stored password.

Scoping access: Entra ABAC repository permissions

A registry runs in one of two role assignment permissions modes. The legacy mode, RBAC Registry Permissions, honours AcrPull, AcrPush and AcrDelete at registry scope. The newer mode, RBAC Registry + ABAC Repository Permissions, lets you attach conditions on the repository name to role assignments. Microsoft says the ABAC mode will become the default and recommends migrating.

In ABAC mode the data-plane roles are Container Registry Repository Reader, Writer and Contributor, plus Container Registry Repository Catalog Lister, which always applies registry-wide because it does not support conditions. Conditions use the request attribute for repository name with exact match or prefix match. Two details catch people out:

  • An ABAC-enabled role assigned without a condition applies to every repository. Unconditioned assignments are effectively registry-wide.
  • Prefix conditions need the trailing slash. A prefix of backend also matches backend-infra/k8s; backend/ does not.

Switching mode has side effects that break automation if you are not ready. AcrPull, AcrPush and AcrDelete stop being honoured. Owner, Contributor and Reader grant control-plane rights only, not image access. ACR Tasks and quick builds lose default access to the source registry and need an identity attached with --source-acr-auth-id. Credentials issued under the old mode are invalidated, and clients receive HTTP 401 until they obtain new ones; Microsoft notes that restarting pods does not refresh them on AKS.

Microsoft's documented migration sequence is: assign equivalent ABAC roles without conditions to every identity holding a legacy role, switch mode, refresh credentials on all clients, verify, remove legacy assignments, then validate. Once the switch is stable, add conditions to narrow each assignment. Doing it in that order separates the outage risk from the least-privilege work. Run it in a preproduction registry first.

By default a registry has a public endpoint. Private Link gives the registry private IP addresses in your virtual network so traffic stays on the virtual network and the Microsoft backbone. Private endpoints are a Premium tier feature, with up to 200 private endpoints per registry. Once endpoints work, disable public access with az acr update --name <registry> --public-network-enabled false.

DNS is where most rollouts stall. You need a private DNS zone named exactly privatelink.azurecr.io, records for the registry endpoint and for each regional data endpoint (for example myregistry.<region>.data.azurecr.io), and a conditional forwarder to Azure DNS at 168.63.129.16 for custom or on-premises resolvers. Each geo-replica adds a data endpoint that needs its own private IP and record. Microsoft recommends at least a /27 subnet for private endpoints on geo-replicated registries, because a replication that runs out of IPs fails and rolls back without naming the subnet.

Plan for the documented limitations before you disable public access:

  • az acr build fails without public access unless you use a dedicated agent pool.
  • Azure DevOps-managed agents do not support private endpoints; use self-hosted agents with line of sight to the endpoint.
  • Trusted services such as Defender for Cloud need the network bypass setting.
  • Private Link and service endpoint rules cannot be combined; remove old network rules.
  • Private endpoint connections from principals with the right Azure permissions are approved automatically. Require manual approval if you want a review step.

Use az acr check-health --vnet to verify DNS from inside the network, and confirm that dig on the registry name returns a private address. The network design itself, including hub and spoke DNS, is covered in the Azure Virtual Network Security Guide.

Anonymous pull: the setting that overrides everything

Anonymous pull is available on Standard and Premium registries and is disabled by default. When enabled it makes all registry content publicly readable, applies to every repository, and, as Microsoft warns, overrides both token-based and Entra-based repository permissions for pull. A team that carefully scoped tokens per repository loses that work the moment someone enables anonymous pull to make a demo easier.

Check it with az acr show -n <registry> --query anonymousPullEnabled across every subscription. If a public image genuinely needs to be published, put it in a dedicated registry that holds nothing else. Never enable anonymous pull on a registry that holds internal images, and never treat an internal image as secret-free; build-time secrets in layers are a common leak path covered in the Container Registry Pull Credentials Guide.

Content trust, signing and the Notary Project path

Docker Content Trust in ACR is a Premium tier feature with its own role model. Pushing signed images needs the AcrImageSigner role in addition to a push role; pulling signed images needs only a pull role. The admin account cannot be granted signing permission, and repository-scoped tokens do not support push and pull of signed images.

Microsoft has set two dates. From 31 May 2026, Docker Content Trust can no longer be enabled on new registries or on registries that have not enabled it before. On 31 March 2028 it is removed entirely. Microsoft points customers to its guidance on transitioning from Docker Content Trust to the Notary Project, which stores signatures as registry artifacts. Microsoft also notes that acr import does not preserve Docker Content Trust signatures.

For registries still using content trust, the practical steps are: inventory who holds AcrImageSigner, move signing onto build identities rather than people, plan Notary Project signing with keys held in Key Vault, and add signature verification at deploy time in the cluster. Signing is only useful if something refuses unsigned images, so the admission policy is the control that matters, not the signature alone.

Logging and detection for registry identities

Route the registry's resource logs (login events and repository events) to a Log Analytics workspace, alongside the Activity Log for control-plane changes. The workspace side of that design is covered in the Azure Monitor and Log Analytics Security Guide. Detections worth building first, as NHI Mgmt Group recommendations:

  • Any successful login by the admin user, or the admin user being enabled.
  • Anonymous pull being enabled, or public network access being re-enabled.
  • New tokens, new token passwords without expiry, and scope map changes that add a wildcard or a system scope map.
  • Pushes to production repositories by any identity other than the known build identities.
  • Pulls from unfamiliar source IP ranges by service principals or tokens, which map to ATT&CK T1078.004 Valid Accounts: Cloud Accounts.
  • A burst of tag deletions or untag operations, which can signal cleanup after an image swap.

Common failure patterns

  • Admin user enabled for one deployment years ago. The password sits in a dozen pipeline variables and nobody knows which are live.
  • Tokens linked to system scope maps. A "pull token for a device" turns out to be _repositories_pull across every repository.
  • Token passwords with no expiry. The default behaviour, so it is the norm unless someone overrode it.
  • Shared push identity. One service principal pushes for every team, so an image swap cannot be attributed.
  • ABAC switch without credential refresh. Clusters fail with 401 errors for hours and the team rolls back to the legacy mode.
  • Unconditioned ABAC roles. The registry is in ABAC mode but every assignment still applies to all repositories.
  • Private endpoint with public access still on. The private path exists, but so does the public one.
  • Anonymous pull on a mixed registry. One public image justifies exposing every internal one.

Practitioner checklist

  • Inventory every registry and record admin user state, anonymous pull state, public network access, SKU and permissions mode.
  • Disable the admin user everywhere and enforce it with Azure Policy; regenerate both passwords before disabling.
  • Move Azure workloads to managed identities and external pipelines to federated service principals.
  • Separate push and pull identities, and keep push rights on build identities only.
  • Give every token an owner, a non-system scope map and a password expiry; review quarterly.
  • Plan and test the ABAC migration in preproduction, then add repository conditions to every assignment.
  • On Premium registries, deploy private endpoints with correct DNS for data endpoints and disable public access.
  • Keep anonymous pull off on any registry that holds internal images.
  • Plan the move from Docker Content Trust to Notary Project signing before 31 March 2028, with deploy-time verification.
  • Send registry resource logs to Log Analytics and alert on admin logins, scope map changes and unexpected pushes.

Standards and references

Related NHI Mgmt Group resources: Container Registry Security Guide · Azure Managed Identities Security Guide · AKS Workload Identity Guide · Azure RBAC and Service Principals Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.