Gallery › Network › Azure built-in policies
All flow log resources should be in enabled state
Converted Policy Audit Disabled Mode Indexed Version 1.0.1
Audit for flow log resources to verify if flow log status is enabled. Enabling flow logs allows to log information about IP traffic flowing. It can be used for optimizing network flows, monitoring throughput, verifying compliance, detecting intrusions and more.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONNetworkWatcherFlowLog_Enabled_Audit.json · 49 lines
{
"properties": {
"displayName": "All flow log resources should be in enabled state",
"description": "Audit for flow log resources to verify if flow log status is enabled. Enabling flow logs allows to log information about IP traffic flowing. It can be used for optimizing network flows, monitoring throughput, verifying compliance, detecting intrusions and more.",
"policyType": "BuiltIn",
"mode": "Indexed",
"metadata": {
"version": "1.0.1",
"category": "Network"
},
"version": "1.0.1",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allof": [
{
"field": "type",
"equals": "Microsoft.Network/networkWatchers/flowLogs"
},
{
"field": "Microsoft.Network/networkWatchers/flowLogs/enabled",
"equals": false
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/27960feb-a23c-4577-8d36-ef8b5f35e0be",
"name": "27960feb-a23c-4577-8d36-ef8b5f35e0be"
}Bylaw27960feb-a23c-4577-8d36-ef8b5f35e0be.bylaw.ps1 · 29 lines
# Converted from NetworkWatcherFlowLog_Enabled_Audit.json by ConvertTo-Bylaw.
Policy '27960feb-a23c-4577-8d36-ef8b5f35e0be' {
Properties @{
DisplayName = 'All flow log resources should be in enabled state'
Description = 'Audit for flow log resources to verify if flow log status is enabled. Enabling flow logs allows to log information about IP traffic flowing. It can be used for optimizing network flows, monitoring throughput, verifying compliance, detecting intrusions and more.'
Version = '1.0.1'
Category = 'Network'
PolicyVersion = '1.0.1'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Network/networkWatchers/flowLogs' {
Require 'enabled is not false' {
Field enabled | Must -Not -Be $false -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Network/NetworkWatcherFlowLog_Enabled_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw