Gallery › Guest Configuration › Azure built-in policies
Private endpoints for Guest Configuration assignments should be enabled
Uses Condition Policy Audit Deny Disabled Mode All Version 1.1.0
Private endpoint connections enforce secure communication by enabling private connectivity to Guest Configuration for virtual machines. Virtual machines will be non-compliant unless they have the tag, 'EnablePrivateNetworkGC'. This tag enforces secure communication through private connectivity to Guest Configuration for Virtual Machines. Private connectivity limits access to traffic coming only from known networks and prevents access from all other IP addresses, including within Azure.
ConvertTo-Bylaw converted this policy, and proved it compiles back to the same definition. Conditions the language can't express yet are written as raw JSON with Condition.
{
"properties": {
"displayName": "Private endpoints for Guest Configuration assignments should be enabled",
"policyType": "BuiltIn",
"mode": "All",
"description": "Private endpoint connections enforce secure communication by enabling private connectivity to Guest Configuration for virtual machines. Virtual machines will be non-compliant unless they have the tag, 'EnablePrivateNetworkGC'. This tag enforces secure communication through private connectivity to Guest Configuration for Virtual Machines. Private connectivity limits access to traffic coming only from known networks and prevents access from all other IP addresses, including within Azure.",
"metadata": {
"version": "1.1.0",
"category": "Guest Configuration"
},
"version": "1.1.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.Compute/virtualMachines"
},
{
"not": {
"anyof": [
{
"field": "[concat('tags[', 'EnablePrivateNeworkGC', ']')]",
"equals": "TRUE"
},
{
"field": "[concat('tags[', 'EnablePrivateNetworkGC', ']')]",
"equals": "TRUE"
}
]
}
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/480d0f91-30af-4a76-9afb-f5710ac52b09",
"name": "480d0f91-30af-4a76-9afb-f5710ac52b09"
}# Converted from Azure_PrivateLink_Deny.json by ConvertTo-Bylaw.
Policy '480d0f91-30af-4a76-9afb-f5710ac52b09' {
Properties @{
DisplayName = 'Private endpoints for Guest Configuration assignments should be enabled'
Description = 'Private endpoint connections enforce secure communication by enabling private connectivity to Guest Configuration for virtual machines. Virtual machines will be non-compliant unless they have the tag, ''EnablePrivateNetworkGC''. This tag enforces secure communication through private connectivity to Guest Configuration for Virtual Machines. Private connectivity limits access to traffic coming only from known networks and prevents access from all other IP addresses, including within Azure.'
Version = '1.1.0'
Category = 'Guest Configuration'
PolicyVersion = '1.1.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Compute/virtualMachines' {
Require '[concat(''''tags['''', ''''EnablePrivateNeworkGC'''', '''']'''')] and [concat(''''tags['''', ''''EnablePrivateNetworkGC'''', '''']'''')] are as required' {
AnyOf {
Condition -Violation '{ "field": "[concat(''tags['', ''EnablePrivateNeworkGC'', '']'')]", "notEquals": "TRUE" }'
Condition -Violation '{ "field": "[concat(''tags['', ''EnablePrivateNetworkGC'', '']'')]", "notEquals": "TRUE" }'
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Guest Configuration/Azure_PrivateLink_Deny.json in Azure/azure-policy, under the MIT licence.
Bylaw