All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Stephen Frost <sfrost@snowman.net>
Cc: SELinux <selinux@tycho.nsa.gov>
Subject: Re: postgresql policy
Date: Thu, 28 May 2015 15:27:33 -0400	[thread overview]
Message-ID: <55676C25.5040609@tycho.nsa.gov> (raw)
In-Reply-To: <20150528190926.GG26667@tamriel.snowman.net>

On 05/28/2015 03:09 PM, Stephen Frost wrote:
> Stephen,
> 
> * Stephen Smalley (sds@tycho.nsa.gov) wrote:
>> On 05/28/2015 12:52 PM, Ted Toth wrote:
>>> The ref policy contains a number of sepgsql_ types that are specific
>>> to the sepgsql postgresql module. The sepgsql module was written to
>>> support a postgresql security patch that was never accepted by the
>>> upstream. Now postgresql has gone in a different direction security
>>> wise adding row level security (RLS). I've been working on developing
>>> RLS policy to label rows on insert and update and to check access
>>> perms on select. I've tried using the sepgsql module in the RLS policy
>>> but have come to the conclusion that because it was not designed for
>>> this purpose it is not usable. So I'd like to suggest that these types
>>> be moved out of the postgresql policy possibly into their own module
>>> although I personally think they have little if any use.
>>
>> Should probably post a rfc patch to refpolicy list.
>>
>> On a different note, does this RLS implementation have any SELinux
>> integration or is it just the typical "let's implement our own custom
>> policy engine in the database manager and not link it in any way to the
>> OS security model" approach?  Pity if it is the latter.
> 
> As the one who committed RLS to PostgreSQL, I'm hopeful that what we
> have is actually able to provide both.  There is a system inside of
> PostgreSQL for creating policies, which was a requirement of the PG
> community as we fully expect it to be used in non-SELinux environments,
> but there are also hooks available where a module (such as the sepgsql
> contrib module that's included with PG) could add its own restrictive
> and/or permissive policies.

Thanks, glad to hear that there are at least hooks available.

> I'm certainly interested in the type changes being discussed here and
> would love to work with someone from the SELinux community on improving
> the sepgsql contrib module (or, perhaps, adding a different and simpler
> module which is closer to a shim around SELinux than the existing
> sepgsql module).

Yes, the latter might be the best path.  It could use the newer
selinux_check_access() interface in libselinux for checking whether a
given permission is granted and avoid having to replicate or directly
use the lower level interfaces.

  reply	other threads:[~2015-05-28 19:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 16:52 postgresql policy Ted Toth
2015-05-28 18:54 ` Stephen Smalley
2015-05-28 19:09   ` Stephen Frost
2015-05-28 19:27     ` Stephen Smalley [this message]
2015-05-28 19:40       ` Ted Toth
2015-05-28 19:43         ` Stephen Frost
2015-05-28 19:50           ` Ted Toth
2015-05-28 19:10   ` Ted Toth
2015-05-28 19:28     ` Stephen Smalley
2015-05-28 19:34       ` Ted Toth
2015-05-28 19:41         ` Stephen Frost
2015-05-28 19:43           ` Ted Toth
2015-05-28 19:49             ` Stephen Frost
2015-05-29 14:48   ` Christopher J. PeBenito

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=55676C25.5040609@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=sfrost@snowman.net \
    /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.