Bylaw

Gallery › Azure Databricks › Azure Community Policy

Audit - Databricks should use customer-managed key for encrypting managed services

Converted Policy Audit Disabled Mode All Version 1.0.0

Customer-managed key based encryption should be configured for Databricks's managed services.

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

Azure Policy JSONazurepolicy.json · 44 lines
{
  "name": "f795ec9f-7c96-49bd-9e68-a0265222164c",
  "type": "Microsoft.Authorization/policyDefinitions",
  "properties": {
    "displayName": "Audit - Databricks should use customer-managed key for encrypting managed services",
    "description": "Customer-managed key based encryption should be configured for Databricks's managed services.",
    "metadata": {
      "version": "1.0.0",
      "category": "Azure Databricks"
    },
    "mode": "All",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Audit or Disabled the execution of the Policy"
        },
        "allowedValues": [
          "Audit",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Databricks/workspaces"
          },
          {
            "field": "Microsoft.Databricks/workspaces/encryption.entities.managedServices.keySource",
            "exists": false
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    }
  }
}
Bylawf795ec9f-7c96-49bd-9e68-a0265222164c.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy 'f795ec9f-7c96-49bd-9e68-a0265222164c' {

    Properties @{
        DisplayName = 'Audit - Databricks should use customer-managed key for encrypting managed services'
        Description = 'Customer-managed key based encryption should be configured for Databricks''s managed services.'
        Version     = '1.0.0'
        Category    = 'Azure Databricks'
        Mode        = 'All'
    }

    Parameter Effect @{
        AllowedValues = @('Audit', 'Disabled')
        Default       = 'Audit'
        DisplayName   = 'Effect'
        Description   = 'Audit or Disabled the execution of the Policy'
    }

    Resource 'Microsoft.Databricks/workspaces' {

        Require 'encryption.entities.managedServices.keySource exists' {
            Field encryption.entities.managedServices.keySource | Must -Exist
        }
    }

    Effect (Param Effect)
}

Source: policyDefinitions/Azure Databricks/audit-databricks-should-use-customer-managed-key-for-encrypting-managed-services/azurepolicy.json in Azure/Community-Policy, under the MIT licence.