Join our Newsletter — 33% off our NHI Course
Home› Guides› CrowdSec Guide: Collaborative IP Reputation and Remediation Bouncers…
Guide SOC & Detection Engineering

CrowdSec Guide: Collaborative IP Reputation and Remediation Bouncers Done Safely

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 13 min read
On this page

CrowdSec can block abusive IP addresses across a whole estate within seconds, and the same speed means one bad scenario, a missing allowlist or a leaked bouncer key can lock out customers or your own operations team. This guide explains how the CrowdSec Security Engine fits together, how decisions flow from log detection to remediation, what the engine shares with the CrowdSec Central API, and how to deploy it so legitimate users are not blocked. It is written for Linux and web operations teams running CrowdSec in front of SSH, web servers, reverse proxies and firewalls. For the wider network control picture, see the Network Security Guide.

This is an independent guide from NHI Mgmt Group, based on CrowdSec's public documentation as of November 2026. It is not sponsored or reviewed by CrowdSec. Product features change, so confirm settings against CrowdSec's current documentation.

Key takeaways

  • Detection and blocking are separate jobs. The Log Processor detects behaviour and writes decisions to the Local API; remediation components (bouncers) read those decisions and enforce them at the firewall, web server or proxy.
  • Allowlist before you enforce. Centralised Local API allowlists stop alerts, decisions and blocklist entries for trusted IPs and ranges, so add office egress, monitoring probes, load balancers and partner ranges first.
  • Know what leaves the host. Shared signals carry the scenario name, hash and version, a timestamp, your machine ID and the offending IP; context sharing and manual decisions are separate console options you control.
  • Treat bouncer API keys as machine credentials. Each key is shown once at creation, sits in a configuration file and grants read access to every decision, so give each bouncer its own key and protect the file.
  • Roll out in simulation first. Simulation mode and short ban durations let you measure false positives before decisions reach production traffic.

How CrowdSec works

CrowdSec is an open source security engine (MIT licence for the engine, and detection rules on the CrowdSec Hub are also published under MIT). It reads logs or HTTP requests, matches them against behaviour-based scenarios, and turns a match into a decision such as a ban on an IP. The decision is stored by the Local API and enforced by whichever remediation components you install. Optionally, the engine shares signals with the Central API and receives a community blocklist in return.

ComponentWhat it doesWhere it runsSecurity note
Log Processor (agent)Reads log sources, parses events, runs scenarios, raises alertsEach host or log collectorAuthenticates to the Local API as a machine (credentials in /etc/crowdsec/local_api_credentials.yaml) or by client certificate
AppSecLog Processor feature that inspects HTTP requests forwarded by compatible web serversAlongside the Log ProcessorInline on the request path: test rules before enforcing
Scenarios, parsers, collectionsDetection content: parsers normalise logs, scenarios describe behaviour (for example SSH brute force), collections bundle bothInstalled from the Hub with cscliCustom or modified ("tainted") scenarios are shared upstream by default unless you disable it
Local API (LAPI)Stores alerts and decisions, applies profiles, serves decisions to bouncers, talks to the Central APIOne central instance or one per hostDefault listen_uri in the shipped config is 127.0.0.1:8080; expose it beyond localhost only with TLS
ProfilesRules that decide whether an alert becomes a decision, a notification or just a log entry/etc/crowdsec/profiles.yamlShipped default: ban, scope IP or range, duration 4h
Remediation components (bouncers)Enforce decisions: firewall (iptables, nftables), web server, reverse proxy, CDNWherever traffic is controlledAuthenticate with an API key or client certificate
Central API (CAPI)Receives shared signals and distributes blocklistsCrowdSec serviceOutbound connection configured under online_client
ConsoleWeb interface for alerts, engines, blocklists and allowlists across an organisationapp.crowdsec.netEnrolment changes what is shared; review console options after enrolling
cscliCommand line administration of hub content, decisions, bouncers, machines and allowlistsLAPI host and agentsRestrict to administrators: it can create keys and delete decisions

Agents, scenarios and the local API

An alert is the output of a scenario: a bucket of events from one source that overflowed a threshold. The Local API passes each alert through profiles in order of definition. The shipped profiles file has two entries, default_ip_remediation and default_range_remediation, each issuing a ban for 4h and then stopping with on_success: break. A commented duration_expr example lengthens bans for repeat offenders based on how many decisions an IP already has.

  • Local overrides: put custom profiles in profiles.yaml.local. It is read before profiles.yaml and the two are not merged, so end your local profiles with on_success: break where you intend them to be final.
  • Distributed setups: several Log Processors can report to one Local API. Each agent is a machine identity; register and review them (cscli machines list) and remove decommissioned hosts.
  • Certificate authentication: the Local API can accept client certificates instead of passwords and keys. Configure cert_file, key_file and ca_cert_path under api.server.tls, restrict which certificate OUs are accepted with agents_allowed_ou and bouncers_allowed_ou, and add crl_path for revocation. CrowdSec also checks OCSP and auto-creates new clients named CN@IP, which suits auto-scaling fleets.
  • Notifications: profiles can send alerts to Slack, Splunk, HTTP or email plugins. Route bans on critical services to the on-call channel so a mistaken block is noticed quickly.

