The Monday Supabase RLS sweep
This week's Lovable report is a reminder that the failure is silent: a table without row-level security works perfectly until a stranger reads it. A check that takes one SQL query is exactly what people forget to repeat. A scheduled job that runs the query against every project you own and mails you only when it finds something turns a one-time audit into a standing guard.
- List the Postgres connection strings for each Supabase project you run, stored as read-only credentials in the scheduler's secrets.
- For each, run select schemaname, tablename from pg_tables where schemaname = 'public' and rowsecurity = false, and also list tables that have RLS on but zero policies (join pg_policies).
- Diff against last week's result stored in a file in the repo, so you hear only about new exposures, and fetch each project's REST URL with the anon key to confirm what an outsider can actually read.
- Send yourself one email per run with a subject line that starts with the count, and skip the email entirely when the count is zero.