1
Adding custom API keys with selectable Postgres role for backend components
Source: supabase/supabase#46804 · opened by @LeonardoDiCappuccino
Problem When using a secret key for backend components, we grant them all privileges of the service_role so in most cases they have access to parts of the db they do not need to have or actually shouldn't. In my understanding this violates the principle of least privilege even if security is properly enforced in the backend components. Suggestion Adding the possibility in Project Settings -> API Keys to add a 'Service Key' (legacy service_role API key is not meant) where you can select a Postgres role. Custom roles can be selected there so we can use other roles then anon, authenticated and service_role (from the publishable/secret key) in a backend components. With the custom Postgres role we have fine control over what the backend components can access in the db. Current solution For people interested, this is my current approach in detail: 1. Generating new signing keys via supabase cli (be careful with exposing the key in shell history): 2.…
No pledges yet. Be the first to back this.
Comments
Similar requests
showApiKeysLastUsed feature flag is off for all users - "Last used" indicators not visible during legacy key migration
2 votes · 0 comments
Custom query parameter on postgrest-js
4 votes · 0 comments
Configure External PostgreSQL for Supabase Instead of supabase-db
3 votes · 0 comments
Support for cloning databases and multiple databases within a single Supabase instance
3 votes · 0 comments
Add secret-safe temporary PostgreSQL access for MCP-managed branches
1 vote · 0 comments
No comments yet.