security hook on authorization

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: PgSQL-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: security hook on authorization
Date: 2010-08-20 01:16:29
Message-ID: 4C6DD76D.3070500@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I also plan to add a security hook on authorization time.
It shall allow external security providers to set up credential of
the authenticated clients.

Please note that it is not intended to control authentication process.
It is typically checked based on a pair of username and password.
What I want to discuss is things after success of this authentication
steps.

From viewpoint of SE-PostgreSQL, it uses getpeercon(3) which obtains
a security label of the peer process, so it does not need to consider
database username. But we can easily assume other security mechanism
which assigns a certain label based on the authenticated database user
such as Oracle Label Security.

So, I think this hook should be also invoked on the code path of
SET SESSION AUTHORIZATION, not only database login time, although
SE-PostgreSQL ignores this case.

So, I think SetSessionUserId() is a candidate to put this hook which is
entirely called from both of the code path.
This routine is to assign credential of the default database privilege
mechanism, so it seems to me it is a good point where external security
provider also assigns its credential of the authenticated database user.

Thanks,
--
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

Attachment Content-Type Size
pgsql-authorization-hook.1.patch text/x-patch 2.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-20 01:43:02 Re: BUG #5305: Postgres service stops when closing Windows session
Previous Message David Fetter 2010-08-19 23:37:49 Re: proposal: tuplestore, tuplesort aggregate functions