How to lock a database user account after some unauthorized login attempts in a postgresql

3.4k Views Asked by At

I want to know whether Postgres has a policy to lock a particular database user after several unauthorized login attempts.

1

There are 1 best solutions below

0
Emilio Platzer On

You can write it using pluggins:

See https://wiki.postgresql.org/images/e/e3/Hooks_in_postgresql.pdf

There is a hook named ClientAuthentication_hook it is called after the login is checked and before the answer is sended to the client. There you can do what you want.