Best for
- Use when setting up or troubleshooting CrowdSec.
magnus919/agent-skills/crowdsec/SKILL.md
Deploy, configure, and manage CrowdSec — the open-source, collaborative IPS/IDPS/WAF. Covers Security Engine setup (Linux, Docker), cscli hub management, remediation components, AppSec WAF, profiles, notifications, blocklists, CTI, and metrics. Use when setting up or troubleshooting CrowdSec.
Decision brief
CrowdSec is an open-source, collaborative security engine that detects and blocks malicious actors. It analyzes logs and HTTP requests using behavior-based patterns (scenarios) and enforces blocks through remediation components (bouncers).
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/magnus919/agent-skills --skill "crowdsec"Inspect the Agent Skill "crowdsec" from https://github.com/magnus919/agent-skills/blob/a4db8e7d4350816f02515bac12d91c8050db1e58/crowdsec/SKILL.md at commit a4db8e7d4350816f02515bac12d91c8050db1e58. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
CrowdSec has a modular, API-centric architecture. The main components: | Component | Role | |-----------|------| | Security Engine (crowdsec) | Reads logs, parses them, evaluates scenarios, and produces alerts/decisions. Runs the Log Processor and Local API (LAPI). | | Local API…
Review the “Quick Reference” section in the pinned source before continuing.
Review the “Installation” section in the pinned source before continuing.
Review the “Linux (Debian/Ubuntu)” section in the pinned source before continuing.
curl -s https://install.crowdsec.net | sudo sh sudo apt update sudo apt install crowdsec
Permission review
The documentation includes network, browsing, or remote request actions.
curl -s https://install.crowdsec.net | sudo shThe documentation includes network, browsing, or remote request actions.
api_url: http://127.0.0.1:8080The documentation asks the agent to create, modify, or delete local files.
**Create notification config:** File in `/etc/crowdsec/notifications/<plugin>.yaml`The documentation asks the agent to read local files, directories, or repositories.
| Reference | Load when | File |Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 94/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 34 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
CrowdSec is an open-source, collaborative security engine that detects and blocks malicious actors. It analyzes logs and HTTP requests using behavior-based patterns (scenarios) and enforces blocks through remediation components (bouncers).
CrowdSec has a modular, API-centric architecture. The main components:
| Component | Role |
|---|---|
| Security Engine (crowdsec) | Reads logs, parses them, evaluates scenarios, and produces alerts/decisions. Runs the Log Processor and Local API (LAPI). |
| Local API (LAPI) | HTTP API that stores decisions, serves remediation components, and communicates with the Central API. Runs inside the Security Engine. |
| Central API (CAPI) | CrowdSec's cloud service — receives signals from all instances and distributes community blocklists. |
| Remediation Components (formerly "bouncers") | Connect to LAPI to fetch decisions and enforce blocks at various levels (firewall, reverse proxy, web server). |
| AppSec Component | WAF subsystem that inspects HTTP requests in real-time. Lives in the Security Engine. |
| cscli | Command-line tool to manage the entire CrowdSec stack. |
| Data flow: Logs → Parsers (s00-raw, s01-parse, s02-enrich) → Scenarios → Alerts → LAPI → Decisions → Remediation Components → Block |
Important: The Security Engine alone only detects — it does NOT block. You must add at least one remediation component to enforce decisions.
| Task | Command |
|---|---|
| Install engine | curl -s https://install.crowdsec.net | sudo sh then sudo apt install crowdsec |
| Install firewall bouncer | sudo apt install crowdsec-firewall-bouncer-iptables (or -nftables) |
| Add bouncer API key | sudo cscli bouncers add <name> |
| List bouncers | sudo cscli bouncers list |
| Install collection | sudo cscli collections install crowdsecurity/nginx |
| List collections | sudo cscli collections list |
| View metrics | sudo cscli metrics |
| List alerts | sudo cscli alerts list |
| List decisions | sudo cscli decisions list |
| Manually ban IP | sudo cscli decisions add --ip <IP> |
| Manually unban IP | sudo cscli decisions delete --ip <IP> (or remove --ip, which is an alias) |
| View status | sudo systemctl status crowdsec |
| Reload config | sudo systemctl reload crowdsec |
# Add repository
curl -s https://install.crowdsec.net | sudo sh
sudo apt update
sudo apt install crowdsec
# Optionally install firewall bouncer
sudo apt install crowdsec-firewall-bouncer-iptables
During installation, CrowdSec auto-detects running services (SSH, nginx, etc.) and installs appropriate collections + acquisition config.
services:
crowdsec:
image: crowdsecurity/crowdsec:latest
restart: always
ports:
- 127.0.0.1:8080:8080 # LAPI
- 127.0.0.1:6060:6060 # Prometheus metrics
- 127.0.0.1:7422:7422 # AppSec WAF
environment:
COLLECTIONS: "crowdsecurity/linux crowdsecurity/nginx"
GID: "${GID-1000}"
TZ: "UTC"
volumes:
- ./crowdsec/config:/etc/crowdsec
- ./crowdsec/data:/var/lib/crowdsec/data
- /var/log:/var/log:ro
Version note: Persisting
/var/lib/crowdsec/datais mandatory since v1.7.0. On older versions (v1.6.x and earlier), the container uses this directory for the SQLite database but does not require it. However, persisting it is always recommended to avoid data loss on container restart. Use a named volume or bind mount; tmpfs is only suitable for throwaway/non-production deployments.
Key environment variables:
| Variable | Default | Description |
|---|---|---|
COLLECTIONS | (none) | Space-separated list of collections to install |
DISABLE_LOCAL_API | false | Set true to run as log processor only |
DISABLE_AGENT | false | Set true to run as LAPI only |
BOUNCER_KEY_<name> | (none) | Seed API key for a bouncer |
TZ | UTC | Timezone |
CONFIG_FILE | /etc/crowdsec/config.yaml | Path to main config |
/etc/crowdsec/config.yaml)Key sections: common, config_paths, crowdsec_service, db_config, api, prometheus.
Use config.yaml.local for local overrides — values here take precedence over config.yaml and survive package upgrades. Supports environment variable substitution (${VAR}).
/etc/crowdsec/acquis.yaml or /etc/crowdsec/acquis.d/*.yaml)Tells CrowdSec which log files to read:
filenames:
- /var/log/nginx/*.log
labels:
type: nginx
---
filenames:
- /var/log/auth.log
- /var/log/syslog
labels:
type: syslog
---
source: docker
container_name_regexp:
- .*caddy*
labels:
type: caddy
The labels.type field is mandatory — it determines which parsers handle the logs.
Note: For log files on network shares (NFS, SMB) or Docker bind mounts where inotify doesn't work reliably, add
poll_without_inotify: trueto the acquisition entry. This polls the file at intervals instead of relying on filesystem events.
/etc/crowdsec/profiles.yaml)Controls what remediation action is taken when a scenario triggers:
name: default_ip_remediation
filters:
- Alert.Remediation == true && Alert.GetScope() == "Ip"
decisions:
- type: ban
duration: 4h
on_success: break
Override values via profiles.yaml.local. Files are read sequentially (not merged).
/etc/crowdsec/simulation.yaml)When enabled, CrowdSec still detects but does not enforce:
simulation: true
exclusions:
- crowdsecurity/ssh-bf
cscli [global flags] <command> [subcommand] [options]
Global flags: -c <config> (config path), -o json|human|raw (output format), --debug, --color
| Category | Key Commands | Load detail |
|---|---|---|
| Hub Management | cscli hub update, cscli collections install/list/upgrade/inspect, cscli parsers install/list/upgrade, cscli scenarios install/list/upgrade | references/cscli-command-reference.md |
| Decisions & Alerts | cscli decisions add/list/delete, cscli alerts list/inspect | references/cscli-command-reference.md |
| Bouncers & Agents | cscli bouncers add/list/delete, cscli machines add/list/delete | references/cscli-command-reference.md |
| Metrics | cscli metrics, cscli metrics show appsec|bouncers | references/cscli-command-reference.md |
| Console & LAPI | cscli console status/enroll, cscli lapi register | references/cscli-command-reference.md |
| Additional | cscli version, cscli config, cscli explain, cscli simulation, cscli allowlists | references/cscli-command-reference.md |
See the full command reference at references/cscli-command-reference.md.
Collections bundle parsers + scenarios for a service. This is the primary way to add protection:
| Collection | Protects |
|---|---|
crowdsecurity/linux | Linux syslog, SSH, sudo |
crowdsecurity/sshd | SSH brute force detection |
crowdsecurity/nginx | Nginx web server |
crowdsecurity/traefik | Traefik reverse proxy |
crowdsecurity/caddy | Caddy web server |
crowdsecurity/apache2 | Apache httpd |
crowdsecurity/base-http-scenarios | Generic HTTP attacks |
crowdsecurity/http-cve | CVE-based HTTP attack detection |
crowdsecurity/whitelist-good-actors | Whitelist known good actors (search engines, CDNs) |
crowdsecurity/appsec-virtual-patching | AppSec virtual patching rules |
crowdsecurity/appsec-crs | OWASP CRS rules for AppSec |
crowdsecurity/appsec-generic-rules | Generic AppSec WAF rules |
crowdsecurity/mysql | MySQL database |
crowdsecurity/postgres | PostgreSQL |
crowdsecurity/cloudflare | Cloudflare-protected sites |
Browse all collections at: https://app.crowdsec.net/hub/collections
After installing a bouncer, add it to LAPI:
sudo cscli bouncers add my-bouncer-name
# Save the API key returned — it won't be shown again
Blocks IPs at the network level. Best for SSH, databases, SMTP.
sudo apt install crowdsec-firewall-bouncer-iptables
# or
sudo apt install crowdsec-firewall-bouncer-nftables
Config at: /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml
Block at the reverse proxy level. Supports AppSec WAF forwarding.
Static config (traefik.yaml):
experimental:
plugins:
bouncer:
moduleName: github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin
version: v1.6.0
Dynamic config (middleware):
middlewares:
crowdsec:
plugin:
bouncer:
enabled: true
crowdsecMode: live
crowdsecLapiScheme: http
crowdsecLapiHost: crowdsec:8080
crowdsecLapiKey: "<your-api-key>"
forwardedHeadersTrustedIPs:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
The Nginx bouncer uses Lua directives to check requests against CrowdSec decisions.
sudo apt install crowdsec-firewall-bouncer-nginx
Bouncer config (/etc/crowdsec/bouncers/crowdsec-nginx-bouncer.yaml):
api_url: http://127.0.0.1:8080
api_key: "<your-bouncer-api-key>"
mode: stream # stream (push) or live (pull on each request)
update_frequency: 10s # How often to refresh decisions in stream mode
Nginx config (add to server {} block or nginx.conf):
lua_package_path "/usr/lib/crowdsec/lua/?.lua;;";
lua_shared_dict crowdsec_cache 10m;
init_by_lua_block {
local bouncer = require "crowdsec"
bouncer.init()
}
access_by_lua_block {
local bouncer = require "crowdsec"
if bouncer.check() then
return ngx.exit(ngx.FORBIDDEN)
end
}
After setup: sudo systemctl reload nginx && sudo systemctl restart crowdsec.
Config at /etc/crowdsec/bouncers/crowdsec-nginx-bouncer.yaml. See the full configuration guide with nginx.conf directives and Cloudflare CDN support in references/nginx-bouncer.md.
Full list: https://hub.crowdsec.net/browse/#remediation-components
The AppSec Component turns CrowdSec into a full WAF with virtual patching.
In acquis.yaml (or acquis.yaml.local):
source: appsec
listen_addr: 0.0.0.0:7422
appsec_config: crowdsecurity/appsec-default
labels:
type: appsec
Install AppSec collections:
sudo cscli collections install crowdsecurity/appsec-virtual-patching
sudo cscli collections install crowdsecurity/appsec-crs
sudo cscli collections install crowdsecurity/appsec-generic-rules
ban or captcha immediately. Used for SQLi, XSS, path traversal, CVE exploitation.notification to profile in /etc/crowdsec/profiles.yaml/etc/crowdsec/notifications/<plugin>.yamlSupported plugins: Slack, HTTP/Webhook, Email (SMTP), Splunk, Telegram, Sentry
sudo cscli notifications test <plugin_name>
sudo cscli notifications list
# /etc/crowdsec/notifications/http.yaml
type: http
name: http_default
log_level: info
format: json
url: https://hooks.example.com/crowdsec
method: POST
headers:
Content-Type: application/json
Blocklists are curated threat feeds you subscribe to via the CrowdSec Console. They augment community blocklists with third-party intelligence.
Two tiers in config.yaml under api.server.online_client.pull:
community: true/false — Pull from the CrowdSec community networkblocklists: true/false — Pull from subscribed third-party blocklistsCrowdSec provides an IP reputation API. Configure in config.yaml:
api:
cti:
key: "<your-cti-api-key>"
cache_timeout: "60m"
cache_size: 50
enabled: true
Use cscli decisions list -o json to see CTI-enriched output.
CrowdSec supports many log sources:
| Source | Config Type | Stream | One-shot |
|---|---|---|---|
| File | filenames: | Yes | Yes |
| Docker | source: docker | Yes | Yes |
| Journald | source: journald | Yes | Yes |
| Syslog | source: syslog | Yes | No |
| HTTP | source: http | Yes | No |
| Kafka | source: kafka | Yes | No |
| AWS CloudWatch | source: cloudwatch | Yes | Yes |
| AWS S3 | source: s3 | Yes | Yes |
| Loki | source: loki | Yes | Yes |
| Windows Event | source: windows_evt_log | Yes | Yes |
Common acquisition parameters:
log_level: Per-source log leveltransform: Expression to modify events pre-parsinguse_time_machine: true — Use log timestamps instead of read time (important for buffered logs like IIS, S3)labels.type: Required — determines which parser handles the logsCrowdSec supports multiple database backends in /etc/crowdsec/config.yaml:
db_config:
type: sqlite # or mysql, postgresql, pgx
db_path: /var/lib/crowdsec/data/crowdsec.db
use_wal: true # SQLite WAL mode for better concurrency
max_open_conns: 100
flush:
max_items: 50000 # Max alerts before purge; lower if disk-constrained
max_age: 7d # Alert retention — both max_items and max_age act independently
metrics_max_age: 90d
Flush tuning guidance:
max_items and max_age act as independent thresholds — whichever triggers first causes a flush. Set both for belt-and-suspenders control.max_items: 10000 and decision_bulk_size: 2000 to reduce write frequency.max_items to 100000+ but monitor disk usage.VACUUM periodically on the SQLite database file to shrink it after large flushes.sudo cscli metrics # Full metrics dashboard
sudo cscli metrics -o json # JSON for programmatic use
Metrics include: Acquisition stats, parser hits/unparsed, scenario counts, alert counts, decisions (local vs CAPI), bouncer activity.
Enable in config.yaml:
prometheus:
enabled: true
level: full # or "aggregated" for low cardinality
listen_addr: 0.0.0.0
listen_port: 6060
CrowdSec provides Grafana dashboards: https://github.com/crowdsecurity/grafana-dashboards
Free web console at https://app.crowdsec.net — provides:
Enroll: sudo cscli console enroll <enrollment_key>
CrowdSec supports TLS for LAPI communication:
api:
server:
tls:
cert_file: "/path/to/cert.pem"
key_file: "/path/to/key.pem"
client_verification: "RequireAndVerifyClientCert"
ca_cert_path: "/path/to/ca.pem"
agents_allowed_ou:
- agents_ou
bouncers_allowed_ou:
- bouncers_ou
Load the following reference files for deeper coverage of specific topics:
| Reference | Load when | File |
|---|---|---|
| Full config.yaml reference | You need every configuration directive explained | references/config-reference.md |
| cscli command reference | You need every cscli subcommand and flag | references/cscli-command-reference.md |
| AppSec WAF deep dive | Setting up or troubleshooting AppSec | references/appsec-deep-dive.md |
| Docker deployment guide | Running CrowdSec in Docker Compose | references/docker-deployment.md |
| Traefik bouncer setup | Integrating with Traefik reverse proxy | references/traefik-bouncer.md |
| Nginx bouncer setup | Configuring the Nginx bouncer with nginx.conf directives | references/nginx-bouncer.md |
| Database configuration | Choosing between SQLite, MySQL, PostgreSQL | references/database-config.md |
| Production hardening | Security, TLS, performance tuning | references/production-hardening.md |
| Hub collections list | You need to know which collection protects what | references/hub-collections.md |
| Troubleshooting guide | Something isn't working | references/troubleshooting.md |
| Production operations checklist | Verifying or operating a deployment | references/operations-checklist.md |
Alternatives
mission69b/t2000
Publishing, upgrading, and deploying Sui Move packages. Use this skill when the user needs to publish a package, upgrade a published package, deploy to multiple networks, serialize transactions for multisig signing, run a local Sui network (localnet), prepare for Mainnet launch, monitor production deployments, or debug dry run failures. Also use when the user asks about sui client publish, sui client upgrade, UpgradeCap, upgrade policies, Published.toml, --serialize-output, localnet, mainnet lau
teng-lin/notebooklm-py
Complete API for Google NotebookLM - full programmatic access including features not in the web UI. Create notebooks, add sources, generate all artifact types, download in multiple formats. Activates on explicit /notebooklm or intent like "create a podcast about X"
TencentCloudBase/CloudBase-AI-Toolkit
Build production-ready AI agent backends using the CloudBase Agent Python SDK — create agents with LangGraph/CrewAI/LlamaIndex, serve them via FastAPI with AG-UI protocol streaming + OpenAI-compatible endpoints, add tools (bash, filesystem, MCP, code execution), memory (in-memory, TDAI, MySQL, MongoDB), observability (OpenTelemetry/Langfuse), and middleware (auth, logging). Use this skill when the user wants to create an AI agent server, build a chatbot backend, set up human-in-the-loop workflow
ok-helloworld/vibe-pentest
Race condition and TOCTOU testing for web apps. Use when testing one-time operations, concurrent HTTP abuse, rate-limit bypass, Turbo Intruder gates, HTTP/2 single-packet attacks, and CWE-362-style synchronization gaps.