An attacker with push rights, the registry admin password or a repository token pushes a modified image over a trusted tag, or deletes the clean digest so the next deployment pulls theirs. Clusters and apps that pull by tag then run the attacker's code with the workload's identity and network access. Lock the repository and copy the bad image as evidence first, then cut off the credentials that pushed it.
Look here
Log
Search for
ContainerRegistryRepositoryEvents
Pushes, untags and deletes, by identity and address. Needs a diagnostic setting on the registry: ContainerRegistryRepositoryEvents | where OperationName contains "Push" or OperationName contains "Untag" or OperationName contains "Delete" | project TimeGenerated, OperationName, Repository, Tag, Digest, Identity, CallerIpAddress
ContainerRegistryLoginEvents
Who authenticated to the registry and from where: ContainerRegistryLoginEvents | summarize count() by Identity, CallerIpAddress, UserAgent, ResultDescription
Pulls of the bad digest
Every identity that pulled the bad digest. Map each identity to a cluster or app: ContainerRegistryRepositoryEvents | where Digest == "<digest>" and OperationName contains "Pull" | summarize first=min(TimeGenerated), last=max(TimeGenerated) by Identity, CallerIpAddress, UserAgent
AKS workloads
Pods running the digest: kubectl get pods --all-namespaces -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.status.containerStatuses[*].imageID}{"\n"}{end}' | grep <digest>
AzureActivity
Credential, token and import changes on the registry, under Microsoft.ContainerRegistry/registries: write, listCredentials/action, regenerateCredential/action, tokens/write, scopeMaps/write, generateCredentials/action and importImage/action. Role assignments at registry scope log as: Microsoft.Authorization/roleAssignments/write
Admin user
Whether the registry admin user is on: az acr show --name <registry> --query adminUserEnabled
Tokens
Repository tokens you did not create: az acr token list --registry <registry> -o table
Content trust
Whether Docker Content Trust is still on: az acr config content-trust show --registry <registry>
Defender for Containers
Vulnerability findings for the digest. New pushes are scanned within a few hours, and images pushed or pulled in the last 30 days are rescanned daily
Contain
#
Item
1
Lock the repository so its images cannot be updated or deleted: az acr repository update --name <registry> --repository <repo> --write-enabled false
2
Copy the bad image to an evidence registry by digest: az acr import --name <evidence-registry> --source <registry>.azurecr.io/<repo>@<digest> --image case-<id>/<repo>:evidence
3
Save the repository's manifest metadata with the evidence: az acr manifest list-metadata --registry <registry> --name <repo>
4
Block new pulls of the bad digest: az acr repository update --name <registry> --image <repo>@<digest> --read-enabled false
5
Regenerate the first admin password: az acr credential renew --name <registry> --password-name password
6
Regenerate the second admin password: az acr credential renew --name <registry> --password-name password2
7
Turn the admin user off: az acr update --name <registry> --admin-enabled false
8
Disable tokens the attacker used or created, and read each token's scope map with az acr scope-map show: az acr token update --name <token> --registry <registry> --status disabled
9
List role assignments on the registry: az role assignment list --scope <registry-id>
10
Remove push rights you did not grant: az role assignment delete --ids <assignment-id>
11
Delete attacker tokens destructive, permanently invalidates their passwords: az acr token delete --name <token> --registry <registry> --yes
Eradicate and recover
#
Item
1
Rebuild the image from reviewed source, push it, and deploy by digest. Check the pipeline first with the DevOps pipeline playbook
2
Replace every pod and app that ran the bad digest, and treat their identities as compromised with the AKS and managed identity playbooks
3
Delete the bad manifest after evidence is saved destructive: az acr repository delete --name <registry> --image <repo>@<digest> --yes
4
Sign images with Notation and keys in Key Vault, and verify signatures on AKS with Ratify and Azure Policy
5
Disable Docker Content Trust before you move to Notation signing: az acr config content-trust update --registry <registry> --status disabled
6
Enable soft delete, which is in preview. A registry cannot have both soft delete and a retention policy: az acr config soft-delete update --registry <registry> --days 30 --status enabled
7
Send both registry log categories to the workspace on every registry, and enable Defender for Containers
Watch out
The Activity Log records no push, pull or delete, and the registry keeps no resource logs until you create a diagnostic setting. Purge events appear only when a retention policy is set.
A resource lock from az lock protects the registry resource and leaves repository content open to change. Tag and manifest attributes are separate, so deleteEnabled=false on a tag leaves its manifest deletable.
Docker Content Trust retires on March 31, 2028, and the current CLI accepts only --status disabled. Where it is on, it blocks nothing for clients without it, and tokens with repository-scoped permissions cannot push or pull signed images.
Defender for Cloud pulls images to scan them under an alphanumeric ID, so exclude that ID when you list who pulled a digest. Regenerated passwords take about 60 seconds to replicate.
Microsoft Learn: lock a container image, monitor Container Registry and its data reference, registry log tables, registry authentication, tokens and scope maps, Docker Content Trust and the move to Notary Project, soft delete policy, import images, Microsoft.ContainerRegistry operations, Azure CLI reference for az acr. Checked October 2026. Scan images with Defender for Cloud and vulnerability assessment for Azure: checked September 2026.