rls-probe: check who can read and change whose data, by running your migrations offline #52251
zkousama
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all. I built an open-source tool that tests RLS policies by running them rather than reading them.
It replays your
supabase/migrationsinto an in-memory Postgres with the parts of Supabase your rules depend on (auth.uid(), the anon, authenticated and service_role roles, storage), seeds two users, and tries every table and bucket as a visitor and as the other user. It callssecurity definerfunctions the same way, and each fix it suggests is tested on a copy of the database before it's shown. It reads the app's code to say whether each finding looks like a mistake or on purpose, and asks you about the rest. For the October 30 grants change, it lists the grants each table needs and holds back the ones that would expose data.You can run it in the browser at https://zkousama.github.io/rls-probe/, or with
npx rls-probe .. The GitHub Action and the MCP server are in the README: https://github.com/zkousama/rls-probeFeedback welcome, especially policies it gets wrong.
All reactions