Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XdP2E-0000WR-L2 for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Oct 2014 19:42:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XdP2C-00068m-Qf for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Oct 2014 19:42:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XdP2A-00068d-Qt for pgsql-bugs@postgresql.org; Sun, 12 Oct 2014 19:42:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XdP23-0003qb-Rc for pgsql-bugs@postgresql.org; Sun, 12 Oct 2014 19:42:25 +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 s9CJgALo025517; Sun, 12 Oct 2014 15:42:10 -0400 From: Tom Lane To: Steven Siebert cc: Bruce Momjian , Magnus Hagander , Stephen Frost , pgsql-bugs Subject: Re: BUG #10680: LDAP bind password leaks to log on failed authentication In-reply-to: References: <20140619135428.GM16098@tamriel.snowman.net> <31008.1403189850@sss.pgh.pa.us> <20140619153712.GV16098@tamriel.snowman.net> <20140619160901.GW16098@tamriel.snowman.net> <20141011183535.GA21267@momjian.us> Comments: In-reply-to Steven Siebert message dated "Sun, 12 Oct 2014 14:40:37 -0400" Date: Sun, 12 Oct 2014 15:42:10 -0400 Message-ID: <25516.1413142930@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Steven Siebert writes: > Attached is the patch (against master) for the approach we discussed: > sanitizing the log message by removing the sensitive information out of the > hba raw line. I still say that this is an ill-considered, unmaintainable, and fundamentally insecure approach to solving the wrong problem. As a single example of what's wrong with it, suppose that you fat-finger some syntax detail of an LDAP line in pg_hba.conf. When you issue "pg_ctl reload", will the postmaster log the broken line in the postmaster log? I sure hope so, because not doing so would be a major usability fail. Will it obscure the RADIUS secret? No, because the syntax error will prevent it from correctly identifying which part of the line is the secret, if indeed it even realizes that the line might contain a secret. If we go down this path, we'll be battling "oh, but what about that other scenario?" cases till kingdom come; there will never be any reason to think we've covered them all. The right problem to be solving, to my mind, is that you feel a need to give access to the postmaster log to untrusted people. Now maybe that's just a problem of wrong administrative procedures, but let's consider what we might do in PG to improve your ability to do that safely. Perhaps what we should be entertaining is a proposal to have multiple log channels, some containing more security-relevant messages and others less so. Then you could give people the ability to read only the non-security-relevant messages. If we arranged for *all* messages relevant to pg_hba.conf to go into a secure log, it'd be a lot easier to convince ourselves that we would not leak any security-critical info than if we take the approach this patch proposes. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs