From 4e58c3d320349582666779bbdd9c4207247a7e11 Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 27 Nov 2026 13:30:16 -0700 Subject: [PATCH] crowdsec: document the firewall bouncer; fix filter comment Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 11 +++++++++-- .../templates/crowdsec-firewall-bouncer.yaml.local.j2 | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d6d4577..41e0f26 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -139,8 +139,15 @@ user (`vault_aws_dns`). It also deletes the records listed under bouncer, AppSec, rate limiting; rebuilt daily, rolled out by dockcheck). `caddy_crowdsec_enforce`, `caddy_appsec` and `caddy_ratelimit` stage the features; `caddy_custom: false` rolls all of it back in one deploy. -- Unban an IP: `docker exec crowdsec cscli decisions delete --ip ` (SSH - over Tailscale never goes through Caddy). +- CrowdSec also reads the host's sshd journal (image `-debian` for + journalctl) and Gitea's log file. The host runs + `crowdsec-firewall-bouncer` (nftables, own `crowdsec` tables on the input + and forward hooks, LAPI at 127.0.0.1:8080). `crowdsec_firewall_all_decisions` + false = only ssh bans hit the firewall; true = every decision, all ports. + Never enable `nftables.service` (its config flushes the whole ruleset). +- Unban an IP: `docker exec crowdsec cscli decisions delete --ip ` (works + for Caddy and the firewall). Ansible reaches the server over Tailscale, which + is allowlisted; if your public IP is banned, Tailscale falls back to relays. - Tinyauth (`auth.`) puts a Pocket ID login (group `admins`) in front of Baikal's `/admin` and the Changedetection UI via the `(sso)` snippet. diff --git a/roles/docker/templates/crowdsec-firewall-bouncer.yaml.local.j2 b/roles/docker/templates/crowdsec-firewall-bouncer.yaml.local.j2 index 97dcaa9..cf234ae 100644 --- a/roles/docker/templates/crowdsec-firewall-bouncer.yaml.local.j2 +++ b/roles/docker/templates/crowdsec-firewall-bouncer.yaml.local.j2 @@ -12,9 +12,10 @@ nftables_hooks: - input - forward {% if not crowdsec_firewall_all_decisions %} -# Until crowdsec_firewall_all_decisions: only local SSH detections and manual -# bans. Afterwards every decision (HTTP, Gitea, community blocklist) is -# enforced on all ports. +# Until crowdsec_firewall_all_decisions: only decisions whose scenario +# mentions ssh (local ssh detections; manual bans only with --reason ssh-...). +# Afterwards every decision (HTTP, Gitea, community blocklist) is enforced +# on all ports. scenarios_containing: - ssh origins: