Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C66AE6334D9 for ; Fri, 16 Oct 2009 06:37:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 76504-06 for ; Fri, 16 Oct 2009 09:37:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og119.obsmtp.com (exprod7og119.obsmtp.com [64.18.2.16]) by mail.postgresql.org (Postfix) with SMTP id 8DE88633263 for ; Fri, 16 Oct 2009 06:37:18 -0300 (ADT) Received: from source ([209.85.219.226]) by exprod7ob119.postini.com ([64.18.6.12]) with SMTP ID DSNKStg+y8dSgoCfTy6vMwWFYM+SKgBfurlb@postini.com; Fri, 16 Oct 2009 02:37:18 PDT Received: by mail-ew0-f226.google.com with SMTP id 26so1802616ewy.5 for ; Fri, 16 Oct 2009 02:37:15 -0700 (PDT) Received: by 10.210.4.5 with SMTP id 5mr1297639ebd.23.1255685835387; Fri, 16 Oct 2009 02:37:15 -0700 (PDT) Received: from ?192.168.1.117? ([88.195.103.165]) by mx.google.com with ESMTPS id 23sm2339712eya.36.2009.10.16.02.37.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Oct 2009 02:37:14 -0700 (PDT) Message-ID: <4AD83EC6.2080800@enterprisedb.com> Date: Fri, 16 Oct 2009 12:37:10 +0300 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: KaiGai Kohei CC: Tom Lane , Stephen Frost , robertmhaas@gmail.com, pgsql-hackers@postgresql.org, kaigai@kaigai.gr.jp Subject: Re: Reworks for Access Control facilities (r2363) References: <4AC5A14F.6050306@ak.jp.nec.com> <20091012024604.GW17756@tamriel.snowman.net> <4AD54082.9050001@ak.jp.nec.com> <10495.1255627322@sss.pgh.pa.us> <4AD7CCDD.1070402@ak.jp.nec.com> In-Reply-To: <4AD7CCDD.1070402@ak.jp.nec.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.469 tagged_above=-10 required=5 tests=AWL=0.130, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/939 X-Sequence-Number: 147751 KaiGai Kohei wrote: > The purpose of this patch is to provide function entrypoints for the > upcoming SE-PostgreSQL feature, because I got a few comments that we > hesitate to put sepgsql_xxx() hooks on the main routines directly in > the first commit fest. In addition, I already tried to put SE-PG hooks > within pg_xxx_aclchecks() in this CF, but it was failed due to the > differences in the security models. Can you elaborate that? It might well be that you need to adapt the SE-PostgreSQL security model to the one that's there already. Putting SE-PG hooks into existing pg_xxx_aclcheck functions is the only low-impact way I can see to implement SE-PostgreSQL. >> * There are two special-purpose shims, ac_database_calculate_size and >> ac_tablespace_calculate_size, that got added for the benefit of >> utils/adt/dbsize.c. What if that code were still in contrib? How is it >> different from a lot of the code that is in contrib now, eg dblink or >> pgrowlocks, to say nothing of third-party modules? Presuming that the >> shim layer can know explicitly about each individual permission-checking >> requirement is a dead-end design. > > Back to the definition of access controls (or reference monitor). > It prevents violated accesses launched by user's requests (SQL). > It is not a job to protect something from malicious internal modules. The issue isn't malicious modules, but modules that have pg_xxx_aclcheck calls in them and haven't been modified to do SE-pgsql checks like you modified all the backend code. As the patch stands, they would perform just the regular acl checks and bypass SE-pgsql. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com