From: Greg Smith on
Tom Lane wrote:
> It's been perfectly clear since day one, and was reiterated as recently
> as today
> http://archives.postgresql.org/message-id/4B21757E.7090806(a)2ndquadrant.com
> that what the security community wants is row-level security.

I think David Quigley's comments from earlier today summarize the
situation better than I did:

"For our purposes in DoD we need the MAC Framework and the row based
access controls. But if a good starting point is to just do the access
control over the database objects, then it will be useful for some
commercial cases and some limited military cases"

So it's not without value even in its current "Lite" form. But there's
clearly a whole lot more use-cases that would benefit from a version
with row filtering.

--
Greg Smith 2ndQuadrant Baltimore, MD
PostgreSQL Training, Services and Support
greg(a)2ndQuadrant.com www.2ndQuadrant.com


--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Magnus Hagander on
On Fri, Dec 11, 2009 at 05:45, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas(a)gmail.com> writes:
>> On Thu, Dec 10, 2009 at 5:08 PM, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
>>> My guess is that a credible SEPostgres offering will require a long-term
>>> amount of work at least equal to, and very possibly a good deal more
>>> than, what it took to make a native Windows port.
>
>> The SEPostgres community is surely a lot smaller than the Windows
>> community, but I'm not sure whether the effort estimate is accurate or
>> not.  If "credible" includes "row-level security", then I think I
>> might agree, but right now we're just trying to get off the ground.
>
> It's been perfectly clear since day one, and was reiterated as recently
> as today
> http://archives.postgresql.org/message-id/4B21757E.7090806(a)2ndquadrant.com
> that what the security community wants is row-level security.  The

If that is true, then shouldn't we have an implementation of row level
security *first*, and then an implementation of selinux hooks that
work with this row level security feature? Rather than first doing
selinux hooks, then row level security, which will likely need new
and/or changed hooks...

