Bylaw

Gallery › Azure Data Explorer › Azure built-in policies

Disk encryption should be enabled on Azure Data Explorer

Converted Policy Audit Deny Disabled Mode Indexed Version 2.0.0

Enabling disk encryption helps protect and safeguard your data to meet your organizational security and compliance commitments.

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

Azure Policy JSONADX_disk_encrypted.json · 58 lines
{
  "properties": {
    "policyType": "BuiltIn",
    "displayName": "Disk encryption should be enabled on Azure Data Explorer",
    "description": "Enabling disk encryption helps protect and safeguard your data to meet your organizational security and compliance commitments.",
    "metadata": {
      "version": "2.0.0",
      "category": "Azure Data Explorer"
    },
    "version": "2.0.0",
    "mode": "Indexed",
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "Audit",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Kusto/Clusters"
          },
          {
            "anyOf": [
              {
                "field": "Microsoft.Kusto/clusters/enableDiskEncryption",
                "exists": false
              },
              {
                "field": "Microsoft.Kusto/clusters/enableDiskEncryption",
                "equals": false
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "2.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/f4b53539-8df9-40e4-86c6-6b607703bd4e",
  "name": "f4b53539-8df9-40e4-86c6-6b607703bd4e"
}
Bylawf4b53539-8df9-40e4-86c6-6b607703bd4e.bylaw.ps1 · 33 lines
# Converted from ADX_disk_encrypted.json by ConvertTo-Bylaw.
Policy 'f4b53539-8df9-40e4-86c6-6b607703bd4e' {

    Properties @{
        DisplayName   = 'Disk encryption should be enabled on Azure Data Explorer'
        Description   = 'Enabling disk encryption helps protect and safeguard your data to meet your organizational security and compliance commitments.'
        Version       = '2.0.0'
        Category      = 'Azure Data Explorer'
        PolicyVersion = '2.0.0'
        Mode          = 'Indexed'
    }

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

    Resource 'Microsoft.Kusto/Clusters' {

        Require 'enableDiskEncryption exists' {
            Field enableDiskEncryption | Must -Exist
        }

        Require 'enableDiskEncryption is not false' {
            Field enableDiskEncryption | Must -Not -Be $false -IfPresent
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Azure Data Explorer/ADX_disk_encrypted.json in Azure/azure-policy, under the MIT licence.