Bylaw

Gallery › Regulatory Compliance › Azure built-in policies

Sovereignty Baseline - Global Policies

Converted Initiative Version 1.2.0

The Microsoft Cloud for Sovereignty recommends global policies to help organizations achieve their sovereignty goals by default denying the creation of resources outside of approved regions. More details can be found here: https://aka.ms/SovereigntyBaselinePolicies

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

Azure Policy JSONMCfS_Sovereignty_Baseline_Global_Policies.json · 195 lines
{
  "properties": {
    "displayName": "Sovereignty Baseline - Global Policies",
    "policyType": "BuiltIn",
    "description": "The Microsoft Cloud for Sovereignty recommends global policies to help organizations achieve their sovereignty goals by default denying the creation of resources outside of approved regions. More details can be found here: https://aka.ms/SovereigntyBaselinePolicies",
    "metadata": {
      "category": "Regulatory Compliance",
      "version": "1.2.0"
    },
    "version": "1.2.0",
    "policyDefinitionGroups": [
      {
        "additionalMetadataId": "/providers/Microsoft.PolicyInsights/policyMetadata/MCfS_Sovereignty_Baseline_Policy_SO.1",
        "name": "SO.1 - Data Residency"
      },
      {
        "additionalMetadataId": "/providers/Microsoft.PolicyInsights/policyMetadata/MCfS_Sovereignty_Baseline_Policy_SO.5",
        "name": "SO.5 - Trusted Launch"
      }
    ],
    "parameters": {
      "effect": {
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Deny",
        "metadata": {
          "description": "All policy effects will be 'Deny' by default, but some policies will allow other values such as 'Audit' which could be useful in non-production environments.",
          "displayName": "The policy effect to use for policies that have a configurable effect"
        },
        "type": "string"
      },
      "listOfAllowedLocations": {
        "allowedValues": [
          "asia",
          "asiapacific",
          "australia",
          "australiacentral",
          "australiacentral2",
          "australiaeast",
          "australiasoutheast",
          "brazil",
          "brazilsouth",
          "brazilsoutheast",
          "brazilus",
          "canada",
          "canadacentral",
          "canadaeast",
          "centralindia",
          "centralus",
          "centraluseuap",
          "eastasia",
          "eastus",
          "eastus2",
          "eastus2euap",
          "eastusstg",
          "europe",
          "france",
          "francecentral",
          "francesouth",
          "germany",
          "germanynorth",
          "germanywestcentral",
          "global",
          "india",
          "israel",
          "israelcentral",
          "italy",
          "italynorth",
          "japan",
          "japaneast",
          "japanwest",
          "jioindiacentral",
          "jioindiawest",
          "korea",
          "koreacentral",
          "koreasouth",
          "newzealand",
          "northcentralus",
          "northeurope",
          "norway",
          "norwayeast",
          "norwaywest",
          "poland",
          "polandcentral",
          "qatar",
          "qatarcentral",
          "singapore",
          "southafrica",
          "southafricanorth",
          "southafricawest",
          "southcentralus",
          "southcentralusstg",
          "southeastasia",
          "southindia",
          "sweden",
          "swedencentral",
          "switzerland",
          "switzerlandnorth",
          "switzerlandwest",
          "uaecentral",
          "uaenorth",
          "uksouth",
          "ukwest",
          "unitedstates",
          "westcentralus",
          "westeurope",
          "westindia",
          "westus",
          "westus2",
          "westus3"
        ],
        "defaultValue": [],
        "metadata": {
          "description": "Any non-global resources attempted to be deployed outsize of this region will be blocked by default.",
          "displayName": "The list of Azure regions that are approved for usage",
          "strongType": "location"
        },
        "type": "array"
      }
    },
    "policyDefinitions": [
      {
        "definitionVersion": "1.*.*",
        "groupNames": [
          "SO.1 - Data Residency"
        ],
        "parameters": {
          "listOfAllowedLocations": {
            "value": "[parameters('listOfAllowedLocations')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988",
        "policyDefinitionReferenceId": "AllowedLocationsForResourceGroups"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [
          "SO.1 - Data Residency"
        ],
        "parameters": {
          "listOfAllowedLocations": {
            "value": "[parameters('listOfAllowedLocations')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c",
        "policyDefinitionReferenceId": "AllowedLocations"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [
          "SO.1 - Data Residency"
        ],
        "parameters": {
          "listOfAllowedLocations": {
            "value": "[parameters('listOfAllowedLocations')]"
          },
          "policyEffect": {
            "value": "[parameters('effect')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0473574d-2d43-4217-aefe-941fcdf7e684",
        "policyDefinitionReferenceId": "AllowedLocationsForAzureCosmosDB"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [
          "SO.5 - Trusted Launch"
        ],
        "parameters": {},
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b03bb370-5249-4ea4-9fce-2552e87e45fa",
        "policyDefinitionReferenceId": "SupportTrustedLaunchVmImages"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [
          "SO.5 - Trusted Launch"
        ],
        "parameters": {},
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/c95b54ad-0614-4633-ab29-104b01235cbf",
        "policyDefinitionReferenceId": "EnableTrustedLaunchVmImages"
      }
    ],
    "versions": [
      "1.2.0",
      "1.1.1",
      "1.1.0-PREVIEW",
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/c1cbff38-87c0-4b9f-9f70-035c7a3b5523",
  "name": "c1cbff38-87c0-4b9f-9f70-035c7a3b5523"
}
Bylawc1cbff38-87c0-4b9f-9f70-035c7a3b5523.bylaw.ps1 · 79 lines
# Converted from MCfS_Sovereignty_Baseline_Global_Policies.json by ConvertTo-Bylaw.
Initiative 'c1cbff38-87c0-4b9f-9f70-035c7a3b5523' {

    Properties @{
        DisplayName   = 'Sovereignty Baseline - Global Policies'
        Description   = 'The Microsoft Cloud for Sovereignty recommends global policies to help organizations achieve their sovereignty goals by default denying the creation of resources outside of approved regions. More details can be found here: https://aka.ms/SovereigntyBaselinePolicies'
        Category      = 'Regulatory Compliance'
        Version       = '1.2.0'
        PolicyVersion = '1.2.0'
    }

    Parameter Effect @{
        Type          = 'string'
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'The policy effect to use for policies that have a configurable effect'
        Description   = 'All policy effects will be ''Deny'' by default, but some policies will allow other values such as ''Audit'' which could be useful in non-production environments.'
    }
    Parameter ListOfAllowedLocations @{
        Type          = 'array'
        AllowedValues = @('asia', 'asiapacific', 'australia', 'australiacentral', 'australiacentral2', 'australiaeast', 'australiasoutheast', 'brazil', 'brazilsouth', 'brazilsoutheast', 'brazilus', 'canada', 'canadacentral', 'canadaeast', 'centralindia', 'centralus', 'centraluseuap', 'eastasia', 'eastus', 'eastus2', 'eastus2euap', 'eastusstg', 'europe', 'france', 'francecentral', 'francesouth', 'germany', 'germanynorth', 'germanywestcentral', 'global', 'india', 'israel', 'israelcentral', 'italy', 'italynorth', 'japan', 'japaneast', 'japanwest', 'jioindiacentral', 'jioindiawest', 'korea', 'koreacentral', 'koreasouth', 'newzealand', 'northcentralus', 'northeurope', 'norway', 'norwayeast', 'norwaywest', 'poland', 'polandcentral', 'qatar', 'qatarcentral', 'singapore', 'southafrica', 'southafricanorth', 'southafricawest', 'southcentralus', 'southcentralusstg', 'southeastasia', 'southindia', 'sweden', 'swedencentral', 'switzerland', 'switzerlandnorth', 'switzerlandwest', 'uaecentral', 'uaenorth', 'uksouth', 'ukwest', 'unitedstates', 'westcentralus', 'westeurope', 'westindia', 'westus', 'westus2', 'westus3')
        Default       = @()
        DisplayName   = 'The list of Azure regions that are approved for usage'
        Description   = 'Any non-global resources attempted to be deployed outsize of this region will be blocked by default.'
        Metadata      = [ordered]@{ strongType = 'location' }
    }

    DefinitionGroup 'SO.1 - Data Residency' @{
        AdditionalMetadataId = '/providers/Microsoft.PolicyInsights/policyMetadata/MCfS_Sovereignty_Baseline_Policy_SO.1'
    }
    DefinitionGroup 'SO.5 - Trusted Launch' @{
        AdditionalMetadataId = '/providers/Microsoft.PolicyInsights/policyMetadata/MCfS_Sovereignty_Baseline_Policy_SO.5'
    }

    PolicyDefinition @{
        Id          = 'e765b5de-1225-4ba3-bd56-1ac6695af988'
        ReferenceId = 'AllowedLocationsForResourceGroups'
        Version     = '1.*.*'
        Group       = 'SO.1 - Data Residency'
        Parameters  = @{
            listOfAllowedLocations = (Param ListOfAllowedLocations)
        }
    }

    PolicyDefinition @{
        Id          = 'e56962a6-4747-49cd-b67b-bf8b01975c4c'
        ReferenceId = 'AllowedLocations'
        Version     = '1.*.*'
        Group       = 'SO.1 - Data Residency'
        Parameters  = @{
            listOfAllowedLocations = (Param ListOfAllowedLocations)
        }
    }

    PolicyDefinition @{
        Id          = '0473574d-2d43-4217-aefe-941fcdf7e684'
        ReferenceId = 'AllowedLocationsForAzureCosmosDB'
        Version     = '1.*.*'
        Group       = 'SO.1 - Data Residency'
        Parameters  = [ordered]@{
            listOfAllowedLocations = (Param ListOfAllowedLocations)
            policyEffect           = (Param Effect)
        }
    }

    PolicyDefinition @{
        Id          = 'b03bb370-5249-4ea4-9fce-2552e87e45fa'
        ReferenceId = 'SupportTrustedLaunchVmImages'
        Version     = '1.*.*'
        Group       = 'SO.5 - Trusted Launch'
    }

    PolicyDefinition @{
        Id          = 'c95b54ad-0614-4633-ab29-104b01235cbf'
        ReferenceId = 'EnableTrustedLaunchVmImages'
        Version     = '1.*.*'
        Group       = 'SO.5 - Trusted Launch'
    }
}

Members (5)

Source: built-in-policies/policySetDefinitions/Regulatory Compliance/MCfS_Sovereignty_Baseline_Global_Policies.json in Azure/azure-policy, under the MIT licence.