Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0kUj-0005BL-Km for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Dec 2022 14:24:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p0kUi-000151-Gx for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Dec 2022 14:24:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0kUi-00014s-7e for pgsql-hackers@lists.postgresql.org; Thu, 01 Dec 2022 14:24:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0kUb-00043V-CP for pgsql-hackers@postgresql.org; Thu, 01 Dec 2022 14:24:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2B1EOhPj1563757; Thu, 1 Dec 2022 09:24:44 -0500 From: Tom Lane To: Alvaro Herrera cc: Noah Misch , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: pgsql: Revoke PUBLIC CREATE from public schema, now owned by pg_databas In-reply-to: <20221201111639.t6cabzqlmcl4yjtl@alvherre.pgsql> References: <20221201111639.t6cabzqlmcl4yjtl@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 01 Dec 2022 12:16:39 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1563755.1669904683.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 01 Dec 2022 09:24:43 -0500 Message-ID: <1563756.1669904683@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > On 2022-Dec-01, Noah Misch wrote: >> This is free from the problem found in ddl-create-public-reorg-really.p= atch. >> However, the word "other" doesn't belong there. (The per-user schemas = should >> not have public CREATE privilege.) I would also move that same sentenc= e up >> front, like this: >> = >> Constrain ordinary users to user-private schemas. To implement this >> pattern, first ensure that no schemas have public CREATE privileges. >> Then, for every user needing to create non-temporary objects, create a >> schema with the same name as that user. (Recall that the default searc= h >> path starts with $user, which resolves to the user name. Therefore, if >> each user has a separate schema, they access their own schemas by >> default.) This pattern is a secure schema usage pattern unless an >> untrusted user is the database owner or holds the CREATEROLE privilege,= in >> which case no secure schema usage pattern exists. > +1 LGTM Sounds good. I'll make it so in a bit. regards, tom lane