BETA: HAProxy spoe filter for CrowdSec - WAF and IP protection
10K+
This is a minimal scratch-based Docker image containing only the statically-linked bouncer binary and essential files.
/crowdsec-spoa-bouncer # The bouncer binary
/etc/ssl/certs/ca-certificates.crt # CA certs for HTTPS to LAPI
/etc/crowdsec/bouncers/crowdsec-spoa-bouncer.yaml # Default config
/usr/lib/crowdsec-haproxy-spoa-bouncer/lua/ # Lua files for HAProxy
/var/lib/crowdsec-haproxy-spoa-bouncer/html/ # Ban/captcha templates
docker run -d \
--name crowdsec-spoa-bouncer \
-e CROWDSEC_KEY=your-api-key \
-e CROWDSEC_URL=http://crowdsec:8080/ \
-p 9000:9000 \
-p 6060:6060 \
crowdsecurity/spoa-bouncer
Mount your own configuration file for full control:
docker run -d \
--name crowdsec-spoa-bouncer \
-v /path/to/your/config.yaml:/etc/crowdsec/bouncers/crowdsec-spoa-bouncer.yaml:ro \
-p 9000:9000 \
crowdsecurity/spoa-bouncer
Or specify a different config path:
docker run -d \
--name crowdsec-spoa-bouncer \
-v /path/to/config.yaml:/config.yaml:ro \
-p 9000:9000 \
crowdsecurity/spoa-bouncer -c /config.yaml
For simple deployments, the default configuration supports environment variables:
| Variable | Default | Description |
|---|---|---|
CROWDSEC_KEY | required | API key for CrowdSec LAPI |
CROWDSEC_URL | http://crowdsec:8080/ | CrowdSec LAPI URL |
LOG_MODE | stdout | Log output: stdout or file |
LOG_LEVEL | info | Log level: trace, debug, info, warn, error |
UPDATE_FREQUENCY | 10s | How often to poll LAPI for decisions |
INSECURE_SKIP_VERIFY | false | Skip TLS verification for LAPI |
LISTEN_TCP | 0.0.0.0:9000 | TCP listener address |
PROMETHEUS_ENABLED | true | Enable Prometheus metrics |
PROMETHEUS_ADDR | 0.0.0.0 | Prometheus listen address |
PROMETHEUS_PORT | 6060 | Prometheus listen port |
Note: Default values are set in the Docker image. Only CROWDSEC_KEY must be provided.
docker run -d \
--name crowdsec-spoa-bouncer \
-v /path/to/config.yaml:/etc/crowdsec/bouncers/crowdsec-spoa-bouncer.yaml:ro \
-v /run/crowdsec-spoa:/run/crowdsec-spoa \
crowdsecurity/spoa-bouncer
Ensure the socket directory exists and has appropriate permissions for HAProxy to connect.
services:
crowdsec-spoa-bouncer:
image: crowdsecurity/spoa-bouncer
restart: unless-stopped
environment:
- CROWDSEC_KEY=${CROWDSEC_API_KEY}
- CROWDSEC_URL=http://crowdsec:8080/
- LOG_LEVEL=info
ports:
- "6060:6060" # Prometheus metrics
networks:
- crowdsec
deploy:
resources:
limits:
memory: 256M
haproxy:
image: haproxy:3.1
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
ports:
- "80:80"
- "443:443"
networks:
- crowdsec
depends_on:
- crowdsec-spoa-bouncer
networks:
crowdsec:
The scratch image runs as root by default. To run as a specific user:
docker run -d \
--user 1000:1000 \
--name crowdsec-spoa-bouncer \
-p 9000:9000 \
crowdsecurity/spoa-bouncer
Note: Ensure mounted volumes have appropriate permissions for the specified user.
Prometheus metrics are enabled by default on port 6060. Since this is a scratch image with no shell, use external health checks:
# Docker Compose with healthcheck via curl sidecar
services:
crowdsec-spoa-bouncer:
image: crowdsecurity/spoa-bouncer
environment:
- CROWDSEC_KEY=${API_KEY}
# Use depends_on with service_healthy for dependent services
healthcheck:
image: curlimages/curl:8.11.1
command: ["sh", "-c", "while true; do curl -sf http://crowdsec-spoa-bouncer:6060/metrics > /dev/null && echo healthy || echo unhealthy; sleep 30; done"]
depends_on:
- crowdsec-spoa-bouncer
Or check from the host:
curl -sf http://localhost:6060/metrics > /dev/null && echo "healthy" || echo "unhealthy"
| Port | Default | Description |
|---|---|---|
| 9000 | Yes | SPOA TCP listener |
| 6060 | Yes | Prometheus metrics (enabled by default) |
| 6070 | No | pprof debug endpoint (disabled by default) |
docker logs -f crowdsec-spoa-bouncer
Set the LOG_LEVEL environment variable:
docker run -e LOG_LEVEL=debug -e CROWDSEC_KEY=... crowdsecurity/spoa-bouncer
docker build -t crowdsecurity/spoa-bouncer .
| Argument | Default | Description |
|---|---|---|
| GOVERSION | 1.25 | Go version for build stage |
Content type
Image
Digest
sha256:9d01409b5…
Size
6 MB
Last updated
2 months ago
docker pull crowdsecurity/spoa-bouncer