Gallery › Storage › Azure built-in policies
Storage accounts should use private link (excluding storage accounts managed by Azure Red Hat OpenShift)
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.0
Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to your storage account, data leakage risks are reduced. Learn more about private links at - https://aka.ms/azureprivatelinkoverview. Storage accounts in resource groups managed by ARO 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 use private link (excluding storage accounts managed by Azure Red Hat OpenShift)",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to your storage account, data leakage risks are reduced. Learn more about private links at - https://aka.ms/azureprivatelinkoverview. Storage accounts in resource groups managed by ARO are excluded from evaluation.",
"metadata": {
"version": "1.0.0",
"category": "Storage"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"value": "[resourcegroup().managedBy]",
"notContains": "/providers/Microsoft.RedHatOpenShift/"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Storage/storageAccounts/privateEndpointConnections",
"existenceCondition": {
"field": "Microsoft.Storage/storageAccounts/privateEndpointConnections/privateLinkServiceConnectionState.status",
"equals": "Approved"
}
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/18ac0011-fb88-42b6-a025-b33b6f0d2cb3",
"name": "18ac0011-fb88-42b6-a025-b33b6f0d2cb3"
}# Converted from StorageAccountPrivateEndpointEnabledWithAROExcluded_AINE.json by ConvertTo-Bylaw.
Policy '18ac0011-fb88-42b6-a025-b33b6f0d2cb3' {
Properties @{
DisplayName = 'Storage accounts should use private link (excluding storage accounts managed by Azure Red Hat OpenShift)'
Description = 'Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to your storage account, data leakage risks are reduced. Learn more about private links at - https://aka.ms/azureprivatelinkoverview. Storage accounts in resource groups managed by ARO are excluded from evaluation.'
Version = '1.0.0'
Category = 'Storage'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Storage/storageAccounts' {
Require 'Requirement 1' {
Arm '[resourcegroup().managedBy]' | Must -ContainText '/providers/Microsoft.RedHatOpenShift/'
}
}
AuditIfNotExists 'Microsoft.Storage/storageAccounts/privateEndpointConnections' -Effect (Param Effect) {
Require 'privateLinkServiceConnectionState.status is Approved' {
Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
}
}
}Source: built-in-policies/policyDefinitions/Storage/StorageAccountPrivateEndpointEnabledWithAROExcluded_AINE.json in Azure/azure-policy, under the MIT licence.
Bylaw