Gallery › Mission › Azure built-in policies
Configure key vaults to disable unrestricted public network access in Mission Platform products and services
Converted Policy Disabled Modify Mode Indexed Version 1.0.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Disable public network access to Key Vaults in Mission Platforms only when the firewall default action is Allow. Vaults restricted to selected virtual networks and IP addresses are left unchanged. Existing firewall rules and trusted-service bypass settings are preserved. Configure required private connectivity and service access before remediation to avoid disrupting workloads.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Configure key vaults to disable unrestricted public network access in Mission Platform products and services",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Disable public network access to Key Vaults in Mission Platforms only when the firewall default action is Allow. Vaults restricted to selected virtual networks and IP addresses are left unchanged. Existing firewall rules and trusted-service bypass settings are preserved. Configure required private connectivity and service access before remediation to avoid disrupting workloads.",
"metadata": {
"version": "1.0.0",
"category": "Mission"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.KeyVault/vaults"
},
{
"not": {
"field": "Microsoft.KeyVault/vaults/createMode",
"equals": "recover"
}
},
{
"field": "Microsoft.KeyVault/vaults/publicNetworkAccess",
"notEquals": "Disabled"
},
{
"field": "Microsoft.KeyVault/vaults/networkAcls.defaultAction",
"notEquals": "Deny"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"conflictEffect": "audit",
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/f25e0fa2-a7c8-4377-a976-54943a77a395"
],
"operations": [
{
"operation": "addOrReplace",
"field": "Microsoft.KeyVault/vaults/publicNetworkAccess",
"value": "Disabled"
}
]
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/fb759c06-d992-42c0-b099-9e09cf902093",
"name": "fb759c06-d992-42c0-b099-9e09cf902093"
}# Converted from KeyVaultDisablePublicNetworkAccess_Modify.json by ConvertTo-Bylaw.
Policy 'fb759c06-d992-42c0-b099-9e09cf902093' {
Properties @{
DisplayName = 'Configure key vaults to disable unrestricted public network access in Mission Platform products and services'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Disable public network access to Key Vaults in Mission Platforms only when the firewall default action is Allow. Vaults restricted to selected virtual networks and IP addresses are left unchanged. Existing firewall rules and trusted-service bypass settings are preserved. Configure required private connectivity and service access before remediation to avoid disrupting workloads.'
Version = '1.0.0'
Category = 'Mission'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Modify', 'Disabled')
Default = 'Modify'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.KeyVault/vaults' {
When {
Field createMode | Must -Not -Be 'recover'
Field publicNetworkAccess | Must -Not -Be 'Disabled'
}
Require 'networkAcls.defaultAction is Deny' {
Field networkAcls.defaultAction | Must -Be 'Deny'
}
}
Modify -Role 'Key Vault Contributor' -ConflictEffect Audit -Effect (Param Effect) {
Field publicNetworkAccess | AddOrReplace 'Disabled'
}
}Source: built-in-policies/policyDefinitions/Mission/KeyVaultDisablePublicNetworkAccess_Modify.json in Azure/azure-policy, under the MIT licence.
Bylaw