Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gC4OE-0000Nx-At for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Oct 2018 15:02:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gC4OC-0004dE-EL for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Oct 2018 15:02:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gC4OC-0004d7-85 for pgsql-bugs@lists.postgresql.org; Mon, 15 Oct 2018 15:02:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gC4O6-000460-1G for pgsql-bugs@lists.postgresql.org; Mon, 15 Oct 2018 15:02:35 +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 w9FF2Rqo011304; Mon, 15 Oct 2018 11:02:27 -0400 From: Tom Lane To: rotten@windfish.net cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15432: ddl logging includes password in plaintext In-reply-to: <15432-be79e9461630b14c@postgresql.org> References: <15432-be79e9461630b14c@postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Mon, 15 Oct 2018 14:44:24 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11302.1539615747.1@sss.pgh.pa.us> Date: Mon, 15 Oct 2018 11:02:27 -0400 Message-ID: <11303.1539615747@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > When I have logging set to 'ddl', and create a user, I can see their > password in plain text in the logs: > postgres=# create user example with password 'secretpassword'; > CREATE ROLE > 2018-10-15 10:09:03.513 EDT postgres 127.0.0.1 postgres psql LOG: > statement: create user example with password 'secretpassword'; Yup. There are ways to hash the password on the client side before sending, if you want to defend against that. > This may not technically be a 'bug'. However, it should not be > out-of-the-box behavior. The password itself should be obfuscated from the > logs by default. This complaint has been made before, and rejected before, and I do not foresee the policy changing. Obfuscating the logs is impractical on both performance and system-structural grounds. And if we tried, it would be unreliable --- for instance, if you misspelled any of the keywords in this example command, would you still expect the hypothetical log obfuscator to figure out that it should get rid of 'secretpassword'? Moreover, in most database situations where you'd really care about password secrecy, there is a lot of *other* data going through the system that you'd not want exposed to prying eyes, either. Credit card numbers, personally-identifiable medical data, yadda yadda are all likely to be there in logs of INSERT/UPDATE/SELECT commands. The short answer here is that you need to limit access to the log files just as much as the rest of the database data. regards, tom lane