Bylaw

Gallery › Security Center › Azure built-in policies

Configure Microsoft Defender for Endpoint integration settings with Microsoft Defender for Cloud (WDATP_EXCLUDE_LINUX...)

Converted Policy DeployIfNotExists Disabled Mode All Version 1.0.0

Configures the Microsoft Defender for Endpoint integration settings, within Microsoft Defender for Cloud (also known as WDATP_EXCLUDE_LINUX_...), for enabling auto provisioning of MDE for Linux servers. WDATP setting must be turned on for this setting to be applied. See: https://learn.microsoft.com/azure/defender-for-cloud/integration-defender-for-endpoint for more information.

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

Azure Policy JSONMDC_MDE_WDATP_EXCLUDE_LINUX_DINE.json · 83 lines
{
  "properties": {
    "displayName": "Configure Microsoft Defender for Endpoint integration settings with Microsoft Defender for Cloud (WDATP_EXCLUDE_LINUX...)",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Configures the Microsoft Defender for Endpoint integration settings, within Microsoft Defender for Cloud (also known as WDATP_EXCLUDE_LINUX_...), for enabling auto provisioning of MDE for Linux servers. WDATP setting must be turned on for this setting to be applied. See: https://learn.microsoft.com/azure/defender-for-cloud/integration-defender-for-endpoint for more information.",
    "metadata": {
      "version": "1.0.0",
      "category": "Security Center"
    },
    "version": "1.0.0",
    "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.Resources/subscriptions"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Security/settings",
          "name": "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW",
          "deploymentScope": "subscription",
          "existenceScope": "subscription",
          "existenceCondition": {
            "field": "Microsoft.Security/settings/DataExportSetting.enabled",
            "equals": "false"
          },
          "roleDefinitionIds": [
            "/providers/Microsoft.Authorization/roleDefinitions/fb1c8493-542b-48eb-b624-b4c8fea62acd"
          ],
          "deployment": {
            "location": "northeurope",
            "properties": {
              "mode": "incremental",
              "parameters": {},
              "template": {
                "$schema": "http://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json",
                "contentVersion": "1.0.0.0",
                "parameters": {},
                "variables": {},
                "resources": [
                  {
                    "type": "Microsoft.Security/settings",
                    "apiVersion": "2022-05-01",
                    "name": "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW",
                    "kind": "DataExportSettings",
                    "properties": {
                      "enabled": "false"
                    }
                  }
                ],
                "outputs": {}
              }
            }
          }
        }
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/f9e2bd2f-47c7-4059-8265-c5292aa62c8a",
  "name": "f9e2bd2f-47c7-4059-8265-c5292aa62c8a"
}
Bylawf9e2bd2f-47c7-4059-8265-c5292aa62c8a.bylaw.ps1 · 32 lines
# Converted from MDC_MDE_WDATP_EXCLUDE_LINUX_DINE.json by ConvertTo-Bylaw.
Policy 'f9e2bd2f-47c7-4059-8265-c5292aa62c8a' {

    Properties @{
        DisplayName   = 'Configure Microsoft Defender for Endpoint integration settings with Microsoft Defender for Cloud (WDATP_EXCLUDE_LINUX...)'
        Description   = 'Configures the Microsoft Defender for Endpoint integration settings, within Microsoft Defender for Cloud (also known as WDATP_EXCLUDE_LINUX_...), for enabling auto provisioning of MDE for Linux servers. WDATP setting must be turned on for this setting to be applied. See: https://learn.microsoft.com/azure/defender-for-cloud/integration-defender-for-endpoint for more information.'
        Version       = '1.0.0'
        Category      = 'Security Center'
        PolicyVersion = '1.0.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.Resources/subscriptions'

    DeployIfNotExists 'Microsoft.Security/settings' -Role 'Security Admin' -Name 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW' -ExistenceScope Subscription -Effect (Param Effect) {
        Require 'DataExportSetting.enabled is false' {
            Field DataExportSetting.enabled | Must -Be 'false'
        }
        Deployment @{
            TemplateFile = './templates/f9e2bd2f-47c7-4059-8265-c5292aa62c8a.json'
            Scope        = 'Subscription'
            Location     = 'northeurope'
        }
    }
}

Its deployment templates are written beside it:

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