Custom Caddy with CrowdSec bouncer, AppSec and rate limiting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
f9c44868a4
5 files changed
+266
No files matched your search
@@ -0,0 +1,41 @@
|
||||
# Fixture using every plugin directive in the shapes the real Caddyfile uses.
|
||||
{
|
||||
auto_https off
|
||||
order crowdsec first
|
||||
order appsec after crowdsec
|
||||
crowdsec {
|
||||
api_url http://crowdsec:8080
|
||||
api_key {$CROWDSEC_API_KEY}
|
||||
ticker_interval 15s
|
||||
appsec_url http://crowdsec:7422
|
||||
appsec_max_body_bytes 1048576
|
||||
appsec_fail_open
|
||||
}
|
||||
}
|
||||
|
||||
(protect) {
|
||||
crowdsec
|
||||
appsec
|
||||
}
|
||||
|
||||
(ratelimit_login) {
|
||||
rate_limit {
|
||||
zone {args[0]} {
|
||||
match {
|
||||
method POST
|
||||
path {args[1:]}
|
||||
not remote_ip private_ranges 100.64.0.0/10
|
||||
}
|
||||
key {client_ip}
|
||||
events 10
|
||||
window 1m
|
||||
}
|
||||
log_key
|
||||
}
|
||||
}
|
||||
|
||||
:8080 {
|
||||
import protect
|
||||
import ratelimit_login test_login /login /api/token/
|
||||
respond "ok"
|
||||
}
|
||||
Reference in new issue
Block a user