Bouncers and remediation

Remediation components only enforce what the Local API tells them. Choose the enforcement point by what you need to protect and how much context you want at the point of blocking.

Enforcement pointStrengthTrade-offGood fit
Host firewall (iptables or nftables sets)Drops traffic before any service sees it; protects every portBlunt: a blocked shared IP loses all access, including to status pagesSSH and non-HTTP services, single servers
Web server or reverse proxyCan apply ban or challenge per request and show a block pageOnly covers HTTP traffic through that proxyPublic websites and APIs where some users share IPs
Edge firewall, CDN or WAF integrationStops traffic upstream and protects origin capacityDepends on the provider's list size and update intervalLarge estates with central egress and ingress

Components work in one of two modes. In live mode the component asks the Local API on each check; in stream mode it downloads all current decisions into a local cache and polls for changes. The firewall bouncer, for example, polls every update_frequency: 10s in its shipped configuration, uses deny_action: DROP, and inserts its rule into the INPUT chain by default. Containers published through Docker often bypass INPUT, which is why the configuration offers DOCKER-USER and FORWARD chains: check which chain your traffic actually traverses before assuming you are protected.

Community blocklist and data sharing

Participation in the Central API is what gives CrowdSec its collaborative reputation data, and it is also the point where data leaves your environment. Review it with your privacy lead before enrolling production hosts.

Data itemWhen it is sentHow you control it
Signal meta-data: scenario name, hash and version, decision timestamp, machine ID, offending IP with geolocation where availableWhen the engine raises an alert from a shared scenarioRemove or leave unconfigured the online_client section to run without the Central API
List of enabled scenariosAt login to the Central APIDetermines which community blocklist entries you receive
Alerts from custom and tainted scenariosBy default (share_custom: true, share_tainted: true)cscli console disable custom and cscli console disable tainted
Manual decisionsOnly when the manual console option is on; console enrolment turns it onReview with cscli console status after enrolling
Alert context (selected log fields)Only when context sharing is enabled (share_context: false in the shipped file)Keep off unless you have checked which fields, such as URLs or usernames, would be sent
Console metrics: names and versions of remediation components and enginesWhen enrolledConsole enrolment
  • Privacy view: attacker IP addresses can be personal data under GDPR, and so can your own users' addresses if a scenario misfires. Record the sharing in your processing records and keep context sharing off unless it is needed. See the AI and GDPR Guide for the wider lawful-basis discussion.
  • Manual decisions: an engineer banning a partner IP by hand should not publish that IP to a shared reputation service. Check the manual option deliberately.
  • Availability: the Security Engine and Hub content are open source. CrowdSec also offers Console plans; its documentation describes some features, such as managing allowlists across multiple engines from the Console, as available to premium users. Check the current plan terms before designing around a Console feature.

Avoiding false positives and lockouts

Most CrowdSec incidents are self-inflicted: a monitoring probe, NAT gateway or office VPN trips a scenario and gets banned. Build trust lists before turning on enforcement.

MechanismWhere it actsUse it for
Centralised LAPI allowlists (cscli allowlists)Drops local alerts, removes IPs from blocklists before they reach the database, bypasses AppSec and bot detection, blocks cscli decisions on listed IPs unless forcedTrusted IPs and CIDR ranges: office egress, VPN, monitoring, load balancers, partners
Parser whitelists (parsers/s02-enrich/)Discards events at parse time, before bucketsExpression rules on log fields, such as a health-check URL or user agent
Postoverflow whitelists (postoverflows/s01-whitelist/)Checked after a scenario overflowsExpensive checks such as reverse DNS; the folder does not exist by default and must be created
Simulation modeAlerts are produced but decisions are not enforcedTrialling new scenarios or a new estate
  1. Inventory trusted sources: list office and VPN egress, uptime monitors, vulnerability scanners you run, CDN and load balancer ranges, and partner integrations.
  2. Create the allowlist: cscli allowlists create corp_trusted -d "office, VPN and monitoring" (the description is mandatory), then cscli allowlists add corp_trusted 203.0.113.0/24. Use -e 7d for temporary entries, such as a penetration test window, so they expire.
  3. Fix the real source IP: behind a proxy or load balancer, make sure logs record the client address, not the proxy. Otherwise one ban blocks everyone.
  4. Simulate: enable simulation (globally, or per scenario) for at least a week of normal traffic, then review alerts with cscli alerts list.
  5. Enforce in rings: start with SSH on non-critical hosts, then web tiers. Keep the default 4h duration until false positive rates are known.
  6. Prepare rollback: document how to remove a decision (cscli decisions delete --ip) and how to stop the bouncer service, and make sure out-of-band console access exists for hosts you could lock yourself out of.

