More Info:
Restrict the AKS clusters access to Azure Container Registry to read-only (pull) so the cluster cannot push or modify images.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS AKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify how AKS pulls images from ACR
- On any machine with Azure CLI and access to the subscription, list the cluster and its node resource group:
- Determine whether you are using:
- Managed identity (system-assigned or user-assigned) attached to the AKS cluster, or
- A service principal, or
- ACR firewall + private endpoint only (no identity/RBAC link).
- On any machine with Azure CLI and access to the subscription, list the cluster and its node resource group:
-
Enumerate ACR instances and check role assignments
- List ACRs in the subscription:
- For each ACR, list role assignments relevant to AKS (replace
<ACR_NAME>): - In the output, look for assignments to:
- The AKS managed identity (object/principal ID from step 1), or
- The AKS service principal.
- Note roles such as
AcrPull(read-only) vs broader ones (AcrPush,Owner,Contributor,AcrImageSigner, custom roles that include write/delete actions).
- List ACRs in the subscription:
-
Decide required access and plan corrections
- For each identity used by AKS:
- If only image pulling is required, the desired role is AcrPull at the minimal required scope (ideally the specific ACR, not subscription or resource group).
- If broader roles are in use, confirm whether any workload or pipeline actually needs push/delete/sign operations from inside the cluster; if so, limit that to a separate identity not bound to the entire cluster where possible.
- For each identity used by AKS:
-
Restrict existing over-privileged role assignments
- For each over-privileged assignment (example:
AcrPush,Contributor,Ownerfor the AKS identity on ACR), remove it: - From the JSON, copy the
idof the specific assignment to remove, then: - If the cluster still needs pull access and has no
AcrPullassignment, add it:
- For each over-privileged assignment (example:
-
Review other access paths to ACR (optional but recommended)
- Check subscription- or resource-group-level assignments that might indirectly grant write access to ACR:
- If you find higher-scope roles that include ACR write/delete actions and are not strictly required, plan to replace them with more granular, read-only assignments where feasible.
- Check subscription- or resource-group-level assignments that might indirectly grant write access to ACR:
-
Verify effective read-only configuration
- For each ACR used by the cluster, confirm only
AcrPull(or other strictly read-only custom roles you have vetted) are assigned to the AKS identity at the ACR scope: - Independently verify that push/delete is no longer allowed from the cluster identity by attempting a test push using that identity’s context from a non-production environment, ensuring it fails while pulls still succeed.
- For each ACR used by the cluster, confirm only
Using kubectl
Using kubectl
kubectl cannot change Azure Container Registry permissions or the AKS-to-ACR integration; those settings are managed in Azure (portal/CLI/IaC) at the cloud provider/control plane level. Refer to the Manual Steps section for how to review and adjust AKS access to ACR to be read-only (pull).
Automation
Automation

