Bylaw

Gallery › Security Center › Azure built-in policies

[Deprecated]: Auto provisioning of the Log Analytics agent should be enabled on your subscription

Converted Policy AuditIfNotExists Disabled Mode All Version 1.1.0-deprecated Deprecated

Azure Security Center collects VM data using the Log Analytics agent for security monitoring. Enable auto provisioning for automatic deployment. This policy is deprecated due to the Azure Monitoring agent deprecation. Learn more at aka.ms/policydefdeprecation.

ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.

Azure Policy JSONASC_Automatic_provisioning_log_analytics_monitoring_agent.json · 50 lines
{
  "properties": {
    "displayName": "[Deprecated]: Auto provisioning of the Log Analytics agent should be enabled on your subscription",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Azure Security Center collects VM data using the Log Analytics agent for security monitoring. Enable auto provisioning for automatic deployment. This policy is deprecated due to the Azure Monitoring agent deprecation. Learn more at aka.ms/policydefdeprecation.",
    "metadata": {
      "version": "1.1.0-deprecated",
      "category": "Security Center",
      "deprecated": true
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "Disabled",
        "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/autoProvisioningSettings",
          "existenceCondition": {
            "field": "Microsoft.Security/autoProvisioningSettings/autoProvision",
            "equals": "On"
          }
        }
      }
    },
    "versions": [
      "1.1.0",
      "1.0.1"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/475aae12-b88a-4572-8b36-9b712b2b3a17",
  "name": "475aae12-b88a-4572-8b36-9b712b2b3a17"
}
Bylaw475aae12-b88a-4572-8b36-9b712b2b3a17.bylaw.ps1 · 29 lines
# Converted from ASC_Automatic_provisioning_log_analytics_monitoring_agent.json by ConvertTo-Bylaw.
Policy '475aae12-b88a-4572-8b36-9b712b2b3a17' {

    Properties @{
        DisplayName   = '[Deprecated]: Auto provisioning of the Log Analytics agent should be enabled on your subscription'
        Description   = 'Azure Security Center collects VM data using the Log Analytics agent for security monitoring. Enable auto provisioning for automatic deployment. This policy is deprecated due to the Azure Monitoring agent deprecation. Learn more at aka.ms/policydefdeprecation.'
        Version       = '1.1.0-deprecated'
        Category      = 'Security Center'
        Deprecated    = $true
        PolicyVersion = '1.1.0'
        Mode          = 'All'
    }

    Parameter Effect @{
        Type          = 'string'
        AllowedValues = @('AuditIfNotExists', 'Disabled')
        Default       = 'Disabled'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the policy'
    }

    Resource 'Microsoft.Resources/subscriptions'

    AuditIfNotExists 'Microsoft.Security/autoProvisioningSettings' -Effect (Param Effect) {
        Require 'autoProvision is On' {
            Field autoProvision | Must -Be 'On'
        }
    }
}

Source: built-in-policies/policyDefinitions/Security Center/ASC_Automatic_provisioning_log_analytics_monitoring_agent.json in Azure/azure-policy, under the MIT licence.