Gallery › Storage › Azure built-in policies
Storage accounts should restrict network access (excluding storage accounts managed by Azure Red Hat OpenShift)
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Network access to storage accounts should be restricted. Configure network rules so only applications from allowed networks can access the storage account. To allow connections from specific internet or on-premises clients, access can be granted to traffic from specific Azure virtual networks or to public internet IP address ranges. Storage accounts in resource groups managed by Azure Red Hat OpenShift are excluded from evaluation.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Storage accounts should restrict network access (excluding storage accounts managed by Azure Red Hat OpenShift)",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Network access to storage accounts should be restricted. Configure network rules so only applications from allowed networks can access the storage account. To allow connections from specific internet or on-premises clients, access can be granted to traffic from specific Azure virtual networks or to public internet IP address ranges. Storage accounts in resource groups managed by Azure Red Hat OpenShift are excluded from evaluation.",
"metadata": {
"version": "1.0.0",
"category": "Storage"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"value": "[resourcegroup().managedBy]",
"notContains": "/providers/Microsoft.RedHatOpenShift/"
},
{
"field": "Microsoft.Storage/storageAccounts/networkAcls.defaultAction",
"notEquals": "Deny"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/f0308946-498a-43fd-8d44-a75b47cd2aef",
"name": "f0308946-498a-43fd-8d44-a75b47cd2aef"
}# Converted from Storage_NetworkAcls_WithAROExcluded_Audit.json by ConvertTo-Bylaw.
Policy 'f0308946-498a-43fd-8d44-a75b47cd2aef' {
Properties @{
DisplayName = 'Storage accounts should restrict network access (excluding storage accounts managed by Azure Red Hat OpenShift)'
Description = 'Network access to storage accounts should be restricted. Configure network rules so only applications from allowed networks can access the storage account. To allow connections from specific internet or on-premises clients, access can be granted to traffic from specific Azure virtual networks or to public internet IP address ranges. Storage accounts in resource groups managed by Azure Red Hat OpenShift are excluded from evaluation.'
Version = '1.0.0'
Category = 'Storage'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The effect determines what happens when the policy rule is evaluated to match'
}
Resource 'Microsoft.Storage/storageAccounts' {
When {
Arm '[resourcegroup().managedBy]' | Must -Not -ContainText '/providers/Microsoft.RedHatOpenShift/'
}
Require 'networkAcls.defaultAction is Deny' {
Field networkAcls.defaultAction | Must -Be 'Deny'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Storage/Storage_NetworkAcls_WithAROExcluded_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw