Repository navigation
Conversation
added 2 commits
November 15, 2026 21:56
Music Assistant serves album artwork from /imageproxy/<sha256>. The path has no file extension, so http-logs marks it as a non-static resource and each artwork has a distinct hash: loading a library triggers crowdsecurity/http-crawl-non_statics, and the resulting 403s then cascade into http-probing and http-generic-403-bf. Allowlist GET /imageproxy/<64 hex hash> with status 200, 304, 404 or 499. 403 is intentionally not allowlisted because it means the client is already blocked, so keep that signal detectable. Tests cover the full artwork burst, 304/404/499 responses, and negative controls for /, a malformed hash and a 403 on a valid hash.
Replace the private 192.168.1.100 client and 10.9.0.3 upstream with 192.0.2.100 (TEST-NET-1) and 198.51.100.10 (TEST-NET-2), as reserved by RFC 5737 for documentation and examples.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is my first attempt at making a contribution to crowdsec. I used the Big Pickle LLM in OpenCode to help me set this up. My crowdsec setup banned my while using Music Assistant, and I found out it came from scrolling the library which triggers a lot of requests for downloading album/song artwork. I did not find an existing allowlist for this scenario, so I thought it might be a good case for a first attempt at writing my first PR. I reviewed the files in the PR myself and tested it on my live setup, it works for my case, I am not getting bans anymore while scrolling my library.
The content below is generated by the AI.
Description
Adds
crowdsecurity/music-assistant-allowlist, a parser that allowlists Music Assistant album-artwork requests so that opening a library does not triggercrowdsecurity/http-crawl-non_statics.Music Assistant serves artwork from
GET /imageproxy/<sha256>?size=…&checksum=…. The path has no file extension, socrowdsecurity/http-logsclassifies it as a non-static resource, and every artwork has a distinct hash. Loading a library therefore produces dozens of distinct URLs in seconds and crosses the capacity ofhttp-crawl-non_statics.Observed on a real Traefik → Music Assistant deployment, loading one library on a phone:
crowdsecurity/http-crawl-non_staticsafter 45+ distinct/imageproxy/<hash>requests;crowdsecurity/http-probingandLePresidente/http-generic-403-bffired from the resulting403responses while the phone was already banned.The second and third are cascades of the first, so this parser allowlists only the requests Music Assistant itself serves.
What is matched
GETon/imageproxy/followed by a 64-character hexadecimal hash, with status200,304,404or499. The query string and a trailing slash are optional.404is included: Music Assistant answers404when an artwork id is no longer known or the upstream artwork provider cannot serve the image.499is included: clients cancel artwork requests while scrolling.403is deliberately excluded: it is the reverse proxy or an existing CrowdSec ban refusing the client, not Music Assistant. Allowlisting it would hidehttp-probing/http-generic-403-bfevidence, so those events stay detectable. The test contains a negative-control event for this.Only this path is matched.
/,/ws,/sendspin, malformed ids and any other verb or status are still parsed normally.Tests
.tests/music-assistant-allowlistfeeds 51 anonymized Traefik JSON events throughtraefik-logs,http-logs,dateparse-enrichand this parser:200(enough to cross thehttp-crawl-non_staticscapacity);304, one499, one404→ all allowlisted;GET /200→ not allowlisted;/imageproxy/not-a-valid-hash400→ not allowlisted;403→ not allowlisted;scenario.assertasserts zero alerts for the whole file.Verified locally:
cscli hubtest run music-assistant-allowlist→ 58 assertions pass;crowdsecurity/http-crawl-non_statics, so the test is meaningful;hublint check→Checked 1433 items: 0 warnings, 0 errors;cscli explainon a real request reportsparser success, ignored by whitelist (Music Assistant allowlist), and no new alert appeared after installing the parser and unbanning the client.Notes for reviewers
crowdsecurity/actual-budget-whitelist.whitelist:YAML key is the CrowdSec directive and is unchanged; only the item name and reason use "allowlist", matchingcrowdsecurity/plex-allowlist.Checklist