Skip to main content

More Info:

Grant only the minimum permissions required for the AKS cluster service principal to read and pull images from Azure Container Registry, avoiding broad Owner or account administrator roles.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS AKS

Triage and Remediation

Remediation

Manual Steps

  1. Identify the AKS cluster’s identity and attached ACRs
    • Run on any machine with Azure CLI access:
    • Determine whether the cluster uses a system-assigned identity, user-assigned managed identity, or legacy service principal.
  2. List current role assignments on each ACR and identify over-privileged roles
    • For each registry (replace with actual names and resource groups):
    • Look for assignments of broad roles like Owner, Contributor, or subscription/resource-group–scoped roles to the AKS identity or to generic user/service principals that are not required for image pull.
  3. Verify that the AKS identity has only the minimum ACR role (AcrPull or AcrPull-equivalent)
    • From the output above, for the AKS identity principalId (or service principal appId), confirm that:
      • Scope is the ACR resource (not entire subscription or resource group) unless broader scope is intentionally required.
      • Role is AcrPull (or AcrImageSigner/AcrPush only where there is a clear business need).
    • If AKS authenticates using image pull secrets instead of managed identity, identify the underlying principal:
    • Review who manages the credentials used in those secrets and what roles they have on the ACR (via az role assignment list as above).
  4. Remove over-privileged role assignments and reassign least-privilege roles
    • For any AKS identity or service principal that has Owner, Contributor, or other broad roles on the ACR and does not require them, remove the assignment:
    • Then assign the minimal required role (AcrPull) scoped to the ACR:
    • If needed, configure or update the AKS–ACR integration so AKS uses this principal:
  5. Optionally migrate from legacy service principal / broad roles to dedicated identity for ACR access
    • If the AKS cluster or image-pulling process currently uses a generic Owner/Contributor principal, create or select a dedicated identity with only ACR permissions:
    • Integrate this identity into AKS either as the cluster managed identity or via pull secrets, following your chosen authentication pattern.
  6. Verify least-privilege configuration and cluster image pull functionality
    • Re-list ACR role assignments and confirm only minimal roles remain for AKS-related principals:
    • Validate that pods can still pull images from ACR:
    • If the test pod starts successfully and the role assignments show only scoped AcrPull (and any explicitly justified roles), the configuration meets the intent of the control.
kubectl cannot change Azure Container Registry role assignments or AKS–ACR integration, because these live in Azure RBAC and AKS configuration managed via the Azure portal, Azure CLI, or IaC. To address this finding, make the changes described in the Manual Steps section using those cloud provider tools.