Re: Postgres 12 RLS - Mailing list pgsql-general

From Laura Smith
Subject Re: Postgres 12 RLS
Date
Msg-id WllKePxJqsF7cRQpEMx5mazwFaxyHIXuJOro5q_Mtj0JqOHEpXib0BgLN9xrP9tGxS4PXvfFBbhSEkoFLovWsM4LveExPgYQ3Jf7KQggkNA=@protonmail.ch
Whole thread Raw
In response to Re: Postgres 12 RLS  (Paul Förster <paul.foerster@gmail.com>)
Responses Re: Postgres 12 RLS  (Paul Förster <paul.foerster@gmail.com>)
List pgsql-general
On Monday, 8 June 2020 11:25, Paul Förster <paul.foerster@gmail.com> wrote:

> Hi Laura,
>
> > On 08. Jun, 2020, at 12:17, Laura Smith n5d9xq3ti233xiyif2vp@protonmail.ch $$ LANGUAGE plpgsql SECURITY DEFINER;
>
> you might want to use security invoker instead of definer.
>
> https://www.postgresql.org/docs/current/sql-createfunction.html#SQL-CREATEFUNCTION-SECURITY
>
> https://www.cybertec-postgresql.com/en/abusing-security-definer-functions/
>
> Cheers,
> Paul


Hi Paul,

I had a lightbulb moment just now and tried that, but it doesn't seem to be working.

The app returns "pg_execute(): Query failed: ERROR:  permission denied for table...."

This is despite me:
• Changing to SECURITY INVOKER on the PG function.
• Granting the app user relevant perms on the underlying table
• Re-granting execute for the app on the function

Am I missing somehthing ?





pgsql-general by date:

Previous
From: Ravi Krishna
Date:
Subject: Re: Concurrenctly running CREATE TEMP TABLE IF NOT EXISTS [...] AS[...]
Next
From: Alastair McKinley
Date:
Subject: ts_debug() style functions for jsonpath debugging