From: Bruce Momjian <bruce@momjian.us>
To: Tim Cross <theophilusx@gmail.com>
Cc: Michel Pelletier <pelletier.michel@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Should I enforce ssl/local socket use?
Date: Mon, 15 Jun 2020 14:51:23 -0400
Message-ID: <20200615185123.GF12122@momjian.us> (raw)
In-Reply-To: <874krn1zrt.fsf@gmail.com>
References: <CACxu=vKAKTiCmP=6bnjqsi2qgVsPJ4f2WE5VYgp8ysyiVkicaw@mail.gmail.com>
<874krn1zrt.fsf@gmail.com>
On Sun, Jun 7, 2020 at 10:32:39AM +1000, Tim Cross wrote:
>
> Michel Pelletier <pelletier.michel@gmail.com> writes:
>
> > Hello,
> >
> > 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? Are there scenarios
> > where one can foresee needing to generate secrets not over ssl or a domain
> > socket?
> >
>
> I'm never very fond of enforcing a particular behaviour as it assumes we
> understand all environments and use cases. Far better to make this the
> default behaviour, but allow users to disable it if they want and
> clearly document that option as insecure. I also suspect that without
> the ability to somehow disable the checks, people will find elaborate
> ways to work around them which are almost certainly going to be even
> worse from a security perspective.
You also have to allow a way to disable it that is secure or it is
useless, which makes it even more complex.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
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: bruce@momjian.us, theophilusx@gmail.com, pelletier.michel@gmail.com
Subject: Re: Should I enforce ssl/local socket use?
In-Reply-To: <20200615185123.GF12122@momjian.us>
References: <CACxu=vKAKTiCmP=6bnjqsi2qgVsPJ4f2WE5VYgp8ysyiVkicaw@mail.gmail.com> <874krn1zrt.fsf@gmail.com> <20200615185123.GF12122@momjian.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