CrowdSec (detection only) and staged custom-Caddy plumbing

- crowdsec stack on lava reading Caddy's access log (logs/ subpath only),
  collections caddy, http-cve, base-http-scenarios, appsec-virtual-patching;
  AppSec listener on :7422; allowlist for lava, Tailscale, the server
- caddy_custom switch (image + plugin directives), staged by
  caddy_crowdsec_enforce / caddy_appsec / caddy_ratelimit; all off, so the
  rendered config is unchanged in effect
- (protect) on every site, (ratelimit_login) on login paths, both empty
  until enabled; caddy recreated when compose.yml or .env changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-27 12:22:15 -07:00
1 parent 8aad8132b6
commit 48a4e48b84
13 files changed
+261 -1

No files matched your search

+20
View File
@@ -33,3 +33,23 @@ notifications:
appriseapi_endpoint: "http://apprise:8000/notify/apprise"
# Pocket ID group allowed through Tinyauth to admin pages.
tinyauth_admin_group: admins
# Custom Caddy (repo phil/caddy-custom: CrowdSec bouncer + AppSec + rate
# limiting, rebuilt daily, rolled out by dockcheck).
# caddy_custom: false = stock caddy:2-alpine and no plugin directives in the
# Caddyfile; set it back to false to roll everything back in one deploy.
# The other flags stage the rollout and only matter when caddy_custom is on.
caddy_custom: false
caddy_custom_image: "{{ subdomains.git }}/phil/caddy"
caddy_custom_tag: "2" # pin to "<ver>-<fingerprint>" to hold a build
caddy_image: "{{ (caddy_custom_image ~ ':' ~ caddy_custom_tag) if caddy_custom else 'caddy:2-alpine' }}"
caddy_crowdsec_enforce: false # block IPs CrowdSec has banned
caddy_appsec: false # AppSec virtual patching on each request
caddy_ratelimit: false # per-IP limits on login POSTs
# Never banned by CrowdSec, never rate limited.
crowdsec_allowlist:
- "{{ docker.subnet }}" # containers hairpinning through Caddy
- "100.64.0.0/10" # Tailscale IPv4
- "fd7a:115c:a1e0::/48" # Tailscale IPv6
- "{{ network.netcup_ip }}" # the server itself