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 1oEZ26-0007E4-ML for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jul 2022 16:28:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEZ25-0006Ig-8g for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jul 2022 16:28:13 +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 1oEZ24-0006Fs-Vd for pgsql-hackers@lists.postgresql.org; Thu, 21 Jul 2022 16:28:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEZ22-000519-MM for pgsql-hackers@postgresql.org; Thu, 21 Jul 2022 16:28:12 +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 26LGS7Sq039753; Thu, 21 Jul 2022 12:28:07 -0400 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Thu, 21 Jul 2022 12:15:30 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <39751.1658420887.1@sss.pgh.pa.us> Date: Thu, 21 Jul 2022 12:28:07 -0400 Message-ID: <39752.1658420887@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > Currently, it's possible to remove the rolissuper bit from the > bootstrap superuser, but this leaves that user - and the system in > general - in an odd state. The bootstrap user continues to own all of > the objects it owned before, e.g. all of the system catalogs. Direct > DML on system catalogs is blocked by pg_class_aclmask_ext(), but it's > possible to do things like rename a system function out of the way and > create a new function with the same signature. Therefore, creating a > new superuser and making the original one a non-superuser is probably > not viable from a security perspective, because anyone who gained > access to that role would likely have little difficulty mounting a > Trojan horse attack against the current superusers. True, but what if the idea is to have *no* superusers? I seem to recall people being interested in setups like that. On the whole I don't have any objection to your proposal, I just worry that somebody else will. Of course there's always "UPDATE pg_authid SET rolsuper = false", which makes it absolutely clear that you're breaking the glass cover. regards, tom lane