From: KaiGai Kohei <kaigai@kaigai.gr.jp>
To: russell@coker.com.au
Cc: Joshua Brindle <jbrindle@tresys.com>,
"James W. Hoeft" <Jim@MagitekLtd.com>,
selinux@tycho.nsa.gov
Subject: Re: [RFC] SELinux and PostgreSQL
Date: Fri, 08 Sep 2006 22:46:34 +0900 [thread overview]
Message-ID: <4501743A.30808@kaigai.gr.jp> (raw)
In-Reply-To: <200609082206.02747.russell@coker.com.au>
Russell Coker wrote:
> On Friday 08 September 2006 12:10, "Joshua Brindle" <jbrindle@tresys.com>
> wrote:
>>> I'm confused. Password column is a good example - let's say
>>> the password column is labeled at top secret, then how can a
>>> secret user create a new row? I would assume a password would
>> Well, first of all a secret user can write a top secret column but I
>> think I know what you meant..
>
> Yes, in the MLS side of things the user can write-up (limited to the high
> level of their range unless there is an attribute on either the domain or the
> type to allow going higher).
>
> But if you have the password labeled with a restrictive type (something
> equivalent to shadow_t) then it becomes a little more tricky.
When a unauthorized user try to insert a new row into the table which contains
the password column, I think an insert query without password column should be
allowed because this query doesn't write anything to the password column.
So, NULL or a default value of password column will be set on this query.
Because this selection is done by administrator, we cannot say the user touched
the sensitive column. How do you think this behavior?
I hope to explain by an example.
When the table FOOBAR has three columns (ID, NAME, PASSWORD) and user 'KaiGai'
does not have a permission to insert.
The following query (A) and (C) will be failed in this case, because 'KaiGai'
try to set anything into PASSWORD column. But the query (B) will succeed
because he doesn't set anything into there.
(A) insert into FOOBAR(ID, NAME, PASSWORD) values(123, 'KaiGai', 'xyz');
(B) insert into FOOBAR(ID, NAME) values(123, 'KaiGai');
(C) insert into FOOBAR(ID, NAME, PASSWORD) values(123, 'KaiGai', null);
>>> be required, but that either means a secret user cannot read
>>> or cannot write (or can't do either). If that's not the case,
>>> then does that mean the row can be created without a
>>> password? In which case, does that mean only top secret users
>> Probably a trusted stored procedure that has a higher level of access
>> would be used
>
> Or a trusted SQL client program. When considering ways of improving the
> security of database backed web sites my best ideas involved having multiple
> programs doing database access with different contexts.
>
> For example the PHP script that wants to delete a topic might run a program
> that takes the user-name and password for the database connection on stdin
> (which would be used to validate the user's rights to delete the topic), and
> command-line parameters to specify the forum and topic to be deleted. That
> way someone who cracks part of the forum software would only be able to
> delete topics that their UID is permitted to delete.
I approve with the both ideas.
Anyway, an unauthorized user should not be able to access sensitive data
without passing any trusted procedure. I believe this behavior is general
in SELinux.
> Also for database access I think we want permission for a trusted connection
> manager to perform connections on behalf of other contexts. So we need to be
> able to specify in policy that domain foo_t can connect as bar_t and maybe
> permit range transitions too. I expect this to be controversial. But a very
> common need for database security is where you start with a front-end process
> that runs under the same context for all users. There are several places
> where the privileges for different users can be separated, the database
> connection is one of them.
>
>>> I would also think multiple security queries per database
>>> query would present a significant performance hit (but then
>>> again, that may be the price we have to pay for the added security).
>> Many of the lookups are already going to be done (eg., table, column DAC
>> permissions) and the AVC is pretty fast, I don't think the hit will be
>> significant but I'd be very willing to find out..
>
> I agree. Lots of database operations can be CPU intensive, SE Linux checks
> with the AVC in user-space should not be a factor in overall performance.
>
> Security Enhanced X is where we will have difficulty in delivering
> performance.
In addition, PostgreSQL will optimize the query by sorting the conditions
and using index, so the priority of executing functions is low.
The evaluation by SELinux is not done for any rows.
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-08 13:46 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
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 [this message]
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=4501743A.30808@kaigai.gr.jp \
--to=kaigai@kaigai.gr.jp \
--cc=Jim@MagitekLtd.com \
--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.