Bylaw

Gallery › Azure Data Explorer › Azure built-in policies

Azure Data Explorer encryption at rest should use a customer-managed key

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0

Enabling encryption at rest using a customer-managed key on your Azure Data Explorer cluster provides additional control over the key being used by the encryption at rest. This feature is oftentimes applicable to customers with special compliance requirements and requires a Key Vault to managing the keys.

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

Azure Policy JSONADX_CMK.json · 66 lines
{
  "properties": {
    "policyType": "BuiltIn",
    "displayName": "Azure Data Explorer encryption at rest should use a customer-managed key",
    "description": "Enabling encryption at rest using a customer-managed key on your Azure Data Explorer cluster provides additional control over the key being used by the encryption at rest. This feature is oftentimes applicable to customers with special compliance requirements and requires a Key Vault to managing the keys.",
    "metadata": {
      "version": "1.0.0",
      "category": "Azure Data Explorer"
    },
    "version": "1.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/keyVaultProperties",
                "exists": false
              },
              {
                "field": "Microsoft.Kusto/clusters/keyVaultProperties.keyName",
                "exists": false
              },
              {
                "field": "Microsoft.Kusto/clusters/keyVaultProperties.keyVersion",
                "exists": false
              },
              {
                "field": "Microsoft.Kusto/clusters/keyVaultProperties.keyVaultUri",
                "exists": false
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/81e74cea-30fd-40d5-802f-d72103c2aaaa",
  "name": "81e74cea-30fd-40d5-802f-d72103c2aaaa"
}
Bylaw81e74cea-30fd-40d5-802f-d72103c2aaaa.bylaw.ps1 · 41 lines
# Converted from ADX_CMK.json by ConvertTo-Bylaw.
Policy '81e74cea-30fd-40d5-802f-d72103c2aaaa' {

    Properties @{
        DisplayName   = 'Azure Data Explorer encryption at rest should use a customer-managed key'
        Description   = 'Enabling encryption at rest using a customer-managed key on your Azure Data Explorer cluster provides additional control over the key being used by the encryption at rest. This feature is oftentimes applicable to customers with special compliance requirements and requires a Key Vault to managing the keys.'
        Version       = '1.0.0'
        Category      = 'Azure Data Explorer'
        PolicyVersion = '1.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 'keyVaultProperties exists' {
            Field keyVaultProperties | Must -Exist
        }

        Require 'keyVaultProperties.keyName exists' {
            Field keyVaultProperties.keyName | Must -Exist
        }

        Require 'keyVaultProperties.keyVersion exists' {
            Field keyVaultProperties.keyVersion | Must -Exist
        }

        Require 'keyVaultProperties.keyVaultUri exists' {
            Field keyVaultProperties.keyVaultUri | Must -Exist
        }
    }

    Effect (Param Effect)
}

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