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/application-gateway/configure-waf-custom-rules.md
+33-20Lines changed: 33 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Configure Web Application Firewall v2 custom rules using Azure PowerShell
3
-
description: Learn how to configure WAF v2 custom rules using Azure PowerShell
2
+
title: Configure web application firewall v2 custom rules by using Azure PowerShell
3
+
description: Learn how to configure web application firewall v2 custom rules by using Azure PowerShell
4
4
services: application-gateway
5
5
author: vhorne
6
6
ms.service: application-gateway
@@ -9,33 +9,32 @@ ms.date: 6/18/2019
9
9
ms.author: victorh
10
10
---
11
11
12
-
# Configure Web Application Firewall v2 with a custom rule using Azure PowerShell
12
+
# Configure web application firewall v2 custom rules by using Azure PowerShell
13
13
14
14
<!--- If you make any changes to the PowerShell in this article, also make the change in the corresponding Sample file: azure-docs-powershell-samples/application-gateway/waf-rules/waf-custom-rules.ps1 --->
15
15
16
-
Custom rules allow you to create your own rulesevaluated for each request that passes through the Web Application Firewall (WAF) v2. These rules hold a higher priority than the rest of the rules in the managed rule sets. The custom rules have an action (to allow or block), a match condition, and an operator to allow full customization.
16
+
With custom rules, you can create your own rules, which are evaluated for each request that passes through the web application firewall (WAF). These rules hold a higher priority than the rest of the rules in the managed rule sets. To allow full customization, the custom rules have an action (to allow or block), a match condition, and an operator.
17
17
18
-
This article creates an Application Gateway WAF v2 that uses a custom rule. The custom rule blocks traffic if the request header contains User-Agent *evilbot*.
18
+
This article creates an Azure Application Gateway WAF v2 that uses a custom rule. The custom rule blocks traffic if the request header contains User-Agent *evilbot*.
19
19
20
-
To see more custom rule examples, see [Create and use custom web application firewall rules](create-custom-waf-rules.md)
20
+
To view more custom rule examples, see [Create and use custom web application firewall rules](create-custom-waf-rules.md).
21
21
22
-
If you want run the Azure PowerShell in this article in one continuous script that you can copy, paste, and run, see [Azure Application Gateway PowerShell samples](powershell-samples.md).
22
+
To run the Azure PowerShell code in this article in one continuous script that you can copy, paste, and run, see [Azure Application Gateway PowerShell samples](powershell-samples.md).
* You need an Azure PowerShell module. If you choose to install and use Azure PowerShell locally, this script requires Azure PowerShell module version 2.1.0 or later. Do the following:
27
28
28
-
If you choose to install and use Azure PowerShell locally, this script requires the Azure PowerShell module version 2.1.0 or later.
29
-
30
-
1. To find the version, run `Get-Module -ListAvailable Az`. If you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-az-ps).
31
-
2. To create a connection with Azure, run `Connect-AzAccount`.
1. To find the version, run `Get-Module -ListAvailable Az`. If you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-az-ps).
30
+
2. To create a connection with Azure, run `Connect-AzAccount`.
Copy file name to clipboardExpand all lines: articles/application-gateway/create-custom-waf-rules.md
+27-26Lines changed: 27 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Create and use Azure Web Application Firewall (WAF) v2 custom rules
3
-
description: This article provides information on how to create Web Application Firewall (WAF) v2 custom rules in Azure Application Gateway.
2
+
title: Create and use Azure web application firewall (WAF) v2 custom rules
3
+
description: This article discusses how to create web application firewall (WAF) v2 custom rules in Azure Application Gateway.
4
4
services: application-gateway
5
5
ms.topic: article
6
6
author: vhorne
@@ -9,20 +9,20 @@ ms.date: 6/18/2019
9
9
ms.author: victorh
10
10
---
11
11
12
-
# Create and use Web Application Firewall v2 custom rules
12
+
# Create and use web application firewall v2 custom rules
13
13
14
-
The Azure Application Gateway Web Application Firewall (WAF) v2 provides protection for web applications. This protection is provided by the Open Web Application Security Project (OWASP) Core Rule Set (CRS). In some cases, you may need to create your own custom rules to meet your specific needs. For more information about WAF custom rules, see [Custom web application firewall rules overview](custom-waf-rules-overview.md).
14
+
Azure Application Gateway web application firewall (WAF) v2 provides protection for web applications. This protection is provided by the Open Web Application Security Project (OWASP) core rule set. In some cases, you might need to create your own custom rules to meet your specific needs. For more information about WAF custom rules, see [Overview: Custom web application firewall rules](custom-waf-rules-overview.md).
15
15
16
-
This article shows you some example custom rules that you can create and use with your v2 WAF. To learn how to deploy a WAF with a custom rule using Azure PowerShell, see [Configure Web Application Firewall custom rules using Azure PowerShell](configure-waf-custom-rules.md).
16
+
This article shows you some example custom rules that you can create and use with WAF v2. To learn how to deploy WAF with a custom rule by using Azure PowerShell, see [Configure web application firewall custom rules by using Azure PowerShell](configure-waf-custom-rules.md).
17
17
18
-
>[!NOTE]
19
-
> If your application gateway is not using the WAF tier, the option to upgrade the application gateway to the WAF tier appears in the right pane.
18
+
>[!NOTE]
19
+
> If your application gateway isn't using the WAF tier, the option to upgrade the application gateway to the WAF tier appears in the right pane.
20
20
21
21
![Enable WAF][fig1]
22
22
23
23
## Example 1
24
24
25
-
You know there's a bot named *evilbot* that you want to block from crawling your website. In this case, you’ll block on the User-Agent *evilbot* in the request headers.
25
+
You know there's a bot named *evilbot* that you want to block from crawling your website. In this example, you block the User-Agent *evilbot* in the request headers.
@@ -70,11 +70,11 @@ And here is the corresponding JSON:
70
70
}
71
71
```
72
72
73
-
To see a WAF deployed using this custom rule, see [Configure a Web Application Firewall custom rule using Azure PowerShell](configure-waf-custom-rules.md).
73
+
To view a WAF that's deployed by using this custom rule, see [Configure a web application firewall custom rule by using Azure PowerShell](configure-waf-custom-rules.md).
74
74
75
75
### Example 1a
76
76
77
-
You can accomplish the same thing using a regular expression:
77
+
You can accomplish the same thing by using a regular expression:
For this example, you want to block User-Agent *evilbot*, and traffic in the range 192.168.5.0/24. To accomplish this, you can create two separate match conditions, and put them both in the same rule. This ensures that if both *evilbot* in the User-Agent header **and** IP addresses from the range 192.168.5.0/24 are matched, then the request is blocked.
179
+
For this example, you want to block User-Agent *evilbot*, and traffic in the range 192.168.5.0/24. To achieve this result, you can create two separate match conditions and put them both in the same rule. This approach ensures that if both *evilbot* in the User-Agent header *and* IP addresses from the range 192.168.5.0/24 are matched, the request is blocked.
@@ -247,9 +248,9 @@ Here's the corresponding JSON:
247
248
248
249
## Example 4
249
250
250
-
For this example, you want to block if the request is either outside of the IP address range *192.168.5.0/24*, or the user agent string isn't *chrome* (meaning the user isn’t using the Chrome browser). Since this logic uses **or**, the two conditions are in separate rules as seen in the following example. *myrule1* and *myrule2*both need to match to block the traffic.
251
+
For this example, you want to block if the request is either outside of the IP address range *192.168.5.0/24*, or the user agent string isn't *chrome* (that is, the user isn’t using the Chrome browser). Because this logic uses *or*, the two conditions are in separate rules, as shown in the following example. To block the traffic, both *myrule1* and *myrule2* need to match.
You want to block custom SQLI. Since the logic used here is **or**, and all the values are in the *RequestUri*, all of the *MatchValues* can be in a comma-separated list.
338
+
You want to block custom SQLI. Because the logic used here is *or* and all the values are in the *RequestUri*, all the *MatchValues* can be in a comma-separated list.
0 commit comments