pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: allow building trusted languages without the untrusted versions
Date: Wed, 25 May 2022 13:49:40 -0400
Message-ID: <20220525174940.GQ9030@tamriel.snowman.net> (raw)
In-Reply-To: <20220524205841.GA1254661@nathanxps13>
References: <20220523165403.GC938919@nathanxps13>
	<1290329.1653326228@sss.pgh.pa.us>
	<CA+TgmoY-Xy_ObfYVUTSamD8BmW8npaktbr65JtnkW-c1VQobVA@mail.gmail.com>
	<1333860.1653338790@sss.pgh.pa.us>
	<CA+TgmoYZKLxftaZZvj4_-zHQ27CBeUs+KvggyU3qS79-7aQEPA@mail.gmail.com>
	<1354561.1653345768@sss.pgh.pa.us>
	<CA+TgmoZ_c0j4ut87_QCFm697Qq5Z_u66VZt2PYenfZVjUT1qRA@mail.gmail.com>
	<20220524172851.GA1191690@nathanxps13>
	<CA+TgmobOQiDXpYq6TgaCzH3p5c0Fko-wXqCjgd5YsR6RsX31vA@mail.gmail.com>
	<20220524205841.GA1254661@nathanxps13>

Greetings,

* Nathan Bossart (nathandbossart@gmail.com) wrote:
> I guess I'd ask again whether we can do both...  We've got predefined roles
> like pg_execute_server_program that allow access to COPY TO/FROM PROGRAM,
> but I have no way to categorically disable that ѕort of thing if I wanted
> to really lock things down, even for superusers.  I'm not suggesting that
> every predefined role needs a corresponding configure option, but basic
> things like arbitrary disk/network/program access seem like reasonable
> proposals.

Locking things down "even for superuser" is something we've very
explicitly said we're not going to try and do.  Even with v1 functions,
the ability to hack around with pg_proc strikes me as almost certainly
going to provide a way for someone to gain enough control of execution
to be able to 'break out', not to mention obvious other things like
ALTER SYSTEM to change archive_command to run whatever shell commands an
attacker with superuser wants to..

> I have about 50% of a generic --disable-disk-access patch coded up which
> I'll share soon to help inform the discussion.

Do you disable the ability of superusers to use ALTER SYSTEM with this?

I really don't think this is going to be anywhere near as
straight-forward as it might appear to be to prevent a superuser from
being able to break out of PG.  Instead, we should be moving in the
direction of making it so that there doesn't need to be a superuser
that's ever logged into except under serious emergency situations where
the system is built to require multi-person access to do so.

Thanks,

Stephen

Attachments:

  [application/pgp-signature] signature.asc (818B, ../20220525174940.GQ9030@tamriel.snowman.net/2-signature.asc)
  download

view thread (35+ messages)  latest in thread

Message-ID: <20220525174940.GQ9030@tamriel.snowman.net>
Permalink:  ../20220525174940.GQ9030@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20220525174940.GQ9030@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: sfrost@snowman.net, nathandbossart@gmail.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: allow building trusted languages without the untrusted versions
  In-Reply-To: <20220525174940.GQ9030@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