last sync: 2021-Oct-15 16:53:12 UTC

Azure Policy definition

[Preview]: Configure supported Windows Arc machines to automatically install the Azure Security agent

Name [Preview]: Configure supported Windows Arc machines to automatically install the Azure Security agent
Azure Portal
Id d01f3018-de9f-4d75-8dae-d12c1875da9f
Version 1.0.0-preview
details on versioning
Category Security Center
Microsoft docs
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.
Mode Indexed
Type BuiltIn
Preview True
Deprecated FALSE
Effect Default: DeployIfNotExists
Allowed: (DeployIfNotExists, Disabled)
Used RBAC Role
Role Name Role Id
Log Analytics Contributor 92aaf0da-9dab-42b6-94a3-d43ce8d16293
History
Date/Time (UTC ymd) (i) Change type Change detail
2021-09-13 16:35:32 add d01f3018-de9f-4d75-8dae-d12c1875da9f
Used in Initiatives none
JSON
{
  "displayName": "[Preview]: 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.0.0-preview",
    "preview": true
  },
  "parameters": {
    "effect": {
      "type": "String",
      "metadata": {
        "displayName": "Effect",
        "description": "Enable or disable the execution of the policy"
      },
      "allowedValues": [
        "DeployIfNotExists",
        "Disabled"
      ],
      "defaultValue": "DeployIfNotExists"
    }
  },
  "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": {}
                  }
                }
              ]
            }
          }
        }
      }
    }
  }
}