Skip to content

Instantly share code, notes, and snippets.

@azMantas
Created September 27, 2021 18:55
Show Gist options
  • Save azMantas/29b08bcedeea6a5db8beeb15389c40f4 to your computer and use it in GitHub Desktop.
Save azMantas/29b08bcedeea6a5db8beeb15389c40f4 to your computer and use it in GitHub Desktop.
Azure Policy definition - modify - st_allowCrossTenantReplication
{
"name": "st_allowCrossTenantReplication",
"properties": {
"DisplayName": "Storage account should disallow cross tenant blob replication",
"mode": "All",
"metadata": {
"category": "Storage"
},
"parameters": {
"effect": {
"type": "String",
"allowedValues": [
"Deny",
"Modify",
"Disabled"
],
"defaultValue": "Modify"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"not": {
"field": "Microsoft.Storage/storageAccounts/allowCrossTenantReplication",
"equals": "false"
}
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab"
],
"conflictEffect": "audit",
"operations": [
{
"operation": "addOrReplace",
"field": "Microsoft.Storage/storageAccounts/allowCrossTenantReplication",
"value": false
}
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment