Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTcsI-0006pg-2Z for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2015 21:00:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTcsG-0001zp-6C for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2015 21:00:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTcsE-0001za-Ry for pgsql-hackers@postgreSQL.org; Thu, 05 Mar 2015 21:00:03 +0000 Received: from mail-bn1bon0660.outbound.protection.outlook.com ([2a01:111:f400:fc10::1:660] helo=na01-bn1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTcsA-000633-QG for pgsql-hackers@postgreSQL.org; Thu, 05 Mar 2015 21:00:00 +0000 Received: from decina.attlocal.net (2602:306:ce8b:3460:75e0:5448:6acd:4893) by CY1PR11MB0347.namprd11.prod.outlook.com (25.161.165.15) with Microsoft SMTP Server (TLS) id 15.1.106.15; Thu, 5 Mar 2015 20:59:48 +0000 Message-ID: <54F8C3B8.5070802@BlueTreble.com> Date: Thu, 5 Mar 2015 14:59:36 -0600 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Stephen Frost CC: Bruce Momjian , PostgreSQL-development Subject: Re: MD5 authentication needs help References: <20150304174354.GC29780@tamriel.snowman.net> <20150304175857.GA31979@momjian.us> <20150304182731.GG29780@tamriel.snowman.net> <20150304191625.GB31979@momjian.us> <20150304192151.GJ29780@tamriel.snowman.net> <20150304193715.GC31979@momjian.us> <20150304194654.GL29780@tamriel.snowman.net> <20150304204327.GD31979@momjian.us> <20150304205603.GM29780@tamriel.snowman.net> <54F8B7FD.8070706@BlueTreble.com> <20150305201756.GG29780@tamriel.snowman.net> In-Reply-To: <20150305201756.GG29780@tamriel.snowman.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2602:306:ce8b:3460:75e0:5448:6acd:4893] X-ClientProxiedBy: BN1PR12CA0030.namprd12.prod.outlook.com (25.160.77.40) To CY1PR11MB0347.namprd11.prod.outlook.com (25.161.165.15) Authentication-Results: postgreSQL.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR11MB0347; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(479174004)(377454003)(51704005)(24454002)(59896002)(47776003)(122386002)(87266999)(33656002)(77156002)(62966003)(87976001)(23746002)(65956001)(50986999)(50466002)(93886004)(53416004)(83506001)(19580395003)(80316001)(19580405001)(40100003)(36756003)(15975445007)(86362001)(42186005)(110136001)(54356999)(76176999)(46102003)(2950100001)(92566002)(3826002)(336755003)(18886065003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR11MB0347; H:decina.attlocal.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002007)(5005006); SRVR:CY1PR11MB0347; BCL:0; PCL:0; RULEID:; SRVR:CY1PR11MB0347; X-Forefront-PRVS: 05066DEDBB X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2015 20:59:48.3905 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR11MB0347 X-Pg-Spam-Score: -1.9 (-) 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 3/5/15 2:17 PM, Stephen Frost wrote: > * Jim Nasby (Jim.Nasby@BlueTreble.com) wrote: >> On 3/4/15 2:56 PM, Stephen Frost wrote: >>>> 2) The per-session salt sent to the client is only 32-bits, meaning >>>>> that it is possible to reply an observed MD5 hash in ~16k connection >>>>> attempts. >>> Yes, and we have no (PG-based) mechanism to prevent those connection >>> attempts, which is a pretty horrible situation to be in. >> >> Is there some reason we don't just fix that? I'm thinking that this >> is a special case where we could just modify the pg_auth tuple >> in-place without bloating the catalog (we already do that somewhere >> else). Is there something else that makes this difficult? Are we >> afraid of an extra GUC to control it? > > I'm all for it, though I would ask that we provide a way for superusers > to delegate the ability to reset locked accounts to non-superusers. > > I'd want to think about it a bit more before settling on using pg_authid I guess it's a question of how durable we want it to be. We could conceivable keep it in shared memory and let it wipe on a crash. But we already have code that ignores MVCC on a catalog table (IIRC for updating pg_class stats after vacuum) so the pattern is there. I don't see that we need more sophistication than that... > to track the data. In any case, I do think we need a way to disable > this ability for certain roles In the interest of something for this release... do we really need that? My thought is we just special-case the postgres user and be done with it. Though, if there's some other way to reset an account from the shell, no need to even special case postgres. Though, I guess if we just follow the normal GUC behavior of allowing per-database and -user overrides it wouldn't be that hard. > and, furtherr, that we not track failed > logins in cases where it's disabled (which might well be the default- I > don't think we want to add this overhead for systems which have lots of > recurring logins (think application users where they aren't doing > pooling). Yeah, presumably if allowed_authentication_failures < 0 then we don't bother with the check at all. -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers