pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mladen Gogala <gogala.mladen@gmail.com>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?
Date: Wed, 14 Sep 2022 23:40:08 -0400
Message-ID: <3100447.1663213208@sss.pgh.pa.us> (raw)
In-Reply-To: <2bc1d63b-5376-bd25-4592-d86b77e4a4b8@gmail.com>
References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com>
	<2bc1d63b-5376-bd25-4592-d86b77e4a4b8@gmail.com>

Mladen Gogala <gogala.mladen@gmail.com> writes:
> ... This doesn't look like a big problem because 
> applications usually don't contain code for killing other user's 
> sessions. I am not sure that GTA is running on top of Postgres database.

Yeah, I meant to comment on that further but forgot.  I don't
particularly buy the premise that it's useful to prohibit a session
belonging to user X from killing another session belonging to user X.
In the end, the main point of a database is to store your data.
Therefore, if you don't trust another session that is running as
your userID, you have already lost.  That session can drop your
tables, or corrupt the data in those tables to an arbitrary extent,
and the SQL permissions system will not squawk even feebly.  Under
any reasonable understanding of the goals of a DB, those consequences
are far worse than killing a session.  So if you're not happy with
this hazard, you should not be accepting the idea that actors you
don't trust are allowed to submit queries under the same userID
as you.  And if you're using a client-side software stack that
forces that situation on you, it's time to look for another one.

Or in other words, I flatly reject the claim that this:

>>> It's common to design a three tier app so that the middle tier always authorizes as just a single role—say, "client"—and where the operations that "client" can perform are limited as the overall design specifies.

is in any way sane or secure.  There is not very much that the
database server can do to clean up after insecure client-side stacks.

			regards, tom lane





view thread (32+ messages)  latest in thread

Message-ID: <3100447.1663213208@sss.pgh.pa.us>
Permalink:  ../3100447.1663213208@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3100447.1663213208@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, gogala.mladen@gmail.com, bryn@yugabyte.com
  Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?
  In-Reply-To: <3100447.1663213208@sss.pgh.pa.us>
  References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> <2bc1d63b-5376-bd25-4592-d86b77e4a4b8@gmail.com> <3100447.1663213208@sss.pgh.pa.us>

* 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