You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/web-application-firewall/ag/web-application-firewall-troubleshoot.md
+42-15Lines changed: 42 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ description: This article provides troubleshooting information for Web Applicati
5
5
author: halkazwini
6
6
ms.author: halkazwini
7
7
ms.service: azure-web-application-firewall
8
-
ms.topic: concept-article
9
-
ms.date: 06/10/2025
8
+
ms.topic: how-to
9
+
ms.date: 06/13/2025
10
10
---
11
11
12
12
# Troubleshoot Web Application Firewall (WAF) for Azure Application Gateway
@@ -17,7 +17,7 @@ Start by reviewing the [WAF overview](ag-overview.md) and [WAF configuration](ap
17
17
18
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.
19
19
20
-
## Understanding WAF logs
20
+
## Understand WAF logs
21
21
22
22
The purpose of WAF logs is to show every request that WAF matches or blocks. It's a ledger of all evaluated requests that are matched or blocked. If you notice that the WAF blocks a request that it shouldn't (a false positive), you can do a few things. First, narrow down, and find the specific request. Look through the logs to find the specific URI, timestamp, or transaction ID of the request. When you find the associated log entries, you can begin to act on the false positives.
23
23
@@ -130,15 +130,15 @@ The final two log entries show the request was blocked because the anomaly score
130
130
}
131
131
```
132
132
133
-
## Fixing false positives
133
+
## Fix false positives
134
134
135
135
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:
136
136
137
137
- Use an exclusion list. For more information about exclusion lists, see [WAF exclusion lists](application-gateway-waf-configuration.md).
138
138
139
139
- Disable the rule.
140
140
141
-
### Using an exclusion list
141
+
### Use an exclusion list
142
142
143
143
To make an informed decision about handling a false positive, it’s important to familiarize yourself with the technologies your application uses. For example, say there isn't a SQL server in your technology stack, and you're getting false positives related to those rules. Disabling those rules doesn't necessarily weaken your security.
144
144
@@ -154,24 +154,26 @@ In this example, you want to exclude the **Request attribute name** that equals
154
154
155
155
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).
156
156
157
-
### Disabling rules
157
+
### Disable rules
158
158
159
159
Another way to get around a false positive is to disable the rule that matched on the input the WAF thought was malicious. Since you've parsed the WAF logs and have narrowed the rule down to 942130, you can disable it in the Azure portal. See [Customize web application firewall rules through the Azure portal](application-gateway-customize-waf-rules-portal.md).
160
160
161
161
One benefit of disabling a rule is that if you know all traffic that contains a certain condition that is normally blocked is valid traffic, you can disable that rule for the entire WAF. However, if it’s only valid traffic in a specific use case, you open up a vulnerability by disabling that rule for the entire WAF since it's a global setting.
162
162
163
163
If you want to use Azure PowerShell, see [Customize web application firewall rules through PowerShell](application-gateway-customize-waf-rules-powershell.md). If you want to use Azure CLI, see [Customize web application firewall rules through the Azure CLI](application-gateway-customize-waf-rules-cli.md).
164
164
165
-
## HAR files
165
+
## Record HAR files
166
166
167
167
You can use your browser or an external tool like Fiddler to record HTTP Archive (HAR) files. HAR files contain information about the requests and responses that your browser makes when loading a web page. This information can be useful for troubleshooting WAF issues.
168
168
169
169
> [!TIP]
170
170
> It's a good practice to have the HAR file ready when you contact support. The support team can use the HAR file to help diagnose the issue.
171
171
172
+
# [**Edge**](#tab/edge)
173
+
172
174
To record and save a HAR file in Microsoft Edge, follow these steps
173
175
174
-
1. Press **F12** or **Ctrl + Shift + I** to launch Edge Developer tools. You can also launch the tools from the toolbar menu under **More tools > Developer tools**.
176
+
1. Press **F12** or **Ctrl+Shift+I** to launch Edge Developer tools. You can also launch the tools from the toolbar menu under **More tools > Developer tools**.
175
177
176
178
1. In the **Console** tab, select **Clear console** or press **Ctrl + L**.
177
179
@@ -187,11 +189,38 @@ To record and save a HAR file in Microsoft Edge, follow these steps
187
189
188
190
1. Stop recording by selecting the **Stop recording network log**.
189
191
190
-
1. Select **Export HAR (sanitized)...** and save the file. If you don't see the export icon, expand the width of your Edge developer tools window.
192
+
1. Select **Export HAR (sanitized)...** and save the HAR file. If you don't see the export icon, expand the width of your Edge developer tools window.
191
193
192
194
:::image type="content" source="../media/web-application-firewall-troubleshoot/edge-dev-tools-save-file.png" alt-text="Screenshot that shows how to save the HAR file in Microsoft Edge developer tools.":::
193
195
194
-
## Finding request attribute names
196
+
# [**Chrome**](#tab/chrome)
197
+
198
+
To record and save a HAR file in Google Chrome, follow these steps
199
+
200
+
1. Press **F12** or **Ctrl+Shift+I** to launch Chrome Developer tools. You can also launch the tools from the toolbar menu under **More tools > Developer tools**.
201
+
202
+
1. In the **Console** tab, select **Clear console** or press **Ctrl + L**.
203
+
204
+
:::image type="content" source="../media/web-application-firewall-troubleshoot/chrome-dev-tools-console.png" alt-text="Screenshot of the Console tab of Google Chrome developer tools.":::
205
+
206
+
1. Select the **Network** tab.
207
+
208
+
1. Select **Clear network log**, and then select the **Record network log** if it's not recording.
209
+
210
+
:::image type="content" source="../media/web-application-firewall-troubleshoot/chrome-dev-tools-network.png" alt-text="Screenshot of the Network tab of Google Chrome developer tools.":::
211
+
212
+
1. Load the webpage that's protected by your WAF for which you want to troubleshoot.
213
+
214
+
1. Stop recording by selecting the **Stop recording network log**.
215
+
216
+
1. Select **Export HAR (sanitized)...** and save the HAR file.
217
+
218
+
:::image type="content" source="../media/web-application-firewall-troubleshoot/edge-dev-tools-save-file.png" alt-text="Screenshot that shows how to save the HAR file in Microsoft Edge developer tools.":::
219
+
220
+
---
221
+
222
+
223
+
## Find request attribute names
195
224
196
225
With the help of [Fiddler](https://www.telerik.com/fiddler), you inspect individual requests and determine what specific fields of a web page are called. This can help to exclude certain fields from inspection using Exclusion Lists.
197
226
@@ -318,17 +347,15 @@ The first entry is logged because the user used a numeric IP address to navigate
318
347
319
348
The second one (rule 942130) is the interesting one. You can see in the details that it matched a pattern `(1=1)`, and the field is named **text1**. Follow the same previous steps to exclude the **Request Attribute Name** that equals `1=1`.
320
349
321
-
## Finding request header names
350
+
## Find request header names
322
351
323
352
Fiddler is a useful tool once again to find request header names. In the following screenshot, you can see the headers for this GET request, which include *Content-Type*, *User-Agent*, and so on.
324
353
325
354
:::image type="content" source="../media/web-application-firewall-troubleshoot/fiddler-2.png" alt-text="Screenshot of the Progress Telerik Fiddler Web Debugger. The Raw tab lists request header details like the connection, content-type, and user-agent." lightbox="../media/web-application-firewall-troubleshoot/fiddler-2.png":::
326
355
327
-
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.
328
-
329
-
:::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." lightbox="../media/web-application-firewall-troubleshoot/chrome-f12.png":::
356
+
Another way to view request and response headers is to use the developer tools of Microsoft Edge or Google Chrome. For more information, see [Record HAR files](#record-har-files).
330
357
331
-
## Finding request cookie names
358
+
## Find request cookie names
332
359
333
360
If the request contains cookies, the **Cookies** tab can be selected to view them in Fiddler.
0 commit comments