Bylaw

Gallery › VirtualEnclaves › Azure built-in policies

[Preview]: Control the use of Service Bus in a Virtual Enclave

Converted Initiative Version 1.0.0-preview Preview

This initiative deploys Azure policies for Service Bus ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves

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

Azure Policy JSONServiceBusInitiative.json · 70 lines
{
  "properties": {
    "displayName": "[Preview]: Control the use of Service Bus in a Virtual Enclave",
    "policyType": "BuiltIn",
    "description": "This initiative deploys Azure policies for Service Bus ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves",
    "metadata": {
      "version": "1.0.0-preview",
      "category": "VirtualEnclaves",
      "preview": true
    },
    "version": "1.0.0-preview",
    "parameters": {
      "logRetentionDays": {
        "type": "String",
        "metadata": {
          "displayName": "Required retention (days)",
          "description": "The required resource logs retention in days"
        },
        "defaultValue": "365"
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/295fc8b1-dc9f-4f53-9c61-3f313ceab40a",
        "policyDefinitionReferenceId": "ServiceBusShouldUseCmkForEncryption",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/ebaf4f25-a4e8-415f-86a8-42d9155bef0b",
        "policyDefinitionReferenceId": "ServiceBusShouldHaveDoubleEncryptionEnabled",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1c06e275-d63d-4540-b761-71f364c2111d",
        "policyDefinitionReferenceId": "ServiceBusShouldUsePrivateLink",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/cbd11fd3-3002-4907-b6c8-579f0e700e13",
        "policyDefinitionReferenceId": "ServiceBusShouldDisablePublicAccess",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/f8d36e2f-389b-4ee4-898d-21aeb69a0f45",
        "policyDefinitionReferenceId": "ServiceBusShouldHaveResourceLogsEnabled",
        "definitionVersion": "5.*.*",
        "parameters": {
          "requiredRetentionDays": {
            "value": "[parameters('logRetentionDays')]"
          }
        }
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/cfb11c26-f069-4c14-8e36-56c394dae5af",
        "policyDefinitionReferenceId": "ServiceBusShouldDenyLocalAuthenticationMethods",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/910711a6-8aa2-4f15-ae62-1e5b2ed3ef9e",
        "policyDefinitionReferenceId": "ServiceBusShouldDisableLocalAuthentication",
        "definitionVersion": "1.*.*"
      }
    ],
    "versions": [
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/8fcdb3f1-1369-426d-9917-81edfee903ab",
  "name": "8fcdb3f1-1369-426d-9917-81edfee903ab"
}
Bylaw8fcdb3f1-1369-426d-9917-81edfee903ab.bylaw.ps1 · 63 lines
# Converted from ServiceBusInitiative.json by ConvertTo-Bylaw.
Initiative '8fcdb3f1-1369-426d-9917-81edfee903ab' {

    Properties @{
        DisplayName   = '[Preview]: Control the use of Service Bus in a Virtual Enclave'
        Description   = 'This initiative deploys Azure policies for Service Bus ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves'
        Version       = '1.0.0-preview'
        Category      = 'VirtualEnclaves'
        Preview       = $true
        PolicyVersion = '1.0.0-preview'
    }

    Parameter LogRetentionDays @{
        Default     = '365'
        DisplayName = 'Required retention (days)'
        Description = 'The required resource logs retention in days'
    }

    PolicyDefinition @{
        Id          = '295fc8b1-dc9f-4f53-9c61-3f313ceab40a'
        ReferenceId = 'ServiceBusShouldUseCmkForEncryption'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'ebaf4f25-a4e8-415f-86a8-42d9155bef0b'
        ReferenceId = 'ServiceBusShouldHaveDoubleEncryptionEnabled'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '1c06e275-d63d-4540-b761-71f364c2111d'
        ReferenceId = 'ServiceBusShouldUsePrivateLink'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'cbd11fd3-3002-4907-b6c8-579f0e700e13'
        ReferenceId = 'ServiceBusShouldDisablePublicAccess'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'f8d36e2f-389b-4ee4-898d-21aeb69a0f45'
        ReferenceId = 'ServiceBusShouldHaveResourceLogsEnabled'
        Version     = '5.*.*'
        Parameters  = @{
            requiredRetentionDays = (Param LogRetentionDays)
        }
    }

    PolicyDefinition @{
        Id          = 'cfb11c26-f069-4c14-8e36-56c394dae5af'
        ReferenceId = 'ServiceBusShouldDenyLocalAuthenticationMethods'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '910711a6-8aa2-4f15-ae62-1e5b2ed3ef9e'
        ReferenceId = 'ServiceBusShouldDisableLocalAuthentication'
        Version     = '1.*.*'
    }
}

Members (7)

Source: built-in-policies/policySetDefinitions/VirtualEnclaves/ServiceBusInitiative.json in Azure/azure-policy, under the MIT licence.