Gallery › Container Registry › Azure built-in policies
Container registries should have repository scoped access token disabled.
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
Disable repository scoped access tokens for your registry so that repositories are not accessible by tokens. Disabling local authentication methods like admin user, repository scoped access tokens and anonymous pull improves security by ensuring that container registries exclusively require Azure Active Directory identities for 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 repository scoped access token disabled.",
"description": "Disable repository scoped access tokens for your registry so that repositories are not accessible by tokens. Disabling local authentication methods like admin user, repository scoped access tokens and anonymous pull improves security by ensuring that container registries exclusively require Azure Active Directory identities for authentication. Learn more at: https://aka.ms/acr/authentication.",
"policyType": "BuiltIn",
"mode": "All",
"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/tokens"
},
{
"field": "Microsoft.ContainerRegistry/registries/tokens/status",
"notequals": "disabled"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/ff05e24e-195c-447e-b322-5e90c9f9f366",
"name": "ff05e24e-195c-447e-b322-5e90c9f9f366"
}# Converted from ACR_TokenDisabled_AuditDeny.json by ConvertTo-Bylaw.
Policy 'ff05e24e-195c-447e-b322-5e90c9f9f366' {
Properties @{
DisplayName = 'Container registries should have repository scoped access token disabled.'
Description = 'Disable repository scoped access tokens for your registry so that repositories are not accessible by tokens. Disabling local authentication methods like admin user, repository scoped access tokens and anonymous pull improves security by ensuring that container registries exclusively require Azure Active Directory identities for authentication. Learn more at: https://aka.ms/acr/authentication.'
Version = '1.0.0'
Category = 'Container Registry'
PolicyVersion = '1.0.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.ContainerRegistry/registries/tokens' {
Require 'status is disabled' {
Field status | Must -Be 'disabled'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Container Registry/ACR_TokenDisabled_AuditDeny.json in Azure/azure-policy, under the MIT licence.
Bylaw