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 1p0hYe-0005qe-S3 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Dec 2022 11:16:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p0hYc-00076x-EQ for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Dec 2022 11:16:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0hYc-00076o-4n for pgsql-hackers@lists.postgresql.org; Thu, 01 Dec 2022 11:16:46 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0hYZ-0003BA-6t for pgsql-hackers@postgresql.org; Thu, 01 Dec 2022 11:16:45 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E82EA5C00C1; Thu, 1 Dec 2022 06:16:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 01 Dec 2022 06:16:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1669893401; x=1669979801; bh=r RP/AIOQoSyCb83qPPH5CWtiJ6YEyIww7OPcffP3gMI=; b=wn8UPGTPU5lFOga48 V3mNpVhnIxWHVi+TPCDq0jJqkMnGqDw91nWupHXL3ykK/4VImKXRS7pAlBsI2q3S YqcfT5eLq12KSiNrIfvIaeSWRVuODbLNIAt1GX86vwIpjjQ0Rcj2qBNkc+J1NAX8 HdggQ+JkUUfi8GwW+Zy4ktltA3UHaglpNVzJD8jVI7cvDfMCAEkAgkrGSYnoZS/d +pPbS9OK20VUb6hdYWM4UCqntDxcHj8mXvSwWdiQi1rxUleHLVehqPyR+ICkWR5q UwRwa9YN27xI3qLcrWAtIPMyUe8U9hlMsecSu1eqcluHoB8jAH7ulnB5n1w7Fm/W V80CA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtdehgddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Dec 2022 06:16:41 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 44C21E98; Thu, 1 Dec 2022 12:16:39 +0100 (CET) Date: Thu, 1 Dec 2022 12:16:39 +0100 From: Alvaro Herrera To: Noah Misch Cc: Tom Lane , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: pgsql: Revoke PUBLIC CREATE from public schema, now owned by pg_databas Message-ID: <20221201111639.t6cabzqlmcl4yjtl@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221201082533.GA309855@rfd.leadboat.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Dec-01, Noah Misch wrote: > This is free from the problem found in ddl-create-public-reorg-really.patch. > However, the word "other" doesn't belong there. (The per-user schemas should > not have public CREATE privilege.) I would also move that same sentence 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 search > 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 -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/