Azure Firewall Logging and Monitoring

Effective logging and monitoring are crucial for understanding network traffic, identifying potential security threats, and troubleshooting issues with your Azure Firewall deployment. Azure Firewall integrates with Azure Monitor to provide comprehensive insights.

Key Logging and Monitoring Components

Azure Firewall Logs

Azure Firewall generates several types of logs that capture different aspects of its operation:

Azure Monitor Integration

Azure Firewall's logs can be sent to various destinations for analysis:

Configuring Diagnostic Settings

To enable logging, you need to configure diagnostic settings for your Azure Firewall resource:

  1. Navigate to your Azure Firewall resource in the Azure portal.
  2. Under Monitoring, select Diagnostic settings.
  3. Click + Add diagnostic setting.
  4. Select the log categories you want to collect (e.g., AzureDiagnostics, NetworkRule, ApplicationRule, ThreatIntel).
  5. Choose the destination(s) for your logs (Log Analytics workspace, Storage account, or Event Hubs).
  6. Click Save.
It's recommended to send logs to a Log Analytics workspace for immediate analysis and alert configuration.

Analyzing Logs with Log Analytics

Once logs are sent to a Log Analytics workspace, you can use KQL to query and analyze them. Here are some common query examples:

Common KQL Queries

View all network rule matches:

AzureDiagnostics
| where Category == "NetworkRule"
| project TimeGenerated, Resource, RuleCollectionGroup, Rule, Action, SourceIP, DestinationIP, Protocol, DestinationPort, PrimaryUser, UserInfo, HostName, RuleCollection, NetworkRuleName

View all application rule matches:

AzureDiagnostics
| where Category == "ApplicationRule"
| project TimeGenerated, Resource, RuleCollectionGroup, Rule, Action, SourceIP, Protocol, HostName, FQDN, UserInfo, PrimaryUser, NetworkRuleName

View threats detected by Threat Intelligence:

AzureDiagnostics
| where Category == "ThreatIntel"
| project TimeGenerated, Resource, ThreatIntelDescription, ThreatIntelType, SourceIP, DestinationIP, Port, RuleName

Count network traffic by source IP:

AzureDiagnostics
| where Category == "NetworkRule"
| summarize count() by SourceIP
| order by count_ desc

Count application traffic by FQDN:

AzureDiagnostics
| where Category == "ApplicationRule"
| summarize count() by FQDN
| order by count_ desc

Azure Firewall Metrics

Azure Monitor also provides key performance metrics for your Azure Firewall, including:

You can view these metrics in the Azure portal under the Metrics section of your Azure Firewall resource and set up alerts based on metric thresholds.

Alerting on Firewall Events

Create alert rules in Azure Monitor based on your KQL queries or metrics to be proactively notified of security events or performance issues. Common alerts include:

Consider integrating your Azure Firewall logs with a SIEM solution for advanced threat detection and security analysis.

Further Reading