Skip to content

Commit 90cb7a4

Browse files
Merge pull request #280994 from vhorne/waf-req-size-limits
update cli example parameter values
2 parents a0dd642 + 36dd442 commit 90cb7a4

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

articles/web-application-firewall/ag/application-gateway-waf-request-size-limits.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article provides information on Web Application Firewall reque
44
services: web-application-firewall
55
author: vhorne
66
ms.service: web-application-firewall
7-
ms.date: 03/05/2024
7+
ms.date: 07/16/2024
88
ms.author: victorh
99
ms.topic: concept-article
1010
---
@@ -22,7 +22,7 @@ Web Application Firewall allows you to configure request size limits within a lo
2222

2323
The request body size field and the file upload size limit are both configurable within the Web Application Firewall. The maximum request body size field is specified in kilobytes and controls overall request size limit excluding any file uploads. The file upload limit field is specified in megabytes and it governs the maximum allowed file upload size. For the request size limits and file upload size limit, see [Application Gateway limits](../../azure-resource-manager/management/azure-subscription-service-limits.md#application-gateway-limits).
2424

25-
For Application Gateway v2 Web Application Firewalls running Core Rule Set 3.2, or newer, the maximum request body size enforcement and max file upload size enforcement can be disabled and the Web Application Firewall will no longer reject a request, or file upload, for being too large. When maximum request body size enforcement and max file upload size enforcement are disabled within the Web Application Firewall, Application Gateway's limits determine the maximum size allowable. For more information, see [Application Gateway limits](../../azure-resource-manager/management/azure-subscription-service-limits.md#application-gateway-limits).
25+
For Application Gateway v2 Web Application Firewalls running Core Rule Set 3.2, or newer, the maximum request body size enforcement and max file upload size enforcement can be disabled and the Web Application Firewall no longer rejects a request, or file upload, for being too large. When maximum request body size enforcement and max file upload size enforcement are disabled within the Web Application Firewall, Application Gateway's limits determine the maximum size allowable. For more information, see [Application Gateway limits](../../azure-resource-manager/management/azure-subscription-service-limits.md#application-gateway-limits).
2626

2727
Only requests with Content-Type of *multipart/form-data* are considered for file uploads. For content to be considered as a file upload, it has to be a part of a multipart form with a *filename* header. For all other content types, the request body size limit applies.
2828

@@ -36,7 +36,7 @@ Only requests with Content-Type of *multipart/form-data* are considered for file
3636

3737
Web Application Firewall offers a configuration setting to enable or disable the request body inspection. By default, the request body inspection is enabled. If the request body inspection is disabled, Web Application Firewall doesn't evaluate the contents of an HTTP message's body. In such cases, Web Application Firewall continues to enforce Web Application Firewall rules on headers, cookies, and URI. In Web Application Firewalls running Core Rule Set 3.1 (or lower), if the request body inspection is turned off, then maximum request body size field isn't applicable and can't be set.
3838

39-
For Policy Web Application Firewalls running Core Rule Set 3.2 (or newer), request body inspection can be enabled/disabled independently of request body size enforcement and file upload size limits. Additionally, policy Web Application Firewalls running Core Rule Set 3.2 (or newer) can set the maximum request body inspection limit independently of the maximum request body size. The maximum request body inspection limit tells the Web Application Firewall how deep into a request it should inspect and apply rules; setting a lower value for this field can improve Web Application Firewall performance but may allow for uninspected malicious content to pass through your Web Application Firewall.
39+
For Policy Web Application Firewalls running Core Rule Set 3.2 (or newer), request body inspection can be enabled/disabled independently of request body size enforcement and file upload size limits. Additionally, policy Web Application Firewalls running Core Rule Set 3.2 (or newer) can set the maximum request body inspection limit independently of the maximum request body size. The maximum request body inspection limit tells the Web Application Firewall how deep into a request it should inspect and apply rules; setting a lower value for this field can improve Web Application Firewall performance but might allow for uninspected malicious content to pass through your Web Application Firewall.
4040

4141
For older Web Application Firewalls running Core Rule Set 3.1 (or lower), turning off the request body inspection allows for messages larger than 128 KB to be sent to Web Application Firewall, but the message body isn't inspected for vulnerabilities. For Policy Web Application Firewalls running Core Rule Set 3.2 (or newer), you can achieve the same outcome by disabling maximum request body limit.
4242

@@ -46,35 +46,35 @@ When your Web Application Firewall receives a request that's over the size limit
4646

4747
## Troubleshooting
4848

49-
If you're an Application Gateway v2 Web Application Firewall customer running Core Rule Set 3.2 or later and you have issues with requests, or file uploads, getting rejected incorrectly for maximum size, or if you see requests not getting inspected fully, you may need to verify that all values are set correctly. Using PowerShell or the Azure Command Line Interface you can verify what each value is set to, and update any values as needed.
49+
If you're an Application Gateway v2 Web Application Firewall customer running Core Rule Set 3.2 or later and you have issues with requests, or file uploads, getting rejected incorrectly for maximum size, or if you see requests not getting inspected fully, you might need to verify that all values are set correctly. Using PowerShell or the Azure Command Line Interface you can verify what each value is set to, and update any values as needed.
5050

5151
**Enforce request body inspection**
52-
- PS: "RequestBodyCheck"
52+
- PowerShell: "RequestBodyCheck"
5353
- CLI: "request_body_check"
54-
- Controls if your Web Application Firewall will inspect the request body and apply managed and custom rules to the request body traffic per your Web Application Firewall policy’s settings.
54+
- Controls if your Web Application Firewall inspects the request body and apply managed and custom rules to the request body traffic per your Web Application Firewall policy’s settings.
5555

5656
**Maximum request body inspection limit (KB)**
57-
- PS: "RequestBodyInspectLimitInKB"
57+
- PowerShell: "RequestBodyInspectLimitInKB"
5858
- CLI: "request_body_inspect_limit_in_kb"
59-
- Controls how deep into a request body the Web Application Firewall will inspect and apply managed/custom rules. Generally speaking, you’d want to set this to the max possible setting, but some customers might want to set it to a lower value to improve performance.
59+
- Controls how deep into a request body the Web Application Firewall inspects and applies managed/custom rules. Generally speaking, you’d want to set this to the max possible setting, but some customers might want to set it to a lower value to improve performance.
6060

6161
**Enforce maximum request body limit**
62-
- PS: "RequestBodyEnforcement"
62+
- PowerShell: "RequestBodyEnforcement"
6363
- CLI: "request_body_enforcement"
64-
- Control if your Web Application Firewall will enforce a max size limit on request bodies; when turned off it will not reject any requests for being too large.
64+
- Control if your Web Application Firewall enforces a max size limit on request bodies; when turned off it does not reject any requests for being too large.
6565

6666
**Maximum request body size (KB)**
67-
- PS: "MaxRequestBodySizeInKB"
67+
- PowerShell: "MaxRequestBodySizeInKB"
6868
- CLI: "max_request_body_size_in_kb"
6969
- Controls how large a request body can be before the Web Application Firewall rejects it for exceeding the max size setting.
7070

7171
**Enforce maximum file upload limit**
72-
- PS: "FileUploadEnforcement"
72+
- PowerShell: "FileUploadEnforcement"
7373
- CLI: "file_upload_enforcement"
74-
- Controls if your Web Application Firewall will enforce a max size limit on file uploads; when turned off it will not reject any file uploads for being too large.
74+
- Controls if your Web Application Firewall enforces a max size limit on file uploads; when turned off it does not reject any file uploads for being too large.
7575

7676
**Maximum file upload size (MB)**
77-
- PS: "FileUploadLimitInMB"
77+
- PowerShell: "FileUploadLimitInMB"
7878
- CLI: file_upload_limit_in_mb
7979
- Controls how large a file upload can be before the Web Application Firewall rejects it for exceeding the max size setting.
8080

@@ -90,7 +90,8 @@ $plcy = Get-AzApplicationGatewayFirewallPolicy -Name <policy-name> -ResourceGrou
9090
$plcy.PolicySettings
9191
```
9292

93-
You can use these commands to update the policy settings to the desired values for inspection limit and max size limitation related fields. You can swap out 'RequestBodyEnforcement' in the example below for one of the other values that you want to update.
93+
You can use these commands to update the policy settings to the desired values for inspection limit and max size limitation related fields. You can swap out 'RequestBodyEnforcement' in the following example for one of the other values that you want to update.
94+
9495

9596
```azurepowershell-interactive
9697
$plcy = Get-AzApplicationGatewayFirewallPolicy -Name <policy-name> -ResourceGroupName <resourcegroup-name>
@@ -108,14 +109,14 @@ Set-AzApplicationGatewayFirewallPolicy -InputObject $plcy
108109
You can use Azure CLI to return the current values for these fields from your Azure policy settings and update the fields to the desired values using [these commands](/cli/azure/network/application-gateway/waf-policy/policy-setting).
109110

110111
```azurecli-interactive
111-
az network application-gateway waf-policy update --name <WAF Policy name> --resource-group <WAF policy RG> --set policySettings.request_body_inspect_limit_in_kb='2000' policySettings.max_request_body_size_in_kb='2000' policySettings.file_upload_limit_in_mb='3500' --query policySettings -o table
112+
az network application-gateway waf-policy update --name <WAF Policy name> --resource-group <WAF policy RG> --set policySettings.request_body_inspect_limit_in_kb='128' policySettings.max_request_body_size_in_kb='128' policySettings.file_upload_limit_in_mb='100' --query policySettings -o table
112113
```
113114

114115
**Output:**
115116
```azurecli-interactive
116117
FileUploadEnforcement FileUploadLimitInMb MaxRequestBodySizeInKb Mode RequestBodyCheck RequestBodyEnforcement RequestBodyInspectLimitInKB State
117118
----------------------- --------------------- ------------------------ --------- ------------------ ------------------------ ----------------------------- -------
118-
True 3500 2000 Detection True True 2000 Enabled
119+
True 100 128 Detection True True 128 Enabled
119120
```
120121

121122
## Next steps

0 commit comments

Comments
 (0)