Gallery › Desktop Virtualization › Azure built-in policies
Azure Virtual Desktop hostpools should disable public network access only on session hosts
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Disabling public network access for your Azure Virtual Desktop hostpool session hosts, but allowing public access for end users improves security by limiting exposure to the public internet. Learn more at: https://aka.ms/avdprivatelink.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDVHostpool_PrivateNetworkPublicClient_AuditDeny.json · 50 lines
{
"properties": {
"displayName": "Azure Virtual Desktop hostpools should disable public network access only on session hosts",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disabling public network access for your Azure Virtual Desktop hostpool session hosts, but allowing public access for end users improves security by limiting exposure to the public internet. Learn more at: https://aka.ms/avdprivatelink.",
"metadata": {
"version": "1.0.0",
"category": "Desktop Virtualization"
},
"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.DesktopVirtualization/hostpools"
},
{
"field": "Microsoft.DesktopVirtualization/hostPools/publicNetworkAccess",
"notEquals": "EnabledForClientsOnly"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/a22065a3-3b04-46ff-b84c-2d30e5c300d0",
"name": "a22065a3-3b04-46ff-b84c-2d30e5c300d0"
}Bylawa22065a3-3b04-46ff-b84c-2d30e5c300d0.bylaw.ps1 · 28 lines
# Converted from DVHostpool_PrivateNetworkPublicClient_AuditDeny.json by ConvertTo-Bylaw.
Policy 'a22065a3-3b04-46ff-b84c-2d30e5c300d0' {
Properties @{
DisplayName = 'Azure Virtual Desktop hostpools should disable public network access only on session hosts'
Description = 'Disabling public network access for your Azure Virtual Desktop hostpool session hosts, but allowing public access for end users improves security by limiting exposure to the public internet. Learn more at: https://aka.ms/avdprivatelink.'
Version = '1.0.0'
Category = 'Desktop Virtualization'
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.DesktopVirtualization/hostpools' {
Require 'publicNetworkAccess is EnabledForClientsOnly' {
Field publicNetworkAccess | Must -Be 'EnabledForClientsOnly'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Desktop Virtualization/DVHostpool_PrivateNetworkPublicClient_AuditDeny.json in Azure/azure-policy, under the MIT licence.
Bylaw