Are custom PostgreSQL role passwords or SCRAM verifiers exposed in Supabase logs? #51359
Replies: 2 comments
|
I can answer the PostgreSQL side from a test; the Supabase-specific retention and redaction questions (2, and the platform part of 5 and 6) need someone from the team, and I would not assume redaction without their confirmation. What stock PostgreSQL does (checked on 16.15):
A pattern that limits the exposure whatever the log settings are:
What I did not verify: Supabase's default |
|
I can fill most of the Supabase-specific gaps from the current docs — with one correction to the threat model that matters more than any of the defaults: the error path leaks even when statement logging is off. What the Supabase docs establish1. Statement logging is opt-in, via pgAudit. By default, Postgres logs on a hosted project capture "database activity and errors" — statement classes are not recorded until you enable pgAudit and select a scope. So the happy path of 2. The failure path is a different story. An erroring statement is logged with its full text on the 3. No redaction is documented — quite the opposite. The statement-logging guide explicitly warns that "recorded statements and messages can contain sensitive values." I would treat any credential-bearing statement as retained telemetry by policy, independent of what the platform does. 4. If pgAudit is on, scope it away from your provisioning session. pgAudit on Supabase supports session and role-scoped configuration. If your project (or a teammate) has DDL auditing enabled, run credential provisioning from a connection whose role is outside the audited scope — that's the one lever the platform gives you for keeping secrets out of retained statement logs. What this changes in practiceThe split pattern @DigitalA7 described becomes even more clearly right on hosted:
One genuinely open question for the team, which the docs don't settle: whether SQL executed through the Studio SQL editor / Management API is retained on the platform side separately from Small disclosure: I audit Supabase/PostgREST setups for production apps, so I care about exactly this class of question — but the doc references above are the load-bearing part, and everything in them stands on its own. |
Uh oh!
There was an error while loading. Please reload this page.
Hi Supabase community,
I’m preparing a security-sensitive Node.js application using Supabase only as hosted PostgreSQL. We are not using Supabase Auth or the Data API.
We need to create a dedicated least-privilege PostgreSQL LOGIN role for the application runtime.
The intended model is:
The remaining concern is secure credential provisioning.
We do not want either the plaintext runtime password or a reusable SCRAM-SHA-256 verifier to appear in PostgreSQL logs, Supabase Log Explorer, platform/audit logs, or other retained telemetry.
For example, if initialization executes:
CREATE ROLE dating_beta_api
LOGIN
PASSWORD 'SCRAM-SHA-256$...';
my understanding is that PostgreSQL statement/error logging could potentially record the credential-bearing SQL.
One possible approach would be a controlled administrator session such as:
BEGIN;
SET LOCAL log_statement = 'none';
CREATE ROLE dating_beta_api
LOGIN
PASSWORD 'SCRAM-SHA-256$...';
-- restricted grants here
COMMIT;
Before implementing this, I would appreciate guidance on the Supabase-supported approach:
We have not executed the credential creation yet and are looking for the safest supported pattern before doing so.
Thanks for any guidance, especially from anyone who has implemented custom least-privilege PostgreSQL roles on Supabase.
All reactions