Supabase checklist¶
Copy this list into a pull request, design review or project kickoff and tick what applies. Rules are grouped by level and sorted by score (criteria). Each links to the file that explains it and cites its sources. Automatable names tools that can check the rule in CI (see the file's "How to enforce" section).
Also apply the general checklist.
This file is generated by python3 scripts/rank.py fix from the guidelines. Don't edit it by hand.
Strongly recommended (9–10)¶
-
SUPABASE-1(10) Enable Row Level Security on every table in an exposed schema, such aspublic, and grant theanonandauthenticatedroles only the operations your app needs. (specific/supabase) Automatable:supabase test db, Supabase Advisors. -
SUPABASE-2(9) Never createsecurity definerfunctions in an exposed schema, setsearch_path = ''on every one, and create views withsecurity_invoker = trueor keep them out of exposed schemas. (specific/supabase) Automatable: Supabase Advisors. -
SUPABASE-8(9) Put only the publishable key, or the legacyanonkey, in clients, and keep secret keys and theservice_rolekey in servers and Edge Functions, out of source control. (specific/supabase) Automatable: GitHub secret scanning push protection.
Recommended (6–8)¶
-
SUPABASE-3(8) Write a separate policy for each operation, name its role withto authenticatedorto anon, compare owner columns with(select auth.uid()), addwith checkto insert and update policies, and base authorisation onapp_metadata, never onuser_metadata, which users can change themselves. (specific/supabase) Automatable:supabase test db, Supabase Advisors. -
SUPABASE-10(8) Make every schema change, including RLS policies, grants and functions, a migration file insupabase/migrationsunder version control, and never change the production database directly in the dashboard. (specific/supabase) -
SUPABASE-11(8) Plan backups for your recovery point objective: Supabase backs up only paid-plan projects daily, so on the Free plan export the database regularly withsupabase db dump --remote(CLI 3 dumps the local stack without--remote) and keep the copies off-site, and on paid plans enable point-in-time recovery when losing up to a day of data is too much. (specific/supabase) -
SUPABASE-4(7) Test the policies of every table with pgTAP: a test file per table undersupabase/teststhat asserts which operations each role may and may not perform, run withsupabase test dbon every pull request. (specific/supabase) Automatable:supabase test db. -
SUPABASE-5(7) Index every column that policies filter on, and wrapauth.uid()andauth.jwt()in aselectso that Postgres evaluates them once per statement instead of once per row. (specific/supabase) Automatable: Supabase Advisors. -
SUPABASE-6(7) If you enable anonymous sign-ins, check theis_anonymousclaim in restrictive policies on data that only permanent users may reach, and protect the sign-in endpoint with CAPTCHA. (specific/supabase) Automatable:supabase test db, Supabase Advisors. -
SUPABASE-7(7) Keep Storage buckets private unless every file in them may be public, control access with policies onstorage.objects, for example per user folder, and give temporary access to private files with signed URLs. (specific/supabase) Automatable:supabase test db, Supabase Advisors. -
SUPABASE-9(7) Check every caller of an Edge Function: keepverify_jwton for functions that users call, and query with the client that applies their RLS policies; use the admin client, which bypasses RLS, only for work that must cross policies, and verify the signature of external webhooks. (specific/supabase) -
SUPABASE-12(7) Connect each runtime the way Supabase recommends: clients through the Data API, serverless and edge functions through the shared pooler in transaction mode, with prepared statements off and a pool of one connection per instance, and migrations,pg_dumpand long-running backends through a direct connection or the pooler's session mode. (specific/supabase) -
SUPABASE-13(7) Turn on SSL enforcement and network restrictions for the database. (specific/supabase) -
SUPABASE-15(7) Configure Supabase Auth for production: turn on email confirmations, send auth email through your own SMTP server, enable CAPTCHA on sign-up, sign-in and password reset, let one-time passwords expire within an hour, and review the rate limits. (specific/supabase) -
SUPABASE-14(6) Leave the Spend Cap on, or watch the organization's usage page when it's off, so that an attack or a bug can't run up unlimited charges. (specific/supabase)