-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Browser viz is hiding route paths for Java Spring in title #10
Comments
Okay, small update: |
Update: been trying to make a new kind of Normalizer, called "extractor" to really get the exact route defined instead of just the semgrep lines. |
Adding a new semgrep variable like $ROUTE in the spring rules could help grabbing the routes easily https://github.com/mschwager/route-detect/blob/main/routes/rules/spring.yml#L6C28-L6C28 - pattern: |
@$METHOD(path = $PATH)
$RETURNTYPE $FUNC(...) { ... }
...
...
...
metadata:
references:
- https://www.baeldung.com/spring-security-method-security
route-detect:
fill: red
route_extractor: spring
route: $PATH Then you could reuse that information simply in generating the d3 graph |
Hi there! Sorry, I've been quite busy lately. I will try to find some time to review the issues and PRs you've opened 👍 |
Thanks for this cool tool ! Was actually playing with a similar idea using semgrep :)
I think the "title" in the semgrepData JSON object is super long for some semgrep detections, and D3 is only showing me the
@Operation
, because the rest of the string has\n
line breaksIf I remove the
\n
manually it doesn't fix it, hovering the cursor above a route will show the whole semgrep finding, including the URL mapping !Not sure how this should be fixed, I would definitely put the RequestMapping above everything else cause that's the API route
EDIT: Alright I think the secret sauce is in d3ify
route-detect/routes/commands/viz.py
Line 85 in 2804595
So maybe splitting the result lines further and extracting specific things, per language/framework, to have the route shown in D3
Maybe a generic regex extractor that can support all the framework ways of declaring URLs/paths ? that way it could extract the path everytime
The text was updated successfully, but these errors were encountered: