crowdsec: detect vaultwarden and navidrome native-login brute force #294
No reviewers
Labels
No labels
audit-work
bug
docs
general-admin
major-upgrade
needs-vps-sync
new-service
on-hold
outside-work
post-podman
renovate
upstream
vps
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mysticalsoap/docker!294
Loading…
Reference in a new issue
No description provided.
Delete branch "crowdsec-native-logins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Vaultwarden and Navidrome authenticate users themselves behind an Authelia bypass, and CrowdSec had no log source for either, so a credential-guessing run only ever met each app's own rate limit (#121). Navidrome's Subsonic API has no rate limit at all and answers a bad password with HTTP 200, so the Traefik access log can't see it either.
Fix
Both hub collections (
Dominic-Wagner/vaultwarden,sdwilsh/navidrome), declared inCOLLECTIONStogether with the four collections that had only ever been installed by hand.Each app logs to
/var/log/<app>, bind-mounted read-only intocrowdsec; logrotate rules (HUPreopen for Vaultwarden,copytruncatefor Navidrome, which treatsSIGHUPas shutdown);just normalizecreates the dirs.local/navidrome-auth(s02-enrich): strips the port from Navidrome'sremoteAddrso the private-range whitelist can match it, and tags SubsonicAPI: Invalid loginlines with thelog_typethe hub scenario keys on.Docs: CrowdSec section rewritten to point at
COLLECTIONSandacquis.yaml, plus the Navidrome specifics and a first-start gotcha.ND_EXTAUTH_TRUSTEDSOURCES(the media subnet, Traefik's address there is dynamic) so Navidrome logs the client instead of Traefik. The same setting enables Navidrome's header login: Traefik's forwardAuth stripsRemote-Userfrom client requests and Authelia sets it for a session holder even underbypass, so a signed-in browser lands in Navidrome by username (created if missing; knock keeps the names aligned). Subsonic clients, Feishin's web build included (credentials: same-origin), keep using the Navidrome password. User docs note the removal order (LLDAP first).Verification
cscli explainon captured lines: the Vaultwarden failed-login line reachesvaultwarden-bfandvaultwarden-bf_user-enum; Navidrome Subsonic and web-401 lines with a public IP reachnavidrome-bf; the same lines with Traefik'sip:portget the port stripped and are whitelisted.just normalize, logrotate rules installed,just up infra vaultwarden media, one bad login per app.cscli metricsshows both files read, the failed-login lines parsed, then whitelisted (LAN source). With the trust setting deployed, Navidrome'sremoteAddrequals Traefik'sClientHostfor the same request, bare IP, no port. A bucket overflow can't be produced from the LAN, so that part rests on explain.LOG_FILEset;docker logs navidromegoes quiet by design.No matching files for patternand never picked up the files created after it started; one restart after the first deploy fixed it._helper/ci/check-compose.shgreen.