Gallery › Monitoring › Azure built-in policies
Log Analytics workspaces should block log ingestion and querying from public networks
Converted Policy Audit Deny Disabled Mode Indexed Version 1.1.0
Improve workspace security by blocking log ingestion and querying from public networks. Only private-link connected networks will be able to ingest and query logs on this workspace. Learn more at https://aka.ms/AzMonPrivateLink#configure-log-analytics.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONLogAnalyticsWorkspaces_NetworkAccessEnabled_Deny.json · 61 lines
{
"properties": {
"displayName": "Log Analytics workspaces should block log ingestion and querying from public networks",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Improve workspace security by blocking log ingestion and querying from public networks. Only private-link connected networks will be able to ingest and query logs on this workspace. Learn more at https://aka.ms/AzMonPrivateLink#configure-log-analytics.",
"metadata": {
"version": "1.1.0",
"category": "Monitoring"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
},
"allowedValues": [
"audit",
"Audit",
"deny",
"Deny",
"disabled",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.OperationalInsights/workspaces"
},
{
"anyOf": [
{
"field": "Microsoft.OperationalInsights/workspaces/publicNetworkAccessForIngestion",
"notEquals": "disabled"
},
{
"field": "Microsoft.OperationalInsights/workspaces/publicNetworkAccessForQuery",
"notEquals": "disabled"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/6c53d030-cc64-46f0-906d-2bc061cd1334",
"name": "6c53d030-cc64-46f0-906d-2bc061cd1334"
}Bylaw6c53d030-cc64-46f0-906d-2bc061cd1334.bylaw.ps1 · 32 lines
# Converted from LogAnalyticsWorkspaces_NetworkAccessEnabled_Deny.json by ConvertTo-Bylaw.
Policy '6c53d030-cc64-46f0-906d-2bc061cd1334' {
Properties @{
DisplayName = 'Log Analytics workspaces should block log ingestion and querying from public networks'
Description = 'Improve workspace security by blocking log ingestion and querying from public networks. Only private-link connected networks will be able to ingest and query logs on this workspace. Learn more at https://aka.ms/AzMonPrivateLink#configure-log-analytics.'
Version = '1.1.0'
Category = 'Monitoring'
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('audit', 'Audit', 'deny', 'Deny', 'disabled', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The effect determines what happens when the policy rule is evaluated to match'
}
Resource 'Microsoft.OperationalInsights/workspaces' {
Require 'publicNetworkAccessForIngestion is disabled' {
Field publicNetworkAccessForIngestion | Must -Be 'disabled'
}
Require 'publicNetworkAccessForQuery is disabled' {
Field publicNetworkAccessForQuery | Must -Be 'disabled'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Monitoring/LogAnalyticsWorkspaces_NetworkAccessEnabled_Deny.json in Azure/azure-policy, under the MIT licence.
Bylaw