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 1l6d3k-0004Ij-3E for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Feb 2021 17:32:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6d3j-0008Ke-2L for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Feb 2021 17:32:19 +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 1l6d3i-0008KX-Rh for pgsql-hackers@lists.postgresql.org; Mon, 01 Feb 2021 17:32:18 +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 1l6d3f-0006NT-U3 for pgsql-hackers@postgresql.org; Mon, 01 Feb 2021 17:32:17 +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 111HW9Q93344751; Mon, 1 Feb 2021 12:32:09 -0500 From: Tom Lane To: Stephen Frost cc: Greg Stark , Jacob Champion , "pgsql-hackers@postgresql.org" Subject: Re: Proposal: Save user's original authenticated identity for logging In-reply-to: <20210201170605.GJ27507@tamriel.snowman.net> References: <20210129220101.GE27507@tamriel.snowman.net> <2829030.1611959442@sss.pgh.pa.us> <2832058.1611963634@sss.pgh.pa.us> <3085246.1612108406@sss.pgh.pa.us> <20210201170605.GJ27507@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Mon, 01 Feb 2021 12:06:05 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3344749.1612200729.1@sss.pgh.pa.us> Date: Mon, 01 Feb 2021 12:32:09 -0500 Message-ID: <3344750.1612200729@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> This doesn't sound particularly workable: how would you manage >> inside-the-database permissions? Kerberos isn't going to know >> what "view foo" is, let alone know whether you should be allowed >> to read or write it. So ISTM there has to be a role to hold >> those permissions. Certainly, you could allow multiple external >> identities to share a role ... but that works today. > Agreed- we would need something in the database to tie it to and I don't > see it making much sense to try to invent something else for that when > that's what roles are. What's been discussed before and would certainly > be nice, however, would be a way to have roles automatically created. > There's pg_ldap_sync for that today but it'd be nice to have something > built-in and which happens at connection/authentication time, or maybe a > background worker that connects to an ldap server and listens for > changes and creates appropriate roles when they're created. Considering > we've got the LDAP code already, that'd be a really nice capability. That's still got the same issue though: where does the role get any permissions from? I suppose you could say "allow auto-creation of new roles and make them members of group X", where X holds the permissions that "everybody" should have. But I'm not sure how much that buys compared to just letting everyone log in as X. regards, tom lane