selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
traefik-crowdsec-bouncer logo

Self-host traefik-crowdsec-bouncer

v0.5.0

CrowdSec bouncer for Traefik forward authentication

AlphaOpen SourceMIT
Updated4 years ago
LanguageGo
Setup difficultyModerate
Stars
332
Port
8080 (HTTP server for forward auth and health checks)
Requires
CrowdSec agent
Docker
fbonalair/traefik-crowdsec-bouncer

What is traefik-crowdsec-bouncer?

traefik-crowdsec-bouncer is a lightweight Go HTTP service that acts as a CrowdSec bouncer for Traefik v2. It uses Traefik's ForwardAuth middleware to check incoming request IPs against CrowdSec's decisions API, returning 403 Forbidden for banned IPs and allowing legitimate traffic through. The service runs as a Docker container configured via environment variables including the CrowdSec API key, agent host, log level, ban response code/message, listening port, and trusted proxies. It exposes health check endpoints (/ping, /healthz) and a Prometheus metrics endpoint. Requires a running CrowdSec agent and Traefik v2 instance.

Should you self-host traefik-crowdsec-bouncer?

traefik-crowdsec-bouncer scores 41/100 on selfhost.directory (how scoring works) and ranks #64 of 78 in Security. It has 332 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is pentagi (83/100, 32 629 stars). It scores higher overall, so compare the two before you pick. See traefik-crowdsec-bouncer vs pentagi side by side.

Features

  • Configurable ban response
  • ForwardAuth integration
  • Health check endpoints
  • HTTPS support for CrowdSec API
  • IP-based blocking
  • Prometheus Metrics
  • Trusted proxies support

traefik-crowdsec-bouncer README

How to configure traefik-crowdsec-bouncer

  • CROWDSEC_AGENT_HOSTHost and port of CrowdSec agent, i.e. crowdsec-agent:8080

    Host and port of CrowdSec agent, i.e. crowdsec-agent:8080

  • CROWDSEC_BOUNCER_API_KEYCrowdSec bouncer API key required to be authorized to request local API

    CrowdSec bouncer API key required to be authorized to request local API

  • CROWDSEC_BOUNCER_BAN_RESPONSE_CODE403HTTP code to respond in case of ban

    HTTP code to respond in case of ban

  • CROWDSEC_BOUNCER_BAN_RESPONSE_MSGForbiddenHTTP body as message to respond in case of ban

    HTTP body as message to respond in case of ban

  • CROWDSEC_BOUNCER_LOG_LEVEL1Minimum log level for bouncer. Expected value zerolog levels

    Minimum log level for bouncer. Expected value zerolog levels

  • CROWDSEC_BOUNCER_SCHEMEhttpScheme to query CrowdSec agent. Expected value: http, https

    Scheme to query CrowdSec agent. Expected value: http, https

    values: http, https

  • GIN_MODEdebugRun app in debug or release mode

    Run app in debug or release mode

    values: debug, release

  • HEALTH_CHECKER_TIMEOUT_DURATION2sGolang string representation of a duration to wait for bouncer's answer before failing health check

    Golang string representation of a duration to wait for bouncer's answer before failing health check

  • PORT8080Change listening port of web server

    Change listening port of web server

  • TRUSTED_PROXIES0.0.0.0/0List of trusted proxies IP addresses in CIDR format, delimited by ','

    List of trusted proxies IP addresses in CIDR format, delimited by ','

More in Network

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…