Gallery › Security Center › Azure built-in policies
[Deprecated]: Configure supported Windows Arc machines to automatically install the Azure Security agent
Converted Policy DeployIfNotExists Disabled Mode Indexed Version 1.1.0-deprecated Deprecated
Configure supported Windows Arc machines to automatically install the Azure Security agent. Security Center collects events from the agent and uses them to provide security alerts and tailored hardening tasks (recommendations). Target Windows Arc machines must be in a supported location.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_AzureSecurityWindowsAgent_Arc_DINE.json · 113 lines
{
"properties": {
"displayName": "[Deprecated]: Configure supported Windows Arc machines to automatically install the Azure Security agent",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Configure supported Windows Arc machines to automatically install the Azure Security agent. Security Center collects events from the agent and uses them to provide security alerts and tailored hardening tasks (recommendations). Target Windows Arc machines must be in a supported location.",
"metadata": {
"category": "Security Center",
"version": "1.1.0-deprecated",
"deprecated": true
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Disabled",
"allowedValues": [
"DeployIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.HybridCompute/machines"
},
{
"field": "Microsoft.HybridCompute/imageOffer",
"like": "windows*"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.HybridCompute/machines/extensions",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.HybridCompute/machines/extensions/type",
"equals": "AzureSecurityWindowsAgent"
},
{
"field": "Microsoft.HybridCompute/machines/extensions/Publisher",
"equals": "Microsoft.Azure.Security.Monitoring"
},
{
"field": "Microsoft.HybridCompute/machines/extensions/provisioningState",
"equals": "Succeeded"
}
]
},
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/92aaf0da-9dab-42b6-94a3-d43ce8d16293"
],
"deployment": {
"properties": {
"mode": "incremental",
"parameters": {
"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": {
"location": {
"type": "string"
},
"vmName": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.HybridCompute/machines/extensions",
"name": "[concat(parameters('vmName'), '/', 'AzureSecurityWindowsAgent')]",
"apiVersion": "2021-06-10-preview",
"location": "[parameters('location')]",
"properties": {
"publisher": "Microsoft.Azure.Security.Monitoring",
"type": "AzureSecurityWindowsAgent",
"settings": {},
"protectedSettings": {}
}
}
]
}
}
}
}
}
},
"versions": [
"1.1.0",
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/d01f3018-de9f-4d75-8dae-d12c1875da9f",
"name": "d01f3018-de9f-4d75-8dae-d12c1875da9f"
}Bylawd01f3018-de9f-4d75-8dae-d12c1875da9f.bylaw.ps1 · 40 lines
# Converted from ASC_AzureSecurityWindowsAgent_Arc_DINE.json by ConvertTo-Bylaw.
Policy 'd01f3018-de9f-4d75-8dae-d12c1875da9f' {
Properties @{
DisplayName = '[Deprecated]: Configure supported Windows Arc machines to automatically install the Azure Security agent'
Description = 'Configure supported Windows Arc machines to automatically install the Azure Security agent. Security Center collects events from the agent and uses them to provide security alerts and tailored hardening tasks (recommendations). Target Windows Arc machines must be in a supported location.'
Category = 'Security Center'
Version = '1.1.0-deprecated'
Deprecated = $true
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('DeployIfNotExists', 'Disabled')
Default = 'Disabled'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.HybridCompute/machines' {
Require 'imageOffer is not like windows*' {
Field 'Microsoft.HybridCompute/imageOffer' | Must -Not -BeLike 'windows*' -IfPresent
}
}
DeployIfNotExists 'Microsoft.HybridCompute/machines/extensions' -Role 'Log Analytics Contributor' -Effect (Param Effect) {
Require 'type, publisher and provisioningState are as required' {
Field 'Microsoft.HybridCompute/machines/extensions/type' | Must -Be 'AzureSecurityWindowsAgent'
Field publisher | Must -Be 'Microsoft.Azure.Security.Monitoring'
Field provisioningState | Must -Be 'Succeeded'
}
Deployment -TemplateFile './templates/d01f3018-de9f-4d75-8dae-d12c1875da9f.json' -Parameters ([ordered]@{
location = (Arm '[field(''location'')]')
vmName = (Arm '[field(''name'')]')
})
}
}Its deployment templates are written beside it:
templates/d01f3018-de9f-4d75-8dae-d12c1875da9f.json
Source: built-in-policies/policyDefinitions/Security Center/ASC_AzureSecurityWindowsAgent_Arc_DINE.json in Azure/azure-policy, under the MIT licence.
Bylaw