From: KaiGai Kohei <kaigai@kaigai.gr.jp>
To: Joshua Brindle <method@manicmethod.com>
Cc: Kohei KaiGai <kaigai@ak.jp.nec.com>,
"Christopher J. PeBenito" <cpebenito@tresys.com>,
selinux@tycho.nsa.gov
Subject: Re: [PATCH] SE-PostgreSQL Security Policy
Date: Sat, 08 Mar 2008 10:33:42 +0900 [thread overview]
Message-ID: <47D1ECF6.1030805@kaigai.gr.jp> (raw)
In-Reply-To: <47D16A6C.7090909@manicmethod.com>
Joshua Brindle wrote:
>>> Also, after looking at the code I don't see why install_module and
>>> load_module need to be different permissions, granted they are a
>>> privileged operation but why not collapse them into a single access
>>> vector?
>>
>> load_module is a permission to associate a database and a loadable
>> module,
>> like filesystem:associate permission.
>>
>> When we tries to load a shared library module, the following permissins
>> are required.
>>
>> (Client) (Shared Library) : db_database install_module;
>> (Client) (Database) : db_database install_module;
>> (Database) (Shared Library) : db_database load_module;
>>
>> `install_module' defines a relationship between a client and
>> database/library.
>> `load_module' defines a relationship between a database and library.
>>
>
> I see, do you have an actual use case for load_module? I don't know that
> filesystem:associate has ever been used in a useful way, though I might
> just not know of such a use.
The db_database:install_module is evaluated when client tries to
declare a function implemented at external shared library file.
The db_database:load_module is evaluated whenever SE-PostgreSQL
tries to load a shared library file.
In the later case, it has to be evaluated after server process
restarting. If someone replace shared library files during
SE-PostgreSQL stopping, the prior checks are invalid.
However, I doubt a bit whether SE-PostgreSQL should check the first
relationship between client and shared libraries, or not.
It may not be a work as `reference monitor for SQL'.
<snip>
>>> And one more question. I see you have a type transition for
>>> sepgsql_proc_t but I never saw sepgsql_proc_t as the subject of any
>>> rules, which I don't understand. The hooks appear to always use the
>>> client_sid as the subject but for stored procedures to be useful they
>>> may need to access data that the client wouldn't be able to, or did I
>>> miss something?
>>
>> When a sepgsql_client_domain invokes sepgsql_trusted_proc_t, the
>> client_sid
>> is transted into sepgsql_trusted_domain_t.
>> However, domain transition is kept in invokations for another
>> procedure type.
>> sepgsql_proc_t is always a object type, as postgresql_exex_t is always
>> a file
>> type, not a domain.
>>
>
> What if you call multiple procedures in a single call? Are the domain
> transition lifetimes limited to while the procedure is running? Are the
> other columns queried in the same query the original caller context?
Yes, we can put several different trusted procedure in a single call.
Yes, every domain transition lifetimes are limited to while the procedure
is running. However, setting up function arguments are not included within
the lifetime of domain transition.
Yes, other columns are refered in the original client context.
> e.g., if I did:
>
> select fname, lname, get_ssn(ssn), dob, get_cr(cr);
>
> and there were type_transitions for get_ssn and get_cr, how are the
> transitions handled?
If "ssn" and "cr" are hidden from the client, the above query is not
suceeded, even if get_ssn() and get_cr() is declared as trusted procedure.
The context is original one when it read "ssn" and "cr" to set up
arguments of trusted procedure, so it cannot refer these columns.
You have to give get_ssn()/get_cr() a key to refer this table,
then these functions run another query under new domain.
Please consider the following situation:
select fname, lname, get_ssn(malicious_intercept(ssn)), ...
If we can refer "ssn", it breaks everything :)
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:[~2008-03-08 1:33 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-13 9:29 [PATCH] SE-PostgreSQL Security Policy Kohei KaiGai
2008-02-25 16:30 ` Christopher J. PeBenito
2008-02-26 3:07 ` Kohei KaiGai
2008-02-27 8:00 ` Kohei KaiGai
2008-03-04 15:16 ` KaiGai Kohei
2008-03-06 15:27 ` Christopher J. PeBenito
2008-03-06 18:51 ` Joshua Brindle
2008-03-07 2:20 ` Kohei KaiGai
2008-03-07 16:16 ` Joshua Brindle
2008-03-08 1:33 ` KaiGai Kohei [this message]
2008-03-07 1:52 ` Kohei KaiGai
2008-03-07 9:32 ` Kohei KaiGai
2008-03-07 20:48 ` Christopher J. PeBenito
2008-03-09 14:24 ` KaiGai Kohei
2008-03-11 12:57 ` Christopher J. PeBenito
2008-03-11 16:57 ` KaiGai Kohei
2008-03-12 8:42 ` Kohei KaiGai
2008-03-17 9:31 ` [PATCH] SE-PostgreSQL Security Policy (try #3) Kohei KaiGai
2008-03-19 14:45 ` Christopher J. PeBenito
2008-03-21 4:32 ` KaiGai Kohei
2008-03-21 5:11 ` KaiGai Kohei
2008-03-24 18:44 ` Christopher J. PeBenito
2008-03-25 10:35 ` KaiGai Kohei
2008-03-25 13:24 ` Christopher J. PeBenito
2008-03-27 9:52 ` KaiGai Kohei
2008-03-27 13:23 ` Christopher J. PeBenito
2008-03-28 4:50 ` KaiGai Kohei
2008-05-05 13:48 ` Christopher J. PeBenito
2008-05-12 2:31 ` KaiGai Kohei
2008-05-12 14:33 ` KaiGai Kohei
[not found] ` <1210615044.11188.17.camel@gorn>
2008-05-13 2:39 ` KaiGai Kohei
2008-03-10 7:52 ` [PATCH] SE-PostgreSQL Security Policy Kohei KaiGai
2008-03-11 12:30 ` Christopher J. PeBenito
2008-03-11 13:03 ` KaiGai Kohei
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=47D1ECF6.1030805@kaigai.gr.jp \
--to=kaigai@kaigai.gr.jp \
--cc=cpebenito@tresys.com \
--cc=kaigai@ak.jp.nec.com \
--cc=method@manicmethod.com \
--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.