Skip to content

Commit 61c600d

Browse files
authored
Merge pull request #89473 from teresayao/patch-7
Update waf-front-door-configure-ip-restriction.md
2 parents e387d13 + 52fd5e5 commit 61c600d

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

articles/frontdoor/waf-front-door-configure-ip-restriction.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ An IP address–based access control rule is a custom WAF rule that lets you con
2121

2222
By default, your web application is accessible from the internet. If you want to limit access to clients from a list of known IP addresses or IP address ranges, you may create an IP matching rule that contains the list of IP addresses as matching values and sets operator to "Not" (negate is true) and the action to **Block**. After an IP restriction rule is applied, requests that originate from addresses outside this allowed list receive a 403 Forbidden response.
2323

24+
A client IP address can be different from the IP address WAF observes, for example, when a client accesses WAF via a proxy. You can create IP restriction rules based on either Client IP addresses (RemoteAddr) or Socket IP addresses seen by WAF (SocketAddr).
25+
2426
## Configure a WAF policy with the Azure CLI
2527

2628
### Prerequisites
@@ -63,7 +65,7 @@ az network front-door waf-policy rule create \
6365
--resource-group <resource-group-name> \
6466
--policy-name IPAllowPolicyExampleCLI --defer
6567
```
66-
Next, add match condition to the rule:
68+
Next, add client IP match condition to the rule:
6769

6870
```azurecli
6971
az network front-door waf-policy rule match-condition add\
@@ -75,7 +77,17 @@ az network front-door waf-policy rule match-condition add\
7577
--resource-group <resource-group-name> \
7678
--policy-name IPAllowPolicyExampleCLI
7779
```
78-
80+
For Socket IP (SocketAddr) match condition:
81+
```azurecli
82+
az network front-door waf-policy rule match-condition add\
83+
--match-variable SocketAddr \
84+
--operator IPMatch
85+
--values "ip-address-range-1" "ip-address-range-2"
86+
--negate true\
87+
--name IPAllowListRule\
88+
--resource-group <resource-group-name> \
89+
--policy-name IPAllowPolicyExampleCLI
90+
7991
### Find the ID of a WAF policy
8092
Find a WAF policy's ID by using the [az network front-door waf-policy show](/cli/azure/ext/front-door/network/front-door/waf-policy?view=azure-cli-latest#ext-front-door-az-network-front-door-waf-policy-show) command. Replace *IPAllowPolicyExampleCLI* in the following example with your unique policy that you created earlier.
8193
@@ -137,7 +149,17 @@ $IPMatchCondition = New-AzFrontDoorWafMatchConditionObject `
137149
-MatchValue "ip-address-range-1", "ip-address-range-2"
138150
-NegateCondition 1
139151
```
140-
152+
153+
For Socket IP (SocketAddr) match condition:
154+
```powershell
155+
$IPMatchCondition = New-AzFrontDoorWafMatchConditionObject `
156+
-MatchVariable SocketAddr `
157+
-OperatorProperty IPMatch `
158+
-MatchValue "ip-address-range-1", "ip-address-range-2"
159+
-NegateCondition 1
160+
```
161+
162+
141163
### Create a custom IP allow rule
142164

143165
Use the [New-AzFrontDoorCustomRuleObject](/powershell/module/Az.FrontDoor/New-azfrontdoorwafcustomruleobject) command to define an action and set a priority. In the following example, requests not from client IPs that match the list will be blocked.

0 commit comments

Comments
 (0)