From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Filtering DatabaseMetaData to show only the items for which the current user has access
Date: Tue, 13 Sep 2016 08:12:29 +0200
Message-ID: <nr85cb$1qv$1@blaine.gmane.org> (raw)
In-Reply-To: <338A7B0E9A69874B9D933A0B0D2527A4E708469E@adama.fhcrc.org>
References: <338A7B0E9A69874B9D933A0B0D2527A4E708469E@adama.fhcrc.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Langley, Scott E schrieb am 13.09.2016 um 01:54:
> We have a desire to hide unneeded database objects from our
> database-challenged users - as they might see in a simple database
> viewer application - by removing their privileges on such objects.
>
> It appears that many database viewing applications, e.g.,
> DbVisualizer, rely on what is returned by the JDBC driver’s
> DatabaseMetaData methods to determine which schemas and tables to
> display to the user
>
> Another way would be to:
>
> 1. Modify the information_schema views for a particular database to
> only show the current user the objects for which they have
> privileges.
>
> 2. Then, have the PostgreSQL JDBC driver populate its
> DatabaseMetatData information only using the contents of the
> information_schema and not query pg_catalog, pg_class, and the other
> Postgres-specific system information tables.
If your aim is users of SQL clients, then what's the use of that?
As you can run any SQL statement inside those applications, the users
can still run the query directly against pg_class and the other system tables
Or they just use psql or any other tools that is not based on the JDBC driver
to get that information. You can never get security right on the client side.
Plus: with the driver being OpenSource, anyone can build their own version
with those checks disabled, or simply use an older version of the driver.
Thomas
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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-jdbc@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: Filtering DatabaseMetaData to show only the items for which the current user has access
In-Reply-To: <nr85cb$1qv$1@blaine.gmane.org>
References: <338A7B0E9A69874B9D933A0B0D2527A4E708469E@adama.fhcrc.org> <nr85cb$1qv$1@blaine.gmane.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