Gallery › Site Recovery › Azure built-in policies
[Preview]: Recovery Services vaults should use private link
Converted Policy Audit Disabled Mode Indexed Version 1.0.0-preview Preview
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 Azure Recovery Services vaults, data leakage risks are reduced. Learn more about private links for Azure Site Recovery at: https://aka.ms/HybridScenarios-PrivateLink and https://aka.ms/AzureToAzure-PrivateLink.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "[Preview]: Recovery Services vaults should use private link",
"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 Azure Recovery Services vaults, data leakage risks are reduced. Learn more about private links for Azure Site Recovery at: https://aka.ms/HybridScenarios-PrivateLink and https://aka.ms/AzureToAzure-PrivateLink.",
"policyType": "BuiltIn",
"mode": "Indexed",
"metadata": {
"version": "1.0.0-preview",
"category": "Site Recovery",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.RecoveryServices/vaults"
},
{
"count": {
"field": "Microsoft.RecoveryServices/vaults/privateEndpointConnections[*]",
"where": {
"allOf": [
{
"field": "Microsoft.RecoveryServices/vaults/privateEndpointConnections[*].privateLinkServiceConnectionState.status",
"equals": "Approved"
},
{
"field": "Microsoft.RecoveryServices/vaults/privateEndpointConnections[*].provisioningState",
"equals": "Succeeded"
},
{
"field": "Microsoft.RecoveryServices/vaults/privateEndpointConnections[*].id",
"contains": "SiteRecovery"
}
]
}
},
"less": 1
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/11e3da8c-1d68-4392-badd-0ff3c43ab5b0",
"name": "11e3da8c-1d68-4392-badd-0ff3c43ab5b0"
}# Converted from RecoveryServices_PrivateEndpoint_Audit.json by ConvertTo-Bylaw.
Policy '11e3da8c-1d68-4392-badd-0ff3c43ab5b0' {
Properties @{
DisplayName = '[Preview]: Recovery Services vaults should use private link'
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 Azure Recovery Services vaults, data leakage risks are reduced. Learn more about private links for Azure Site Recovery at: https://aka.ms/HybridScenarios-PrivateLink and https://aka.ms/AzureToAzure-PrivateLink.'
Version = '1.0.0-preview'
Category = 'Site Recovery'
Preview = $true
PolicyVersion = '1.0.0-preview'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.RecoveryServices/vaults' {
Require 'privateEndpointConnections, privateLinkServiceConnectionState.status, provisioningState and 1 more are as required' {
Count 'privateEndpointConnections[*]' -Where {
Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
Field provisioningState | Must -Be 'Succeeded'
Field id | Must -ContainText 'SiteRecovery'
} | Must -BeGreaterOrEqual 1
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Site Recovery/RecoveryServices_PrivateEndpoint_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw