Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)

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>, Jacob Champion <pchampion(at)vmware(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "chap(at)anastigmatix(dot)net" <chap(at)anastigmatix(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
Subject: Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)
Date: 2021-10-19 22:52:46
Message-ID: CAOuzzgqjd0dahsNdv6HQCu19Sum8PbHkWg7Outo=2ij8O65obA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

On Tue, Oct 19, 2021 at 18:26 Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
wrote:

>
>
> > On Oct 19, 2021, at 3:18 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> >
> > On Tue, 2021-10-19 at 13:17 -0700, Mark Dilger wrote:
> >> Wouldn't it be much cleaner to have superuser bypass the trigger?
> >
> > Maybe it could be a user property like "BYPASS_EVENT_TRIGGERS", and
> > only superusers could adjust it (like the SUPERUSER and REPLICATION
> > properties).
> >
> > I suppose it would default to BYPASS_EVENT_TRIGGERS for superusers and
> > not for non-superusers. A little awkward to have different defaults,
> > but it seems sensible in this case.
> >
> > Would this bypass all event triggers, or only the event triggers of
> > another user?
>
> The difficulty is that non-superuser owned event triggers could be
> something of a minefield for scripts run as superuser. The cleanest way
> around that would be to have them never fire in response to superuser
> actions. Installations could still have event triggers that cover all
> users, including superusers, as long as they have those triggers owned by
> superuser.
>
> The implementation in the patch set does this, but with finer grained
> precision, because the universe of roles is divided into more than just
> superuser vs. non-superuser.

This last point is particularly important. Non-super users may be able to
become superuser and those roles which are able to need to also be
protected. Only protecting superuser roles themselves is *not* enough.

Thanks,

Stephen

>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-10-19 23:30:30 Re: ThisTimeLineID can be used uninitialized
Previous Message Mark Dilger 2021-10-19 22:26:20 Re: Delegating superuser tasks to new security roles (Was: Granting control of SUSET gucs to non-superusers)