Gallery › Security Center › Azure built-in policies
[Deprecated]: Azure Defender for container registries should be enabled
Converted Policy AuditIfNotExists Disabled Mode All Version 1.0.3-deprecated Deprecated
Azure Defender for container registries provides vulnerability scanning of any images pulled within the last 30 days, pushed to your registry, or imported, and exposes detailed findings per image.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_EnableAdvancedThreatProtectionOnContainerRegistry_Audit.json · 51 lines
{
"properties": {
"displayName": "[Deprecated]: Azure Defender for container registries should be enabled",
"policyType": "BuiltIn",
"mode": "All",
"description": "Azure Defender for container registries provides vulnerability scanning of any images pulled within the last 30 days, pushed to your registry, or imported, and exposes detailed findings per image.",
"metadata": {
"version": "1.0.3-deprecated",
"category": "Security Center",
"deprecated": true
},
"version": "1.0.3",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Resources/subscriptions"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Security/pricings",
"name": "ContainerRegistry",
"existenceScope": "subscription",
"existenceCondition": {
"field": "Microsoft.Security/pricings/pricingTier",
"equals": "Standard"
}
}
}
},
"versions": [
"1.0.3"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c25d9a16-bc35-4e15-a7e5-9db606bf9ed4",
"name": "c25d9a16-bc35-4e15-a7e5-9db606bf9ed4"
}Bylawc25d9a16-bc35-4e15-a7e5-9db606bf9ed4.bylaw.ps1 · 29 lines
# Converted from ASC_EnableAdvancedThreatProtectionOnContainerRegistry_Audit.json by ConvertTo-Bylaw.
Policy 'c25d9a16-bc35-4e15-a7e5-9db606bf9ed4' {
Properties @{
DisplayName = '[Deprecated]: Azure Defender for container registries should be enabled'
Description = 'Azure Defender for container registries provides vulnerability scanning of any images pulled within the last 30 days, pushed to your registry, or imported, and exposes detailed findings per image.'
Version = '1.0.3-deprecated'
Category = 'Security Center'
Deprecated = $true
PolicyVersion = '1.0.3'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Resources/subscriptions'
AuditIfNotExists 'Microsoft.Security/pricings' -Name 'ContainerRegistry' -ExistenceScope Subscription -Effect (Param Effect) {
Require 'pricingTier is Standard' {
Field pricingTier | Must -Be 'Standard'
}
}
}Source: built-in-policies/policyDefinitions/Security Center/ASC_EnableAdvancedThreatProtectionOnContainerRegistry_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw