Skip to content

Container Registry export policy should be disabled#

Security · Container Registry · Rule · 2025_09 · Important

Export policy on Azure container registry may allow artifact exfiltration.

Description#

Azure Container Registry (ACR) export policy allows copying container images and artifacts to other registries or locations. When the export policy is enabled, data can be moved out of the registry via acr import or acr transfer commands.

To improve security and prevent exfiltration, the export policy should be disabled from an already network restricted registry. An already network restricted registry is one that has publicNetworkAccess set to Disabled and is accessible only through private endpoints.

Disabling export of artifacts does not prevent authorized access to the registry within the virtual network to pull artifacts or perform other data-plane operations.

To audit registry use, configure diagnostic settings to monitor registry operations.

Recommendation#

Consider disabling public network access and the export policy status for private container registries.

Examples#

Configure with Bicep#

To deploy registries that pass this rule:

  • Set properties.policies.exportPolicy.status to disabled.
  • Set properties.publicNetworkAccess to Disabled to restrict access to private endpoints only.

For example:

Azure Bicep snippet
resource registry 'Microsoft.ContainerRegistry/registries@2025-05-01-preview' = {
  name: name
  location: location
  sku: {
    name: 'Premium'
  }
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    adminUserEnabled: false
    anonymousPullEnabled: false
    publicNetworkAccess: 'Disabled'
    zoneRedundancy: 'Enabled'
    policies: {
      quarantinePolicy: {
        status: 'enabled'
      }
      retentionPolicy: {
        days: 30
        status: 'enabled'
      }
      softDeletePolicy: {
        retentionDays: 90
        status: 'enabled'
      }
      exportPolicy: {
        status: 'disabled'
      }
    }
  }
}

Configure with Azure Verified Modules

A pre-validated module supported by Microsoft is available from the Azure Bicep public registry. To reference the module, please use the following syntax:

br/public:avm/res/container-registry/registry:<version>

To use the latest version:

br/public:avm/res/container-registry/registry:0.9.3

Configure with Azure template#

To deploy registries that pass this rule:

  • Set properties.policies.exportPolicy.status to disabled.
  • Set properties.publicNetworkAccess to Disabled to restrict access to private endpoints only.

For example:

Azure Template snippet
{
  "type": "Microsoft.ContainerRegistry/registries",
  "apiVersion": "2025-05-01-preview",
  "name": "[parameters('name')]",
  "location": "[parameters('location')]",
  "sku": {
    "name": "Premium"
  },
  "identity": {
    "type": "SystemAssigned"
  },
  "properties": {
    "adminUserEnabled": false,
    "anonymousPullEnabled": false,
    "publicNetworkAccess": "Disabled",
    "zoneRedundancy": "Enabled",
    "policies": {
      "quarantinePolicy": {
        "status": "enabled"
      },
      "retentionPolicy": {
        "days": 30,
        "status": "enabled"
      },
      "softDeletePolicy": {
        "retentionDays": 90,
        "status": "enabled"
      },
      "exportPolicy": {
        "status": "disabled"
      }
    }
  }
}

Configure with Azure CLI#

Azure CLI snippet
az resource update -n '<name>' -g '<resource_group>' --resource-type 'Microsoft.ContainerRegistry/registries' --api-version '2021-06-01-preview' --set 'properties.policies.exportPolicy.status=disabled' --set 'properties.publicNetworkAccess=disabled'

Configure with Azure Policy#

To address this issue at runtime use the following policies:

Notes#

An Azure container registry with export policy disabled:

  • Prevents copying registry data using ACR import/ export jobs.
  • Allows standard operations through private endpoints.
  • Is available for Premium tier registries only.

This rule may produce false positives if the registry is intended to serve artifacts to external clients, such as in the case of public registries.

Comments