Skip to content

Commit f6d58fc

Browse files
Merge pull request #232054 from Miskatonic-Electronic/patch-38
Update custom-waf-rules-overview.md
2 parents 7925066 + 6d92168 commit f6d58fc

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

articles/web-application-firewall/ag/custom-waf-rules-overview.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ms.custom: devx-track-azurepowershell
1414

1515
The Azure Application Gateway Web Application Firewall (WAF) v2 comes with a pre-configured, platform-managed ruleset that offers protection from many different types of attacks. These attacks include cross site scripting, SQL injection, and others. If you're a WAF admin, you may want to write your own rules to augment the core rule set (CRS) rules. Your custom rules can either block, allow, or log requested traffic based on matching criteria. If the WAF policy is set to detection mode, and a custom block rule is triggered, the request is logged and no blocking action is taken.
1616

17-
Custom rules allow you to create your own rules that are evaluated for each request that passes through the WAF. These rules hold a higher priority than the rest of the rules in the managed rule sets. The custom rules contain a rule name, rule priority, and an array of matching conditions. If these conditions are met, an action is taken (to allow, block, or log). If a custom rule is triggered, and an allow or block action is taken, no further custom or managed rules are evaluated.
17+
Custom rules allow you to create your own rules that are evaluated for each request that passes through the WAF. These rules hold a higher priority than the rest of the rules in the managed rule sets. The custom rules contain a rule name, rule priority, and an array of matching conditions. If these conditions are met, an action is taken (to allow, block, or log). If a custom rule is triggered, and an allow or block action is taken, no further custom or managed rules are evaluated. Custom rules can be enabled/disabled on demand.
1818

19-
For example, you can block all requests from an IP address in the range 192.168.5.0/24. In this rule, the operator is *IPMatch*, the matchValues is the IP address range (192.168.5.0/24), and the action is to block the traffic. You also set the rule's name and priority.
19+
For example, you can block all requests from an IP address in the range 192.168.5.0/24. In this rule, the operator is *IPMatch*, the matchValues is the IP address range (192.168.5.0/24), and the action is to block the traffic. You also set the rule's name, priority and enabled/disabled state.
2020

2121
Custom rules support using compounding logic to make more advanced rules that address your security needs. For example, ((Condition 1 **and** Condition 2) **or** Condition 3). This means that if Condition 1 **and** Condition 2 are met, **or** if Condition 3 is met, the WAF should take the action specified in the custom rule.
2222

@@ -44,14 +44,16 @@ $AllowRule = New-AzApplicationGatewayFirewallCustomRule `
4444
-Priority 2 `
4545
-RuleType MatchRule `
4646
-MatchCondition $condition `
47-
-Action Allow
47+
-Action Allow `
48+
-State Enabled
4849
4950
$BlockRule = New-AzApplicationGatewayFirewallCustomRule `
5051
-Name example2 `
5152
-Priority 2 `
5253
-RuleType MatchRule `
5354
-MatchCondition $condition `
54-
-Action Block
55+
-Action Block `
56+
-State Enabled
5557
```
5658

5759
The previous `$BlockRule` maps to the following custom rule in Azure Resource Manager:
@@ -63,6 +65,7 @@ The previous `$BlockRule` maps to the following custom rule in Azure Resource Ma
6365
"priority": 2,
6466
"ruleType": "MatchRule",
6567
"action": "Block",
68+
"state": "Enabled",
6669
"matchConditions": [
6770
{
6871
"matchVariables": [
@@ -93,6 +96,10 @@ This custom rule contains a name, priority, an action, and the array of matching
9396

9497
The name of the rule. It appears in the logs.
9598

99+
### Enable rule [optional]
100+
101+
Turn this rule on/off. Custom rules are enabled by default.
102+
96103
### Priority [required]
97104

98105
- Determines the rule valuation order. The lower the value, the earlier the evaluation of the rule. The allowable range is from 1-100.

0 commit comments

Comments
 (0)