Gallery › Mission › Azure built-in policies
Storage accounts should restrict cross tenant replication in Mission Platform products and services
Converted Policy Disabled Modify Mode Indexed Version 1.0.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This policy helps enforce data residency and security boundaries by preventing cross-tenant replication of storage accounts. It ensures that object replication policies do not inadvertently replicate data to storage accounts outside the intended tenant.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONStorageDisableExternalReplication_Modify.json · 61 lines
{
"properties": {
"displayName": "Storage accounts should restrict cross tenant replication in Mission Platform products and services",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This policy helps enforce data residency and security boundaries by preventing cross-tenant replication of storage accounts. It ensures that object replication policies do not inadvertently replicate data to storage accounts outside the intended tenant.",
"metadata": {
"version": "1.0.0",
"category": "Mission"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Storage Account Disable External replication effect",
"description": "Specify the Storage Account Disable External replication effect"
},
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"field": "Microsoft.Storage/storageAccounts/allowCrossTenantReplication",
"notEquals": false
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab"
],
"operations": [
{
"operation": "addOrReplace",
"field": "Microsoft.Storage/storageAccounts/allowCrossTenantReplication",
"value": false
}
]
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/6bebaf3c-2420-4459-b512-c0f77f3d0afb",
"name": "6bebaf3c-2420-4459-b512-c0f77f3d0afb"
}Bylaw6bebaf3c-2420-4459-b512-c0f77f3d0afb.bylaw.ps1 · 30 lines
# Converted from StorageDisableExternalReplication_Modify.json by ConvertTo-Bylaw.
Policy '6bebaf3c-2420-4459-b512-c0f77f3d0afb' {
Properties @{
DisplayName = 'Storage accounts should restrict cross tenant replication in Mission Platform products and services'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This policy helps enforce data residency and security boundaries by preventing cross-tenant replication of storage accounts. It ensures that object replication policies do not inadvertently replicate data to storage accounts outside the intended tenant.'
Version = '1.0.0'
Category = 'Mission'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Modify', 'Disabled')
Default = 'Modify'
DisplayName = 'Storage Account Disable External replication effect'
Description = 'Specify the Storage Account Disable External replication effect'
}
Resource 'Microsoft.Storage/storageAccounts' {
Require 'allowCrossTenantReplication is false' {
Field allowCrossTenantReplication | Must -Be $false
}
}
Modify -Role 'Storage Account Contributor' -Effect (Param Effect) {
Field allowCrossTenantReplication | AddOrReplace $false
}
}Source: built-in-policies/policyDefinitions/Mission/StorageDisableExternalReplication_Modify.json in Azure/azure-policy, under the MIT licence.
Bylaw