Skip site navigation (1) Skip section navigation (2)

Re: [RFC] A tackle to the leaky VIEWs for RLS

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, pgsql-hackers(at)postgresql(dot)org, sfrost(at)snowman(dot)net
Subject: Re: [RFC] A tackle to the leaky VIEWs for RLS
Date: 2010-06-01 16:52:42
Message-ID: AANLkTil1n2qWDD7IZlgBVt2IFL29rWfVkSseL9b9r2Fi@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Jun 1, 2010 at 10:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> CREATE SECURITY VIEW, anyone?

That may be the best approach, but I think it needs more than one line
of exposition.  The approach I proposed was to test whether the user
has privileges to execute the underlying query directly without going
through the view.  If so, we needn't be concerned.  If not, then we
start thinking about which functions/operators we trust.

The only disadvantage to that approach that I see is that it
introduces some extra permission-checking overhead.  If having an
explicit notion of which views are intended to be security views
enables us to reduce or eliminate that overhead, it may be worth
doing.  But I'm not sure that it does.  A blanket rule that says
"don't push untrusted quals into security views" is not going to be
too satisfactory - we probably want to do that only when the view is
queried by an untrusted user - the superuser, or someone else with
adequate permissions, will presumably still want his quals to get
pushed down.

Perhaps there is some value to having a knob that goes the opposite
directions and essentially says "I don't really care whether this view
is leaky from a security perspective".  But presumably we don't want
to deliver that behavior by default and require the user to ask for a
SECURITY VIEW to get something else - if anything, we'd want CREATE
VIEW to create the normal (secure) version and add CREATE LEAKY VIEW
to do the other thing.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-06-01 17:02:41
Subject: Re: [RFC] A tackle to the leaky VIEWs for RLS
Previous:From: Stephen FrostDate: 2010-06-01 16:39:20
Subject: Re: [RFC] A tackle to the leaky VIEWs for RLS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group