Contents
CrowdSec is open source software that reads your server’s logs, spots attack behavior, and blocks the IP addresses behind it. It judges SSH brute force, website scanning, port scanning, and similar activity against rules called scenarios.
Its main design choice is that the part that detects and the part that blocks are separate. The Security Engine reads logs and decides. A bouncer (also called a Remediation Component) does the blocking. In exchange for sending your detections to CrowdSec’s central service, you can also receive a list of attacker IPs that other users detected, called the community blocklist.
This review is for people who run their own Linux servers and want to block attacks on SSH or a web server automatically. After reading it, you can do the following:
- Explain how detection (the Security Engine) and blocking (a bouncer) divide the work
- Install it on a test Linux machine, put your own IP on an allowlist, and check sshd detection with cscli
- Explain what data leaves your machine and how to stop it
What CrowdSec does
According to the official documentation, the Security Engine works in this order.
- It reads logs from the places you configure (acquisitions).
- Parsers normalize the log lines.
- Scenarios decide whether the behavior looks like an attack.
- From each result, a profile creates a decision.
A decision is something like “block this IP for 4 hours”. The default profile creates a 4-hour ban for IP-level detections. A bouncer carries the decision out.
| Component | Role |
|---|---|
| Log Processor | Reads logs and judges them with scenarios |
| Local API (LAPI) | Stores alerts and decisions in a database. It is the entry point for bouncers and cscli. By default it listens on 127.0.0.1:8080 |
| Bouncer (Remediation Component) | Gets decisions from the LAPI and blocks at a firewall or web server |
| cscli | The command for checking state and changing settings |
| Central API | A service run by CrowdSec. It receives detections and distributes blocklists |
Bouncers exist for firewalls (iptables, nftables, ipset, pf) and for Nginx, Apache, Traefik, HAProxy, Cloudflare, and more. To protect a non-web service such as SSH or a database, use the firewall bouncer.
Detection rules are distributed on the Hub (hub.crowdsec.net). For sshd, you install the crowdsecurity/sshd collection. It contains a parser for sshd logs and several scenarios, including ssh-bf (brute force), ssh-slow-bf (slow brute force), and ssh-cve-2024-6387. The ssh-bf definition uses a bucket with a capacity of 5 that leaks every 10 seconds, so it triggers when authentication failures pile up in a short time.
How it works
Read it as text (full explanation)
CrowdSec splits each line of the logs your server writes into fields such as source IP and username with parsers, and drops any line that no parser can read. Of the lines it can read, those that match a scenario’s filter go into a bucket, and a leaky bucket loses items at a fixed interval, so it overflows when events arrive faster than it leaks. For example, ssh-bf targets SSH brute-force login (T1110 Brute Force; guessing passwords is T1110.001 Password Guessing) and is a leaky bucket that counts failed authentications per source IP, with a capacity of 5 and a leak of one item every 10 seconds. An overflow goes through a last allowlist check, a profile then turns it into a potential decision such as a ban, and a bouncer fetches the decision from the Local API and blocks the IP. CrowdSec misses activity that never reaches a log and failures that never overflow the bucket. Because ssh-bf counts per source IP, an IP whose failures stay below the overflow rate is not stopped by ssh-bf.
Network traffic
In its default setup, CrowdSec talks to a central service (the Central API). Check what it sends, and how to stop it, before you install.
Registration with the Central API. The Debian-family packages ask during installation whether to use the centralized remote API server. The default answer is Yes. On Yes, the post-install script runs cscli capi register. In the source, the RPM package and the Windows MSI also run cscli capi register, and the Docker image registers at startup unless you set DISABLE_ONLINE_API.
Detections (signals). According to the official documentation, every alert pushes this metadata:
- The name of the scenario that triggered
- The hash and version of that scenario
- The timestamp of the decision
- Your machine_id
- The offending IP address (with location data when available)
The documentation does not say that log text is sent. But the source (pkg/apiserver/apic.go) sends more than these five items, including the alert message, the IP’s AS name and number, country, and coordinates, the start and end times, and the decisions. Alerts from custom or modified scenarios are also pushed by default. In the source, enrolling in the Console (cscli console enroll) turns on sharing of manual decisions, alerts from modified scenarios, and the alert context (share_context).
The scenario list and component versions. The community blocklist is matched to the scenarios you run, so the engine sends its list of enabled scenarios at login. For the Console and for health monitoring, it also sends the names and versions of your registered Security Engines and bouncers.
Usage metrics. In the source code, the LAPI bundles the OS name and version, the CrowdSec version, installed Hub items, data sources, and the names and types of bouncers, and sends them to the Central API (only when it has Central API credentials). Setting disable_usage_metrics_export to true in the configuration file stops this.
Blocklist downloads. The engine receives a list that matches your installed scenarios from the Central API.
Hub downloads. The Debian-family packages run cscli hub update and cscli hub upgrade at install time, and they enable an update timer.
How to stop it
| What you want | How |
|---|---|
| Do not use the Central API | Answer No to the question during installation. Afterward, comment out the online_client section of the configuration file, as the official documentation describes |
| Stop sending alerts from custom or modified scenarios | sudo cscli console disable custom / sudo cscli console disable tainted |
| Stop sending usage metrics | disable_usage_metrics_export: true in the configuration file |
| Turn sending and receiving off separately | sharing (whether to send signals) and pull (community, blocklists; whether to receive them) under online_client. The configuration reference explains them; in the source, all default to true |
With the Central API off, local detection and blocking keep working. CrowdSec logs “push and pull to Central API disabled”. You no longer receive the community blocklist.
For free users, the documentation says: users who send signals regularly get the Community Blocklist (about 15,000 IPs), users who do not get the Lite list (capped at 3,000 IPs), and paying users get Premium (up to 60,000 IPs). Sharing your detections is the price of the full blocklist. The documentation also lists other reasons for landing on Lite, such as having few public services and therefore few detections.
We could not confirm from the official documentation how to install and update Hub items on a machine fully cut off from the internet.
Console enrollment
The CrowdSec Console (app.crowdsec.net) is a web interface for viewing alerts from several machines and subscribing to extra blocklists. Signing up is free. The official installation steps do not include Console enrollment, so you do not need it for detection and blocking. To enroll, run cscli console enroll with the enrollment key shown in the Console, then accept the engine in the Console. This also turns on sharing of manual decisions.
License and supported platforms
- License: The Security Engine is MIT (checked in the repository’s LICENSE and the GitHub API). The README says the Hub’s detection rules are also MIT. The firewall bouncer (cs-firewall-bouncer) is MIT too.
- Operating systems: The official documentation lists Linux, FreeBSD, Windows, Docker, Kubernetes, OPNsense, pfSense, and WHM. There is no macOS binary; you run the Linux container with Docker.
- CPU and resources: amd64, arm64, and armhf. The recommended minimum is 1 CPU core, 100 MB of free memory, and 1 GB of free disk space.
- Linux: Install from the official repository with
apt,yum,dnf,zypper, oropkg. - FreeBSD: Install with
pkg install crowdsec. The firewall bouncer uses pf. - Windows: Install with the MSI or Chocolatey. It runs as a Windows service. You install the Windows Firewall bouncer separately, and it needs the .NET 10 runtime.
- Administrator rights: Every Linux step in the documentation uses
sudo. The systemd unit has noUser=setting, so the service runs as root. We could not find a statement on whether Windows needs administrator rights.
Try it safely: check sshd detection on a test Linux machine
Run these steps on a test Linux VM (Debian or Ubuntu). They follow the official documentation and source, and we did not run them in our own environment. If a step or an output differs from what you see, trust the official documentation.
The firewall bouncer can block your own SSH if you get a rule wrong. Take a VM snapshot, and keep a way in that does not depend on SSH, such as the hypervisor console.
-
Add the official repository and install the package. The first line is a script that runs as root, so read it first, or use the manual steps in the official documentation.
curl -s https://install.crowdsec.net | sudo sh sudo apt install crowdsecDuring installation you are asked whether to use the centralized remote API server. To try it without sending anything out, choose No. In an environment that does not ask, the default Yes registers the engine.
-
Check that sshd detection is installed. The post-install script looks for running services and sets up the matching collections and log sources.
sudo cscli collections list sudo cscli metricsIf
crowdsecurity/sshdis listed andmetricsshows lines read from the log, the engine is reading your logs. -
Put your own IP on an allowlist. Do this before you install a bouncer. 192.0.2.10 is a documentation address, so replace it with the IP you connect from over SSH.
sudo cscli allowlists create mine -d "my admin IP" sudo cscli allowlists add mine 192.0.2.10 -d "my workstation" sudo cscli allowlists inspect mineA parser called
crowdsecurity/whitelistsalready ignores private addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and localhost. The allowlist matters when you connect from a global IP, such as when you reach a VPS from outside. Add yours in that case. -
Check that the allowlist works. Without a special flag, you cannot create a decision for an allowlisted IP.
sudo cscli decisions add --ip 192.0.2.10 --duration 5mIf the command is refused, the allowlist works.
-
Feed one log line through the engine and read the verdict.
cscli explainruns the line you give it through the parsers and scenarios and shows which ones reacted. 192.0.2.50 is a documentation IP, not a real host.sudo cscli explain --type syslog --log "Oct 28 10:15:30 lab sshd[2001]: Invalid user admin from 192.0.2.50 port 40022"If
crowdsecurity/sshd-logsshows green andssh-bfand others appear underScenarios, the sshd log is readable and those scenarios accept it. Do not useexplainon large log files. The official documentation warns that it uses a lot of memory. -
To raise a real alert, use the official test scenario.
crowdsecurity/ssh-generic-testtriggers only when an SSH login fails for a specific test username. Its definition hasremediation: false, so it does not block the IP. The username is on the official health check page. From another machine, try to log in to the VM over SSH with that username, then check the alert.sudo cscli alerts list -s crowdsecurity/ssh-generic-testWith the Hub’s
crowdsecurity/whitelistsinstalled, connections from private IPv4 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and loopback do not raise an alert. You cannot test from a machine on the same LAN as the VM, so connect from outside or stop at step 5. The documentation says the scenario can trigger again for the same IP after 5 minutes, but the Hub definition saysblackhole: 1m(1 minute). If nothing happens, wait 5 minutes. -
Install the blocking part. If the output of
iptables -Vcontainsnf_tables, you are on nftables, so pick the-nftablespackage.sudo apt install crowdsec-firewall-bouncer-iptables sudo cscli bouncers listThe packages normally set up the bouncer’s API key automatically. If the bouncer shows up in
bouncers list, it is connected to the LAPI. -
Create a decision by hand and see the flow. 192.0.2.50 is not your IP, so you will not lock yourself out. Delete it when you are done.
sudo cscli decisions add --ip 192.0.2.50 --duration 10m sudo cscli decisions list sudo cscli decisions delete -i 192.0.2.50If you ever block your own IP, release it with the same
decisions delete.
Common uses
| What you want | How |
|---|---|
| See recorded detections | sudo cscli alerts list (narrow with -s <scenario name>) |
| See active decisions | sudo cscli decisions list |
| Remove a decision | sudo cscli decisions delete -i <IP> |
| Add detection rules | sudo cscli collections install crowdsecurity/nginx, then sudo systemctl reload crowdsec |
| Check how a log is read | sudo cscli explain --type <type> --log "<one line>" |
| Add a bouncer | sudo cscli bouncers add <name> (packages normally do this for you) |
| Use several machines | Run the LAPI on one machine and point the other machines’ Log Processors and bouncers at it |
How CrowdSec differs from fail2ban, Suricata, and SafeLine
- fail2ban: The README says CrowdSec reads the same kind of logs as fail2ban and bans IPs, and that it separates detection from blocking. One machine can read the logs while a different one (a firewall, reverse proxy, or CDN) blocks. Sharing detections also lets you block IPs that other users already detected. For fail2ban’s own design, read the fail2ban review.
- Suricata: Suricata inspects the network traffic itself against rules. CrowdSec looks at the logs your servers write. Anything that never reaches a log is invisible to it.
- SafeLine: SafeLine is a reverse proxy in front of your web app and inspects each request to drop attacks. CrowdSec’s core is behavior detection from logs and blocking by IP. To inspect the content of web requests with CrowdSec, use its WAF feature, AppSec.
Cautions
- Install it only on servers you manage. Do not read other people’s logs or operate other people’s firewalls.
- If you block your own IP, the firewall bouncer cuts you off from every service on that server, including SSH. Put your IP on an allowlist and keep a console route in before you install a bouncer.
- False positives can block legitimate users. For a service behind a CDN or reverse proxy, CrowdSec judges the CDN’s IP unless the logs record the visitor’s real IP. Make the real IP appear in the logs before you rely on it.
- Sending detections is on by default (the Debian-family package question defaults to Yes, and RPM, Windows, and Docker also register by default). If you do not want that, answer No at install time or use the steps above. Deleting
online_api_credentials.yamlmakes CrowdSec fail to start. To turn it off, comment outonline_clientin the configuration. - Detections from modified scenarios do not count as contribution to the community. The expectation is that you use the official Hub scenarios without edits.
- Your configuration and blocklist depend on what each server runs, such as a web server or SSH. If you install few collections, the list you receive is narrower.
Read next
- Split each line of the logs your server writes into fields with parsersFields such as source IP and username. A line that no parser can read is dropped
- Of the lines it can read, those that match a scenario’s filter go into a bucketA leaky bucket loses items at a fixed interval
- The bucket overflows when events arrive faster than it leaksIt goes through a last allowlist check, and a profile then turns it into a potential decision such as a ban
- If a decision is made, a bouncer fetches it from the Local API and blocks the IP
ATT&CK T1110Brute Force
- Guessing passwords is T1110.001 (Brute Force: Password Guessing)
- Scenario ssh-bf (for SSH brute-force login)
- A leaky bucket that counts failed authentications per source IP, with a capacity of 5 items and a leak of one item every 10 seconds
What it misses
- Activity that never reaches a log
- Failures that never overflow the bucket
- ssh-bf counts per source IP, so an IP whose failures stay below the overflow rate is not stopped by ssh-bf.
Sources
- Official repository (crowdsecurity/crowdsec)github.com/crowdsecurity/crowdsec
- LICENSE (MIT)github.com/crowdsecurity/crowdsec/blob/master/LICENSE
- Docs: Security Engine overviewdocs.crowdsec.net/docs/next/intro/
- Docs: Prerequisites and supported operating systemsdocs.crowdsec.net/u/getting_started/intro/
- Docs: Install on Linuxdocs.crowdsec.net/u/getting_started/installation/linux/
- Docs: Install on Windowsdocs.crowdsec.net/u/getting_started/installation/windows/
- Docs: Install on FreeBSDdocs.crowdsec.net/u/getting_started/installation/freebsd/
- Docs: macOS (no native build, use Docker)docs.crowdsec.net/u/getting_started/installation/macos/
- Docs: Central API (data exchanged)docs.crowdsec.net/docs/next/central_api/intro/
- Docs: Community Blocklistdocs.crowdsec.net/docs/next/central_api/community_blocklist/
- Docs: How to disable the Central API (troubleshooting)docs.crowdsec.net/u/troubleshooting/security_engine/
- Docs: Configuration referencedocs.crowdsec.net/docs/next/configuration/crowdsec_configuration/
- Docs: Health check (test scenarios)docs.crowdsec.net/u/getting_started/health_check/
- Docs: AllowListsdocs.crowdsec.net/docs/next/local_api/centralized_allowlists/
- Docs: Remediation Components (bouncers)docs.crowdsec.net/u/bouncers/intro/
- Docs: Firewall Remediation Componentdocs.crowdsec.net/u/bouncers/firewall/
- Docs: cscli explaindocs.crowdsec.net/docs/next/cscli/cscli_explain/
- Docs: Enroll your Security Engine in the Consoledocs.crowdsec.net/u/getting_started/post_installation/console/
- The sshd collection and scenarios on the Hub (crowdsecurity/hub)github.com/crowdsecurity/hub/blob/master/collections/crowdsecurity/sshd.yaml
- Debian package post-install script (postinst)github.com/crowdsecurity/crowdsec/blob/master/build/debian/postinst
- The ssh-generic-test scenario on the Hubgithub.com/crowdsecurity/hub/blob/master/scenarios/crowdsecurity/ssh-generic-test.yaml
- Code that sends signals to the Central API (apic.go)github.com/crowdsecurity/crowdsec/blob/master/pkg/apiserver/apic.go
- The whitelists parser on the Hubgithub.com/crowdsecurity/hub/blob/master/parsers/s02-enrich/crowdsecurity/whitelists.yaml
- Docs: Parsers introductiondocs.crowdsec.net/docs/next/log_processor/parsers/intro/
- Docs: Scenarios introductiondocs.crowdsec.net/docs/next/log_processor/scenarios/intro/
- Docs: Scenario formatdocs.crowdsec.net/docs/next/log_processor/scenarios/format/
- The ssh-bf scenario on the Hubgithub.com/crowdsecurity/hub/blob/master/scenarios/crowdsecurity/ssh-bf.yaml
- MITRE ATT&CK T1110 Brute Forceattack.mitre.org/techniques/T1110/
- MITRE ATT&CK T1110.001 Password Guessingattack.mitre.org/techniques/T1110/001/
Checked on 2026-11-03
Similar tools
SafeLine
Impact Reaches othersA self-hosted, reverse-proxy WAF that sits in front of your own web app, inspects incoming HTTP requests, and blocks attacks. You install it on your own Linux server with Docker.
- Purpose
- Defense
- Type
- Self-hosted server
- Difficulty
- Intermediate
- License
- CopyleftGPL-3.0
- Category
- Defense and hardening / Web security
Suricata
Impact Reaches othersAn intrusion detection and prevention engine (IDS/IPS) that matches network traffic against rules and records suspicious activity as alerts.
- Purpose
- Defense
- Type
- Self-hosted server
- Difficulty
- Intermediate
- License
- CopyleftGPL-2.0
- Category
- Network
Wazuh
Impact Local onlyA free security platform (SIEM/XDR) that collects logs, configuration, and vulnerability data from agents on your endpoints and shows it all in one dashboard.
- Purpose
- Defense
- Type
- Self-hosted server
- Difficulty
- Advanced
- License
- CopyleftGPL-2.0(一部の構成要素は Apache-2.0)
- Category
- Vulnerability scanning / Forensics