All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: "cto@itechfrontiers.com" <cto@itechfrontiers.com>
Cc: KaiGai Kohei <kaigai@ak.jp.nec.com>, selinux@tycho.nsa.gov
Subject: Re: Recent status of SE-PostgreSQL
Date: Thu, 09 Dec 2010 11:10:20 -0500	[thread overview]
Message-ID: <4D00FF6C.2070204@manicmethod.com> (raw)
In-Reply-To: <4D00CB7F.80603@itechfrontiers.com>

cto@itechfrontiers.com wrote:
> KaiGai,
>
> Thanks for explanation, I see, but it seems I need to explain my points:
> (We are talking about designing and implementing secure and robust systems) and
> I had objections based on Practical utilization,
>
> 1) From System Wide Perspective, PostgreSQL is another daemon and should not be
> trusted and thus we give it unprivileged user and control its entire daemon with
> MAC and give Postgres its own little island to rule (I'm sure you aware of this)

Postgres is inherently trusted with it's own objects, the kernel cannot mitigate 
that. The idea is to use extend access controls deeper into objects that the 
kernel cannot itself control access to. The Postgres process and database files 
will be protected by SELinux using kernel access controls and SELinux policy is 
extended into Postgres.

As an example, lets talk about MLS. If a secret user cannot access top secret 
data on the filesystem, but can in the database your system is not capable of 
implementing the security model you've deemed necessary.

There are several current and historic implementations of database systems that 
implement an MLS policy. Where they fall short is integration with the rest of 
the security policy.

Because SELinux provides ways to 1) get the context of a process on the other 
end of a socket from the kernel, 2) use that context to get access control 
decisions from the in-kernel SELinux policy and 3) implement a consistent policy 
across multiple object managers we are able to build a comprehensive and deep 
security policy that cannot be bypassed (assuming your policy does not allow 
bypass).

Using labeled networking it gets even better. Someone sitting on a desktop 
running a database client labeled someuser:nurse_r:nurse_t can have precise 
access granted to the patient tables via labeling, specific columns can be 
removed from their view. Regardless of the credentials used to log in to the 
DBMS the MAC policy takes priority.

>
> 2) You are going to put the same tool, SELinux to rule that little island of
> PostgreSQL, for internal objectives, access control and virtual users:
>
> In my Mumble Opinion, The are objections IN PRACTICAL usage here:
>
>
> 2-1) IMHO, Using the same SELinux for creating control on internal daemon
> architecture (access) is in contrary to "Defense in Depth doctrine" (there
> supposed to be different layers of security and defense, and not to rely on a
> single point of failure which here is actually policy making and administration
> of those policies)
>

Quite the contrary. How do you suppose you will protect access to objects that 
are opaque to the kernel without implementing a security model in the daemon?

> 2-2) IMHO, down from hierarchy of system wide (kernel), MAC/RBAC INTERNALLY
> within daemons (programs) should be MAC/RBAC by design not as an add-on of
> external source , A) because of performance implications B) they are not on the
> same level of trust in contrast to security, and Security adminis cannot deal
> with internal structures and objectives of applications in practical daily
> usages this is why they are isolated, it is up to the developers to provide and
> thus why an external source which is resource intensive should be used, Virtual
> user privileges within database are not mapped directly to system resources,
>
>
> 2-3) Adding SE-PostgreSQL does not bring the daemon at the same level of trust
> and it should be sandboxed or isolated anyway, and of course internal users of a
> DBMS should not be mapped from system users, this is why VIRTUAL users are used
> within DBMS , (same defense doctrine)
> so why should use an external source for MAC/RBAC, when it should be MAC by
> design not as an add-on
>
>
> 2-4) In secure deployment a MIDDLEWARE is placed between web and a totally
> isolated DBMS for the purpose of Content filtration and analysis (not to trust
> WEB applications or its programmers) and for the purpose of load balancing, as
> well as security isolation, (AT LEAST WE DO SO)
> for trusted systems, it is possible to put a single database within a single
> instance of Postgresql and do not share it with other databases,
> since postgresql is process based it does not introduces much more resource
> consumption (as it only needs one additional master process per instance of
> PostgreSQL)
>

Trusting the middleware is placing trust in the wrong layer. You must implement 
access controls in the object owner to have any assurance that it is 
non-bypassable.

If you can find it, dig up the papers written for the Integrity Lock DBMS. They 
are a bit dated (we are talking 80's). Also Security in Computing by Pfleeger 
has a chapter on database security.

--
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.

  reply	other threads:[~2010-12-09 16:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08  4:11 Recent status of SE-PostgreSQL KaiGai Kohei
2010-12-08 15:29 ` Ted Toth
2010-12-08 23:41   ` KaiGai Kohei
2010-12-09  0:33     ` cto
2010-12-09  8:36       ` KaiGai Kohei
2010-12-09 12:28         ` cto
2010-12-09 16:10           ` Joshua Brindle [this message]
2010-12-09 16:46             ` cto
2010-12-09 17:47               ` Casey Schaufler
2010-12-09 18:17                 ` cto
2010-12-09 20:07                   ` Joshua Brindle
2010-12-09 21:35                     ` cto

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=4D00FF6C.2070204@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=cto@itechfrontiers.com \
    --cc=kaigai@ak.jp.nec.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.