Gallery › Key Vault › Azure built-in policies
[Preview]: Azure Key Vault Managed HSM should disable public network access
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0-preview Preview
Disable public network access for your Azure Key Vault Managed HSM so that it's not accessible over the public internet. This can reduce data leakage risks. Learn more at: https://docs.microsoft.com/azure/key-vault/managed-hsm/private-link#allow-trusted-services-to-access-managed-hsm.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONManagedHsm_FirewallEnabled_Audit.json · 55 lines
{
"properties": {
"displayName": "[Preview]: Azure Key Vault Managed HSM should disable public network access",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disable public network access for your Azure Key Vault Managed HSM so that it's not accessible over the public internet. This can reduce data leakage risks. Learn more at: https://docs.microsoft.com/azure/key-vault/managed-hsm/private-link#allow-trusted-services-to-access-managed-hsm.",
"metadata": {
"version": "1.0.0-preview",
"category": "Key Vault",
"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",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.KeyVault/managedHSMs"
},
{
"field": "Microsoft.KeyVault/managedHSMs/createMode",
"notEquals": "recover"
},
{
"field": "Microsoft.KeyVault/managedHSMs/networkAcls.defaultAction",
"notEquals": "Deny"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/19ea9d63-adee-4431-a95e-1913c6c1c75f",
"name": "19ea9d63-adee-4431-a95e-1913c6c1c75f"
}Bylaw19ea9d63-adee-4431-a95e-1913c6c1c75f.bylaw.ps1 · 33 lines
# Converted from ManagedHsm_FirewallEnabled_Audit.json by ConvertTo-Bylaw.
Policy '19ea9d63-adee-4431-a95e-1913c6c1c75f' {
Properties @{
DisplayName = '[Preview]: Azure Key Vault Managed HSM should disable public network access'
Description = 'Disable public network access for your Azure Key Vault Managed HSM so that it''s not accessible over the public internet. This can reduce data leakage risks. Learn more at: https://docs.microsoft.com/azure/key-vault/managed-hsm/private-link#allow-trusted-services-to-access-managed-hsm.'
Version = '1.0.0-preview'
Category = 'Key Vault'
Preview = $true
PolicyVersion = '1.0.0-preview'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.KeyVault/managedHSMs' {
When {
Field createMode | Must -Not -Be 'recover'
}
Require 'networkAcls.defaultAction is Deny' {
Field networkAcls.defaultAction | Must -Be 'Deny'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Key Vault/ManagedHsm_FirewallEnabled_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw