Re: dblink: Add SCRAM pass-through authentication

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: dblink: Add SCRAM pass-through authentication
Date: 2025-03-07 16:22:12
Message-ID: 96f17c8c-1e3c-452b-9371-f2a8aa3f2829@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06.03.25 22:58, Jacob Champion wrote:
> On Thu, Mar 6, 2025 at 12:33 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>> AFAICT, in pgfdw_security_check(), if SCRAM has been used for the
>> outgoing server connection, then PQconnectionUsedPassword() is true, and
>> then this check should fail if no "password" parameter was given. That
>> check should be expanded to allow alternatively passing the SCRAM key
>> component parameters.
>
> pgfdw_security_check() is currently not called if SCRAM passthrough is
> in use, though:
>
>> /*
>> * Perform post-connection security checks only if scram pass-through
>> * is not being used because the password is not necessary.
>> */
>> if (!(MyProcPort->has_scram_keys && UseScramPassthrough(server, user)))
>> pgfdw_security_check(keywords, values, user, conn);

Right. How about the attached? It checks as an alternative to a
password whether the SCRAM keys were provided. That should get us back
to the same level of checking?

Attachment Content-Type Size
0001-WIP-postgres_fdw-Fix-SCRAM-pass-through-security.patch.nocfbot text/plain 3.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-03-07 16:22:40 Re: Statistics Import and Export
Previous Message Tom Lane 2025-03-07 16:21:24 Re: [PATCH] New predefined role pg_manage_extensions