CrowdSec

An open source tool that reads server logs for attack behavior such as brute force and blocks the source IPs through bouncers. It can share detections and receive a community blocklist.

cat crowdsec/meta.ymlChecked on 2026-11-03

Safety

Impact Reaches othersSees other people's traffic or sends traffic to their devices
Admin rights
Required
Test lab
Required

Usage

Purpose
Defense
Difficulty
Intermediate
Type
Self-hosted server
Platforms
Linux / Windows / Docker

Trust

Repository
crowdsecurity/crowdsec
License
PermissiveMIT
GitHub
stars15,6552026-11-17
Maintenance
Actively updatedLast update 2026-11-16
Contents
  1. Introduction
  2. What CrowdSec does
  3. How it works
  4. Network traffic
  5. License and supported platforms
  6. Try it safely: check sshd detection on a test Linux machine
  7. Common uses
  8. How CrowdSec differs from fail2ban, Suricata, and SafeLine
  9. Cautions
  10. Read next
  11. Sources

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.

  1. It reads logs from the places you configure (acquisitions).
  2. Parsers normalize the log lines.
  3. Scenarios decide whether the behavior looks like an attack.
  4. 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.

What it doesn’t doThe Security Engine alone blocks nothing. The official documentation warns that you need a bouncer to enforce decisions. It also sees only what reaches the logs, so an attack that leaves no log entry goes undetected. CrowdSec also has a WAF feature built on Coraza (AppSec), which this review does not cover.

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, or opkg.
  • 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 no User= 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.

  1. 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 crowdsec

    During 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.

  2. 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 metrics

    If crowdsecurity/sshd is listed and metrics shows lines read from the log, the engine is reading your logs.

  3. 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 mine

    A parser called crowdsecurity/whitelists already 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.

  4. 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 5m

    If the command is refused, the allowlist works.

  5. Feed one log line through the engine and read the verdict. cscli explain runs 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-logs shows green and ssh-bf and others appear under Scenarios, the sshd log is readable and those scenarios accept it. Do not use explain on large log files. The official documentation warns that it uses a lot of memory.

  6. To raise a real alert, use the official test scenario. crowdsecurity/ssh-generic-test triggers only when an SSH login fails for a specific test username. Its definition has remediation: 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-test

    With the Hub’s crowdsecurity/whitelists installed, 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 says blackhole: 1m (1 minute). If nothing happens, wait 5 minutes.

  7. Install the blocking part. If the output of iptables -V contains nf_tables, you are on nftables, so pick the -nftables package.

    sudo apt install crowdsec-firewall-bouncer-iptables
    sudo cscli bouncers list

    The packages normally set up the bouncer’s API key automatically. If the bouncer shows up in bouncers list, it is connected to the LAPI.

  8. 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.50

    If 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.yaml makes CrowdSec fail to start. To turn it off, comment out online_client in 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.
How CrowdSec goes from logs to blocking a source IP
  1. 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
  2. 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
  3. 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
  4. 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

  1. Official repository (crowdsecurity/crowdsec)github.com/crowdsecurity/crowdsec
  2. LICENSE (MIT)github.com/crowdsecurity/crowdsec/blob/master/LICENSE
  3. Docs: Security Engine overviewdocs.crowdsec.net/docs/next/intro/
  4. Docs: Prerequisites and supported operating systemsdocs.crowdsec.net/u/getting_started/intro/
  5. Docs: Install on Linuxdocs.crowdsec.net/u/getting_started/installation/linux/
  6. Docs: Install on Windowsdocs.crowdsec.net/u/getting_started/installation/windows/
  7. Docs: Install on FreeBSDdocs.crowdsec.net/u/getting_started/installation/freebsd/
  8. Docs: macOS (no native build, use Docker)docs.crowdsec.net/u/getting_started/installation/macos/
  9. Docs: Central API (data exchanged)docs.crowdsec.net/docs/next/central_api/intro/
  10. Docs: Community Blocklistdocs.crowdsec.net/docs/next/central_api/community_blocklist/
  11. Docs: How to disable the Central API (troubleshooting)docs.crowdsec.net/u/troubleshooting/security_engine/
  12. Docs: Configuration referencedocs.crowdsec.net/docs/next/configuration/crowdsec_configuration/
  13. Docs: Health check (test scenarios)docs.crowdsec.net/u/getting_started/health_check/
  14. Docs: AllowListsdocs.crowdsec.net/docs/next/local_api/centralized_allowlists/
  15. Docs: Remediation Components (bouncers)docs.crowdsec.net/u/bouncers/intro/
  16. Docs: Firewall Remediation Componentdocs.crowdsec.net/u/bouncers/firewall/
  17. Docs: cscli explaindocs.crowdsec.net/docs/next/cscli/cscli_explain/
  18. Docs: Enroll your Security Engine in the Consoledocs.crowdsec.net/u/getting_started/post_installation/console/
  19. The sshd collection and scenarios on the Hub (crowdsecurity/hub)github.com/crowdsecurity/hub/blob/master/collections/crowdsecurity/sshd.yaml
  20. Debian package post-install script (postinst)github.com/crowdsecurity/crowdsec/blob/master/build/debian/postinst
  21. The ssh-generic-test scenario on the Hubgithub.com/crowdsecurity/hub/blob/master/scenarios/crowdsecurity/ssh-generic-test.yaml
  22. Code that sends signals to the Central API (apic.go)github.com/crowdsecurity/crowdsec/blob/master/pkg/apiserver/apic.go
  23. The whitelists parser on the Hubgithub.com/crowdsecurity/hub/blob/master/parsers/s02-enrich/crowdsecurity/whitelists.yaml
  24. Docs: Parsers introductiondocs.crowdsec.net/docs/next/log_processor/parsers/intro/
  25. Docs: Scenarios introductiondocs.crowdsec.net/docs/next/log_processor/scenarios/intro/
  26. Docs: Scenario formatdocs.crowdsec.net/docs/next/log_processor/scenarios/format/
  27. The ssh-bf scenario on the Hubgithub.com/crowdsecurity/hub/blob/master/scenarios/crowdsecurity/ssh-bf.yaml
  28. MITRE ATT&CK T1110 Brute Forceattack.mitre.org/techniques/T1110/
  29. MITRE ATT&CK T1110.001 Password Guessingattack.mitre.org/techniques/T1110/001/

Checked on 2026-11-03

Similar tools

SafeLine

Impact Reaches others
chaitin/safeline

A 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
Actively updatedstars23,297Last update 2026-11-11
Read the SafeLine review

Suricata

Impact Reaches others
OISF/suricata

An 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
Actively updatedstars6,901Last update 2026-11-15
Read the Suricata review

Wazuh

Impact Local only
wazuh/wazuh

A 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
Actively updatedstars17,780Last update 2026-11-17
Read the Wazuh review