-
Notifications
You must be signed in to change notification settings - Fork 197
handles Traefik multilayer routing #1629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Personally I wouldnt alter the traefik router as that is the format of the router itself (it used in the position but we can get and set proper meta data of parent and child for alert purposes) and would move this to the CLF itself. Mind if I take over and update it? however, thinking back now it might break some peoples whitelists that match a full string so we probably need to keep the same naming. |
Please, do! I only wanted to help other traefik multilayer routers enthusiasts to continue using Crowdsec :) |
question do you know if the json logs adds this as a new property or the RouterName key embeds both? also |
|
|
|
@LaurenceJJones here your answer https://github.com/cults/crowdsec-traefik-multilayer-logs you can play with this. |
9f0350e to
024804a
Compare
…ermediate/Leaf routers - Parse Traefik's multi-layer routing chains (X levels of routers) - Extract root router (first in chain), intermediate routers (middle), and leaf router (last) - Use Traefik's official terminology: Root → Intermediate → Leaf - Ensure consistent behavior between CLF and JSON log formats - Add test cases for extended router chains (4 routers) - Provide full chain in traefik_router_name_full for both formats - Expose breakdown via meta fields: traefik_router_name_root, traefik_router_name_intermediate, traefik_router_name_leaf Signed-off-by: Laurence <[email protected]>
024804a to
0798b88
Compare
…low blank routers
- Set traefik_router_name_root to empty string for single/standalone routers
- Only populate root when there's an actual hierarchy (leaf exists)
- Update TRAEFIK_ROUTER pattern to accept blank values ("-")
|
Okay think I got it in a space, where I am happy 😅 this allow us to parse additional properties that might be useful for alert context debugging / false positive. You can see the generated asserts for the meta information basically root: entry |
|
Congrats! Even I foresee the different root / leaf values for routers will be YAGNI (after all, crowdsec bouncer is always a middleware, so already inside the router chain: we already know in which kind of router we’re in), I like your implementation. Thank you! |

Description
Handles Traefik multilayer routing. Fix #1628
Checklist