Re: API change advice: Passing plan invalidation info from the rewriter into the planner? - Mailing list pgsql-hackers
From | Dean Rasheed |
---|---|
Subject | Re: API change advice: Passing plan invalidation info from the rewriter into the planner? |
Date | |
Msg-id | CAEZATCXT0h=4G_WTEtoy_g6PPxgckZsQLMOgt4vSTifRHMdCQg@mail.gmail.com Whole thread Raw |
In response to | Re: API change advice: Passing plan invalidation info from the rewriter into the planner? (Stephen Frost <sfrost@snowman.net>) |
Responses |
Re: API change advice: Passing plan invalidation info from
the rewriter into the planner?
Re: API change advice: Passing plan invalidation info from the rewriter into the planner? |
List | pgsql-hackers |
On 13 June 2014 01:13, Stephen Frost <sfrost@snowman.net> wrote: > Greg, all, > > I will reply to the emails in detail when I get a chance but am out of town > at a funeral, so it'll likely be delayed. I did want to echo my agreement > for the most part with Greg and in particular... > > On Thursday, June 12, 2014, Gregory Smith <gregsmithpgsql@gmail.com> wrote: >> >> On 6/11/14, 10:26 AM, Robert Haas wrote: >>> >>> Now, as soon as we introduce the concept that selecting from a table >>> might not really mean "read from the table" but "read from the table after >>> applying this owner-specified qual", we're opening up a whole new set of >>> attack surfaces. Every pg_dump is an opportunity to hack somebody else's >>> account, or at least audit their activity. >> >> >> I'm in full agreement we should clearly communicate the issues around >> pg_dump in particular, because they can't necessarily be eliminated >> altogether without some major work that's going to take a while to finish. >> And if the work-around is some sort of GUC for killing RLS altogether, >> that's ugly but not unacceptable to me as a short-term fix. > > > A GUC which is enable / disable / error-instead may work quiet well, with > error-instead for pg_dump default if people really want it (there would have > to be a way to disable that though, imv). > > Note that enable is default in general, disable would be for superuser only > (or on start-up) to disable everything, and error-instead anyone could use > but it would error instead of implementing RLS when querying an RLS-enabled > table. > > This approach was suggested by an existing user testing out this RLS > approach, to be fair, but it looks pretty sane to me as a way to address > some of these concerns. Certainly open to other ideas and thoughts though. > Yeah, I was thinking something like this could work, but I would go further. Suppose you had separate GRANTable privileges for direct access to individual tables, bypassing RLS, e.g. GRANT DIRECT SELECT|INSERT|UPDATE|DELETE ON table_name TO role_name Combined with the GUC (direct_table_access, say) to request direct access to all tables. Then with direct_table_access = true/required, a SELECT from a table would error if the user hadn't been granted the DIRECT SELECT privilege on all the tables referenced in the query. Tools like pg_dump would require direct_table_access, but there might be other levels of access that didn't error out. I think if I were using RLS, I would definitely want/expect this level of fine-grained control over permissions on a per-table basis, rather than the superuser/non-superuser level of control, or having RLS-exempt users. Actually, given the fact that the majority of users won't be using RLS, I would be tempted to invert the above logic and have the new privilege be for LIMITED access (via RLS quals). So a user granted the normal SELECT privilege would be able to bypass RLS, but a user only granted LIMITED SELECT wouldn't. Regards, Dean
pgsql-hackers by date: