Azure Container Registry
Connect Azure Container Registry (ACR) to Safeguard. The roles and token permissions each credential needs, which credentials work, and step-by-step setup.
Availability
This integration is switched on per workspace. If you do not see the card under Integrations, ask your Safeguard contact.
What it does
The Azure Container Registry card connects Safeguard to the container images in an Azure Container Registry. Safeguard lists the registry's repositories and tags, and each image you select becomes a project that Safeguard scans for an SBOM and vulnerability findings. Scans are pinned to the image digest the tag points at when the scan starts, and the scan pulls the image with the credential you connect. Find the card under Integrations on the Project/Product tab.
Public vs private
| Public | Private | |
|---|---|---|
| What you enter | An Image URL, such as myregistry.azurecr.io/team/app:1.0 | The Login server and one of the credentials below |
| Credential needed | None. Anonymous pull must be turned on for the registry (Standard or Premium tier) | Admin user, repository-scoped token or service principal |
| What you can select | The images you add by URL | Every repository the credential can list, or the repositories you name |
Supported auth methods
| Method (dialog label) | Use it when | Notes |
|---|---|---|
| Service principal | Recommended for registries in Azure public cloud (*.azurecr.io) | A Microsoft Entra ID app registration with a client secret. Safeguard exchanges it for a registry token |
| Admin user or token, with a repository-scoped token | You want access to named repositories only | A token from Repository permissions > Tokens with its scope map. Tokens cannot list the registry, so you name the repositories |
| Admin user or token, with the admin user | Quick setup on a registry you control | The admin user has full push and pull rights to the whole registry; prefer the other two |
| Workload identity | Not available yet | Shown in the dialog as Coming later |
Permissions required
Safeguard only reads. It never pushes, deletes or untags images, and never changes registry settings, except the push webhook you add yourself (below).
Service principal
| Role on the registry | Required? | What Safeguard uses it for |
|---|---|---|
AcrPull (registries in RBAC Registry Permissions mode) | Required | Listing repositories and tags, reading manifests and pulling images for scans |
Container Registry Repository Reader (registries in RBAC Registry + ABAC Repository Permissions mode) | Required in that mode | Reading tags and manifests and pulling images |
Container Registry Repository Catalog Lister (ABAC mode) | Optional | Listing every repository. Without it, name the repositories in Repositories |
The token flow is Microsoft Entra client credentials for the scope https://containerregistry.azure.net/.default, then the registry's /oauth2/exchange and /oauth2/token endpoints. No Azure Resource Manager (control plane) role is used.
Least privilege: AcrPull on the one registry (or Container Registry Repository Reader, scoped with an ABAC condition to the repositories to scan).
Repository-scoped token
| Scope map action | Required? | What Safeguard uses it for |
|---|---|---|
content/read on each repository | Required | Reading manifests and pulling images |
metadata/read on each repository | Required | Listing tags |
Repository-scoped permissions cannot list the registry's catalog, so add each repository on its own line under Repositories. The token must be Enabled and its password not expired.
Admin user
| Setting | Required? | What it gives |
|---|---|---|
| Admin user enabled under Access keys | Required for this method | Username is the registry name; either password works. It grants push and pull to every repository, more than Safeguard needs |
Token types
| Credential type | Works? | Notes |
|---|---|---|
Service principal with AcrPull | Yes (recommended) | Paste the client secret's Value, not its Secret ID |
Repository-scoped token (content/read, metadata/read) | Yes | Name the repositories; it cannot list them |
| Admin user | Yes, not recommended | Registry-wide push and pull |
Token with a write scope map (content/write, content/delete, _repositories_push, _repositories_admin) | Works, not recommended | Safeguard never writes |
| Managed identity or workload identity federation | Not available yet | |
| Azure China or Azure Government registries with a service principal | No | The service principal method supports *.azurecr.io only |
Expiry: set a client secret or token password expiry of 90 days or less (Azure allows longer). Azure token passwords do not expire unless you set a date, so always set one.
What we never need: AcrPush, AcrDelete, Owner, Contributor, Container Registry Contributor and Data Access Configuration Administrator, or any role outside the registry.
Step-by-step setup
Create the credential in Azure
Service principal:
- In the Azure portal, open Microsoft Entra ID > App registrations > New registration, name it (for example
safeguard-acr) and register it. - Copy the Application (client) ID and Directory (tenant) ID from its overview.
- Under Certificates & secrets > Client secrets, add a secret with an expiry and copy its Value (shown once).
- Open your container registry, then Access control (IAM) > Add role assignment, choose AcrPull (or Container Registry Repository Reader) and assign it to the app.
Repository-scoped token:
- Open your container registry, then Repository permissions > Tokens > + Add.
- Under Scope map, choose Create new, add each repository with
content/readandmetadata/read, and create the token. - Open the token, select password1, set an expiration date and Generate. Copy the password; Azure does not show it again.
Or with the Azure CLI
# Service principal with AcrPull on one registry
ACR_ID=$(az acr show --name <registry> --query id --output tsv)
az ad sp create-for-rbac --name safeguard-acr --role AcrPull --scopes "$ACR_ID" --years 1
# prints appId (client ID), password (client secret) and tenant
# Or a repository-scoped token
az acr token create --name safeguard --registry <registry> \
--repository <team/app> content/read metadata/read
az acr token credential generate --name safeguard --registry <registry> \
--expiration-in-days 90 --password1
# Public tab only: allow anonymous pull (Standard or Premium tier)
az acr update --name <registry> --anonymous-pull-enabledConnect it in Safeguard
- Open Integrations and choose the Project/Product tab.
- Click Connect on the Azure Container Registry card.
- For public images, choose Public, enter a Name, paste an Image URL and click Add, then Next.
- For private images, choose Private, enter a Name and the Login server (for example
myregistry.azurecr.io), then pick the Authentication method:- Service principal: Tenant (directory) ID, Client (application) ID and Client Secret;
- Admin user or token: Username (the registry name or the token name) and Password, plus Repositories for a repository-scoped token.
- Click Verify Credentials. "Credentials verified." means the registry accepted them, with the number of repositories visible.
- Click Next, select repositories and tags, review, and choose a connect option (fast, progressive or deep scan).
Webhooks and triggers
Scan on push is optional. In the connection's Scan on push (optional) panel, Safeguard shows the Service URI (https://api.safeguard.sh/scm/api/v1/registry-webhooks/acr/<connection id>), the Header name X-Safeguard-Webhook-Token and its secret value, and an Azure CLI command:
az acr webhook create --registry <registry> --name safeguard<id> --actions push \
--uri "<Service URI>" --headers "X-Safeguard-Webhook-Token=<secret>" --scope "<repository>:*"The webhook's --scope decides which repositories and tags start a scan. Each push scans the pushed tag as the version <tag>-<first 12 characters of the digest>. Creating the webhook needs a role that can manage registry webhooks; Safeguard's own credential does not. Without a webhook, rescan on a schedule under Integrations > Scheduled.
What we read and store
- Read: repository names, tags and manifest digests, and the images you select for scanning.
- Stored: the connection's settings, the SBOM and findings of each scanned image with its digest, and the credential, which is encrypted at rest and never shown again after you save it.
- Not stored: image layers. The image is read for the scan and not kept.
- No customer data from this integration is sent to third-party LLMs.
Troubleshooting
| Message you see | Cause | Fix |
|---|---|---|
Enter an Azure Container Registry login server, such as myregistry.azurecr.io. | The login server is not an ACR address | Copy it from Container registries > your registry > Overview > Login server |
These credentials could not be verified. | Wrong secret or password, a disabled token, an expired password, or a missing role | Check the role assignment or the scope map, and paste the secret's Value |
This token can't list repositories. Add the repositories it can pull under Repositories. | A repository-scoped token was used | Add one repository per line under Repositories |
Add at least one repository to continue. | A repository-scoped token with an empty Repositories field | Name the repositories the token can pull |
This image could not be found, or the registry does not allow anonymous pull. | Public tab on a registry without anonymous pull, or a wrong image URL | Turn on anonymous pull, or use the Private tab |
Azure error AADSTS53003 | A Conditional Access policy blocks the service principal | Exclude the service principal from that policy |
| Connection fails although the credential is right | The registry allows only private endpoints, or its firewall blocks Safeguard | Allow public network access for Safeguard, or use a registry Safeguard can reach |
Rotation and disconnect
- Rotate: create a new client secret or token password, find the connection under Project Configurations on the Project/Product tab, choose Update, enter the new value, verify and save, then delete the old secret or password in Azure.
- Disconnect: choose Delete from the connection's menu under Project Configurations and confirm Delete configuration. Then remove the role assignment or delete the app registration or token, and delete the push webhook (
az acr webhook delete --registry <registry> --name <webhook>).
Vendor references
- Azure Container Registry Entra permissions and role assignments overview, checked 2026-10-16.
- Token-based repository permissions in Azure Container Registry, checked 2026-10-16.
- Enable anonymous pull access, checked 2026-10-16.
OCI Registry
Connect any registry that speaks the Open Container Initiative (OCI) distribution API to Safeguard. The access a username and token need, which credentials work, and step-by-step setup.
Oracle Container Registry (OCIR)
Connect Oracle Cloud Infrastructure Container Registry (OCIR) to Safeguard. The IAM policy each credential needs, which credentials work, and step-by-step setup.