Thread: Blocking clients based on application name?

Blocking clients based on application name?

From
Wells Oliver
Date:
Seems silly, but can you block clients based on the application name? i.e. if you wanted to block anyone trying to connect with PG Admin III...

--

Re: Blocking clients based on application name?

From
"David G. Johnston"
Date:
On Thursday, August 29, 2019, Wells Oliver <wells.oliver@gmail.com> wrote:
Seems silly, but can you block clients based on the application name? i.e. if you wanted to block anyone trying to connect with PG Admin III...


No

David J. 

Re: Blocking clients based on application name?

From
Jeff Janes
Date:
On Thu, Aug 29, 2019 at 1:49 PM Wells Oliver <wells.oliver@gmail.com> wrote:
Seems silly, but can you block clients based on the application name? i.e. if you wanted to block anyone trying to connect with PG Admin III...

There is an authentication hook you can use to do that, if you are willing to compile some C code and install the .so file.

It isn't going to be very robust, because there are different ways to set the application_name.  But it works for the way pgAdmin3 sets it.

This is heavily based on auth_delay (https://www.postgresql.org/docs/current/auth-delay.html).

Cheers,

Jeff
Attachment