Gallery › Mission › Azure built-in policies
App network configuration should deny link to external private endpoints
Converted Policy Audit Deny Disabled Mode All Version 1.1.0
This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Deny external private endpoints linked to apps in this tenant.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAppRestrictExternalPE_Audit.json · 63 lines
{
"properties": {
"displayName": "App network configuration should deny link to external private endpoints",
"policyType": "BuiltIn",
"mode": "All",
"description": "This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Deny external private endpoints linked to apps in this tenant.",
"metadata": {
"version": "1.1.0",
"category": "Mission"
},
"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.Web/sites/privateEndpointConnections"
},
{
"field": "Microsoft.Web/sites/privateEndpointConnections/privateLinkServiceConnectionState.status",
"equals": "Approved"
},
{
"anyOf": [
{
"field": "Microsoft.Web/sites/privateEndpointConnections/privateEndpoint.id",
"exists": false
},
{
"value": "[split(concat(field('Microsoft.Web/sites/privateEndpointConnections/privateEndpoint.id'), '//'), '/')[2]]",
"notEquals": "[subscription().subscriptionId]"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0",
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/a83269e2-b4f7-4a3f-b5ed-897c787cbc7c",
"name": "a83269e2-b4f7-4a3f-b5ed-897c787cbc7c"
}Bylawa83269e2-b4f7-4a3f-b5ed-897c787cbc7c.bylaw.ps1 · 36 lines
# Converted from AppRestrictExternalPE_Audit.json by ConvertTo-Bylaw.
Policy 'a83269e2-b4f7-4a3f-b5ed-897c787cbc7c' {
Properties @{
DisplayName = 'App network configuration should deny link to external private endpoints'
Description = 'This policy applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. Deny external private endpoints linked to apps in this tenant.'
Version = '1.1.0'
Category = 'Mission'
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.Web/sites/privateEndpointConnections' {
When {
Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
}
Require 'privateEndpoint.id exists' {
Field privateEndpoint.id | Must -Exist
}
Require 'privateEndpoint.id is as required' {
Arm '[split(concat(field(''Microsoft.Web/sites/privateEndpointConnections/privateEndpoint.id''), ''//''), ''/'')[2]]' | Must -Be (Arm '[subscription().subscriptionId]')
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Mission/AppRestrictExternalPE_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw