Gallery › Container Registry › Azure built-in policies
Container registries should have ARM audience token authentication disabled.
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Disable Azure Active Directory ARM audience tokens for authentication to your registry. Only Azure Container Registry (ACR) audience tokens will be used for authentication. This will ensure only tokens meant for usage on the registry can be used for authentication. Disabling ARM audience tokens does not affect admin user's or scoped access tokens' authentication. Learn more at: https://aka.ms/acr/authentication.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Container registries should have ARM audience token authentication disabled.",
"description": "Disable Azure Active Directory ARM audience tokens for authentication to your registry. Only Azure Container Registry (ACR) audience tokens will be used for authentication. This will ensure only tokens meant for usage on the registry can be used for authentication. Disabling ARM audience tokens does not affect admin user's or scoped access tokens' authentication. Learn more at: https://aka.ms/acr/authentication.",
"policyType": "BuiltIn",
"mode": "Indexed",
"metadata": {
"version": "1.0.0",
"category": "Container Registry"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ContainerRegistry/registries"
},
{
"anyOf": [
{
"field": "Microsoft.ContainerRegistry/registries/policies.azureADAuthenticationAsArmPolicy",
"exists": false
},
{
"field": "Microsoft.ContainerRegistry/registries/policies.azureADAuthenticationAsArmPolicy.status",
"exists": false
},
{
"field": "Microsoft.ContainerRegistry/registries/policies.azureADAuthenticationAsArmPolicy.status",
"equals": "enabled"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/42781ec6-6127-4c30-bdfa-fb423a0047d3",
"name": "42781ec6-6127-4c30-bdfa-fb423a0047d3"
}# Converted from ACR_AADAuthenticationAsArmPolicy_AuditDeny.json by ConvertTo-Bylaw.
Policy '42781ec6-6127-4c30-bdfa-fb423a0047d3' {
Properties @{
DisplayName = 'Container registries should have ARM audience token authentication disabled.'
Description = 'Disable Azure Active Directory ARM audience tokens for authentication to your registry. Only Azure Container Registry (ACR) audience tokens will be used for authentication. This will ensure only tokens meant for usage on the registry can be used for authentication. Disabling ARM audience tokens does not affect admin user''s or scoped access tokens'' authentication. Learn more at: https://aka.ms/acr/authentication.'
Version = '1.0.0'
Category = 'Container Registry'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.ContainerRegistry/registries' {
Require 'policies.azureADAuthenticationAsArmPolicy exists' {
Field policies.azureADAuthenticationAsArmPolicy | Must -Exist
}
Require 'policies.azureADAuthenticationAsArmPolicy.status exists' {
Field policies.azureADAuthenticationAsArmPolicy.status | Must -Exist
}
Require 'policies.azureADAuthenticationAsArmPolicy.status is not enabled' {
Field policies.azureADAuthenticationAsArmPolicy.status | Must -Not -Be 'enabled' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Container Registry/ACR_AADAuthenticationAsArmPolicy_AuditDeny.json in Azure/azure-policy, under the MIT licence.
Bylaw