Gallery › Security Center › Azure built-in policies
[Deprecated]: Configure Association to link virtual machines to default Microsoft Defender for Cloud Data Collection Rule
Converted Policy DeployIfNotExists Disabled Mode Indexed Version 3.0.1-deprecated Deprecated
This policy is deprecated as part of Microsoft Defender for Cloud updated strategy. As part of this strategy, Azure Monitor agent is no longer required to receive Defender for Servers security features, but is required for Defender for SQL Server on machines. For more information visit: https://aka.ms/MdcAgentStrategy. Configure machines to automatically create an association with the default data collection rule for Microsoft Defender for Cloud.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "[Deprecated]: Configure Association to link virtual machines to default Microsoft Defender for Cloud Data Collection Rule",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy is deprecated as part of Microsoft Defender for Cloud updated strategy. As part of this strategy, Azure Monitor agent is no longer required to receive Defender for Servers security features, but is required for Defender for SQL Server on machines. For more information visit: https://aka.ms/MdcAgentStrategy. Configure machines to automatically create an association with the default data collection rule for Microsoft Defender for Cloud.",
"metadata": {
"category": "Security Center",
"version": "3.0.1-deprecated",
"deprecated": true
},
"version": "3.0.1",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "DeployIfNotExists",
"allowedValues": [
"DeployIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines"
},
{
"field": "location",
"in": [
"australiacentral",
"australiaeast",
"australiasoutheast",
"brazilsouth",
"canadacentral",
"canadaeast",
"centralindia",
"centralus",
"eastasia",
"eastus2euap",
"eastus",
"eastus2",
"francecentral",
"germanywestcentral",
"japaneast",
"japanwest",
"jioindiawest",
"koreacentral",
"koreasouth",
"northcentralus",
"northeurope",
"norwayeast",
"southafricanorth",
"southcentralus",
"southeastasia",
"southindia",
"switzerlandnorth",
"uaenorth",
"uksouth",
"ukwest",
"westcentralus",
"westeurope",
"westindia",
"westus",
"westus2"
]
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Insights/dataCollectionRuleAssociations",
"name": "Security-RulesAssociation",
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/749f88d5-cbae-40b8-bcfc-e573ddc772fa",
"/providers/microsoft.authorization/roleDefinitions/92aaf0da-9dab-42b6-94a3-d43ce8d16293"
],
"deployment": {
"properties": {
"mode": "incremental",
"parameters": {
"resourceGroup": {
"value": "[resourceGroup().name]"
},
"location": {
"value": "[field('location')]"
},
"vmName": {
"value": "[field('name')]"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceGroup": {
"type": "string"
},
"location": {
"type": "string"
},
"vmName": {
"type": "string"
}
},
"variables": {
"locationLongNameToShortMap": {
"australiacentral": "CAU",
"australiaeast": "EAU",
"australiasoutheast": "SEAU",
"brazilsouth": "CQ",
"canadacentral": "CCA",
"canadaeast": "CCA",
"centralindia": "CIN",
"centralus": "CUS",
"eastasia": "EA",
"eastus2euap": "eus2p",
"eastus": "EUS",
"eastus2": "EUS2",
"francecentral": "PAR",
"germanywestcentral": "DEWC",
"japaneast": "EJP",
"japanwest": "EJP",
"jioindiawest": "CIN",
"koreacentral": "SE",
"koreasouth": "SE",
"northcentralus": "NCUS",
"northeurope": "NEU",
"norwayeast": "NOE",
"southafricanorth": "JNB",
"southcentralus": "SCUS",
"southeastasia": "SEA",
"southindia": "CIN",
"swedencentral": "SEC",
"switzerlandnorth": "CHN",
"switzerlandwest": "CHW",
"uaenorth": "DXB",
"uksouth": "SUK",
"ukwest": "WUK",
"westcentralus": "WCUS",
"westeurope": "WEU",
"westindia": "CIN",
"westus": "WUS",
"westus2": "WUS2"
},
"locationCode": "[variables('locationLongNameToShortMap')[parameters('location')]]",
"subscriptionId": "[subscription().subscriptionId]",
"defaultRGName": "[concat('DefaultResourceGroup-', variables('locationCode'))]",
"dcrName": "[concat('Microsoft-Security-', parameters('location'), '-dcr')]",
"dcrId": "[concat('/subscriptions/', variables('subscriptionId'), '/resourceGroups/', variables('defaultRGName'), '/providers/Microsoft.Insights/dataCollectionRules/', variables('dcrName'))]",
"dcraName": "[concat(parameters('vmName'),'/Microsoft.Insights/Security-RulesAssociation')]"
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines/providers/dataCollectionRuleAssociations",
"name": "[variables('dcraName')]",
"apiVersion": "2021-04-01",
"properties": {
"description": "Association of data collection rule for Microsoft Defender for Cloud. Deleting this association will break the detection of security vulnerabilities for this virtual machine.",
"dataCollectionRuleId": "[variables('dcrId')]"
}
}
]
}
}
}
}
}
},
"versions": [
"3.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/a2ea54a3-9707-45e3-8230-bbda8309d17e",
"name": "a2ea54a3-9707-45e3-8230-bbda8309d17e"
}# Converted from ASC_AMA_DefaultPipeline_DCRA_DINE.json by ConvertTo-Bylaw.
Policy 'a2ea54a3-9707-45e3-8230-bbda8309d17e' {
Properties @{
DisplayName = '[Deprecated]: Configure Association to link virtual machines to default Microsoft Defender for Cloud Data Collection Rule'
Description = 'This policy is deprecated as part of Microsoft Defender for Cloud updated strategy. As part of this strategy, Azure Monitor agent is no longer required to receive Defender for Servers security features, but is required for Defender for SQL Server on machines. For more information visit: https://aka.ms/MdcAgentStrategy. Configure machines to automatically create an association with the default data collection rule for Microsoft Defender for Cloud.'
Category = 'Security Center'
Version = '3.0.1-deprecated'
Deprecated = $true
PolicyVersion = '3.0.1'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('DeployIfNotExists', 'Disabled')
Default = 'DeployIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Compute/virtualMachines' {
Require 'location is not one of 35 values' {
Field location | Must -Not -BeIn @('australiacentral', 'australiaeast', 'australiasoutheast', 'brazilsouth', 'canadacentral', 'canadaeast', 'centralindia', 'centralus', 'eastasia', 'eastus2euap', 'eastus', 'eastus2', 'francecentral', 'germanywestcentral', 'japaneast', 'japanwest', 'jioindiawest', 'koreacentral', 'koreasouth', 'northcentralus', 'northeurope', 'norwayeast', 'southafricanorth', 'southcentralus', 'southeastasia', 'southindia', 'switzerlandnorth', 'uaenorth', 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2') -IfPresent
}
}
DeployIfNotExists 'Microsoft.Insights/dataCollectionRuleAssociations' -Role 'Monitoring Contributor', 'Log Analytics Contributor' -Name 'Security-RulesAssociation' -Effect (Param Effect) {
Deployment -TemplateFile './templates/a2ea54a3-9707-45e3-8230-bbda8309d17e.json' -Parameters ([ordered]@{
resourceGroup = (Arm '[resourceGroup().name]')
location = (Arm '[field(''location'')]')
vmName = (Arm '[field(''name'')]')
})
}
}Its deployment templates are written beside it:
templates/a2ea54a3-9707-45e3-8230-bbda8309d17e.json
Source: built-in-policies/policyDefinitions/Security Center/ASC_AMA_DefaultPipeline_DCRA_DINE.json in Azure/azure-policy, under the MIT licence.
Bylaw