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 1paEYJ-0002FU-RD for pgsql-general@arkaria.postgresql.org; Thu, 09 Mar 2023 11:35:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1paEYH-0007Lz-V0 for pgsql-general@arkaria.postgresql.org; Thu, 09 Mar 2023 11:35:17 +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 1paEYH-0007IY-Jr for pgsql-general@lists.postgresql.org; Thu, 09 Mar 2023 11:35:17 +0000 Received: from smtp.burggraben.net ([88.198.69.140]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1paEYE-0004mt-Kg for pgsql-general@lists.postgresql.org; Thu, 09 Mar 2023 11:35:16 +0000 Received: from squirrel.exwg.net (unknown [IPv6:2001:470:7120:1:527b:9dff:fef7:642d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "squirrel.exwg.net", Issuer "R3" (not verified)) by smtp.burggraben.net (Postfix) with ESMTPS id B0C7EC00313; Thu, 9 Mar 2023 12:35:11 +0100 (CET) Received: by squirrel.exwg.net (Postfix, from userid 1000) id 4B6F724CFA; Thu, 9 Mar 2023 12:35:11 +0100 (CET) Date: Thu, 9 Mar 2023 12:35:11 +0100 From: Christoph Moench-Tegeder To: Dominique Devienne Cc: pgsql-general@lists.postgresql.org Subject: Re: public schema grants to PUBLIC role Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.5 (2021-01-21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ## Dominique Devienne (ddevienne@gmail.com): > Hi. I've recently realized via a post (or article?) from Laurenz that the > PUBLIC role has CREATE privilege on the 'public' schema by default (see > query below). I guess it can't be avoided? You could just use PostgreSQL 15: https://www.postgresql.org/docs/15/release-15.html#id-1.11.6.7.4 > In particular, we need extensions, which are loaded in public by default. > Will USAGE of public be enough for LOGIN users having access to the DB to > use extensions? Plus any grants on the extension's object. > More broadly, we want to secure the DB so that all DB access and schema > access are explicit. > Anything else to be aware of please, beside the two mentioned above? Have a look at default privileges and group roles, that will make your life much easier. https://www.postgresql.org/docs/15/ddl-priv.html Regards, Christoph -- Spare Space.