pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Brad Nicholson <bradn@ca.ibm.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PG13 Trusted Extension usability issue
Date: Mon, 29 Jun 2020 09:49:11 -0400
Message-ID: <20200629134911.GW3125@tamriel.snowman.net> (raw)
In-Reply-To: <30665.1593205561@sss.pgh.pa.us>
References: <OFB5509780.71BADB86-ON85258593.006417C0-85258593.00652490@notes.na.collabserv.com>
	<24570.1593197245@sss.pgh.pa.us>
	<OF33B3FA0B.8B6C3183-ON85258593.00686C7F-85258593.0068B8E1@notes.na.collabserv.com>
	<30665.1593205561@sss.pgh.pa.us>

Greetings,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> "Brad Nicholson" <bradn@ca.ibm.com> writes:
> > Tom Lane <tgl@sss.pgh.pa.us> wrote on 2020/06/26 02:47:25 PM:
> >> I'm confused about your point here.  postgresql_fdw has intentionally
> >> *not* been marked trusted.  That's partly because it doesn't seem like
> >> outside-the-database access is something we want to allow by default,
> >> but it's also the case that there are inside-the-database permissions
> >> issues.
> 
> > Ah - I misread the docs.  Specifically I read this:
> > "For many extensions this means superuser privileges are needed. However,
> > if the extension is marked trusted in its control file, then it can be
> > installed by any user who has CREATE privilege on the current database"
> > To mean that you could mark any extension as trusted in the control file to
> > allow non-superuser installation.
> 
> Well, it's just like anything else in an open-source database: you can
> change the code however you want, but the fallout from that is on you.
> 
> In the case at hand, you might be able to do what you want by adding
> something along the line of
> 
> GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw
>   TO @extowner@ WITH GRANT OPTION;
> 
> to the extension install script.  But nobody's researched whether that's
> reasonable from a security standpoint, or whether it will play nicely
> with dump/reload, etc etc.

Indeed that could be done, and almost certainly will be by cloud
vendors, resulting in more forks of PG done in different ways.

I do agree that, in general, we need a way to allow a superuser to GRANT
the right to connect to other systems (so that it could be done
initially when creating the not-really-superuser-privileged-user, before
the extension is created), since we don't want that to be allowed from
the start, then have that checked by extensions, but once that's done it
seems like it'd be alright to include the above GRANT USAGE in upstream
(regarding this specific concern, at least).

Seems like a default role would probably be the way to add that.

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (6+ messages)

Message-ID: <20200629134911.GW3125@tamriel.snowman.net>
Permalink:  ../20200629134911.GW3125@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20200629134911.GW3125@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, bradn@ca.ibm.com
  Subject: Re: PG13 Trusted Extension usability issue
  In-Reply-To: <20200629134911.GW3125@tamriel.snowman.net>
  References: <OFB5509780.71BADB86-ON85258593.006417C0-85258593.00652490@notes.na.collabserv.com> <24570.1593197245@sss.pgh.pa.us> <OF33B3FA0B.8B6C3183-ON85258593.00686C7F-85258593.0068B8E1@notes.na.collabserv.com> <30665.1593205561@sss.pgh.pa.us> <20200629134911.GW3125@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox