Skip to content

Commit 1fb7c73

Browse files
Merge pull request #297279 from halkazwini/waf-tshoot
Freshness: Troubleshoot Web Application Firewall (WAF) for Azure Application Gateway
2 parents 8cc8043 + 32fb742 commit 1fb7c73

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

articles/web-application-firewall/ag/web-application-firewall-troubleshoot.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
title: Troubleshoot - Azure Web Application Firewall
2+
title: Troubleshoot
3+
titleSuffix: Azure Web Application Firewall
34
description: This article provides troubleshooting information for Web Application Firewall (WAF) for Azure Application Gateway
45
author: halkazwini
56
ms.author: halkazwini
67
ms.service: azure-web-application-firewall
78
ms.topic: concept-article
8-
ms.date: 03/05/2024
9+
ms.date: 03/31/2025
910
---
1011

1112
# Troubleshoot Web Application Firewall (WAF) for Azure Application Gateway
1213

13-
There are a few things you can do if requests that should pass through your Web Application Firewall (WAF) are blocked.
14+
If your Web Application Firewall (WAF) is blocking requests that should be allowed, there are a few steps you can take.
1415

15-
First, ensure you’ve read the [WAF overview](ag-overview.md) and the [WAF configuration](application-gateway-waf-configuration.md) documents. Also, make sure you’ve enabled [WAF monitoring](../../application-gateway/application-gateway-diagnostics.md) These articles explain how the WAF functions, how the WAF rule sets work, and how to access WAF logs.
16+
Start by reviewing the [WAF overview](ag-overview.md) and [WAF configuration](application-gateway-waf-configuration.md) documentation, and ensure [WAF monitoring](../../application-gateway/application-gateway-diagnostics.md) is enabled. These articles explain how the WAF operates, how the rule sets work, and how to access WAF logs.
1617

17-
The OWASP rulesets are designed to be strict out of the box, and to be tuned to suit the specific needs of the application or organization using WAF. It's entirely normal, and expected in many cases, to create exclusions, custom rules, and even disable rules that may be causing issues or false positives. Per-site and per-URI policies allow for these changes to only affect specific sites/URIs. So any changes shouldn’t have to affect other sites that may not be running into the same issues.
18+
The OWASP rule sets are designed to be strict out of the box, and to be tuned to suit the specific needs of the application or organization using WAF. It's entirely normal, and expected in many cases, to create exclusions, custom rules, and even disable rules that may be causing issues or false positives. Per-site and per-URI policies allow for these changes to only affect specific sites/URIs. So changes shouldn’t have to affect other sites that may not be running into the same issues.
1819

1920
## Understanding WAF logs
2021

@@ -133,9 +134,7 @@ The final two log entries show the request was blocked because the anomaly score
133134

134135
With this information, and the knowledge that rule 942130 is the one that matched the `1=1` string, you can do a few things to stop this from blocking your traffic:
135136

136-
- Use an exclusion list
137-
138-
For more information about exclusion lists, see [WAF configuration](application-gateway-waf-configuration.md).
137+
- Use an exclusion list. For more information about exclusion lists, see [WAF exclusion lists](application-gateway-waf-configuration.md).
139138

140139
- Disable the rule.
141140

@@ -145,13 +144,13 @@ To make an informed decision about handling a false positive, it’s important t
145144

146145
One benefit of using an exclusion list is that only a specific part of a request is being disabled. However, this means that a specific exclusion is applicable to all traffic passing through your WAF because it's a global setting. For example, this could lead to an issue if *1=1* is a valid request in the body for a certain app, but not for others. Another benefit is that you can choose between body, headers, and cookies to be excluded if a certain condition is met, as opposed to excluding the whole request.
147146

148-
Occasionally, there are cases where specific parameters get passed into the WAF in a manner that may not be intuitive. For example, there's a token that gets passed when authenticating using Microsoft Entra ID. This token, *__RequestVerificationToken*, usually get passed in as a Request Cookie. However, in some cases where cookies are disabled, this token is also passed as a request attribute or `arg`. If this happens, you need to ensure that *__RequestVerificationToken* is added to the exclusion list as a **Request attribute name** as well.
147+
Occasionally, there are cases where specific parameters get passed into the WAF in a manner that may not be intuitive. For example, there's a token that gets passed when authenticating using Microsoft Entra ID. *__RequestVerificationToken* is usually passed in as a request cookie. However, in some cases where cookies are disabled, this token is also passed as a request attribute or `arg`. If this happens, you need to ensure that *__RequestVerificationToken* is added to the exclusion list as a **Request attribute name** as well.
149148

150-
![Exclusions](../media/web-application-firewall-troubleshoot/exclusion-list.png)
149+
:::image type="content" source="../media/web-application-firewall-troubleshoot/exclusion-list.png" alt-text="Screenshot that shows the exclusion list.":::
151150

