Re: A little RLS oversight?

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: A little RLS oversight?
Дата
Msg-id CAEZATCVp5g92nLHKVCx_rzea_f9QMyXfQT0icW58m8cL2veMEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: A little RLS oversight?  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: A little RLS oversight?  (Robert Haas <robertmhaas@gmail.com>)
Re: A little RLS oversight?  (Joe Conway <joe.conway@crunchydata.com>)
Список pgsql-hackers
On 21 July 2015 at 04:53, Michael Paquier <michael.paquier@gmail.com> wrote:
> On Tue, Jul 14, 2015 at 4:01 AM, Stephen Frost <sfrost@snowman.net> wrote:
>> We need to be careful to avoid the slippery slope of trying to prevent
>> all covert channels, which has been extensively discussed previously.

I think this is more serious than the covert channel leaks discussed
before, since most_common_vals explicitly reveals values from the
table, making it an overt leak, albeit of a small portion of the
table's values.

> Looking at that I am not seeing any straight-forward way to resolve
> this issue except by hardening pg_stats by having an additional filter
> of this type so as a non-owner of a relation cannot see the stats of
> this table directly when RLS is enabled:
> c.relrowsecurity = false OR c.relowner = current_user::regrole::oid
> Attached is a patch doing that (/me now hides, expecting to receive
> laser shots because of the use of current_user on a system view).
> Thoughts?

Hmm, I think it probably ought to do more, based on whether or not RLS
is being bypassed or in force-mode -- see the first few checks in
get_row_security_policies(). Perhaps a new SQL-callable function
exposing those checks and calling check_enable_rls(). It's probably
still worth including the "c.relrowsecurity = false" check in SQL to
save calling the function for the majority of tables that don't have
RLS.

There's another issue here though -- just adding filters to the
pg_stats view won't prevent a determined user from seeing the contents
of the underlying table. For that, the view needs to have the
security_barrier property. Arguably the fact that pg_stats isn't a
security barrier view is a long-standing information leak allowing
users to see values from tables for which they don't have any
permissions. Is anyone concerned about that?

Regards,
Dean



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: psql :: support for \ev viewname and \sv viewname
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: could not truncate directory "pg_subtrans": apparent wraparound