Azure Web Application Firewall monitoring and logging (2024)

  • Article
  • 4 minutes to read

Azure Front Door's Web Application Firewall (WAF) provides extensive logging and telemetry to help you to understand how your WAF is performing and the actions it takes.

Front Door's WAF log is integrated with Azure Monitor. Azure Monitor enables you to track diagnostic information including WAF alerts and logs. You can configure WAF monitoring within the Front Door resource in the portal under the Diagnostics tab, through infrastructure as code approaches, or by using the Azure Monitor service directly.

Metrics

Azure Front Door automatically records metrics to help you to understand the behavior of your WAF.

To access your WAF's metrics:

  1. Sign in to the Azure portal and navigate to your Azure Front Door profile.
  2. Select the Monitoring/Metrics tab on the left.
  3. Add the WebApplicationFirewallRequestCount to track number of requests that match WAF rules.

Custom filters can be created based on action types and rule names. Metrics include requests with all actions except Log.

Azure Web Application Firewall monitoring and logging (1)

Logs and diagnostics

Azure Front Door's WAF provides detailed reporting on each request, and each threat that it detects. Logging is integrated with Azure's diagnostics logs and alerts by using Azure Monitor logs.

Logs aren't enabled by default. You need to explicitly enable logs. You can configure logs in the Azure portal by using the Diagnostic settings tab.

Azure Web Application Firewall monitoring and logging (2)

If logging is enabled and a WAF rule is triggered, any matching patterns are logged in plain text to help you analyze and debug the WAF policy behavior. You can use exclusions to fine tune rules and exclude any data that you want to be excluded from the logs. For more information, see Web application firewall exclusion lists in Azure Front Door.

Front Door provides two types of logs: access logs and WAF logs.

Access logs

The FrontDoorAccessLog includes all requests that go through Front Door. For more information on the Front Door access log, including the log schema, see Monitor metrics and logs in Azure Front Door.

The FrontdoorAccessLog includes all requests that go through Front Door. For more information on the Front Door access log, including the log schema, see Monitoring metrics and logs in Azure Front Door (classic).

The following example query returns the access log entries:

AzureDiagnostics| where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorAccessLog"
AzureDiagnostics| where ResourceType == "FRONTDOORS" and Category == "FrontdoorAccessLog"

The following shows an example log entry:

