pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steven Siebert <smsiebe@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #10680: LDAP bind password leaks to log on failed authentication
Date: Sun, 12 Oct 2014 15:42:10 -0400
Message-ID: <25516.1413142930@sss.pgh.pa.us> (raw)
In-Reply-To: <CAC3nzeivnRFD+41PRhAx8Kd9VwbW0B2bzzJEmf603RTO6xAJvg@mail.gmail.com>
References: <20140619135428.GM16098@tamriel.snowman.net>
	<CAC3nzehiW+L_tX6nvwcegaxh1zQZ2o-19+rOaci2AocbyMkfAA@mail.gmail.com>
	<31008.1403189850@sss.pgh.pa.us>
	<CAC3nzehHdOtSMY+LPDNWjDgKaCb4EQKdB-axQsafrbNw5+pWkw@mail.gmail.com>
	<20140619153712.GV16098@tamriel.snowman.net>
	<CABUevEzTfNTMF3F1hTyK1Lhq+2dt4fdCSyCrRF=BVgckf6y8ng@mail.gmail.com>
	<20140619160901.GW16098@tamriel.snowman.net>
	<CAC3nzegc2hSqcLcGdgGLXsMYapOAPBFmr76VkzqK=vBpefmRdg@mail.gmail.com>
	<CABUevEziycN8irGudCg+DW0MY-afwbEjDR0ODGO9Rz9Sm9wSRQ@mail.gmail.com>
	<CAC3nzeitnG+3DthhAer3TF0OQO0-JsFWVB9iuXMqMCRz7aDmpw@mail.gmail.com>
	<20141011183535.GA21267@momjian.us>
	<CAC3nzeidOUjEsF-dUYo_eDEMQqYMe0zWnc8RtirX8=vPoxAR5w@mail.gmail.com>
	<CAC3nzeivnRFD+41PRhAx8Kd9VwbW0B2bzzJEmf603RTO6xAJvg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Steven Siebert <smsiebe@gmail.com> 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



view thread (32+ messages)  latest in thread

Message-ID: <25516.1413142930@sss.pgh.pa.us>
Permalink:  ../25516.1413142930@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25516.1413142930@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, smsiebe@gmail.com, bruce@momjian.us, magnus@hagander.net, sfrost@snowman.net
  Subject: Re: BUG #10680: LDAP bind password leaks to log on failed authentication
  In-Reply-To: <25516.1413142930@sss.pgh.pa.us>
  References: <20140619135428.GM16098@tamriel.snowman.net> <CAC3nzehiW+L_tX6nvwcegaxh1zQZ2o-19+rOaci2AocbyMkfAA@mail.gmail.com> <31008.1403189850@sss.pgh.pa.us> <CAC3nzehHdOtSMY+LPDNWjDgKaCb4EQKdB-axQsafrbNw5+pWkw@mail.gmail.com> <20140619153712.GV16098@tamriel.snowman.net> <CABUevEzTfNTMF3F1hTyK1Lhq+2dt4fdCSyCrRF=BVgckf6y8ng@mail.gmail.com> <20140619160901.GW16098@tamriel.snowman.net> <CAC3nzegc2hSqcLcGdgGLXsMYapOAPBFmr76VkzqK=vBpefmRdg@mail.gmail.com> <CABUevEziycN8irGudCg+DW0MY-afwbEjDR0ODGO9Rz9Sm9wSRQ@mail.gmail.com> <CAC3nzeitnG+3DthhAer3TF0OQO0-JsFWVB9iuXMqMCRz7aDmpw@mail.gmail.com> <20141011183535.GA21267@momjian.us> <CAC3nzeidOUjEsF-dUYo_eDEMQqYMe0zWnc8RtirX8=vPoxAR5w@mail.gmail.com> <CAC3nzeivnRFD+41PRhAx8Kd9VwbW0B2bzzJEmf603RTO6xAJvg@mail.gmail.com> <25516.1413142930@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox