Supabase rls audit
@shipcheck/supabase-rls-audit
Audit row level security in your Supabase migrations before you launch. Finds tables with RLS off, policies that let anyone write, policies that trust user_metadata, views that skip RLS, and risky SECURITY DEFINER functions, then drafts a fix migration for you to review. Reads .sql files only and never touches your database.
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1create policy "Admins manage invoices" on public.invoices
- 2 for all to authenticated
- 3 using ((auth.jwt() -> 'user_metadata' ->> 'role') = 'admin');
- 5create table public.feedback (
- 6 id bigint generated always as identity primary key,
- 7 message text not null
- 8);
- 9alter table public.feedback enable row level security;
- 10create policy "Anyone can send feedback" on public.feedback
- 11 for insert to anon, authenticated
- 12 with check (true);
- 14create table public.audit_log (
- 15 id bigint generated always as identity primary key,
- 16 event text not null
- 17);
- 18alter table public.audit_log enable row level security;
- 20create view public.note_counts as
- 21 select user_id, count(*) as notes from public.notes group by user_id;
- 23create or replace function public.is_admin()
- 24returns boolean
- 25language sql
- 26security definer
- 27as $$
- 28 select coalesce((select is_admin from public.profiles where id = auth.uid()), false);
- 29$$;
