Re: allowing for control over SET ROLE - Mailing list pgsql-hackers

From Noah Misch
Subject Re: allowing for control over SET ROLE
Date
Msg-id 20230111151655.GB1939321@rfd.leadboat.com
Whole thread Raw
In response to Re: allowing for control over SET ROLE  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: allowing for control over SET ROLE  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Tue, Jan 10, 2023 at 11:06:52AM -0500, Robert Haas wrote:
> On Sat, Jan 7, 2023 at 12:00 AM Noah Misch <noah@leadboat.com> wrote:
> > The docs are silent on the SET / OWNER TO connection.  Hence,
> 
> Reviewing the documentation again today, I realized that the
> documentation describes the rules for changing the ownership of an
> object in a whole bunch of places which this patch failed to update.
> Here's a patch to update all of the places I found.

A "git grep 'direct or indirect mem'" found a few more:

doc/src/sgml/ref/alter_collation.sgml:42:   To alter the owner, you must also be a direct or indirect member of the
new
doc/src/sgml/ref/create_database.sgml:92:        role, you must be a direct or indirect member of that role,
doc/src/sgml/ref/create_schema.sgml:92:        owned by another role, you must be a direct or indirect member of

I wondered if the new recurring phrase "must be able to SET ROLE" should be
more specific, e.g. one of "must have
{permission,authorization,authority,right} to SET ROLE".  But then I stopped
wondering and figured "be able to" is sufficient.

> I suspect that these changes will mean that we don't also need to
> adjust the discussion of the SET option itself, but let me know what
> you think.

I still think docs for the SET option itself should give a sense of the
diversity of things it's intended to control.  It could be simple.  A bunch of
the sites you're modifying are near text like "These restrictions enforce that
altering the owner doesn't do anything you couldn't do by dropping and
recreating the aggregate function."  Perhaps the main SET doc could say
something about how it restricts other things that would yield equivalent
outcomes.  (Incidentally, DROP is another case of something one likely doesn't
want the WITH SET FALSE member using.  I think that reinforces a point I wrote
upthread.  To achieve the original post's security objective, the role must
own no objects whatsoever.)



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: on placeholder entries in view rule action query's range table
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: Minimal logical decoding on standbys