{ "time": "2020-06-09T22:32:17.8383427Z", "category": "FrontDoorAccessLog", "operationName": "Microsoft.Cdn/Profiles/AccessLog/Write", "properties": { "trackingReference": "08Q3gXgAAAAAe0s71BET/QYwmqtpHO7uAU0pDRURHRTA1MDgANjMxNTAwZDAtOTRiNS00YzIwLTljY2YtNjFhNzMyOWQyYTgy", "httpMethod": "GET", "httpVersion": "2.0", "requestUri": "https://wafdemofrontdoorwebapp.azurefd.net:443/?q=%27%20or%201=1", "requestBytes": "715", "responseBytes": "380", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4157.0 Safari/537.36 Edg/85.0.531.1", "clientIp": "xxx.xxx.xxx.xxx", "socketIp": "xxx.xxx.xxx.xxx", "clientPort": "52097", "timeTaken": "0.003", "securityProtocol": "TLS 1.2", "routingRuleName": "WAFdemoWebAppRouting", "rulesEngineMatchNames": [], "backendHostname": "wafdemowebappuscentral.azurewebsites.net:443", "sentToOriginShield": false, "httpStatusCode": "403", "httpStatusDetails": "403", "pop": "SJC", "cacheStatus": "CONFIG_NOCACHE" }}
{ "time": "2020-06-09T22:32:17.8383427Z", "category": "FrontdoorAccessLog", "operationName": "Microsoft.Network/FrontDoor/AccessLog/Write", "properties": { "trackingReference": "08Q3gXgAAAAAe0s71BET/QYwmqtpHO7uAU0pDRURHRTA1MDgANjMxNTAwZDAtOTRiNS00YzIwLTljY2YtNjFhNzMyOWQyYTgy", "httpMethod": "GET", "httpVersion": "2.0", "requestUri": "https://wafdemofrontdoorwebapp.azurefd.net:443/?q=%27%20or%201=1", "requestBytes": "715", "responseBytes": "380", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4157.0 Safari/537.36 Edg/85.0.531.1", "clientIp": "xxx.xxx.xxx.xxx", "socketIp": "xxx.xxx.xxx.xxx", "clientPort": "52097", "timeTaken": "0.003", "securityProtocol": "TLS 1.2", "routingRuleName": "WAFdemoWebAppRouting", "rulesEngineMatchNames": [], "backendHostname": "wafdemowebappuscentral.azurewebsites.net:443", "sentToOriginShield": false, "httpStatusCode": "403", "httpStatusDetails": "403", "pop": "SJC", "cacheStatus": "CONFIG_NOCACHE" }}

WAF logs

The FrontDoorWebApplicationFirewallLog includes requests that match a WAF rule.

The FrontdoorWebApplicationFirewallLog includes any request that matches a WAF rule.

The following table shows the values logged for each request:

PropertyDescription
ActionAction taken on the request. Logs include requests with all actions. Actions are:
  • Allow and allow: The request was allowed to continue processing.
  • Block and block: The request matched a WAF rule configured to block the request. Alternatively, the anomaly scoring threshold was reached and the request was blocked.
  • Log and log: The request matched a WAF rule configured to use the Log action.
  • AnomalyScoring and logandscore: The request matched a WAF rule. The rule contributes to the anomaly score. The request might or might not be blocked depending on other rules that run on the same request.
ClientIPThe IP address of the client that made the request. If there was an X-Forwarded-For header in the request, the client IP address is taken from that header field instead.
ClientPortThe IP port of the client that made the request.
DetailsAdditional details on the request, including any threats that were detected.
matchVariableName: HTTP parameter name of the request matched, for example, header names (up to 100 characters maximum).
matchVariableValue: Values that triggered the match (up to 100 characters maximum).
HostThe Host header of the request.
PolicyThe name of the WAF policy that processed the request.
PolicyModeOperations mode of the WAF policy. Possible values are Prevention and Detection.
RequestUriFull URI of the request.
RuleNameThe name of the WAF rule that the request matched.
SocketIPThe source IP address seen by WAF. This IP address is based on the TCP session, and does not consider any request headers.
TrackingReferenceThe unique reference string that identifies a request served by Front Door. This value is sent to the client in the X-Azure-Ref response header. Use this field when searching for a specific request in the log.

The following example query shows the requests that were blocked by the Front Door WAF:

AzureDiagnostics | where ResourceProvider == "MICROSOFT.CDN" and Category == "FrontDoorWebApplicationFirewallLog" | where action_s == "Block" 
AzureDiagnostics| where ResourceType == "FRONTDOORS" and Category == "FrontdoorWebApplicationFirewallLog"| where action_s == "Block"

The following shows an example log entry, including the reason that the request was blocked:

{ "time": "2020-06-09T22:32:17.8376810Z", "category": "FrontdoorWebApplicationFirewallLog", "operationName": "Microsoft.Cdn/Profiles/Write", "properties": { "clientIP": "xxx.xxx.xxx.xxx", "clientPort": "52097", "socketIP": "xxx.xxx.xxx.xxx", "requestUri": "https://wafdemofrontdoorwebapp.azurefd.net:443/?q=%27%20or%201=1", "ruleName": "Microsoft_DefaultRuleSet-1.1-SQLI-942100", "policy": "WafDemoCustomPolicy", "action": "Block", "host": "wafdemofrontdoorwebapp.azurefd.net", "trackingReference": "08Q3gXgAAAAAe0s71BET/QYwmqtpHO7uAU0pDRURHRTA1MDgANjMxNTAwZDAtOTRiNS00YzIwLTljY2YtNjFhNzMyOWQyYTgy", "policyMode": "prevention", "details": { "matches": [ { "matchVariableName": "QueryParamValue:q", "matchVariableValue": "' or 1=1" } ] } }}
{ "time": "2020-06-09T22:32:17.8376810Z", "category": "FrontdoorWebApplicationFirewallLog", "operationName": "Microsoft.Network/FrontDoorWebApplicationFirewallLog/Write", "properties": { "clientIP": "xxx.xxx.xxx.xxx", "clientPort": "52097", "socketIP": "xxx.xxx.xxx.xxx", "requestUri": "https://wafdemofrontdoorwebapp.azurefd.net:443/?q=%27%20or%201=1", "ruleName": "Microsoft_DefaultRuleSet-1.1-SQLI-942100", "policy": "WafDemoCustomPolicy", "action": "Block", "host": "wafdemofrontdoorwebapp.azurefd.net", "trackingReference": "08Q3gXgAAAAAe0s71BET/QYwmqtpHO7uAU0pDRURHRTA1MDgANjMxNTAwZDAtOTRiNS00YzIwLTljY2YtNjFhNzMyOWQyYTgy", "policyMode": "prevention", "details": { "matches": [ { "matchVariableName": "QueryParamValue:q", "matchVariableValue": "' or 1=1" } ] } }}

Next steps

Azure Web Application Firewall monitoring and logging (2024)

FAQs

How to monitor Azure WAF? ›

Access WAF Metrics in Azure portal
  1. From the Azure portal menu, select All Resources >> <your-Application-Gateway-profile>.
  2. Under Monitoring, select Metrics:
  3. In Metrics, select the metric to add:
  4. Select Add filter to add a filter:
  5. Select New chart to add a new chart.
Jun 24, 2024

How do I monitor application logs in Azure? ›

To enable application logging for Windows apps in the Azure portal, navigate to your app and select App Service logs. Select On for either Application Logging (Filesystem) or Application Logging (Blob), or both. The Filesystem option is for temporary debugging purposes, and turns itself off in 12 hours.

What is the difference between WAF and firewall in Azure? ›

The WAF provides protection at the web application layer. Azure Firewall acts as a central logging and control point, and it inspects traffic between the Application Gateway and the backend servers. The Application Gateway and Azure Firewall aren't sitting in parallel, but one after the other.

How do I check my WAF logs? ›

Complete the following steps:
  1. Open the AWS WAF console.
  2. In the navigation pane, choose AWS WAF, and then choose Web ACLs.
  3. For Region, select the AWS Region that contains your web access control list (web ACL). ...
  4. Select your web ACL.
  5. In the navigation pane, choose Log Insights.
  6. Select the log groups that you want to query.

How should firewalls be monitored with logging solutions? ›

Firewall Rule Monitoring

Manual verification is done by looking at the firewall logs to see if the expected traffic is being allowed or denied. Software tools can automate this process by monitoring the firewall in real time and generating alerts when unexpected traffic is detected.

What is the difference between Azure application gateway and WAF? ›

WAF is an additional setting for the application gateway. It's used to increase the security of applications behind the application gateway, and it also provides centralized protection.

How to test Azure WAF? ›

Tutorial: Setup an Azure WAF Security Protection and Detection Lab
  1. Deploy a demo test environment in Azure.
  2. Deploy Azure Monitor Workbook for WAF.
  3. Enable desktop environment on Linux VM.
  4. Create host file entries to resolve host names.
Jan 14, 2021

What are the different types of logs in Azure Monitor? ›

We will focus on Azure Monitor logs in this article. Within Microsoft Azure, there are two types of logs: Platform logs: the native logs of the Azure platform, made up of activity logs and resource logs. Application logs: the logs developers send from applications to Azure Monitor Logs.

How to check logs for web application? ›

How Can I Monitor My Web Server Logs?
  1. /var/log/apache/access. log.
  2. /var/log/apache2/access. log.
  3. /etc/httpd/log/access_log (on MacOS X)
  4. /var/log/apache2/error. log.

Do I need a WAF if I have a firewall? ›

A network firewall alone will not protect businesses from attacks against webpages, which are only preventable through WAF capabilities. So without an application firewall, businesses could leave their broader network open to attack through web application vulnerabilities.

What is Azure web app firewall? ›

Azure Web Application Firewall is a cloud-native service that protects your web applications from bot attacks and common web vulnerabilities such as SQL injection and cross-site scripting.

How many types of WAF are there? ›

A web application firewall is a type of firewall designated to protect web applications. It continuously inspects HTTP traffic to detect and block malicious traffic and web application attacks.

How do I Audit firewall logs? ›

Firewall audit checklist for security policy rules review
  1. Ensuring continuous compliance.
  2. Gather key information prior t...
  3. Review the change management p...
  4. Audit the firewall's physical ...
  5. Cleanup and optimize the rule ...
  6. Conduct a risk assessment and ...
  7. Ongoing audits.
  8. Automating firewall compliance...

How do I Monitor Azure function logs? ›

To view a near real time stream of application log files generated by your function running in Azure, you can connect to Application Insights and use Live Metrics Stream. Or, you can use the App Service platform built-in log streaming to view a stream of application log files.

Where are Azure WAF logs stored? ›

The logs are preserved for 90 days in the Azure event logs store. Learn more about these logs by reading the View events and activity log article.

Top Articles
Binance Coin price history Sep 2017 - Dec 13, 2023 | Statista
الإبلاغ عن محادثة غير مرغوب فيها - على جهاز يعمل بنظام التشغيل Android
4-Hour Private ATV Riding Experience in Adirondacks 2024 on Cool Destinations
Best Team In 2K23 Myteam
Sandrail Options and Accessories
Erika Kullberg Wikipedia
Coffman Memorial Union | U of M Bookstores
OSRS Fishing Training Guide: Quick Methods To Reach Level 99 - Rune Fanatics
Gameplay Clarkston
Www.megaredrewards.com
Minn Kota Paws
Mikayla Campinos Videos: A Deep Dive Into The Rising Star
South Ms Farm Trader
Best Restaurants Ventnor
More Apt To Complain Crossword
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Viha Email Login
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Bend Pets Craigslist
Urban Dictionary: hungolomghononoloughongous
Noaa Ilx
Weepinbell Gen 3 Learnset
Craigslist Pet Phoenix
Kaitlyn Katsaros Forum
Talkstreamlive
The Many Faces of the Craigslist Killer
Gas Buddy Prices Near Me Zip Code
Jordan Poyer Wiki
Tuw Academic Calendar
Mikayla Campinos: Unveiling The Truth Behind The Leaked Content
Horses For Sale In Tn Craigslist
Craftybase Coupon
Cvs Sport Physicals
In hunt for cartel hitmen, Texas Ranger's biggest obstacle may be the border itself (2024)
Scat Ladyboy
In Branch Chase Atm Near Me
Σινεμά - Τι Ταινίες Παίζουν οι Κινηματογράφοι Σήμερα - Πρόγραμμα 2024 | iathens.gr
Mcgiftcardmall.con
National Insider Threat Awareness Month - 2024 DCSA Conference For Insider Threat Virtual Registration Still Available
Cal Poly 2027 College Confidential
Indiana Jones 5 Showtimes Near Cinemark Stroud Mall And Xd
Coroner Photos Timothy Treadwell
Sacramentocraiglist
Dlnet Deltanet
Congruent Triangles Coloring Activity Dinosaur Answer Key
Clock Batteries Perhaps Crossword Clue
Kidcheck Login
Amourdelavie
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 6375

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.