Bylaw

Gallery › HDInsight › Azure built-in policies

Azure HDInsight clusters should use encryption at host to encrypt data at rest

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0

Enabling encryption at host helps protect and safeguard your data to meet your organizational security and compliance commitments. When you enable encryption at host, data stored on the VM host is encrypted at rest and flows encrypted to the Storage service.

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

Azure Policy JSONEncryptionAtHost_Audit.json · 58 lines
{
  "properties": {
    "displayName": "Azure HDInsight clusters should use encryption at host to encrypt data at rest",
    "description": "Enabling encryption at host helps protect and safeguard your data to meet your organizational security and compliance commitments. When you enable encryption at host, data stored on the VM host is encrypted at rest and flows encrypted to the Storage service.",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "metadata": {
      "version": "1.0.0",
      "category": "HDInsight"
    },
    "version": "1.0.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.HDInsight/clusters"
          },
          {
            "anyOf": [
              {
                "field": "Microsoft.HDInsight/clusters/diskEncryptionProperties.encryptionAtHost",
                "exists": false
              },
              {
                "field": "Microsoft.HDInsight/clusters/diskEncryptionProperties.encryptionAtHost",
                "equals": false
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/1fd32ebd-e4c3-4e13-a54a-d7422d4d95f6",
  "name": "1fd32ebd-e4c3-4e13-a54a-d7422d4d95f6"
}
Bylaw1fd32ebd-e4c3-4e13-a54a-d7422d4d95f6.bylaw.ps1 · 32 lines
# Converted from EncryptionAtHost_Audit.json by ConvertTo-Bylaw.
Policy '1fd32ebd-e4c3-4e13-a54a-d7422d4d95f6' {

    Properties @{
        DisplayName   = 'Azure HDInsight clusters should use encryption at host to encrypt data at rest'
        Description   = 'Enabling encryption at host helps protect and safeguard your data to meet your organizational security and compliance commitments. When you enable encryption at host, data stored on the VM host is encrypted at rest and flows encrypted to the Storage service.'
        Version       = '1.0.0'
        Category      = 'HDInsight'
        PolicyVersion = '1.0.0'
        Mode          = 'Indexed'
    }

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

    Resource 'Microsoft.HDInsight/clusters' {

        Require 'diskEncryptionProperties.encryptionAtHost exists' {
            Field diskEncryptionProperties.encryptionAtHost | Must -Exist
        }

        Require 'diskEncryptionProperties.encryptionAtHost is not false' {
            Field diskEncryptionProperties.encryptionAtHost | Must -Not -Be $false -IfPresent
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/HDInsight/EncryptionAtHost_Audit.json in Azure/azure-policy, under the MIT licence.