Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJjEd-0002JG-Bx for pgsql-admin@arkaria.postgresql.org; Tue, 09 Mar 2021 20:45:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJjEb-0002xA-G2 for pgsql-admin@arkaria.postgresql.org; Tue, 09 Mar 2021 20:45:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJjEb-0002x1-49 for pgsql-admin@lists.postgresql.org; Tue, 09 Mar 2021 20:45:41 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJjEV-0003lH-PT for pgsql-admin@lists.postgresql.org; Tue, 09 Mar 2021 20:45:40 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id 9DA6D3803EA; Tue, 9 Mar 2021 21:45:33 +0100 (CET) Received: from rs.plausibolo.de ([IPv6:::1]) by localhost (h2367442.stratoserver.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id edKBqnyMGUCE; Tue, 9 Mar 2021 21:45:33 +0100 (CET) Received: from [192.168.178.86] (p5b249b77.dip0.t-ipconnect.de [91.36.155.119]) by rs.plausibolo.de (Postfix) with ESMTPSA id 5F0753800DE; Tue, 9 Mar 2021 21:45:33 +0100 (CET) Subject: Re: Lock after several failed login attempts To: pgsql-admin@lists.postgresql.org References: <2037257.1615314027@sss.pgh.pa.us> <20210309184507.GP20766@tamriel.snowman.net> From: Holger Jakobs Message-ID: <208faea3-61d8-2480-ef60-873453a9c198@jakobs.com> Date: Tue, 9 Mar 2021 21:45:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210309184507.GP20766@tamriel.snowman.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="46rsImZhsalMd6LEWucTbJ6UsKHrPRfgI" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --46rsImZhsalMd6LEWucTbJ6UsKHrPRfgI Content-Type: multipart/mixed; boundary="ePlrjATzAMe9KQ5YptiivVQHxa0CEZOTk"; protected-headers="v1" From: Holger Jakobs To: pgsql-admin@lists.postgresql.org Message-ID: <208faea3-61d8-2480-ef60-873453a9c198@jakobs.com> Subject: Re: Lock after several failed login attempts References: <2037257.1615314027@sss.pgh.pa.us> <20210309184507.GP20766@tamriel.snowman.net> In-Reply-To: <20210309184507.GP20766@tamriel.snowman.net> --ePlrjATzAMe9KQ5YptiivVQHxa0CEZOTk Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: de-DE Am 09.03.21 um 19:45 schrieb Stephen Frost: > Greetings, > > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> postbox giridhar writes: >>> Is it possible to lock a database user after several failed login att= empts. >> No such thing is built into PG. You can use external authentication >> solutions, such as PAM, for this and related requirements. > Attempting to arrange for this to happen with the typcial PAM modules i= s > a disaster since PG's authentication code doesn't run as root and the > PAM modules expect to, not to mention that the account then has to exis= t > in the PAM world (as an actual unix user) and be authenticated using PA= M > methods (meaning you can't use PG's SCRAM). > > This capability, among many others in this area, are missing in PG toda= y > and we should accept that and hopefully someone will then work on > implementing them. Suggesting to use PAM really isn't helpful. > > Thanks, > > Stephen Hello, Maybe this can help: fail2ban can also be used for failed login attempts to PostgreSQL https://gist.github.com/rc9000/fd1be13b5c8820f63d982d0bf8154db1 --=20 Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012 --ePlrjATzAMe9KQ5YptiivVQHxa0CEZOTk-- --46rsImZhsalMd6LEWucTbJ6UsKHrPRfgI Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQScuJCxWJK1p5BOebGKV5yTsxlhugUCYEfebAUDAAAAAAAKCRCKV5yTsxlhutho AKC/tXloLwa6a0e92zf+nbx8lVR6yACfc2Ft6sYNTTZGPp4ENqUUuXFdYWc= =4TUK -----END PGP SIGNATURE----- --46rsImZhsalMd6LEWucTbJ6UsKHrPRfgI--