Bylaw

Gallery › Mission › Azure built-in policies

Control the use of Service Bus in Mission Platforms

Converted Initiative Version 1.0.0

This initiative deploys Azure policies for Service Bus ensuring boundary protection of this resource while it operates within the logically separated structure of Mission Platforms.

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

Azure Policy JSONServiceBusInitiative.json · 74 lines
{
  "properties": {
    "displayName": "Control the use of Service Bus in Mission Platforms",
    "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 Mission Platforms.",
    "metadata": {
      "version": "1.0.0",
      "category": "Mission"
    },
    "version": "1.0.0",
    "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/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.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9c376cb6-0545-4233-a22c-074540d4d935",
        "policyDefinitionReferenceId": "ServiceBusShouldEncryptWithCMKWithDeny_Audit",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/d8d639f5-1c93-4893-8d3c-cd5106d3ebc4",
        "policyDefinitionReferenceId": "ServiceBusShouldDisableExternalPrivateEndPoints_Audit",
        "definitionVersion": "1.*.*"
      }
    ],
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/eeba0a64-ba0e-4568-bedd-4541aaff45ed",
  "name": "eeba0a64-ba0e-4568-bedd-4541aaff45ed"
}
Bylaweeba0a64-ba0e-4568-bedd-4541aaff45ed.bylaw.ps1 · 68 lines
# Converted from ServiceBusInitiative.json by ConvertTo-Bylaw.
Initiative 'eeba0a64-ba0e-4568-bedd-4541aaff45ed' {

    Properties @{
        DisplayName   = 'Control the use of Service Bus in Mission Platforms'
        Description   = 'This initiative deploys Azure policies for Service Bus ensuring boundary protection of this resource while it operates within the logically separated structure of Mission Platforms.'
        Version       = '1.0.0'
        Category      = 'Mission'
        PolicyVersion = '1.0.0'
    }

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

    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.*.*'
    }

    PolicyDefinition @{
        Id          = '9c376cb6-0545-4233-a22c-074540d4d935'
        ReferenceId = 'ServiceBusShouldEncryptWithCMKWithDeny_Audit'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'd8d639f5-1c93-4893-8d3c-cd5106d3ebc4'
        ReferenceId = 'ServiceBusShouldDisableExternalPrivateEndPoints_Audit'
        Version     = '1.*.*'
    }
}

Members (8)

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