Gallery › Network › Azure built-in policies
VPN gateways should use only Azure Active Directory (Azure AD) authentication for point-to-site users
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Disabling local authentication methods improves security by ensuring that VPN Gateways use only Azure Active Directory identities for authentication. Learn more about Azure AD authentication at https://docs.microsoft.com/azure/vpn-gateway/openvpn-azure-ad-tenant
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONVPN-AzureAD-audit-deny-disable-policy.json · 60 lines
{
"properties": {
"displayName": "VPN gateways should use only Azure Active Directory (Azure AD) authentication for point-to-site users",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disabling local authentication methods improves security by ensuring that VPN Gateways use only Azure Active Directory identities for authentication. Learn more about Azure AD authentication at https://docs.microsoft.com/azure/vpn-gateway/openvpn-azure-ad-tenant",
"metadata": {
"version": "1.0.0",
"category": "Network"
},
"version": "1.0.0",
"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.Network/virtualNetworkGateways"
},
{
"field": "Microsoft.Network/virtualNetworkGateways/vpnClientConfiguration.vpnClientAddressPool.addressPrefixes",
"exists": "true"
},
{
"count": {
"field": "Microsoft.Network/virtualNetworkGateways/vpnClientConfiguration.vpnAuthenticationTypes[*]",
"where": {
"field": "Microsoft.Network/virtualNetworkGateways/vpnClientConfiguration.vpnAuthenticationTypes[*]",
"notcontains": "AAD"
}
},
"greaterOrEquals": 1
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/21a6bc25-125e-4d13-b82d-2e19b7208ab7",
"name": "21a6bc25-125e-4d13-b82d-2e19b7208ab7"
}Bylaw21a6bc25-125e-4d13-b82d-2e19b7208ab7.bylaw.ps1 · 34 lines
# Converted from VPN-AzureAD-audit-deny-disable-policy.json by ConvertTo-Bylaw.
Policy '21a6bc25-125e-4d13-b82d-2e19b7208ab7' {
Properties @{
DisplayName = 'VPN gateways should use only Azure Active Directory (Azure AD) authentication for point-to-site users'
Description = 'Disabling local authentication methods improves security by ensuring that VPN Gateways use only Azure Active Directory identities for authentication. Learn more about Azure AD authentication at https://docs.microsoft.com/azure/vpn-gateway/openvpn-azure-ad-tenant'
Version = '1.0.0'
Category = 'Network'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Network/virtualNetworkGateways' {
When {
Field vpnClientConfiguration.vpnClientAddressPool.addressPrefixes | Must -Exist
}
Require 'vpnClientConfiguration.vpnAuthenticationTypes is as required' {
Count 'vpnClientConfiguration.vpnAuthenticationTypes[*]' -Where {
Element | Must -Not -ContainText 'AAD'
} | Must -Be 0
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Network/VPN-AzureAD-audit-deny-disable-policy.json in Azure/azure-policy, under the MIT licence.
Bylaw