152151
In this example, you want to exclude the **Request attribute name** that equals *text1*. This is apparent because you can see the attribute name in the firewall logs: **data: Matched Data: 1=1 found within ARGS:text1: 1=1**. The attribute is **text1**. You can also find this attribute name a few other ways, see [Finding request attribute names](#finding-request-attribute-names).
153152

154-
![WAF exclusion lists](../media/web-application-firewall-troubleshoot/waf-config.png)
153+
:::image type="content" source="../media/web-application-firewall-troubleshoot/waf-config.png" alt-text="Screenshot that shows how to configure WAF exclusion lists.":::
155154

156155
You can create exclusions for WAF in Application Gateway at different scope levels. For more information, see [Web Application Firewall exclusion lists](application-gateway-waf-configuration.md#exclusion-scopes).
157156

@@ -169,11 +168,11 @@ With the help of [Fiddler](https://www.telerik.com/fiddler), you inspect individ
169168

170169
In this example, you can see that the field where the *1=1* string was entered is called **text1**.
171170

172-
:::image type="content" source="../media/web-application-firewall-troubleshoot/fiddler-1.png" alt-text="Screenshot of the Progress Telerik Fiddler Web Debugger. In the Raw tab, 1 = 1 is visible after the name text1." border="false":::
171+
:::image type="content" source="../media/web-application-firewall-troubleshoot/fiddler-1.png" alt-text="Screenshot of the Progress Telerik Fiddler Web Debugger. In the Raw tab, 1 = 1 is visible after the name text1.":::
173172

174173
This is a field you can exclude. To learn more about exclusion lists, See [Web application firewall exclusion lists](application-gateway-waf-configuration.md). You can exclude the evaluation in this case by configuring the following exclusion:
175174

176-
![WAF exclusion](../media/web-application-firewall-troubleshoot/waf-exclusion-02.png)
175+
:::image type="content" source="../media/web-application-firewall-troubleshoot/waf-exclusion-02.png" alt-text="Screenshot that shows WAF exclusion.":::
177176

178177
You can also examine the firewall logs to get the information to see what you need to add to the exclusion list. To enable logging, see [Back-end health, resource logs, and metrics for Application Gateway](../../application-gateway/application-gateway-diagnostics.md).
179178

@@ -298,7 +297,7 @@ Fiddler is a useful tool once again to find request header names. In the followi
298297

299298
Another way to view request and response headers is to look inside the developer tools of Chrome. You can press F12 or right-click -> **Inspect** -> **Developer Tools**, and select the **Network** tab. Load a web page, and select the request you want to inspect.
300299

301-
![Chrome F12](../media/web-application-firewall-troubleshoot/chrome-f12.png)
300+
:::image type="content" source="../media/web-application-firewall-troubleshoot/chrome-f12.png" alt-text="Screenshot that shows the result of clicking F12 in a Chrome browser.":::
302301

303302
## Finding request cookie names
304303

@@ -314,9 +313,9 @@ If the request contains cookies, the **Cookies** tab can be selected to view the
314313

315314
- Disable maximum request body limit
316315

317-
By disabling max request body limit, large request bodies can be processed by the WAF without being rejected for being too large. This may be useful if you regularly have large requests.
316+
By disabling max request body limit, WAF can process large request bodies without rejecting them for exceeding the size limit. This setting is useful if you regularly have large requests.
318317

319-
When you disable this option, the request body will only be inspected up to the max request body inspection limit. If there is malicious content in the request beyond the max request body inspection limit the WAF will not detect it.
318+
When you disable this option, the request body will only be inspected up to the max request body inspection limit. If there's malicious content in the request beyond the max request body inspection limit the WAF won't detect it.
320319

321320
- Disable maximum file size limits
322321

@@ -326,9 +325,9 @@ If the request contains cookies, the **Cookies** tab can be selected to view the
326325
> If you know that your app will never need any file upload above a given size, you can restrict that by setting a limit.
327326
328327
> [!WARNING]
329-
> When assigning a new managed ruleset to a WAF policy, all the previous customizations from the existing managed rulesets such as rule state, rule actions and rule level exclusions will be reset to the new managed ruleset's defaults. However, any custom rules, policy settings, and global exclusions will remain unaffected during the new ruleset assignment.
328+
> When assigning a new managed ruleset to a WAF policy, all the previous customizations from the existing managed rulesets such as rule state, rule actions, and rule level exclusions will be reset to the new managed ruleset's defaults. However, any custom rules, policy settings, and global exclusions will remain unaffected during the new ruleset assignment.
330329
331-
## Firewall Metrics (WAF_v1 only)
330+
## Firewall Metrics (WAF v1 only)
332331

333332
For v1 Web Application Firewalls, the following metrics are now available in the portal:
334333

@@ -341,6 +340,7 @@ For v1 Web Application Firewalls, the following metrics are now available in the
341340

342341
To enable metrics, select the **Metrics** tab in the portal, and select one of the three metrics.
343342

344-
## Next steps
343+
## Next step
345344

346-
See [How to configure web application firewall on Application Gateway](tutorial-restrict-web-traffic-powershell.md).
345+
> [!div class="nextstepaction"]
346+
> [Configure Web Application Firewall on Application Gateway](tutorial-restrict-web-traffic-powershell.md)

0 commit comments

Comments
 (0)