Re: Role Self-Administration

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Role Self-Administration
Date: 2021-10-05 17:14:26
Message-ID: CAOuzzgrsDnR_TCKhaeQRNm64akaMDakNyQb4tPEEJtEM+nq1-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

On Tue, Oct 5, 2021 at 12:38 Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
wrote:

>
>
> > On Oct 5, 2021, at 9:23 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> >
> >> - Disallow roles from being able to REVOKE role membership that they
> >> didn't GRANT in the first place.
> >
> > I think that's not quite the right test. For example, if alice and bob
> > are superusers and alice grants pg_monitor to doug, bob should be able
> > to revoke that grant even though he is not alice.
>
> Additionally, role "alice" might not exist anymore, which would leave the
> privilege irrevocable.

Do we actually allow that case to happen today..? I didn’t think we did
and instead there’s a dependency from the grant on to the Alice role. If
that doesn’t exist today then I would think we’d need that and therefore
this concern isn’t an issue.

It's helpful to think in terms of role ownership rather than role creation:
>
> superuser
> +---> alice
> +---> charlie
> +---> diane
> +---> bob
>
> It makes sense that alice can take ownership of diane and drop charlie,
> but not that bob can do so. Nor should charlie be able to transfer
> ownership of diane to alice. Nor should charlie be able to drop himself.

I dislike moving away from the ADMIN OPTION when it comes to roles as it
puts us outside of the SQL standard. Having the ADMIN OPTION for a role
seems, at least to me, to basically mean the things you’re suggesting
“ownership” to mean- so why have two different things, especially when one
doesn’t exist as a concept in the standard..?

I agree that Charlie shouldn’t be able to drop themselves in general, but I
don’t think we need an “ownership” concept for that. We also prevent loops
already which I think is called for in the standard already (would need to
go reread and make sure though) which already prevents Charlie from
granting Diane to Alice. What does the “ownership” concept actually buy us
then?

Thanks,

Stephen

>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2021-10-05 17:15:40 Re: Role Self-Administration
Previous Message Robert Haas 2021-10-05 17:12:03 Re: using an end-of-recovery record in all cases