Supported least-privilege, FORCE RLS, and recovery pattern on hosted Supabase? #51213
Replies: 3 comments
|
Can't answer the managed-role boundary, that one needs someone from Supabase. On Q5 though, a few things that bite when you rehearse against a restored copy in plain Postgres:
Then snapshot grants from information_schema.role_table_grants (and pg_class.relacl / pg_proc.proacl) before the migration, after it, and after the reverse migration, and diff them. Also compare row counts per table against the source. Plain Postgres won't reproduce Supabase's managed roles, so this proves your app objects and grants round-trip, not the provider side. |
|
Here is a comprehensive breakdown of the supported privilege boundaries, role ownership, and recovery patterns on hosted Supabase. 1. Invariant Managed Administrative Roles and ACLsOn hosted Supabase, the engine enforces a clear separation between the administrative control plane, data-plane API proxies, and user migration runners:
2. Least-Privilege Grants Matrix for Application TablesTo enforce least-privilege without breaking the PostgREST Data API or migration workflows:
3.
|
|
On question 5, rehearsing on a populated copy. A few things we hit doing this against a hosted Pro project:
Happy to share the grants we settled on if that's useful. |
Uh oh!
There was an error while loading. Please reload this page.
We are validating a security-sensitive migration for application-owned tables on hosted Supabase and would appreciate a current, provider-supported pattern. This is intentionally project-agnostic; no project access or production change is requested.
Questions:
anon,authenticated, andservice_role, while preserving Auth, backups, migrations, and recovery?FORCE ROW LEVEL SECURITYsupported/recommended for application tables? Are there known exceptions for owner-run orSECURITY DEFINERcode? We understand it does not constrainBYPASSRLSroles.ALTER DEFAULT PRIVILEGESbe scoped explicitly to the actual object-creator role and application schema? Are there Supabase-managed creators/default ACLs we should leave untouched?We have reviewed the Supabase roles, Data API security, RLS, clone-project, backup/restore documentation, and maintainer announcements #34270 and #45329. The remaining gap is the supported boundary between application ACL hardening and privileges required for provider administration/recovery.
All reactions