Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZOGml-0005oo-QV for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Aug 2015 02:56:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZOGml-0003Ef-8c for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Aug 2015 02:56:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZOGlT-0001jD-Ca for pgsql-hackers@postgresql.org; Sun, 09 Aug 2015 02:55:11 +0000 Received: from 01.zmailcloud.com ([192.198.85.104] helo=mx-out-1.zmailcloud.com) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZOGlO-0008SN-Tc for pgsql-hackers@postgresql.org; Sun, 09 Aug 2015 02:55:10 +0000 Received: from smtp.01.com (smtp.01.com [10.10.0.43]) by mx-out-1.zmailcloud.com (Postfix) with ESMTP id 91440563E28; Sat, 8 Aug 2015 21:55:03 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 7E1976022F; Sat, 8 Aug 2015 21:55:03 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id noXvYFaHkBuY; Sat, 8 Aug 2015 21:55:03 -0500 (CDT) Received: from smtp.01.com (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 4E05F6027A; Sat, 8 Aug 2015 21:55:03 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 2D30A60273; Sat, 8 Aug 2015 21:55:03 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id koRbiwT0pMnH; Sat, 8 Aug 2015 21:55:03 -0500 (CDT) Received: from [192.168.47.106] (50-1-62-61.dsl.dynamic.fusionbroadband.com [50.1.62.61]) by smtp-out-2.01.com (Postfix) with ESMTPSA id 6FCEC6022F; Sat, 8 Aug 2015 21:55:02 -0500 (CDT) Message-ID: <55C6C102.6070809@agliodbs.com> Date: Sat, 08 Aug 2015 19:54:58 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Michael Paquier CC: Heikki Linnakangas , Robert Haas , pgsql-hackers Subject: Re: WIP: SCRAM authentication References: <55192AFE.6080106@iki.fi> <55C4FCC2.3000503@iki.fi> <55C63B1E.2040101@iki.fi> <55C679C7.4060908@agliodbs.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 08/08/2015 03:21 PM, Michael Paquier wrote: > On Sun, Aug 9, 2015 at 6:51 AM, Josh Berkus wrote: >> 1. we drop the parameter password_encryption >> 2. we add the parameter password_storage, which takes a list: >> - plain : plain text >> - md5 : current md5 hashes >> - scram : new scram hashed passwords >> This defaults to 'md5, scram' if not specified. >> This list might be extended in the future. > > Perhaps using a different GUC than password_encryption is safer... I > am not that sure. Still that's how I switched password_encryption to > actually handle a list. Default is 'md5' with the first patch, and > 'md5,scram' with the scram patch added and it sets the list of > password verifiers created when PASSWORD with ENCRYPTED/UNENCRYPTED is > used. Well, generally I feel like if we're going to change the *type* of a GUC parameter, we ought to change the *name*. It's far easier for users to figure out that the contents of a parameter need to change if the name is also changed. In other words, I think "invalid parameter 'password_encryption'" is an easier to understand error message than "invalid password_encryption type 'on'". Besides which, password_encryption was always a misnomer. Unless you're going to still accept "on, off" in some kind of wierd backwards-compatibitlity mode? If so, how does that work? > Like password ENCRYPTED (md5,scram) or similar? If no method is > passed, I think that we should default to password_storage instead. Make sense. > Also, I still think that something like PASSWORD VERIFIERS is needed, > users may want to set the verifier user for each method after > calculating it on client-side: we authorize that for md5 even now, and > that's not something this spec authorizes. I don't follow this. Mind you, I'm not sure that I need to. >> 5. we add the superuser-only function pg_apply_password_policy(). This >> applies the policy expressed by password_storage, generating or erasing >> passwords for each user. > > pg_upgrade could make use of that to control password aging with an > option to do the cleanup or not. Not sure what the default should be > though. pg_apply_password_policy(roleid) would be useful as well to do > it on a role base. No objections to an optional roleid parameter, if you think people will use it. >> 6. We add a new connection error for "authentication __method__ not >> supported for user" > > Hm? This would let any user trying to connect with a given method know > that if a method is used or not. What's wrong with failing as we do > now. In case of PASSWORD NULL for example, an attempt of connection > fails all the time with "incorrect password" or similar. So, the DBA sets password_storage = 'scram', but doesn't take the md5 lines out of pg_hba.conf. The app dev tries to connect using a driver which only supports md5. What error should they get? A user/DBA who is getting "invalid password" is going to spend a long time debugging it. Also, it would be very useful to have a distinctive error in the log, so that DBAs could see who is *trying* to connect with the wrong verifier. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers