pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedUser Management, drop users
2+ messages / 2 participants
[nested] [flat]
* User Management, drop users
@ 2007-01-14 20:00 Sven Sporer <s.sporer@gmx.net>
0 siblings, 1 reply; 2+ messages in thread
From: Sven Sporer @ 2007-01-14 20:00 UTC (permalink / raw)
To: pgsql-admin
Hi, I felt that this place is more appropriate to ask my question. I
already posted at psql-novice, but got no response. Here we go:
Right now, I have the following user management concept:
-) when creating a database, an equally named role is created; every
user of this db is in this role, this is to
handle the CONNECT privilege in order to allow these users only to
connect to "their" database, and not others
-) a role "owner" and "admin"; the member of these roles have
CREATEROLE privilege
The problem: users who are member of "admin" are allowed to drop
users from OTHER databases - that's not my
intention. I know that the createrole priv. allows them to drop
users, but I want to restrict that to only
their database (which means: users he created)
So my questions:
1) What is your tidy way to administrate users of multiple databases
in the postgresql cluster? Any tips?
2) How do you restrict the users of a specific database to touch only
the objects in their database?
I'm very interested in the best practices of user management in
PostgreSQL. Any help would be appreciated!
s.sporer
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: User Management, drop users
@ 2007-01-14 20:11 Tom Lane <tgl@sss.pgh.pa.us>
parent: Sven Sporer <s.sporer@gmx.net>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2007-01-14 20:11 UTC (permalink / raw)
To: Sven Sporer <s.sporer@gmx.net>; +Cc: pgsql-admin
Sven Sporer <s.sporer@gmx.net> writes:
> 2) How do you restrict the users of a specific database to touch only
> the objects in their database?
They *are* so restricted. Your problem is that roles are
installation-wide, not local to a particular database, and
so you cannot enforce the restriction you hope for: CREATEROLE
privilege is inherently to do with installation-wide actions.
A possible workaround is to ensure that every user owns at least
one object in "his" database -- table, function, whatever. Then
it's not possible to drop the user without having first gotten
into that database. (As of 8.1 or so --- this wasn't enforced
before that.) However a user with CREATEROLE can still cause all
sorts of mischief with ALTER USER, so preventing only the DROP case
probably isn't that helpful. Bottom line is you don't give out that
privilege to people you don't trust.
If you need better separation among groups of users, give them each
their own installation (postmaster).
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2007-01-14 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-01-14 20:00 User Management, drop users Sven Sporer <s.sporer@gmx.net>
2007-01-14 20:11 ` Re: User Management, drop users Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox