Gallery › Security Center › Azure built-in policies
Enable Microsoft Defender for Cloud on your subscription
Converted Policy DeployIfNotExists Mode All Version 1.0.1
Identifies existing subscriptions that aren't monitored by Microsoft Defender for Cloud and protects them with Defender for Cloud's free features.
Subscriptions already monitored will be considered compliant.
To register newly created subscriptions, open the compliance tab, select the relevant non-compliant assignment, and create a remediation task.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Enable Microsoft Defender for Cloud on your subscription",
"policyType": "BuiltIn",
"mode": "All",
"description": "Identifies existing subscriptions that aren't monitored by Microsoft Defender for Cloud and protects them with Defender for Cloud's free features.\nSubscriptions already monitored will be considered compliant.\nTo register newly created subscriptions, open the compliance tab, select the relevant non-compliant assignment, and create a remediation task.",
"metadata": {
"version": "1.0.1",
"category": "Security Center"
},
"version": "1.0.1",
"parameters": {},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Resources/subscriptions"
},
"then": {
"effect": "deployIfNotExists",
"details": {
"type": "Microsoft.Security/pricings",
"name": "VirtualMachines",
"deploymentScope": "subscription",
"existenceScope": "subscription",
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/fb1c8493-542b-48eb-b624-b4c8fea62acd"
],
"existenceCondition": {
"anyof": [
{
"field": "microsoft.security/pricings/pricingTier",
"equals": "standard"
},
{
"field": "microsoft.security/pricings/pricingTier",
"equals": "free"
}
]
},
"deployment": {
"location": "westeurope",
"properties": {
"mode": "incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"variables": {},
"resources": [
{
"type": "Microsoft.Security/pricings",
"apiVersion": "2018-06-01",
"name": "VirtualMachines",
"properties": {
"pricingTier": "free"
}
}
],
"outputs": {}
}
}
}
}
}
},
"versions": [
"1.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/ac076320-ddcf-4066-b451-6154267e8ad2",
"name": "ac076320-ddcf-4066-b451-6154267e8ad2"
}# Converted from ASC_Register_To_Azure_Security_Center_DINE.json by ConvertTo-Bylaw.
Policy 'ac076320-ddcf-4066-b451-6154267e8ad2' {
Properties @{
DisplayName = 'Enable Microsoft Defender for Cloud on your subscription'
Description = 'Identifies existing subscriptions that aren''t monitored by Microsoft Defender for Cloud and protects them with Defender for Cloud''s free features.
Subscriptions already monitored will be considered compliant.
To register newly created subscriptions, open the compliance tab, select the relevant non-compliant assignment, and create a remediation task.'
Version = '1.0.1'
Category = 'Security Center'
PolicyVersion = '1.0.1'
Mode = 'All'
}
Resource 'Microsoft.Resources/subscriptions'
DeployIfNotExists 'Microsoft.Security/pricings' -Role 'Security Admin' -Name 'VirtualMachines' -ExistenceScope Subscription {
Require 'pricingTier is as required' {
AnyOf {
Field pricingTier | Must -Be 'standard'
Field pricingTier | Must -Be 'free'
}
}
Deployment @{
TemplateFile = './templates/ac076320-ddcf-4066-b451-6154267e8ad2.json'
Scope = 'Subscription'
Location = 'westeurope'
}
}
}Its deployment templates are written beside it:
templates/ac076320-ddcf-4066-b451-6154267e8ad2.json
Source: built-in-policies/policyDefinitions/Security Center/ASC_Register_To_Azure_Security_Center_DINE.json in Azure/azure-policy, under the MIT licence.
Bylaw