pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michel Pelletier <pelletier.michel@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Should I enforce ssl/local socket use?
Date: Sat, 06 Jun 2020 16:52:18 -0400
Message-ID: <1694726.1591476738@sss.pgh.pa.us> (raw)
In-Reply-To: <CACxu=vKAKTiCmP=6bnjqsi2qgVsPJ4f2WE5VYgp8ysyiVkicaw@mail.gmail.com>
References: <CACxu=vKAKTiCmP=6bnjqsi2qgVsPJ4f2WE5VYgp8ysyiVkicaw@mail.gmail.com>

Michel Pelletier <pelletier.michel@gmail.com> writes:
> I'm the author of the pgsodium cryptography library.  I have a question
> about a best practice I'm thinking of enforcing.  Several functions in
> pgsodium generate secrets, I want to check the Proc info to enforce that
> those functions can only be called using a local domain socket or an ssl
> connection.  If the connection isn't secure by that definition, secret
> generating functions will fail.

> If someone really wants to point the gun at their foot, they can connect
> with an unsecured proxy.  My goal would be to make bypassing the check
> annoying.

> Any thoughts?  Is this an insufferably rude attitude?

I would say yes.  How do your functions know that their outputs are going
to be transmitted to the client at all?  Even if the current session
doesn't, what would stop a user from storing the results in a table and
then reading them out over an insecure connection later?  Besides which,
you can't really tell this way how secure or insecure the connection is.
(As a concrete example, the security of a non-SSL connection over
localhost is probably not much worse than over Unix-domain socket.)

> Are there scenarios
> where one can foresee needing to generate secrets not over ssl or a domain
> socket?

Windows users, who lack the Unix-domain option, would probably find it
quite annoying to be forced to use SSL for local connections.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <1694726.1591476738@sss.pgh.pa.us>
Permalink:  ../1694726.1591476738@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1694726.1591476738@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, pelletier.michel@gmail.com
  Subject: Re: Should I enforce ssl/local socket use?
  In-Reply-To: <1694726.1591476738@sss.pgh.pa.us>
  References: <CACxu=vKAKTiCmP=6bnjqsi2qgVsPJ4f2WE5VYgp8ysyiVkicaw@mail.gmail.com> <1694726.1591476738@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