Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrOXu-00024H-Fz for pgsql-bugs@arkaria.postgresql.org; Sat, 27 Jul 2019 15:23:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hrOXt-0003T8-2L for pgsql-bugs@arkaria.postgresql.org; Sat, 27 Jul 2019 15:23:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrOXs-0003T1-Jq for pgsql-bugs@lists.postgresql.org; Sat, 27 Jul 2019 15:23:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hrOXl-0004kw-V9 for pgsql-bugs@lists.postgresql.org; Sat, 27 Jul 2019 15:23:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x6RFNTYJ020361; Sat, 27 Jul 2019 11:23:29 -0400 From: Tom Lane To: postgres-bug@gms.tf cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15930: Redact PGPASSWORD environment variable in psql In-reply-to: <15930-1a5562cad4a72900@postgresql.org> References: <15930-1a5562cad4a72900@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 27 Jul 2019 15:16:55 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20359.1564241009.1@sss.pgh.pa.us> Date: Sat, 27 Jul 2019 11:23:29 -0400 Message-ID: <20360.1564241009@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > Under Linux, when supplying the password via PGPASSWORD to the psql command > the password can be easily retrieved from the /proc/$pid/environ pseudo file > (or indirectly with e.g. `ps ae`) - for the complete runtime of the psql > process. This is true on many OSes. Generally speaking, we deprecate use of PGPASSWORD at all on such platforms. Having psql try to clear it out seems rather pointless to me, as (a) that does nothing for instances of the value that appear in the environments of ancestor processes, and (b) I doubt there is any platform-independent way to hide it. FWIW, Postgres offers a number of other authentication mechanisms that can be both more secure and more convenient than passwords. regards, tom lane