Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 55F29B5DC5A for ; Mon, 12 Sep 2011 12:27:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 64760-08 for ; Mon, 12 Sep 2011 15:27:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f46.google.com (mail-ew0-f46.google.com [209.85.215.46]) by mail.postgresql.org (Postfix) with ESMTP id E8EB5B5DBC4 for ; Mon, 12 Sep 2011 12:27:16 -0300 (ADT) Received: by ewy4 with SMTP id 4so1732431ewy.19 for ; Mon, 12 Sep 2011 08:27:16 -0700 (PDT) Received: by 10.14.18.138 with SMTP id l10mr328375eel.31.1315841235714; Mon, 12 Sep 2011 08:27:15 -0700 (PDT) Received: from [10.1.1.6] (124-148-242-247.dyn.iinet.net.au [124.148.242.247]) by mx.google.com with ESMTPS id g65sm19488334eeg.12.2011.09.12.08.27.12 (version=SSLv3 cipher=OTHER); Mon, 12 Sep 2011 08:27:14 -0700 (PDT) Message-ID: <4E6E24C2.5050901@ringerc.id.au> Date: Mon, 12 Sep 2011 23:26:58 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Rainer Leo CC: pgsql-admin@postgresql.org Subject: Re: Best procedure for restricted access References: <746856965.20110912151609@workfile.de> In-Reply-To: <746856965.20110912151609@workfile.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/68 X-Sequence-Number: 38305 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