Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6eCT-0006Ft-SW for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 16:36:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6eCS-0005Ix-Eq for pgsql-general@arkaria.postgresql.org; Wed, 20 Mar 2019 16:36:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6eCS-0005D0-2q for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 16:36:20 +0000 Received: from mx1.stadt-zuerich.ch ([194.56.33.10]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6eCP-00073x-Pd for pgsql-general@lists.postgresql.org; Wed, 20 Mar 2019 16:36:19 +0000 X-IronPort-AV: E=Sophos;i="5.60,249,1549926000"; d="scan'208";a="81639826" Received: from unknown (HELO SZHM27376.global.szh.loc) ([10.7.50.80]) by mx1.prm.szh.zone with ESMTP/TLS/AES256-GCM-SHA384; 20 Mar 2019 17:36:17 +0100 Received: from SZHM27370.global.szh.loc (10.7.50.50) by SZHM27376.global.szh.loc (10.7.50.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 20 Mar 2019 17:36:12 +0100 Received: from SZHM27370.global.szh.loc ([fe80::25ce:879f:5795:3325]) by SZHM27370.global.szh.loc ([fe80::25ce:879f:5795:3325%10]) with mapi id 15.01.1415.002; Wed, 20 Mar 2019 17:36:12 +0100 From: "Zwettler Markus (OIZ)" To: Tom Lane CC: "pgsql-general@lists.postgresql.org" Subject: AW: Postgres Enhancement Request Thread-Topic: Postgres Enhancement Request Thread-Index: AdTfBQWL01N4qFG6SH+oB/p+HAdUe///+QYAgAA2lICAABkpT///4L/Q Date: Wed, 20 Mar 2019 16:36:11 +0000 Message-ID: <03243f3ae13a41578bfee2bec7f7a01d@zuerich.ch> References: <49902029-5742-00ba-85bd-fd0ba0b7d5f3@gmx.net> <28648.1553090399@sss.pgh.pa.us> <67e4608d-5bce-02eb-2909-a624743d1055@gmx.net> <29580.1553092181@sss.pgh.pa.us> In-Reply-To: <29580.1553092181@sss.pgh.pa.us> Accept-Language: de-CH, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.7.48.250] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Yes, that would be totally ok. Like the "with [grant|admin] option" privile= ge model in SQL. It should be done with all these predefined top-level data= base roles like CREATEROLE. It's doesn't only seem bogus but also a security hole when users can get pr= ivileges they have never been granted. Markus -----Urspr=FCngliche Nachricht----- Von: Tom Lane =20 Gesendet: Mittwoch, 20. M=E4rz 2019 15:30 An: Thomas Kellerer Cc: pgsql-general@lists.postgresql.org Betreff: Re: Postgres Enhancement Request Thomas Kellerer writes: > Tom Lane schrieb am 20.03.2019 um 14:59: >> No, it wouldn't. The point of CREATEROLE is to allow user creation=20 >> and deletion to be done by a role that's less than full superuser. >> If we changed it like that, then you'd be right back at needing=20 >> superuser for very routine role creations. That's *not* an=20 >> improvement, even if it somehow fit better into the OP's desired=20 >> security model (which he hasn't explained). > I didn't take this to be a request to remove the createdb privilege in ge= neral, but a request to have finer grained control what kind of privileges = the role with createrole can grant to newly created roles (or what it can d= o in general). Hmm. Thinking about it a bit more carefully, it does seem bogus that a rol= e that has CREATEROLE but not CREATEDB can make a role that has the latter = privilege. It would be more sensible to have a uniform rule that "you can'= t grant a privilege you don't have yourself", which would mean that the OP'= s problem could perhaps be solved by making a role that has CREATEROLE but = not CREATEDB. You could imagine going further and applying the full SQL privilege model t= o these things, which would make it possible to have a role that has CREATE= DB (so can make DBs itself) but can't pass that privilege on to others for = lack of grant options on CREATEDB. But that would be a very much bigger chunk of work, and I'm not sure I see = the payback. regards, tom lane