Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jF4RY-0006tS-Up for pgsql-general@arkaria.postgresql.org; Thu, 19 Mar 2020 23:19:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jF4RX-0001ze-Hm for pgsql-general@arkaria.postgresql.org; Thu, 19 Mar 2020 23:19:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jF4RX-0001uK-4U for pgsql-general@lists.postgresql.org; Thu, 19 Mar 2020 23:19:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jF4RQ-0001N8-F4 for pgsql-general@lists.postgresql.org; Thu, 19 Mar 2020 23:19:13 +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 02JNJ6nG005503; Thu, 19 Mar 2020 19:19:06 -0400 From: Tom Lane To: Dave Hughes cc: pgsql-general@lists.postgresql.org Subject: Re: Passwordcheck configuration In-reply-to: References: Comments: In-reply-to Dave Hughes message dated "Thu, 19 Mar 2020 18:24:14 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5501.1584659946.1@sss.pgh.pa.us> Date: Thu, 19 Mar 2020 19:19:06 -0400 Message-ID: <5502.1584659946@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dave Hughes writes: > I have a requirement to set some password complexity for our database such > as length of password, upper case, lower case, special characters, > expiration limit, reuse, etc. Usually, if you have to do something like that, we recommend setting PG to use PAM authentication and configuring the restrictions on the PAM side. The only native capability in that direction is that you can set a password expiration date. Note that it's widely believed that this sort of thing makes you LESS secure, not more. Quite aside from the well-established fact that forced password changes are bad from a human-factors standpoint, you can't check any of those other points unless the password is sent to the server as cleartext. That creates its own set of vulnerabilities, and I don't know of anybody who considers it good practice. > I saw there was a module you can use for this called passwordcheck. Seems > easy to install, but I don't see how you can configure it for you specific > needs? passwordcheck hasn't got any out-of-the-box configurability. It's mainly meant as sample code that people could modify if they have a mind to. (I seem to recall some recent discussion about deprecating/removing passwordcheck altogether, but I can't find it right now.) regards, tom lane