Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rKhob-0047Ha-5J for pgsql-general@arkaria.postgresql.org; Tue, 02 Jan 2024 16:40:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rKhoZ-00HPKd-GS for pgsql-general@arkaria.postgresql.org; Tue, 02 Jan 2024 16:40:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rKhoY-00HPK0-L8 for pgsql-general@lists.postgresql.org; Tue, 02 Jan 2024 16:40:27 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rKhoV-00FBIf-RA for pgsql-general@lists.postgresql.org; Tue, 02 Jan 2024 16:40:25 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9032F5C01CC; Tue, 2 Jan 2024 11:40:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 02 Jan 2024 11:40:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1704213622; x=1704300022; bh=BpSzx/wXv6Rd4FBesFtHqeCHIpImfzn5hXF6+YcZDs8=; b= hFIjXo+8gNPrZ/1VjSTSdiDaBpFcX4HXN+73BLjz0HnBT7gVcfODKSYXdfKAp1d1 +l6+8ONxfCZBech9QozvNInYfPWig5TflyDoiNzwU9UDSYETNiseaRETl9UYrABd ofBtqgs6brlWICPg8xqpYraD9GUo7qBEzr4cbNEU6kwiLj2bzG77llyZcLeiy0Sc 7ruOIcCI5A3r2TKPVytl6F8F74T+/Ptt8vWB/sfMx6HQpShPdTNWjDdKEv1BE1jM NNc6cNGbNCaWYTfUbFVFQeaAI4GlGcIP1+/3U8ppWjyd5woYJM+9eossCz2xWmt5 cOmYydkTnua5JNq3Ze5r8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704213622; x= 1704300022; bh=BpSzx/wXv6Rd4FBesFtHqeCHIpImfzn5hXF6+YcZDs8=; b=N hGXdht7b5UNxAAWYq+6Ji26e1HPKq03u08VFNSC7vQV+Cm/XkVZ4IrxOtdwi++Cu ugDjrK5sn1N5/MYed+ToU4QNCVG6Tfv7fARgEnimksxcIIBp6yNAhUSS8ebdZr0C FzZi918Or9Fr7CRccB8cEIDUtmtBB6SQDaXOFRy/TEYm/l8DmqkNmWGMwcUJUxDU gMyBm+PeERUSyFC5FkjoHxH/FxUEjgrqLgjUguwkZDF9dFwxO665AuHtC04OQG8C 4QJSC55nf00rLJbqF8dc0aivzsOwRHrjURGY1K96bRkGxjVMmRmNBkXSwfyBj/xt Io/8iwSWekVrzT6m7khDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegfedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhushhpvggtthffohhmrghinhculdegledmnecujfgurhepkfffgggfuffvvehfhfgj tgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurh hirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhep vdekfedtgfefueejhfeuledufeejiefhvedutedvhfelhffhheelgeegieekgfffnecuff homhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpsghlohhgshhpohhtrdgtohhmnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirg hnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Jan 2024 11:40:21 -0500 (EST) Message-ID: Date: Tue, 2 Jan 2024 08:40:21 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: New SET privilege for pg_has_role() in v16+ Content-Language: en-US To: Dominique Devienne , "David G. Johnston" Cc: pgsql-general@lists.postgresql.org References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/2/24 08:21, Dominique Devienne wrote: > On Tue, Jan 2, 2024 at 5:11 PM David G. Johnston > > wrote: > > On Tue, Jan 2, 2024 at 8:25 AM Dominique Devienne > > wrote: > > pg_has_role() from > https://www.postgresql.org/docs/current/functions-info.html > > added the 'SET' privilege in v16, and on top of the existing > 'MEMBER' and 'USAGE' ones: > > Membership no longer does anything by itself. > > > OK! That's news to me, I must go back to the v16 (?) release notes and > learn more about this. > > Both inherit and set capabilities are now individually controlled > permissions related to membership. > > > Hmmm, what drove this change? (I guess I'm getting back to the rationale > from earlier). > The previous model was not granular enough? > And the new one is as granular as it gets? > > It is indeed possible, but not useful, to grant membership but then > disallow both set and inherit permissions. > > > OK. Yet another thing I'll need to study. > > As I wrote earlier, we use ROLEs extensively, some INHERIT and others > NOT INHERIT, > to map an existing C/C++ enforce security model in mid-tier services, to > a ROLE/GRANT-based > one enforced by PostgreSQL itself, thus understanding why these changes > were made in v16 matters to me a lot. If you want the rationale see: https://rhaas.blogspot.com/2023/01/surviving-without-superuser-coming-to.html > > Thanks, --DD -- Adrian Klaver adrian.klaver@aklaver.com