Re: exposing pg_controldata and pg_config as functions

From: Josh berkus <josh(at)agliodbs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Joe Conway <mail(at)joeconway(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: exposing pg_controldata and pg_config as functions
Date: 2016-02-17 23:34:15
Message-ID: 56C50377.8030503@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/17/2016 03:02 PM, Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>> On 02/17/2016 02:14 PM, Tom Lane wrote:
>>> I thought we'd agreed on requiring superuser access for this function.
>>> I concur that letting just anyone see the config data is inappropriate.
>
>> It does not let anyone see config data out of the box:
>
>> + CREATE VIEW pg_config AS
>> + SELECT * FROM pg_config();
>> +
>> + REVOKE ALL on pg_config FROM PUBLIC;
>> + REVOKE EXECUTE ON FUNCTION pg_config() FROM PUBLIC;
>
> Ah, that's fine. I'd looked for a superuser() check and not seen one,
> but letting the SQL permissions system handle it seems good enough.

What I like about this is that if I want to expose it to a
non-superuser, I can just do a GRANT instead of needing to write a
security definer view.

--
--
Josh Berkus
Red Hat OSAS
(any opinions are my own)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message xujian 2016-02-17 23:41:43 Re: pglogical - how to use pglogical.conflict_resolution
Previous Message xujian 2016-02-17 23:30:35 pglogical - how to use pglogical.conflict_resolution