All of lore.kernel.org
 help / color / mirror / Atom feed
From: KaiGai Kohei <kaigai@kaigai.gr.jp>
To: russell@coker.com.au
Cc: Joshua Brindle <jbrindle@tresys.com>, selinux@tycho.nsa.gov
Subject: Re: [RFC] SELinux and PostgreSQL
Date: Thu, 07 Sep 2006 23:28:52 +0900	[thread overview]
Message-ID: <45002CA4.40907@kaigai.gr.jp> (raw)
In-Reply-To: <200609072324.51487.russell@coker.com.au>

Sorry for delayed replying. :)

Russell Coker wrote:
> On Thursday 07 September 2006 22:52, Joshua Brindle <jbrindle@tresys.com> 
> wrote:
>>> I propose a new object class named as 'database' which contains the
>>> following access vectors.
>>>
>>>   class database
>>>   {
>>>       createtbl
>>>       altertbl
>>>       droptbl
>>>       select
>>>       update
>>>       insert
>>>       delete
>>>       relabelfrom
>>>       relabelto
>>>   }
>> I think you are almost there, below you talk about labeling the tables,
>> rows, etc individually but your object model above isn't treating them
>> any differently.
>>
>> The object model should have an object class for each distinct kind of
>> object, for example database should have create, drop, createtable,
>> droptable, relabelto, relabelfrom. the table object class should have
>> insert. update, delete, select, drop, create, etc. field (or column)
>> object class should have select, update, etc.
> 
> Do we need separate object classes for database and table?
> 
> We can consider databases and tables to be both roughly equivalent to 
> directories in the filesystem permissions.  In a Reiser4 model that would 
> be /database/table/row.  ;)
> 
> So we could have:
> table_auto_trans(dba1_t, system_db_t, database1_t, table)
> table_auto_trans(dba1_t, database1_t, table1_t, table)
> table_trans(dba1_t, database1_t, { table2_t table3_t }, table)
> table_auto_trans({ dba1_t db_user1_t }, table2_t, row1_t, row)

I agree Russell's suggestion, because we can describe those structure
with separated type and type_trans rule.
In addition, it will be more easily applicable to another DBMS.

I have a question to Russell.
How is the security context of database attached?
I estimate it should be done by type_trans rule with server process context
and clients process's context on database object class.

>>> (A) select * from customer;
>>>
>>> (B) select * from customer where avc_has_perm(getpeercon(),
>>>                                               security_context,
>>>                                               DATABASE__SELECT);
>> So is this done from within the database or are you trying to make a
>> trusted proxy that will munge requests before they make it to the
>> database server?
> 
> When I briefly discussed such things with KaiGai the idea was to have it 
> within the database.  A proxy would be very inefficient for this if SE Linux 
> controls were used in any serious manner.  Large amounts of data could be 
> retrieved only to be discarded by the proxy.

I intend to implement it as a patch against to PostgreSQL, not a independent
proxy server.
The reason of this decision is that we cannot enforce SELinux's access controls
to any tables, columns and rows, even if the proxy server rewrite SQL statement.
A query to view is a representative example.
PostgreSQL often rewrite SQL statement into something completely different.

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.

  parent reply	other threads:[~2006-09-07 14:29 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
2006-09-07 14:28     ` KaiGai Kohei [this message]
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=45002CA4.40907@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.