Securing the deployment

CrowdSec itself holds machine credentials and makes enforcement decisions, so protect it like other security infrastructure.

  • One API key per bouncer: register each component with cscli bouncers add <name> on the Local API host. The key is printed once and cannot be retrieved later, so put it straight into the component's configuration (the firewall bouncer reads api_key) or a secrets store. Naming keys per host makes revocation precise. See the API Key Management Guide.
  • File permissions: restrict bouncer configuration files and local_api_credentials.yaml to root and the service account. Never commit them to configuration repositories in clear text.
  • Review and revoke: list registered components with cscli bouncers list and machines with cscli machines list; delete entries for retired hosts and rotate keys when staff with access leave.
  • Transport security: when bouncers or agents reach a remote Local API, use TLS and keep insecure_skip_verify: false. Client certificates with OU restrictions remove the need for pre-shared keys.
  • Network exposure: keep the Local API on localhost or a management network; firewall it from the internet.
  • Updates: keep the engine, hub content (cscli hub update and upgrade) and bouncers current, and apply vendor security updates promptly from CrowdSec's own release notes.

Bouncer keys and agent credentials are non-human identities. They should appear in your NHI inventory with an owner and a rotation date. See the Non-Human Identity (NHI) Guide.

Detection, measurement and framework mapping

Feed CrowdSec alerts to your SIEM so analysts can correlate bans with authentication and application logs. Track these measures:

  • False positive rate: decisions removed manually or allowlisted afterwards, as a share of all local decisions.
  • Time to unblock: from a user report to removal of a wrong decision.
  • Coverage: internet-facing services with an active bouncer, from cscli metrics and your asset list.
  • Bouncer freshness: components that have not pulled decisions recently, a sign of a broken key or network path.
  • Credential hygiene: registered bouncers and machines with no matching live host.
FrameworkReferenceHow CrowdSec relates
MITRE ATT&CKT1110 Brute Force (T1110.001 Password Guessing, T1110.004 Credential Stuffing), T1595 Active Scanning, T1190 Exploit Public-Facing ApplicationBehaviours that common scenarios detect and bans interrupt
NIST SP 800-53 Rev 5SI-4 System Monitoring, SC-7 Boundary Protection, AC-7 Unsuccessful Logon Attempts, IR-4 Incident HandlingDetection, boundary enforcement and automated response
NIST CSF 2.0DE.CM-01, DE.AE-02, RS.MI-01, PR.IR-01Monitoring, analysis, containment and network protection
CIS Controls v8.113.3 Deploy a Network Intrusion Detection Solution; 13.10 Perform Application Layer FilteringNetwork monitoring and defence
ISO/IEC 27001:2022 Annex AA.5.7 Threat intelligence, A.8.16 Monitoring activities, A.8.20 Networks securityShared reputation data, monitoring and network controls

Common failure patterns

  • Banning the proxy: logs record the load balancer address, so the first ban blocks all users.
  • Allowlist added after the incident: monitoring or partner IPs are banned during launch week because nobody listed them first.
  • Bouncer in the wrong chain: container traffic bypasses the INPUT chain and the service is unprotected while dashboards show decisions.
  • Shared or orphaned API keys: one key copied to every server, so a leak exposes the full decision list and revocation breaks the whole estate.
  • Unreviewed sharing: manual decisions or alert context are shared after console enrolment without a privacy check.

Practitioner checklist

  • Confirm logs record the true client IP behind every proxy and load balancer.
  • Create LAPI allowlists for office, VPN, monitoring, scanners and partners before enforcing.
  • Run new scenarios and new estates in simulation, then enforce in rings.
  • Register one named API key per bouncer and store it in a protected file or secrets store.
  • Keep the Local API on localhost or a management network, with TLS for remote clients.
  • Review cscli console status sharing options and record the decision with your privacy lead.
  • Remove bouncers and machines for retired hosts every quarter.
  • Send alerts to the SIEM and measure false positives and time to unblock.

Standards and references

Related NHI Mgmt Group resources: Network Security Guide · Linux Firewall Guide · Linux Server Hardening Guide · Suricata IDS Guide · API Key Management Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.