From: raf <raf@raf.org>
To: pgsql-general@lists.postgresql.org
Subject: Re: Restrict connection from pgadmin.
Date: Wed, 5 Feb 2020 09:12:31 +1100
Message-ID: <20200204221231.nipp2pnbu2lkzkmx@raf.org> (raw)
In-Reply-To: <16203.1580796426@sss.pgh.pa.us>
References: <CAKqG8NUas0UGOj6KJSQQqQrx6tAxnNu5SKDFyKgBQUsmDAi+5Q@mail.gmail.com>
<993e25c3-0389-3f32-2b0c-a3d250e09a10@aklaver.com>
<BFF6D625-FE89-43FE-923A-B17C81D5F1E1@vivaldi.net>
<cac9bdde-bd61-d0c9-5f53-0cb8d064aad5@aklaver.com>
<CAKqG8NURUPNrQtB07yW8rDDAVeo1zzEtj+-j87Tkoak2GmHWQg@mail.gmail.com>
<16203.1580796426@sss.pgh.pa.us>
Tom Lane wrote:
> Pawan Sharma <pawanpg0963@gmail.com> writes:
> > Yes I will show the pgadmin in stat_activity but how can block that..
> > I think I need to create a job to terminate the pgadmin connections and
> > schedule it for every 5 min and so that I will check any new connections
> > from pgadmin.
>
> I think onlookers are still completely mystified as to why you consider
> this a useful activity.
>
> pgadmin is nothing but a GUI. Whatever can be done through it can be
> done equally well through psql, or any other client software. So if
> you're looking for security against unwanted SQL commands, you're going
> about it the wrong way (better to look at preventing logins of privileged
> accounts, and/or use of SQL permissions to limit what can be done).
> If your objective is something else, you haven't explained what that is.
>
> regards, tom lane
You could give normal/application users/roles very
limited permissions (i.e. just the ability to execute
pre-existing security-defining functions and nothing
else), and have a database owner user/role with all the
permissions to create those functions. That's my insane
setup and I love it. Then use pg_hba.conf to limit
which IP addresses the database owner user/role can log
in from. You could also uninstall pg_admin. :-)
Also, if you are worried about "doing a lot of damage
in a minute", always script everything and test it
first either in a transaction that will rollback or on
a test server before executing it in production. I
don't think a GUI is suitable for this.
cheers,
raf
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: raf@raf.org
Subject: Re: Restrict connection from pgadmin.
In-Reply-To: <20200204221231.nipp2pnbu2lkzkmx@raf.org>
References: <CAKqG8NUas0UGOj6KJSQQqQrx6tAxnNu5SKDFyKgBQUsmDAi+5Q@mail.gmail.com> <993e25c3-0389-3f32-2b0c-a3d250e09a10@aklaver.com> <BFF6D625-FE89-43FE-923A-B17C81D5F1E1@vivaldi.net> <cac9bdde-bd61-d0c9-5f53-0cb8d064aad5@aklaver.com> <CAKqG8NURUPNrQtB07yW8rDDAVeo1zzEtj+-j87Tkoak2GmHWQg@mail.gmail.com> <16203.1580796426@sss.pgh.pa.us> <20200204221231.nipp2pnbu2lkzkmx@raf.org>
* 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