0
Challenge · 61RLS at Scale
Advisors & the service_role discipline
Securityused in ~90% of apps
You ship four careful policies and a green pgTAP suite. Two things you never tested still leak the whole table: a `comments` table someone added last sprint and forgot to lock, and a `service_role` key a teammate pasted into a client component eight tickets ago to "unblock testing" and never removed. Neither shows up in a policy review, because neither one is a policy problem.
Core idea. The Security Advisor (engine: Splinter) is Supabase's automated second opinion — a short, numbered checklist that catches exactly the mistakes correct-looking SQL slips past a human: a table with RLS never enabled, a view that quietly bypasses the RLS of the table underneath it, a function an attacker can hijack via `search_path`. `service_role` is the other half of the same discipline, and it is not a policy problem at all: it is the one credential engineered to skip RLS entirely (`BYPASSRLS`), so the question that matters is never "is the policy right" but "can this key possibly reach a browser."
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
Security Advisor · pre-launch sweep4 ERROR4 WARN
A table in the public (API-exposed) schema has no RLS enabled at all — the whole table is readable/writable by anon.
alter table public.posts enable row level security;The habit, not the memorization: you will not recall all eight codes at 2am. You will recall to run the sweep before every launch and read what it says. The codes are here so that when one appears, you recognize it instead of guessing.
↑ play a little first, then dig in