From: KaiGai Kohei <kaigai@kaigai.gr.jp>
To: Joshua Brindle <jbrindle@tresys.com>
Cc: russell@coker.com.au, selinux@tycho.nsa.gov
Subject: Re: [RFC] SELinux and PostgreSQL
Date: Fri, 08 Sep 2006 00:06:55 +0900 [thread overview]
Message-ID: <4500358F.9030808@kaigai.gr.jp> (raw)
In-Reply-To: <1157638500.14982.29.camel@twoface.columbia.tresys.com>
I intend to filter the result set by appending avc_has_perm(...) condition
for each targeted table. I believe it is the most simple implementation
and it can utilize the optimizer of PostgreSQL.
>>> (A) select * from customer;
>>>
>>> (B) select * from customer where avc_has_perm(getpeercon(),
>>> security_context,
>>> DATABASE__SELECT);
>
> A turns in to B via the proxy. Then the database does the avc_has_perm
> check as part of the query. An administrator would have more access via
> the policy. The proxy would not be discarding anything.
If we consider the modules in PostgreSQL as separated processes,
we may be able to say this mechanism the proxy.
But we cannot rewrite SQL statement outside the server process,
because PosgreSQL itself may rewrite the query tree internally.
The details are described in the following URL:
Chapter 34. The Rule System
http://www.postgresql.org/docs/8.1/static/rules.html
By the above reason, we must inject additional conditions of
SELinux after completion of query rewriting, and we cannot
have any option except the implementation within DBMS.
>> Then when you do a join of two tables with such configurations things would
>> get even more interesting for the author of a proxy.
>>
>>> One could even use the proxy model within the same process space to
>>> manipulate the query as it enters the database server instead of hooking
>>> in to the database server at every access point.
>>>
>>> The bad part about this is that it makes for a less fine grained model
>>> than hooking at access points.
>> If you want to only control table access then things become much easier.
When we do a join of two tables, the joined virtual table are generated
from filtered two result set. All of its contains are allowed to select.
The result is same, even if a view was defined as a select statement
which do a join of multiple tables.
> like I said, "it makes for a less fine grained model"
>
>>> One thing to think about is stored procedures and how those can be dealt
>>> with, triggers, etc. Without access control hooks triggers are much
>>> harder to deal with access control wise, as are stored procedures.
The stored procedure is a bit considerable.
Now I cannot conclude about its handling whether it's suitable for this solution.
More hacking to PostgreSQL is necessary. ;)
Thanks,
--
KaiGai Kohei <kaigai@kaigai.gr.jp>
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-09-07 15:07 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-07 9:49 [RFC] SELinux and PostgreSQL KaiGai Kohei
2006-09-07 12:52 ` Joshua Brindle
2006-09-07 13:24 ` Russell Coker
2006-09-07 13:54 ` Joshua Brindle
2006-09-07 14:07 ` Russell Coker
2006-09-07 14:15 ` Joshua Brindle
2006-09-07 15:06 ` KaiGai Kohei [this message]
2006-09-07 14:28 ` KaiGai Kohei
2003-12-01 23:07 ` Joshua Brindle
2006-09-07 15:52 ` KaiGai Kohei
2006-09-07 17:02 ` Joshua Brindle
2006-09-07 17:18 ` Joshua Brindle
2006-09-08 12:25 ` KaiGai Kohei
2006-09-08 12:25 ` KaiGai Kohei
2006-09-08 0:48 ` Russell Coker
2006-09-08 1:06 ` Joshua Brindle
[not found] ` <6FE441CD9F0C0C479F2D88F959B015883C1638@exchange.columbia.t resys.com>
2006-09-08 2:01 ` James W. Hoeft
2006-09-08 2:10 ` Joshua Brindle
2006-09-08 12:05 ` Russell Coker
2006-09-08 13:19 ` Joshua Brindle
2006-09-08 13:46 ` KaiGai Kohei
2006-09-08 2:04 ` Joshua Brindle
2006-09-08 12:25 ` KaiGai Kohei
2006-09-07 19:08 ` Richard Hally
2006-09-08 12:25 ` KaiGai Kohei
2006-09-10 4:55 ` [RFC] SELinux and PostgreSQL (draft v2) KaiGai Kohei
2006-09-10 7:08 ` Russell Coker
2006-09-11 12:10 ` KaiGai Kohei
2006-09-11 12:16 ` Joshua Brindle
2006-09-11 13:03 ` KaiGai Kohei
2006-09-11 22:42 ` Russell Coker
2006-09-10 17:49 ` Richard Hally
2006-09-10 18:27 ` Joshua Brindle
2006-09-11 0:08 ` Russell Coker
2006-09-11 16:22 ` Richard Hally
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4500358F.9030808@kaigai.gr.jp \
--to=kaigai@kaigai.gr.jp \
--cc=jbrindle@tresys.com \
--cc=russell@coker.com.au \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.