Re: Granting control of SUSET gucs to non-superusers

2021-05-13 Thread Mark Dilger
> On May 13, 2021, at 12:18 PM, Jacob Champion wrote: > > On Thu, 2021-05-13 at 11:42 -0700, Mark Dilger wrote: >> The distinction that Theme+Security would make is that capabilities >> can be categorized by the area of the system: >> -- planner >> -- replication >> -- logging >> ... >> bu

Re: Granting control of SUSET gucs to non-superusers

2021-05-13 Thread Stephen Frost
Greetings, * Jacob Champion (pchamp...@vmware.com) wrote: > On Thu, 2021-05-13 at 11:42 -0700, Mark Dilger wrote: > > The distinction that Theme+Security would make is that capabilities > > can be categorized by the area of the system: > > -- planner > > -- replication > > -- logging > > .

Re: Granting control of SUSET gucs to non-superusers

2021-05-13 Thread Jacob Champion
On Thu, 2021-05-13 at 11:42 -0700, Mark Dilger wrote: > The distinction that Theme+Security would make is that capabilities > can be categorized by the area of the system: > -- planner > -- replication > -- logging > ... > but also by the security implications of what is being done: > --

Re: Granting control of SUSET gucs to non-superusers

2021-05-13 Thread Mark Dilger
> On May 13, 2021, at 10:41 AM, Stephen Frost wrote: > > Greetings, > > * Mark Dilger (mark.dil...@enterprisedb.com) wrote: >>> On May 12, 2021, at 12:58 PM, Robert Haas wrote: >>> - Group things by which section of postgresql.conf they're in, and >>> then further restrict some of them as se

Re: Granting control of SUSET gucs to non-superusers

2021-05-13 Thread Stephen Frost
Greetings, * Mark Dilger (mark.dil...@enterprisedb.com) wrote: > > On May 12, 2021, at 12:58 PM, Robert Haas wrote: > > - Group things by which section of postgresql.conf they're in, and > > then further restrict some of them as security-sensitive. This is > > reasonably close to what you've got,

Re: Granting control of SUSET gucs to non-superusers

2021-05-13 Thread Mark Dilger
> On May 12, 2021, at 12:58 PM, Robert Haas wrote: > > - Group things by which section of postgresql.conf they're in, and > then further restrict some of them as security-sensitive. This is > reasonably close to what you've got, but not exactly what you've got. > One issue is that it risks sep

Re: Granting control of SUSET gucs to non-superusers

