CrowdSec
Common parts of every card (states, backoff, Unit and ExecReload, Test config, manual commands) are described in Monitor window.
| Detected by | systemd units crowdsec, crowdsec-*bouncer* or binaries crowdsec, cscli |
| Read every | 2 minutes while the Monitor window shows the tab |
| Active probe | yes, off by default |
| Test config | no |
| Manual commands | 3 |
What the card reads (passive)
Section titled “What the card reads (passive)”Files, /proc and systemd only:
- the
crowdsecprocess (trusted binary,-c <config>from its command line, otherwise/etc/crowdsec/config.yaml), andconfig.yamlwithconfig.yaml.localover it: a closed list of keys (directories, log, database type and path, Local API listen address and TLS, Prometheus address, acquisition and profile paths). Database user and password are never read. - Credentials (
local_api_credentials.yaml,online_api_credentials.yaml), the database and its-wal/-shmfiles: owner, mode and size only, never the content. The SQLite database is not opened: a reader in WAL mode writes to the-shmfile. - acquisition (
acquis.yaml,acquis.d/*) andprofiles.yaml: sources, files, journal filters, containers, labels; profile names, filters, decisions and their durations. Passwords and other keys outside the list stay on the host. - bouncer configuration files in
/etc/crowdsec/bouncers/: mode,api_url, update frequency and similar;api_keyonly as set. - hub items enabled in
collections,parsers,scenarios,postoverflows,contexts,appsec-*: links into the hub, local files and broken links. systemctl showofcrowdsec*units, dpkg versions of crowdsec and its bouncers, listening ports of the Local API and Prometheus.- the end of
/var/log/crowdsec.log,crowdsec_api.logandcrowdsec-firewall-bouncer.log(tail -c 256 KiB; withlog_media: stdoutthe last 300 journal lines ofcrowdsec.service): line counts per level and the last 25 lines. Values afterpassword,api_key,token,secret,Authorizationand long token-like strings are replaced with***on the host.
The Prometheus endpoint is not called by the passive read.
Card layout
Section titled “Card layout”Open CrowdSec panel opens a tab with all data as tables. Below: warnings, process and config file, systemd units, Local API address and whether it listens, Prometheus address, database size, acquisition sources, profiles, hub file counts, credentials (owner and mode), bouncer configuration and the log tails. With an active run: cscli version, LAPI and CAPI status, decision, alert, bouncer, machine and hub item counts, and every failed cscli command with its exit code.
Warnings include: a unit failed or restarted, Local API on a non-loopback address without TLS, Local
API port not listening, Prometheus on a non-loopback address, SQLite without use_wal, credentials or
a bouncer configuration with api_key readable by other accounts, no acquisition source, broken hub
links, errors in the log; with the active probe: LAPI or CAPI login failing, bouncers pending or not
pulling for over 10 minutes, machines not validated, tainted or outdated hub items, sources with more
than half of their lines unparsed, decisions in simulation mode.
CrowdSec panel
Section titled “CrowdSec panel”A tab tied to the SSH tab it was opened from (not saved with the layout, not moved to another window). Every table sorts by a click on its header, filters by text and copies the shown rows as tab-separated text.
- Decisions: totals (local, CAPI, blocklists, simulated, first to expire); by origin and type, by scope, expiry buckets per origin (1 h, 4 h, 24 h, 7 days, more), by scenario (for lists the list name), by country, by AS, top IPs, top IPv4 /24 ranges, range decisions; local decisions (not CAPI or lists) with value, scenario, events and time left.
- Alerts (7 days, up to 2000): per hour and per day (chart and table), top scenarios, top sources, by country and AS, decision types, the latest alerts.
- Bouncers & machines: bouncers with state, last pull and seconds since, type, version and authentication; machines with last heartbeat, version, OS and features; bouncer configuration files.
- Engine & APIs:
cscli lapi status,cscli capi statusandcscli versionoutput; the Prometheus endpoint’s build version, memory, CPU, open files and goroutines;cscli metricssections (acquisition: lines read, parsed, unparsed and poured per source; parsers; scenarios/buckets; LAPI routes, machines and bouncers; decisions and alerts) as tables. - Hub:
cscli hub listitems with status, local and hub version, up to date, tainted, local. - Configuration: the passive data above.
- Commands: each exact cscli command, its exit code, stderr (redacted) and notes; Copy all.
The host aggregates the lists before sending them: at most 150 local decisions, 100 alerts and the top 30–100 values per count; what was left out is noted under each table. IP addresses are personal data: nothing is kept outside the view.
The panel never adds or removes decisions.
Active probe
Section titled “Active probe”Runs, with cscli from PATH when it passes the trust check,
each as timeout -k 1s <N>s /usr/bin/env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin cscli [-c <config>] …:
| Command | Timeout |
|---|---|
cscli version |
10 s |
cscli lapi status |
20 s |
cscli capi status |
25 s |
cscli decisions list -a -o raw |
60 s |
cscli alerts list -o raw --since 168h -l 2000 |
45 s |
cscli bouncers list -o raw |
20 s |
cscli machines list -o raw |
20 s |
cscli metrics -o json |
25 s |
cscli hub list -o json |
20 s |
then GET /metrics of the Prometheus endpoint (5 s), only when it is on loopback or a wildcard
address and its port is held by the crowdsec process. Most commands need read access to
local_api_credentials.yaml (usually root). cscli is not run when the configuration (config.yaml or its .local)
or a directory on its path is owned by an account other than root and the session’s, or writable by
others: cscli acts on the database, URLs and credential paths named there.
Traces on the host: a machine login and GET /v1/alerts requests in crowdsec_api.log and the
cs_lapi_* metrics; a login to the Central API at api.crowdsec.net (capi status); bouncers list
and machines list open the database directly; the Prometheus request counter grows by one.
Manual commands
Section titled “Manual commands”KryoDesk shows these with Copy / Paste to terminal and never runs them.
| Command | What it does |
|---|---|
sudo cscli decisions list -a |
all decisions as root, CAPI and lists included |
sudo cscli metrics |
engine metrics as root |
sudo cscli hub update |
downloads the hub index (changes files on the host) |