pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Daulat <daulat.dba@gmail.com>
Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Password complexities in Postgres v14.6
Date: Fri, 16 Dec 2022 10:16:46 -0500
Message-ID: <3675887.1671203806@sss.pgh.pa.us> (raw)
In-Reply-To: <2192ed923b577ce4a8a90479c7ed1c97f7a6523d.camel@cybertec.at>
References: <CALfOM6LjVBhpHg+6nVe6reOBYdPJZXvXhkp+dqquG9cVBsGPmQ@mail.gmail.com>
	<2192ed923b577ce4a8a90479c7ed1c97f7a6523d.camel@cybertec.at>

Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Fri, 2022-12-16 at 17:57 +0530, Daulat wrote:
>> Any idea, how we can set some Password complexities in postgres for user password. Like, we can create profiles in Oracle. 
>> I am looking to set the Password complexities  (one parameter from each line item has to be complied to):
>> Default password age for users: 90 days. 
>> Password first letter will be alphabetic in uppercase.
>> English uppercase characters (A through Z)
>> English lowercase characters (a through z)
>> Base 10 digits (0 through 9)
>> Non-alphabetic characters ~" &_-+='! (){}[):;"'<>,.?/ !@#$%*
>> Password Minimum Length 8 character

> There is no reliable way to do this in PostgreSQL, since the server typically
> never sees the clear text password.
> You should consider using one of the other authentication methods like "ldap"
> and enforce the policy on the LDAP server.

Note that this approach typically leads to a net worsening of security.
Farming out the problem to LDAP means that the password has to be sent
in cleartext not only to the PG server, but then on to the LDAP server
(and in an awful lot of setups, that second hop isn't even done in an
encrypted connection).

You can fairly easily enforce password age limits in PG using the
ALTER USER ... VALID UNTIL option.  But for all this other stuff,
there is no way to enforce it at the server without sending passwords
in cleartext, which reduces security rather than increasing it.

In short: your security guidelines are obsolete and need an update.

			regards, tom lane





view thread (12+ messages)  latest in thread

Message-ID: <3675887.1671203806@sss.pgh.pa.us>
Permalink:  ../3675887.1671203806@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3675887.1671203806@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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, daulat.dba@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Password complexities in Postgres v14.6
  In-Reply-To: <3675887.1671203806@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