Replies: 3 comments 1 reply
|
Not Supabase staff, so I can't speak for their log pipeline, but on the PostgreSQL side you're already doing the recommended thing, and the residual risk is smaller than it might look:
What a leaked verifier gives an attacker: a SCRAM verifier is not a usable credential. It's the same value stored in Who can see it in Questions only Supabase can answer: whether their log ingestion (the Logs Explorer / Practical recommendation: keep |
|
I'm not sure how Supabase handles logging for hosted projects, so I'd ask Supabase support directly for that part. On the general side, PostgreSQL masks passwords in logged ALTER ROLE ... PASSWORD statements, but I'd avoid turning off logging or activity tracking just to make this work. A strong random password, set over a secure connection and stored in a secrets manager, is the normal approach. |
|
Adding test results to the answer above. Same caveat: I'm not Supabase staff, so this covers stock PostgreSQL only, not Supabase's log pipeline or Supavisor. I ran libpq's real
On the logging point raised just above: stock PostgreSQL 17 did not mask anything here. The full verifier appeared in the server log, so the The last row is worth knowing. So a sequence that avoids all three on stock PostgreSQL, without global changes or BEGIN;
SET LOCAL log_statement = 'none';
SET LOCAL pg_stat_statements.track_utility = off;
-- PQchangePassword(conn, 'app_user', <32+ random bytes>)
SELECT 1; -- replaces the verifier in pg_stat_activity
COMMIT;Logging in as the role with the new password worked afterwards. Whether Supabase's hosted logs or Supavisor apply their own redaction is the part only Supabase can confirm. |
Uh oh!
There was an error while loading. Please reload this page.
Hi Supabase community,
I'm developing a SaaS application using Supabase PostgreSQL 17.
I have an existing custom PostgreSQL LOGIN role with limited privileges and no
BYPASSRLSpermission. I need to assign it a strong password for a secure server-side database connection.The problem
My local provisioning tool uses libpq
PQchangePassword, which generates a SCRAM-SHA-256 verifier client-side instead of placing the plaintext password in SQL.However, I'm concerned that the generated verifier could be exposed through PostgreSQL activity monitoring, statement logging, or query statistics.
I tested the following session-local settings using the
Setting | Result -- | -- SET LOCAL log_statement = 'none' | Success SET LOCAL log_min_error_statement = 'panic' | Success SET LOCAL pg_stat_statements.track_utility = 'off' | Success SET LOCAL track_activities = 'off' | Permission denied (SQLSTATE 42501)postgresrole:The default activity tracking remains enabled, and I haven't confirmed whether Supabase automatically masks sensitive password-changing statements.
My questions
What is the officially recommended way to assign a password to an existing custom PostgreSQL LOGIN role on hosted Supabase?
Does Supabase redact
ALTER ROLE ... PASSWORDstatements containing client-generated SCRAM verifiers frompg_stat_activity, PostgreSQL logs, query statistics, and Supavisor logs?Is using libpq
PQchangePasswordwith a strong randomly generated password considered an appropriate security practice in this environment?Is there a supported provisioning method that avoids changing global logging settings or granting elevated permissions?
Additional context
PostgreSQL 17
Supabase hosted project
Custom least-privileged LOGIN role
RLS is enabled
No plaintext password is included in SQL
No password has been assigned yet
I'm looking for a supported and secure provisioning approach, not a workaround that disables security protections.
Any guidance from Supabase maintainers or PostgreSQL experts would be appreciated.
Thank you!
All reactions