Bylaw

Gallery › Event Hub › Azure Landing Zones Library

Enforce recommended guardrails for Event Hub

Converted Initiative Version 1.1.0

This policy initiative is a group of policies that ensures Event Hub is compliant per regulated Landing Zones.

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

Azure Policy JSONEnforce-Guardrails-EventHub.alz_policy_set_definition.json · 102 lines
{
  "name": "Enforce-Guardrails-EventHub",
  "properties": {
    "description": "This policy initiative is a group of policies that ensures Event Hub is compliant per regulated Landing Zones.",
    "displayName": "Enforce recommended guardrails for Event Hub",
    "metadata": {
      "alzCloudEnvironments": [
        "AzureCloud",
        "AzureChinaCloud",
        "AzureUSGovernment"
      ],
      "category": "Event Hub",
      "source": "https://github.com/Azure/Enterprise-Scale/",
      "version": "1.1.0"
    },
    "parameters": {
      "eventHubAuthRules": {
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Deny",
        "type": "string"
      },
      "eventHubNamespacesDoubleEncryption": {
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Deny",
        "type": "string"
      },
      "eventHubNamespacesLocalAuth": {
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Deny",
        "type": "string"
      },
      "eventHubNamespacesModifyLocalAuth": {
        "allowedValues": [
          "Modify",
          "Disabled"
        ],
        "defaultValue": "Modify",
        "type": "string"
      }
    },
    "policyDefinitions": [
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('eventHubNamespacesDoubleEncryption')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/836cd60e-87f3-4e6a-a27c-29d687f01a4c",
        "policyDefinitionReferenceId": "Deny-EH-Double-Encryption"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('eventHubNamespacesModifyLocalAuth')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/57f35901-8389-40bb-ac49-3ba4f86d889d",
        "policyDefinitionReferenceId": "Modify-EH-Local-Auth"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('eventHubNamespacesLocalAuth')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/5d4e3c65-4873-47be-94f3-6f8b953a3598",
        "policyDefinitionReferenceId": "Deny-EH-Local-Auth"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('eventHubAuthRules')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b278e460-7cfc-4451-8294-cccc40a940d7",
        "policyDefinitionReferenceId": "Deny-EH-Auth-Rules"
      }
    ],
    "policyType": "Custom"
  },
  "type": "Microsoft.Authorization/policySetDefinitions"
}
BylawEnforce-Guardrails-EventHub.bylaw.ps1 · 68 lines
# Converted from Enforce-Guardrails-EventHub.alz_policy_set_definition.json by ConvertTo-Bylaw.
Initiative 'Enforce-Guardrails-EventHub' {

    Properties @{
        DisplayName = 'Enforce recommended guardrails for Event Hub'
        Description = 'This policy initiative is a group of policies that ensures Event Hub is compliant per regulated Landing Zones.'
        Category    = 'Event Hub'
        Version     = '1.1.0'
        Metadata    = [ordered]@{ alzCloudEnvironments = @('AzureCloud', 'AzureChinaCloud', 'AzureUSGovernment'); source = 'https://github.com/Azure/Enterprise-Scale/' }
    }

    Parameter EventHubAuthRules @{
        Type          = 'string'
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
    }
    Parameter EventHubNamespacesDoubleEncryption @{
        Type          = 'string'
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
    }
    Parameter EventHubNamespacesLocalAuth @{
        Type          = 'string'
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
    }
    Parameter EventHubNamespacesModifyLocalAuth @{
        Type          = 'string'
        AllowedValues = @('Modify', 'Disabled')
        Default       = 'Modify'
    }

    PolicyDefinition @{
        Id          = '836cd60e-87f3-4e6a-a27c-29d687f01a4c'
        ReferenceId = 'Deny-EH-Double-Encryption'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param EventHubNamespacesDoubleEncryption)
        }
    }

    PolicyDefinition @{
        Id          = '57f35901-8389-40bb-ac49-3ba4f86d889d'
        ReferenceId = 'Modify-EH-Local-Auth'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param EventHubNamespacesModifyLocalAuth)
        }
    }

    PolicyDefinition @{
        Id          = '5d4e3c65-4873-47be-94f3-6f8b953a3598'
        ReferenceId = 'Deny-EH-Local-Auth'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param EventHubNamespacesLocalAuth)
        }
    }

    PolicyDefinition @{
        Id          = 'b278e460-7cfc-4451-8294-cccc40a940d7'
        ReferenceId = 'Deny-EH-Auth-Rules'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param EventHubAuthRules)
        }
    }
}

Members (4)

Source: policy_set_definitions/Enforce-Guardrails-EventHub.alz_policy_set_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.