feat(security): RLS default-deny on all tables (closes #144)#7
Merged
Conversation
…n96#144) Migration 0002, adapted from cpatpa/PIP's 0011_rls.sql to Supabase: enable + force RLS on every public table and revoke grants from anon / authenticated, with no policies → default-deny for the public key while the service-role backend (BYPASSRLS) is unaffected. Verified on staging: RLS on 27/27 tables; reading projects via PostgREST returns 401 (anon) / 403 (authenticated user JWT); backend org APIs and the signup/provisioning SECURITY DEFINER triggers keep working. Safe because Mike's frontend never queries tables directly (auth-only) and all data flows through the backend. Per-row policies + a service-role -> user-JWT refactor (to also guard the backend path) remain deferred. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration 0002 (PIP-adapted). Enables RLS + revokes anon/authenticated grants → default-deny; service-role backend unaffected. Verified on staging: 27/27 tables RLS-on, PostgREST reads denied (401/403), backend APIs still work. Closes the upstream-willchen96#144 cross-tenant exposure gap. Per-row policies + user-JWT refactor deferred.