From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Steven Siebert <smsiebe@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Magnus Hagander <magnus@hagander.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:58:01 -0400
Message-ID: <20141012195800.GY28859@tamriel.snowman.net> (raw)
In-Reply-To: <25516.1413142930@sss.pgh.pa.us>
References: <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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> 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.
I agree that this approach is pretty grotty.
> 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.
I've never liked that we tell users to put passwords in pg_hba.conf, be
they LDAP passwords or RADIUS secrets, it's just not the right place.
> 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.
I definitely like the idea of having multiple log channels with a way to
control what kinds of messages go to which- but I've also got a simpler
proposal:
Let's stop having passwords and secrets in a complex configuration file
which can have parsing and other failures.
How about allowing users to put that information in an independent file,
as do for SSL (admittedly, probably more because it's easier for us to
deal with OpenSSL that way, but still)?
ldapbindpwfile=/etc/whatever
radiussecretfile=/etc/whatever
as examples. The files would contain *only* the password or secret
(ignoring any newline) and must be readable by the PG user. We could
happily log any issues with pg_hba, etc, as long as we don't log what
came from those files. Keeping the passwords out of pg_hba.conf also
makes it easier for admins to manage those files across multiple systems
(eg: using puppet, chef, etc) while having local PWs for each box too.
Might not be perfect for LDAP (unless we also provide a
ldapbinduserfile), though the bind user could be handled through puppet
or similar and it isn't as secure a concern, and it'd work directly for
RADIUS which directly support different secrets for different hosts.
Thanks,
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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: sfrost@snowman.net, tgl@sss.pgh.pa.us, smsiebe@gmail.com, bruce@momjian.us, magnus@hagander.net
Subject: Re: BUG #10680: LDAP bind password leaks to log on failed authentication
In-Reply-To: <20141012195800.GY28859@tamriel.snowman.net>
References: <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> <20141012195800.GY28859@tamriel.snowman.net>
* 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