From: Stephen Frost <sfrost@snowman.net>
To: Peter J. Holzer <hjp-pgsql@hjp.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Lock Postgres account after X number of failed logins?
Date: Wed, 6 May 2020 11:48:00 -0400
Message-ID: <20200506154800.GR13712@tamriel.snowman.net> (raw)
In-Reply-To: <20200506152610.GA12354@hjp.at>
References: <98e0c063111b424486fc4735a31e4fc0@lmco.com>
<87h7wuj840.fsf@gmail.com>
<CAEzk6fcdFV8atrrsDWRioitgj1cAobUDu1SdXhyofVPaxa9bfw@mail.gmail.com>
<20200506132828.GP13712@tamriel.snowman.net>
<20200506152610.GA12354@hjp.at>
Greetings,
* Peter J. Holzer (hjp-pgsql@hjp.at) wrote:
> On 2020-05-06 09:28:28 -0400, Stephen Frost wrote:
> > LDAP-based authentication in PG involves passing the user's password to
> > the database server in the clear (or tunneled through SSL, but that
> > doesn't help if the DB is compromised), so it's really not a good
> > solution.
>
> Still a lot better than PostgreSQL's md5 scheme, which stores
> password-equivalent hashes: If the database is compromised the attacker
> has all hashes immediately and can use them to login. Intercepting
> encrypted traffic even at the endpoint is much harder and can only
> uncover passwords actually used.
No, it's really not better because when you're talking about LDAP it's
usually in reference to AD or similar centralized data store- so now you
get a user's credentials not *just* for access to the particular PG
database that you've compromised but across the *entire* AD environment.
If you just compromise the md5 store (which you shouldn't really be
using anyway, but whatever) then, sure, you can use that PW equivilant
to get access into the DB that you've already compromised, and if they
use the same username for other PG databases then maybe those too, but
you don't get access to their VPN credentials, or the ability to RDP to
any server they're allowed to log in to, or to the SQL server databases
they have access to, or, or, or ...
(at least, not without cracking the md5 hash, which requires at least a
little bit of additional effort and we do "salt" it with the username so
it's not completely trivial... still, please, please, please use SCRAM
for local logins, at least..)
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-general@postgresql.org
Cc: sfrost@snowman.net, hjp-pgsql@hjp.at
Subject: Re: Lock Postgres account after X number of failed logins?
In-Reply-To: <20200506154800.GR13712@tamriel.snowman.net>
References: <98e0c063111b424486fc4735a31e4fc0@lmco.com> <87h7wuj840.fsf@gmail.com> <CAEzk6fcdFV8atrrsDWRioitgj1cAobUDu1SdXhyofVPaxa9bfw@mail.gmail.com> <20200506132828.GP13712@tamriel.snowman.net> <20200506152610.GA12354@hjp.at> <20200506154800.GR13712@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