pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Rainer Leo <leo@workfile.de>
Cc: pgsql-admin@postgresql.org
Subject: Re: Best procedure for restricted access
Date: Mon, 12 Sep 2011 23:26:58 +0800
Message-ID: <4E6E24C2.5050901@ringerc.id.au> (raw)
In-Reply-To: <746856965.20110912151609@workfile.de>
References: <746856965.20110912151609@workfile.de>

On 12/09/2011 9:16 PM, Rainer Leo wrote:
> Hello,
>
> I have been asked to configure a database role
> to be used for ODBC access.
>
> So far I have done this:
>
> CREATE ROLE odbc_user LOGIN
>    ENCRYPTED PASSWORD 'bar'
>    NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
>
> REVOKE ALL ON DATABASE foo FROM odbc_user;
> REVOKE CREATE ON SCHEMA public FROM public;
> GRANT SELECT ON v_sales TO odbc_user;
>
> When I try:
>
> foo->  SELECT * FROM customers;
> access is denied as expected
>
> foo->\d baz
> I see table definitions.

You'd have to mess with permissions on the pg_catalog tables and the 
INFORMATION_SCHEMA views. This may have unexpected side-effects or cause 
some clients that expect to be able to use those schema to get metadata 
to cease functioning correctly.

I don't think denying access to table definitions is part of the 
security model's goals at the moment; it's about limiting access to 
_data_ not DDL or definitions. You'll note that function sources are 
also available via pg_catalog, though it seems to be reasonably safe 
(from what I hear, having not tested it) to change permissions to deny 
access to those.

--
Craig Ringer



view thread (3+ messages)

Message-ID: <4E6E24C2.5050901@ringerc.id.au>
Permalink:  ../4E6E24C2.5050901@ringerc.id.au/
Also on:    postgresql.org/message-id/4E6E24C2.5050901@ringerc.id.au

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ringerc@ringerc.id.au, leo@workfile.de
  Subject: Re: Best procedure for restricted access
  In-Reply-To: <4E6E24C2.5050901@ringerc.id.au>

* 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