Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYve4-0007UV-NJ for pgsql-admin@postgresql.org; Thu, 15 Nov 2012 09:22:00 +0000 Received: from outmail149081.authsmtp.net ([62.13.149.81]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYve2-0007nV-LU for pgsql-admin@postgresql.org; Thu, 15 Nov 2012 09:22:00 +0000 Received: from mail-c232.authsmtp.com (mail-c232.authsmtp.com [62.13.128.232]) by punt12.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id qAF9Lu3R041680; Thu, 15 Nov 2012 09:21:56 GMT Received: from ayaki.localdomain (124-148-90-153.dyn.iinet.net.au [124.148.90.153]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id qAF9LmqK017228 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 15 Nov 2012 09:21:50 GMT Message-ID: <50A4B42B.1090308@2ndQuadrant.com> Date: Thu, 15 Nov 2012 17:21:47 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Lukasz Brodziak CC: Frank Cavaliero , pgsql-admin@postgresql.org Subject: Re: Failed Login Attempts parameter References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Server-Quench: e3f4bc8f-2f05-11e2-b10b-0025903375e2 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaQBbY1ZH HGQLWlZEUFR7W2J/ bggfbAdZfEtKVxtj UFZIR1FNFgBqBAMA SF9vJBAOKkQ9eH93 Z0RqEHdZXUI0IEUr RhwHHTsbZzFgbX0e URVaalFVcFFXfh9H b1l/V3AKZDAFKBg1 TUcAFhwUHBNqYApc QwUAIRo2RkkKGHYV WwwPGC0zBgUdTj86 KhE6J0R0 X-Authentic-SMTP: 61633235383639.1019:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.148.90.153/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201211/80 X-Sequence-Number: 40325 On 11/15/2012 04:40 PM, Lukasz Brodziak wrote: > Hi, > > As far as I know there is no such parameter in PG. If you use PG as a > database for your program you can implement the feature in the > appplication by logging the failed logins in separate table(or the one > holding application users and their passwords) and then disable login > for the user if number of failures is bigger than specified value. > Another way is to create a function in postgresql which will check > failed login count and if the attempts go bigger than specified number > it will run a REVOKE on the user role thus disabling login. Then admin > will have to run GRANT for the user manually. Another option would be to monitor syslog or the csvlog and lock the user out by changing their password or revoking CONNECT rights if they trip the threshold. It wouldn't be as responsive to high-rate brute forcing attempts but your IDS should be handing those already. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services