2021-05-12 Thread Robert Haas
On Wed, May 12, 2021 at 11:59 AM Mark Dilger wrote: > I didn't bother updating the docs yet, as I doubt the set of privileges/roles > in this patch will survive contact with this list. They are: > > [ various things ] Interesting classification. I think the trick here is going to be to figure o

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Mon, May 3, 2021 at 2:48 PM Tom Lane wrote: > > I'm still of the opinion that slicing and dicing this at the per-GUC > > level is a huge waste of effort. Just invent one role that lets > > grantees set any GUC, document it as being sup

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Robert Haas
On Mon, May 3, 2021 at 2:48 PM Tom Lane wrote: > I'm still of the opinion that slicing and dicing this at the per-GUC > level is a huge waste of effort. Just invent one role that lets > grantees set any GUC, document it as being superuser-equivalent, > and be done. If you want to grant someone f

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Robert Haas
On Mon, May 3, 2021 at 2:41 PM Stephen Frost wrote: > In general, I agree that we should be looking at predefined roles as > being similar to the Linux capabilities system- defining certain kinds > of operations which the user who has that role is allowed to do, and > then both in-core and extensi

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Tom Lane
Stephen Frost writes: > One thing that seems missing from this discussion and is part of what > paused my effort on the 'admin' role proposed towards the end of the > last cycle is that we really need to consider how this all plays with > ALTER SYSTEM and not just SUSET GUCs but also other (eg: PO

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Mon, May 3, 2021 at 12:25 PM Mark Dilger > wrote: > > As things stand, all custom variables defined via the > > DefineCustom{Bool,Int,Real,String,Enum}Variable are placed in the > > CUSTOM_OPTIONS config_group. We could add a role fo

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Chapman Flack
On 05/03/21 13:23, Robert Haas wrote: > On Mon, May 3, 2021 at 11:45 AM Chapman Flack wrote: >> I guess I was thinking, but forgot to convey to the keyboard, that the >> existence of a non-empty extra_check_hooks chain on a SUSET GUC (which >> could only have been attached from a shared preload li

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Robert Haas
On Mon, May 3, 2021 at 12:25 PM Mark Dilger wrote: > As things stand, all custom variables defined via the > DefineCustom{Bool,Int,Real,String,Enum}Variable are placed in the > CUSTOM_OPTIONS config_group. We could add a role for controlling any SUSET > CUSTOM_OPTIONS GUCs, or we could extend

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Robert Haas
On Mon, May 3, 2021 at 11:45 AM Chapman Flack wrote: > I guess I was thinking, but forgot to convey to the keyboard, that the > existence of a non-empty extra_check_hooks chain on a SUSET GUC (which > could only have been attached from a shared preload library) would > implicitly change SUSET to m

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Mark Dilger
> On May 3, 2021, at 8:22 AM, Robert Haas wrote: > > One problem with having a separate predefined role for every PGC_SUSET > GUC is that it's no help for extensions. Both auto_explain and > pg_stat_statements have such GUCs, and there may be out-of-core > extensions that do as well. We should

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Chapman Flack
On 05/03/21 11:22, Robert Haas wrote: >> The GUC system would have to expose a way for the shared object to >> chain extra_check_hooks off existing GUCs. An extra_check_hook can check >> both the value and the role of the caller. > > I think there are two parts to this problem. First, the SP needs

Re: Granting control of SUSET gucs to non-superusers

2021-05-03 Thread Robert Haas
On Sat, May 1, 2021 at 12:37 PM Chapman Flack wrote: > Maybe version 0 is where the provider just builds a shared object > to go in shared_preload_libraries. The provider has probably already > done a bunch of other stuff more challenging than that. > > The GUC system would have to expose a way fo

Re: Granting control of SUSET gucs to non-superusers

2021-05-01 Thread Michael Banck
Hi, On Fri, Apr 30, 2021 at 04:19:22PM -0700, Mark Dilger wrote: > PostgreSQL defines a number of GUCs that can only be set by > superusers. I would like to support granting privileges on subsets of > these to non-superuser roles, inspired by Stephen Frost's recent work > on pg_read_all_data and

Re: Granting control of SUSET gucs to non-superusers

2021-05-01 Thread Chapman Flack
On 05/01/21 12:13, Mark Dilger wrote: > Extra syntax for use by the service provider seems much easier to justify. > > If the service provider can install extra role-aware check_hooks for gucs, > and if the include directive for postgresql.conf can specify a role under > which a postgresql.conf.te

Re: Granting control of SUSET gucs to non-superusers

2021-05-01 Thread Mark Dilger
> On May 1, 2021, at 7:07 AM, Chapman Flack wrote: > > On 04/30/21 22:00, Mark Dilger wrote: >> Viewing all of this in terms of which controls allow the tenant to escape >> a hypothetical sandbox seems like the wrong approach. Shouldn't we let >> service providers decide which controls would

Re: Granting control of SUSET gucs to non-superusers

2021-05-01 Thread Chapman Flack
On 04/30/21 22:00, Mark Dilger wrote: > Viewing all of this in terms of which controls allow the tenant to escape > a hypothetical sandbox seems like the wrong approach. Shouldn't we let > service providers decide which controls would allow the tenant to escape > the specific sandbox the provider

Re: Granting control of SUSET gucs to non-superusers

2021-04-30 Thread Isaac Morland
On Fri, 30 Apr 2021 at 22:00, Mark Dilger wrote: > Viewing all of this in terms of which controls allow the tenant to escape > a hypothetical sandbox seems like the wrong approach. Shouldn't we let > service providers decide which controls would allow the tenant to escape > the specific sandbox

Re: Granting control of SUSET gucs to non-superusers

2021-04-30 Thread Mark Dilger
> On Apr 30, 2021, at 4:28 PM, Stephen Frost wrote: > > “Can’t be used to gain superuser” may be a sufficiently clear grouping, as > was more or less contemplated by the “admin” approach. If that doesn’t work > though then we need an understanding of what the limits on these groups are, >

Re: Granting control of SUSET gucs to non-superusers

2021-04-30 Thread Tom Lane
Stephen Frost writes: > On Fri, Apr 30, 2021 at 19:19 Mark Dilger > wrote: >> PostgreSQL defines a number of GUCs that can only be set by superusers. I >> would like to support granting privileges on subsets of these to >> non-superuser roles, inspired by Stephen Frost's recent work on >> pg_rea

Re: Granting control of SUSET gucs to non-superusers

2021-04-30 Thread Chapman Flack
On 04/30/21 19:19, Mark Dilger wrote: > We could certainly debate which GUCs could be used to escape the sandbox > vs. which ones could not, but I would prefer a design that allows the > provider to make that determination. I find myself wondering how many GUCs flagged SUSET are not flagged that

Re: Granting control of SUSET gucs to non-superusers

2021-04-30 Thread Stephen Frost
Greetings, On Fri, Apr 30, 2021 at 19:19 Mark Dilger wrote: > PostgreSQL defines a number of GUCs that can only be set by superusers. I > would like to support granting privileges on subsets of these to > non-superuser roles, inspired by Stephen Frost's recent work on > pg_read_all_data and pg_