Gallery › Backup › Azure built-in policies
Azure Recovery Services vaults should disable public network access
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.1
Disabling public network access improves security by ensuring that recovery services vault is not exposed on the public internet. Creating private endpoints can limit exposure of recovery services vault. Learn more at: https://aka.ms/AB-PublicNetworkAccess-Deny.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONRecoveryServices_PublicNetworkAccess_AuditDeny.json · 51 lines
{
"properties": {
"displayName": "Azure Recovery Services vaults should disable public network access",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disabling public network access improves security by ensuring that recovery services vault is not exposed on the public internet. Creating private endpoints can limit exposure of recovery services vault. Learn more at: https://aka.ms/AB-PublicNetworkAccess-Deny.",
"metadata": {
"version": "1.0.1",
"category": "Backup"
},
"version": "1.0.1",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.RecoveryServices/vaults"
},
{
"field": "Microsoft.RecoveryServices/vaults/publicNetworkAccess",
"notEquals": "Disabled"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.1",
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/9ebbbba3-4d65-4da9-bb67-b22cfaaff090",
"name": "9ebbbba3-4d65-4da9-bb67-b22cfaaff090"
}Bylaw9ebbbba3-4d65-4da9-bb67-b22cfaaff090.bylaw.ps1 · 28 lines
# Converted from RecoveryServices_PublicNetworkAccess_AuditDeny.json by ConvertTo-Bylaw.
Policy '9ebbbba3-4d65-4da9-bb67-b22cfaaff090' {
Properties @{
DisplayName = 'Azure Recovery Services vaults should disable public network access'
Description = 'Disabling public network access improves security by ensuring that recovery services vault is not exposed on the public internet. Creating private endpoints can limit exposure of recovery services vault. Learn more at: https://aka.ms/AB-PublicNetworkAccess-Deny.'
Version = '1.0.1'
Category = 'Backup'
PolicyVersion = '1.0.1'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.RecoveryServices/vaults' {
Require 'publicNetworkAccess is Disabled' {
Field publicNetworkAccess | Must -Be 'Disabled'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Backup/RecoveryServices_PublicNetworkAccess_AuditDeny.json in Azure/azure-policy, under the MIT licence.
Bylaw