Re: [GENERAL] Roles inherited from a role which is the owner of adatabase can drop it? - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] Roles inherited from a role which is the owner of adatabase can drop it?
Date
Msg-id CAKFQuwYby6WOjYBM7mLtP6kaL0EqhtEboj6yj33_pk=fLV2fDQ@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Roles inherited from a role which is the owner of a database can drop it?  (Ivan Voras <ivoras@gmail.com>)
Responses Re: [GENERAL] Roles inherited from a role which is the owner of adatabase can drop it?  (Ivan Voras <ivoras@gmail.com>)
List pgsql-general
On Mon, Oct 30, 2017 at 12:25 PM, Ivan Voras <ivoras@gmail.com> wrote:

3. But they do log in with "developer" roles which are inherited from the owner role.

​[...]​
I've tried it on a dummy database and it apparently works as described here. Is this by design?


​Not quite following but ownership is an inheritable permission; and even if it was not SET ROLE is all that would be required.​  Any owner can drop an object that it owns.
 
What are the best practices for this sort of scenario where there is a single owner of all the schema (which is large), where developers need access to everything but cannot do something as drastic as dropping the dbs (and possibly tables)?

​Don't let developers into production databases...

Trusted people (and/or software) should be provided membership into ownership groups.​  Developers should provide these people/programs with vetted scripts to execute against production.  Developers can do whatever they want on their local database instance with full schema-modifying privileges.

"developers need access to everything" - there is a lot of nuance and detail behind that fragment that is needed if one is going to develop a data access and change management policy.

David J.

pgsql-general by date:

Previous
From: Arthur Zakirov
Date:
Subject: Re: [GENERAL] pg_audit to mask literal sql
Next
From: John R Pierce
Date:
Subject: Re: [GENERAL] pg_audit to mask literal sql