From: Wolff, Ken L <ken.l.wolff@lmco.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Failed Login Attempts in PostgreSQL
Date: Fri, 13 Nov 2020 14:44:25 +0000
Message-ID: <6a2ead5b51f54d149d4127fe453616d7@lmco.com> (raw)
You can use fail2ban for example. See for example this thread here https://www.postgresql.org/message-id/flat/61463e206b7c4c0ca17b03a59e890b78%40lmco.com,
and the config on https://github.com/rc9000/postgres-fail2ban-lockout.
(probably needs some small adaptations, but as a base it should work).
--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/
Having been down this road myself, these are the options I eventually identified. Each obviously has its benefits and drawbacks:
* Change the Postgres source code and deploy a new version. Believe there are examples of how to do this in Git.
* Disable/disallow local accounts and rely on LDAP. Be aware passwords would be passed in clear text across the network unless your DCs require SSL.
* Disable/disallow local accounts and rely on PKI certificates. I don’t know that this would necessarily limit failed login attempts but is definitely much more secure.
* Procure a vendor-supported version of PostgreSQL which offers this functionality.
* Fail2ban, as Magnus observed.
* Leverage something like Splunk monitoring to identify failed logins and then reach back into the database to lock accounts when appropriate.
Hope this is of some help.
Ken
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ken.l.wolff@lmco.com
Subject: Re: Failed Login Attempts in PostgreSQL
In-Reply-To: <6a2ead5b51f54d149d4127fe453616d7@lmco.com>
References: <6a2ead5b51f54d149d4127fe453616d7@lmco.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox