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
- 1-- Example migrations for a small notes app. Several mistakes are on purpose.
- 2create table public.profiles (
- 3 id uuid primary key references auth.users (id) on delete cascade,
- 4 display_name text,
- 5 is_admin boolean default false
- 6);
- 7alter table public.profiles enable row level security;
- 9create policy "Profiles are viewable by everyone" on public.profiles
- 10 for select using (true);
- 12create policy "Users can update own profile" on public.profiles
- 13 for update to authenticated
- 14 using ((select auth.uid()) = id)
- 15 with check ((select auth.uid()) = id);
- 17create table public.notes (
- 18 id bigint generated always as identity primary key,
- 19 user_id uuid not null references auth.users (id),
- 20 body text not null,
- 21 created_at timestamptz default now()
- 22);
- 23alter table public.notes enable row level security;
- 25create policy "Signed in users can do anything" on public.notes
- 26 for all to authenticated
- 27 using (auth.role() = 'authenticated');
- 29create table public.invoices (
- 30 id bigint generated always as identity primary key,
- 31 user_id uuid not null,
- 32 amount_cents integer not null,
- 33 status text not null default 'open'
- 34);
