CrowdSec Security Engine & Traefik Bouncer¶
CrowdSec is an open-source, collaborative Intrusion Detection System (IDS) and Intrusion Prevention System (IPS). It analyzes logs from Linux system services, SSH, and Traefik to detect malicious behavior and block bad IP addresses across your infrastructure in real time.
🏗️ Architecture¶
┌─────────────────────────────┐
│ CrowdSec Cloud Console │
│ (Community Threat Intelligence)│
└──────────────▲──────────────┘
│
┌─────────────────────────────┐ ┌──────────────┴──────────────┐
│ Traefik Proxy │ │ CrowdSec Engine │
│ (Access Logs & Bouncer) ├──►│ (Analyzes Traefik/SSH) │
└─────────────────────────────┘ └─────────────────────────────┘
- CrowdSec Engine: Container running
crowdsecurity/crowdsecparsing log files for attack patterns (SSH brute-force, HTTP probing, path traversal, scanner bots). - Traefik Bouncer: Intercepts requests and queries CrowdSec Local API (LAPI) to block malicious IPs dynamically.
🚀 Deployment with Ansible¶
The stack is automated using the Ansible role ansible/roles/crowdsec:
🔐 Configuration & Secrets¶
All keys are managed in .secrets/:
.secrets/crowdsec.md- Documentation for CrowdSec keys..secrets/crowdsec-lapi-key- Secret Local API key shared between CrowdSec engine and Traefik bouncer.
🛠️ CLI Operations (cscli)¶
Run administrative commands inside the crowdsec container: