From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Dominique Devienne <ddevienne@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: New SET privilege for pg_has_role() in v16+
Date: Tue, 2 Jan 2024 08:40:21 -0800
Message-ID: <cb7cfc57-6afa-4175-a4d4-6e26e42ab015@aklaver.com> (raw)
In-Reply-To: <CAFCRh-9fwuiO=T_ddbsF2gPwunPdMDf1pi=Vveo9OPD0FvA5Zw@mail.gmail.com>
References: <CAFCRh--XHhyKgkSZKDtYSxZ2Aqf7VkVzZu2_P2BeSmeYE8y-Jw@mail.gmail.com>
<CAKFQuwbtBy0AcAcuM1Y8Zivn4SiOg_p0WJD0E=TSBz+VejuOkg@mail.gmail.com>
<CAFCRh-9fwuiO=T_ddbsF2gPwunPdMDf1pi=Vveo9OPD0FvA5Zw@mail.gmail.com>
On 1/2/24 08:21, Dominique Devienne wrote:
> On Tue, Jan 2, 2024 at 5:11 PM David G. Johnston
> <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>> wrote:
>
> On Tue, Jan 2, 2024 at 8:25 AM Dominique Devienne
> <ddevienne@gmail.com <mailto:ddevienne@gmail.com>> wrote:
>
> pg_has_role() from
> https://www.postgresql.org/docs/current/functions-info.html
> <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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, ddevienne@gmail.com, david.g.johnston@gmail.com
Subject: Re: New SET privilege for pg_has_role() in v16+
In-Reply-To: <cb7cfc57-6afa-4175-a4d4-6e26e42ab015@aklaver.com>
References: <CAFCRh--XHhyKgkSZKDtYSxZ2Aqf7VkVzZu2_P2BeSmeYE8y-Jw@mail.gmail.com> <CAKFQuwbtBy0AcAcuM1Y8Zivn4SiOg_p0WJD0E=TSBz+VejuOkg@mail.gmail.com> <CAFCRh-9fwuiO=T_ddbsF2gPwunPdMDf1pi=Vveo9OPD0FvA5Zw@mail.gmail.com> <cb7cfc57-6afa-4175-a4d4-6e26e42ab015@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox