Hi all. I built an open-source tool that tests RLS policies by running them rather than reading them.
It replays your supabase/migrations into 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 calls security definer functions 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-probe
Feedback welcome, especially policies it gets wrong.
The user introduces an open-source tool named 'rls-probe' designed to test RLS policies by running them in an in-memory Postgres environment. The tool simulates different user roles and checks access permissions, suggesting fixes for potential issues. Feedback is requested, especially for any policies the tool might misinterpret.