Re: Redact user password on pg_stat_statements

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Redact user password on pg_stat_statements
Date: 2025-02-25 17:44:42
Message-ID: CAA5RZ0t5wG8UoVP6YRS5b1rzcO8NM4yKzTz3wRqmh+69eMof1A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Well sure, but best effort is better than no effort at all. Preventing CREATE/ALTER will catch 99% of items, and as I advocated, there really is no reason for them to be in pg_stat_statements in the first place.
>
>>
>> The clients that set passwords could simply turn off track_utility on a user/transaction level while they are performing the action with
>> sensitive data.
>
>
> Good point, but that relies on the client to do the right thing, and requires two extra steps.

Yes, I think relying on the client to do the right thing is a correct strategy.

> We already have things like \password in psql. The most obvious
>helper feature we could add for this on the server side is to allow
> the password to be an out-of-line parameter:

> alter role joe set password $1;

Giving the client to parametrize DDL commands seems like a good
idea overall, and it gives the client a more robust way to deal with
sensitive passwords. Of course, even if something like this becomes possible,
the responsibility is still on the client to ensure that they are not
logging the parameter values. So, the client doing the right thing
is still required.

--

Sami
Amazon Web Services (AWS)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-02-25 17:50:33 Re: Restrict copying of invalidated replication slots
Previous Message Laurenz Albe 2025-02-25 17:41:48 Re: Update docs for UUID data type