Repository navigation
fix(rbac): filter single-resource reads by row for guests - #3536
Merged
Merged
Conversation
|
|
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Snapshots, application specs and playbook runs were authorized only by a whole-type read, which guests pass so that their listings can be filtered by row. They didn't run under row-level security, so a guest could open any config, component or playbook run by id. They now run under row-level security, so a resource outside a guest's grants isn't found, as specs/authorization/collection-access.md §2 requires.
adityathebe
force-pushed
the
claude/guest-resource-reads
branch
from
October 6, 2026 14:12
819e05c to
6a654fd
Compare
adityathebe
enabled auto-merge (squash)
October 6, 2026 14:13
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.
Implements
specs/authorization/collection-access.md(#3515), §2: a guest opening one resource is checked against their grants only, never passed by the built-inread.Problem
Guests pass whole-type
readchecks as viewers so that their listings can be filtered by row. These routes were authorized only by that whole-type check and didn't run under row-level security, so a guest could open any resource by id:GET /snapshot/topology/:id,/snapshot/incident/:id,/snapshot/config/:idGET /application/:namespace/:nameand/exportGET /playbook/run/:idand/:id/status/db,/resources/:idand/catalog/*already run under row-level security.Change
Add
RLSMiddlewareto those routes. For subjects whose rows aren't filtered, the middleware is a no-op. For a guest, a resource outside their grants is now not found, the same as an id that doesn't exist.Tests
tests/permissions/playbook_list_test.go"opening a run": a run of a playbook outside the caller's row filters returns 404, and one inside returns 200. The permissions suite passes locally (199/199).Generated by Claude Code