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
* chore: allow setting ban status code
* chore: tests probably not needed, fix unit tests
* chore: actually return the set status value
* chore: return 500 on error
| `metrics` | bool | `false` | No | Enable metrics reporting to CrowdSec |
148
150
| `tickerInterval` | duration | `"10s"` | No | Interval to fetch decisions from LAPI |
149
151
| `metricsInterval` | duration | `"10m"` | No | Interval to report metrics to LAPI |
152
+
| `banStatusCode` | int | `403` | No | HTTP status code for ban responses |
150
153
151
154
**Note**: Generate API key with `cscli bouncers add <name>` on your CrowdSec instance.
152
155
@@ -162,6 +165,22 @@ bouncer:
162
165
163
166
Metrics can be viewed using `cscli metrics` on your CrowdSec instance.
164
167
168
+
#### Custom Ban Status Codes
169
+
170
+
By default, the bouncer returns HTTP 403 (Forbidden) for banned IPs. You can customize this to avoid feedback loops when CrowdSec processes Envoy logs:
171
+
172
+
```yaml
173
+
bouncer:
174
+
banStatusCode: 418 # Use 418 "I'm a teapot" to distinguish from legitimate 403s
175
+
```
176
+
177
+
This is useful when CrowdSec analyzes Envoy access logs, as it can ignore ban responses (418) while still processing genuine errors (403).
178
+
179
+
**Common alternatives**:
180
+
- `418`- "I'm a teapot" (RFC 2324)
181
+
- `429`- "Too Many Requests"
182
+
- `444`- Nginx-style "Connection closed without response"
0 commit comments