Configuration
Examples
Real-world configuration examples for IP blocking, geo-blocking, rate limiting, and more.
Real-world configuration examples for common firewall scenarios. All examples are available in the examples folder on GitHub.
Basic Protection
IP Blocking
Block specific IP addresses or ranges:
json
{
"ips": [
{
"ip": "192.168.1.100/32",
"action": "deny",
"notes": "Known attacker"
},
{
"ip": "10.0.0.0/8",
"action": "deny",
"notes": "Internal range"
}
]
}Path Protection
Secure specific URL paths:
json
{
"rules": [
{
"name": "Protect Admin",
"active": true,
"conditionGroup": [
{
"conditions": [
{ "type": "path", "op": "pre", "value": "/admin" }
]
}
],
"action": {
"mitigate": { "action": "challenge" }
}
}
]
}Geo-Blocking
Country-based access control:
json
{
"rules": [
{
"name": "Block High-Risk Countries",
"active": true,
"conditionGroup": [
{
"conditions": [
{
"type": "geo_country",
"op": "inc",
"value": ["CN", "RU", "KP"]
}
]
}
],
"action": {
"mitigate": { "action": "deny" }
}
}
]
}Method Restriction
Limit HTTP methods on specific paths:
json
{
"rules": [
{
"name": "Read-Only API",
"active": true,
"conditionGroup": [
{
"conditions": [
{ "type": "path", "op": "pre", "value": "/api" },
{ "type": "method", "op": "inc", "value": ["PUT", "DELETE", "PATCH"] }
]
}
],
"action": {
"mitigate": { "action": "deny" }
}
}
]
}Advanced Security
Rate Limiting
Prevent abuse through rate limits:
json
{
"rules": [
{
"name": "API Rate Limit",
"active": true,
"conditionGroup": [
{
"conditions": [
{ "type": "path", "op": "pre", "value": "/api" }
]
}
],
"action": {
"mitigate": {
"action": "rate_limit",
"rateLimit": {
"requests": 100,
"window": "60s"
}
}
}
}
]
}Challenge Rules
Bot prevention with browser challenges:
json
{
"rules": [
{
"name": "Challenge Suspicious Traffic",
"active": true,
"conditionGroup": [
{
"conditions": [
{ "type": "path", "op": "pre", "value": "/login" }
]
}
],
"action": {
"mitigate": { "action": "challenge" }
}
}
]
}Redirect Rules
Traffic redirection:
Conditional Rules
Complex condition group combinations:
Specialized Rules
User Agent Filtering
Filter by browser or client type:
Header-Based Rules
Rules based on HTTP headers:
Mixed Rules
Multiple protection layers in a single configuration:
Related Pages
- Configuration — Configuration file reference
- Templates — Pre-built rule templates
- Commands Overview — CLI command reference
This content is sourced from the GitHub Wiki.