Bylaw

Gallery › HDInsight › Azure built-in policies

Azure HDInsight clusters should use encryption in transit to encrypt communication between Azure HDInsight cluster nodes

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0

Data can be tampered with during transmission between Azure HDInsight cluster nodes. Enabling encryption in transit addresses problems of misuse and tampering during this transmission.

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

Azure Policy JSONEncryptionInTransit_Audit.json · 58 lines
{
  "properties": {
    "displayName": "Azure HDInsight clusters should use encryption in transit to encrypt communication between Azure HDInsight cluster nodes",
    "description": "Data can be tampered with during transmission between Azure HDInsight cluster nodes. Enabling encryption in transit addresses problems of misuse and tampering during this transmission.",
    "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/encryptionInTransitProperties.isEncryptionInTransitEnabled",
                "exists": false
              },
              {
                "field": "Microsoft.HDInsight/clusters/encryptionInTransitProperties.isEncryptionInTransitEnabled",
                "equals": false
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/d9da03a1-f3c3-412a-9709-947156872263",
  "name": "d9da03a1-f3c3-412a-9709-947156872263"
}
Bylawd9da03a1-f3c3-412a-9709-947156872263.bylaw.ps1 · 32 lines
# Converted from EncryptionInTransit_Audit.json by ConvertTo-Bylaw.
Policy 'd9da03a1-f3c3-412a-9709-947156872263' {

    Properties @{
        DisplayName   = 'Azure HDInsight clusters should use encryption in transit to encrypt communication between Azure HDInsight cluster nodes'
        Description   = 'Data can be tampered with during transmission between Azure HDInsight cluster nodes. Enabling encryption in transit addresses problems of misuse and tampering during this transmission.'
        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 'encryptionInTransitProperties.isEncryptionInTransitEnabled exists' {
            Field encryptionInTransitProperties.isEncryptionInTransitEnabled | Must -Exist
        }

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

    Effect (Param Effect)
}

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