I'm not convinced that row level security is actually that necessary
(though it's a nice feature, with or without selinux), but if it is,
it seems we are approaching the problem from the wrong direction.


--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Stephen Frost on
Tom,

* Tom Lane (tgl(a)sss.pgh.pa.us) wrote:
> It's been perfectly clear since day one, and was reiterated as recently
> as today
> http://archives.postgresql.org/message-id/4B21757E.7090806(a)2ndquadrant.com
> that what the security community wants is row-level security.

Yes, they do want row-level security. That being said, KaiGai, and
others, have pointed out time and time over again that SEPG without
row-level security is still useful. Additionally, I see absolutely no
way that PG would accept a full SEPG+PGACE+row-level security, etc,
patch in as one whole patch, ever. I have extreme doubt it would even
be something done over one *release*.

That all aside, for the moment, I feel that we should begin a
'two-prong' attack here. First, continue down the path that I've
started to lay out for SEPG. Second, let's hash out a design for
row-level security using the existing PG security model; ideally
using the best features and design decisions of the numerous row-level
security systems already implemented by the major SQL vendors today.

I'll start a new thread on this specific topic to hopefully pull out
anyone who's focus is more on that than on SEPG.

> The
> proposals to make SEPostgres drive regular SQL permissions never came
> out of anyone from that side, they were proposed by PG people looking
> for a manageable first step.

I do not believe this to be accurate. Josh, were you able to find any
public documentation on Trusted Rubix (is that the right name?)? The
RDBMS security policy hashed out on the SELinux list during the
discussion of Rubix and SEPG certainly included support for table-level
objects, did it not? I expect that the SELinux list contributors would
have pointed out if they didn't feel that was at all valuable.

Perhaps what is at issue is the terminology being used here though, or
the approach to enforment being considered. Part of the discussion at
the BWPUG meeting involved the option for SEPG to be a "more-restrictive
only model" in it's implementation. Essentially, this means that all
permissions handling is done the same as it is today, except that once
the PG model has decided an action is allowed, SEPG kicks in and does
any additional checking of the action being requested it wants and may
deny it.

At the end of the day, I don't feel that it really changes the
architecture of the code though. Perhaps users of SELinux will always
want that, but the argument we've heard time and time again here is that
this should be a generalized approach that other security managers could
hook into and use. To do that, I feel we first have to start with the
PG model, which *does* care about all the SQL permissions. Let's
extract the various complaints and concerns about SELinux that have been
thrown around this list and instead consider our first "client" of the
PG modular security framework to be the existing PG SQL permissions
system. If we can agree to that, then it's clear that we can't just
hand-wave the requirement that it be capable of driving the regular SQL
permissions.

> Whatever you might believe about the
> potential market for SEPostgres, you should divide by about a hundred
> as long as it's only an alternate interface to SQL permissions. See
> particularly here:
> http://wiki.postgresql.org/wiki/SEPostgreSQL_Review_at_the_BWPUG#Revisiting_row-level_security
> "Without it, it's questionable whether committing the existing
> stripped-down patch really accomplishes anything" --- how much
> clearer can they be?

Again, let's please address row-level security first at the PG level.
That was recommended previously by many on this list and is clearly a
useful feature which can stand alone in any case.

> If you're not prepared to assume that we're going to do row level
> security, it's not apparent why we should be embarking on this course
> at all. And if you do assume that, I strongly believe that my effort
> estimate above is on the optimistic side.

I do assume we're going to do row level security, but I do not feel that
we need to particularly put one in front of the other. I also feel that
SEPG will be valuable even without row-level security. One of the
realms that we discussed at BWPUG for this is PCI compliance. I'm
hopeful Josh will have an opportunity to review the PCI compliance
"cheat-sheet" that I recall Robert Treat offering and comes to agreement
that SEPG w/o row-level security would greatly improve our ability to
have a PCI compliant system backed with PG.

Thanks,

Stephen
From: Robert Haas on
On Fri, Dec 11, 2009 at 4:31 AM, Magnus Hagander <magnus(a)hagander.net> wrote:
> On Fri, Dec 11, 2009 at 05:45, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas(a)gmail.com> writes:
>>> On Thu, Dec 10, 2009 at 5:08 PM, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
>>>> My guess is that a credible SEPostgres offering will require a long-term
>>>> amount of work at least equal to, and very possibly a good deal more
>>>> than, what it took to make a native Windows port.
>>
>>> The SEPostgres community is surely a lot smaller than the Windows
>>> community, but I'm not sure whether the effort estimate is accurate or
>>> not.  If "credible" includes "row-level security", then I think I
>>> might agree, but right now we're just trying to get off the ground.
>>
>> It's been perfectly clear since day one, and was reiterated as recently
>> as today
>> http://archives.postgresql.org/message-id/4B21757E.7090806(a)2ndquadrant.com
>> that what the security community wants is row-level security.  The
>
> If that is true, then shouldn't we have an implementation of row level
> security *first*, and then an implementation of selinux hooks that
> work with this row level security feature? Rather than first doing
> selinux hooks, then row level security, which will likely need new
> and/or changed hooks...
>
> I'm not convinced that row level security is actually that necessary
> (though it's a nice feature, with or without selinux), but if it is,
> it seems we are approaching the problem from the wrong direction.

I don't think there's a correct ordering to SE-PostgreSQL and
row-level security. They're better together, but I don't think either
has to be done first. If we were going to pick one to do first, I'd
pick SE-PostgreSQL. Row-level security is going to be a @$#! of a
project if we want it done right (and we do).

....Robert

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Robert Haas on
2009/12/11 KaiGai Kohei <kaigai(a)ak.jp.nec.com>:
> It tried to provide a set of comprehensive entry points to replace existing
> PG checks at once.
> However, the SE-PgSQL/Lite patch covers accesses on only database, schema,
> tables and columns. Is it necessary to be comprehensive from the beginning?
> It might be too aggressive changes at once.
>
> Frankly, I hesitate to salvage the patch once rejected, as is.
>
> If we implement a set of security hooks, It seems to me the following approach
> is reasonable:
>
> * It does not touch the existing PG default checks.
>  The purpose of security hooks are to host "enhanced" security features.
>
> * It does not deploy hooks on which no security provider is now proposed.
>  It is important to reduce unnecessary changeset.

I think that we should try to move the PG default checks inside the
hook functions. If we can't do that cleanly, it's a good sign that
the hook functions are not correctly placed to enforce arbitrary
security policy. Furthermore, it defeats what I think would be a good
side goal here, which is to better modularize the existing code.

What I would suggest is that you develop a version of that patch that
is stripped down to apply to only a single object type (databases?
tables and columns - these might have to be together??) and which
addresses Tom's criticisms from the last time around, and post that
(on a new thread) for discussion. That will be much easier to review
(and I will personally commit to reviewing it) but should allow us to
flush out some of the design issues. If we can get agreement on that
as a concept patch, we can move on to talking about which object types
should be included in a committable version of that patch.

....Robert

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers