Gallery › Monitoring › Azure built-in policies
Azure Monitor Private Link Scope should block access to non private link resources
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Azure Private Link lets you connect your virtual networks to Azure resources through a private endpoint to an Azure Monitor Private Link scope (AMPLS). Private Link Access modes are set on your AMPLS to control whether ingestion and query requests from your networks can reach all resources, or only Private Link resources (to prevent data exfiltration). Learn more about private links at: https://docs.microsoft.com/azure/azure-monitor/logs/private-link-security#private-link-access-modes-private-only-vs-open.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "Azure Monitor Private Link Scope should block access to non private link resources",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Azure Private Link lets you connect your virtual networks to Azure resources through a private endpoint to an Azure Monitor Private Link scope (AMPLS). Private Link Access modes are set on your AMPLS to control whether ingestion and query requests from your networks can reach all resources, or only Private Link resources (to prevent data exfiltration). Learn more about private links at: https://docs.microsoft.com/azure/azure-monitor/logs/private-link-security#private-link-access-modes-private-only-vs-open.",
"metadata": {
"version": "1.0.0",
"category": "Monitoring"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Insights/privateLinkScopes"
},
{
"anyOf": [
{
"field": "Microsoft.Insights/privateLinkScopes/accessModeSettings.ingestionAccessMode",
"notEquals": "PrivateOnly"
},
{
"field": "Microsoft.Insights/privateLinkScopes/accessModeSettings.queryAccessMode",
"notEquals": "PrivateOnly"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/a499fed8-bcc8-4195-b154-641f14743757",
"name": "a499fed8-bcc8-4195-b154-641f14743757"
}# Converted from AzureMonitorPrivateLinkScopes_AccessModeSettings_Audit.json by ConvertTo-Bylaw.
Policy 'a499fed8-bcc8-4195-b154-641f14743757' {
Properties @{
DisplayName = 'Azure Monitor Private Link Scope should block access to non private link resources'
Description = 'Azure Private Link lets you connect your virtual networks to Azure resources through a private endpoint to an Azure Monitor Private Link scope (AMPLS). Private Link Access modes are set on your AMPLS to control whether ingestion and query requests from your networks can reach all resources, or only Private Link resources (to prevent data exfiltration). Learn more about private links at: https://docs.microsoft.com/azure/azure-monitor/logs/private-link-security#private-link-access-modes-private-only-vs-open.'
Version = '1.0.0'
Category = 'Monitoring'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The effect determines what happens when the policy rule is evaluated to match'
}
Resource 'Microsoft.Insights/privateLinkScopes' {
Require 'accessModeSettings.ingestionAccessMode is PrivateOnly' {
Field accessModeSettings.ingestionAccessMode | Must -Be 'PrivateOnly'
}
Require 'accessModeSettings.queryAccessMode is PrivateOnly' {
Field accessModeSettings.queryAccessMode | Must -Be 'PrivateOnly'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Monitoring/AzureMonitorPrivateLinkScopes_AccessModeSettings_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw