π‘οΈ Sentinel: [CRITICAL/HIGH] Fix missing authorization checks#18
π‘οΈ Sentinel: [CRITICAL/HIGH] Fix missing authorization checks#18trcyberoptic wants to merge 1 commit into
Conversation
Added `middleware.RequireRole` to `SettingsHandler` and `TicketHandler` to restrict sensitive endpoints such as `.env` configs and ticket assignments to appropriate roles (`admin` and `analyst`). Co-authored-by: trcyberoptic <5022752+trcyberoptic@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: CRITICAL/HIGH
π‘ Vulnerability: Sensitive API endpoints such as those that update environment configuration, modify LDAP settings, and modify risk rules or assign tickets were accessible to any authenticated user. While they were authenticated using JWT, they completely missed Role-Based Access Control checks, meaning a
vieweror any standard user could perform destructive or escalating actions.π― Impact: A low-privileged standard user could manipulate system settings (like replacing
.enventries including Database DSN or Admin Password), update/re-assign tickets, and change ticket statuses, compromising the integrity of the vulnerability tracking system.π§ Fix: Grouped sensitive routes in
internal/handler/settings.goandinternal/handler/tickets.gointo Echo sub-groups, applyingmiddleware.RequireRole("admin")andmiddleware.RequireRole("admin", "analyst")to properly enforce RBAC on those routes.β Verification: Verified by checking out the branch and running
make test. Ensure that a user with theviewerrole interacting with those endpoints will receive a403 Forbiddenresponse.PR created automatically by Jules for task 4117988223185030829 started by @trcyberoptic