feat: add access policy middleware support cidr block
This commit is contained in:
@@ -13,7 +13,7 @@ It supports two actions: `ALLOW` and `DENY`.
|
||||
### How It Works
|
||||
1. **Define an action:** Specify whether the middleware should `ALLOW` or `DENY` access.
|
||||
|
||||
2. **Set sourceRanges:** Provide a list of IP addresses or IP ranges to which the policy applies.
|
||||
2. **Set sourceRanges:** Provide a list of IP addresses, IP ranges or a CIDR block to which the policy applies.
|
||||
|
||||
Requests originating from these sources will be evaluated according to the specified action.
|
||||
|
||||
@@ -28,5 +28,6 @@ middlewares:
|
||||
action: DENY # Specify either DENY or ALLOW
|
||||
sourceRanges:
|
||||
- 192.168.1.1 # Single IP address
|
||||
- 172.18.0.0-172.18.0.10 # IP range
|
||||
- 10.42.1.1-10.42.1.100 # IP range
|
||||
- 10.42.1.1/16 # CIDR block
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user