Container Registry Docker content trust is not enabled#
Security · Container Registry · Rule · 2020_12 · Important
Docker content trust allows images to be signed and verified when pulled from a container registry.
Deprecation
Content trust is replaced by OCI artifact signing.
This rule is deprecated from v1.45.0. By default, PSRule will not evaluate this rule unless explicitly enabled. See https://aka.ms/ps-rule-azure/deprecations.
Description#
Azure Container Registry (ACR) content trust enables pushing and pulling of signed images. Signed images provides additional assurance that they have been built on a trusted source.
To enable content trust, the container registry must be using a Premium SKU.
Content trust is currently not supported in a registry that's encrypted with a customer-managed key. When using customer-managed keys, content trust can not be enabled.
Recommendation#
Consider enabling content trust on registries, clients, and sign container images.
Examples#
Configure with Azure template#
To deploy registries that pass this rule:
- Set 
properties.trustPolicy.statustoenabled. - Set 
properties.trustPolicy.typetoNotary. 
For example:
{
  "type": "Microsoft.ContainerRegistry/registries",
  "apiVersion": "2023-08-01-preview",
  "name": "[parameters('name')]",
  "location": "[parameters('location')]",
  "sku": {
    "name": "Premium"
  },
  "identity": {
    "type": "SystemAssigned"
  },
  "properties": {
    "adminUserEnabled": false,
    "policies": {
      "trustPolicy": {
        "status": "enabled",
        "type": "Notary"
      },
      "retentionPolicy": {
        "days": 30,
        "status": "enabled"
      }
    }
  }
}
Configure with Bicep#
To deploy registries that pass this rule:
- Set 
properties.trustPolicy.statustoenabled. - Set 
properties.trustPolicy.typetoNotary. 
For example:
resource registry 'Microsoft.ContainerRegistry/registries@2023-08-01-preview' = {
  name: name
  location: location
  sku: {
    name: 'Premium'
  }
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    adminUserEnabled: false
    policies: {
      trustPolicy: {
        status: 'enabled'
        type: 'Notary'
      }
      retentionPolicy: {
        days: 30
        status: 'enabled'
      }
    }
  }
}
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:
For example:
To use the latest version:
Links#
- SE:02 Secured development lifecycle
 - Content trust in Azure Container Registry
 - Content trust in Docker
 - Overview of customer-managed keys
 - Azure deployment reference