pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Alastair Turner <minion@decodable.me>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Subject: Re: Proposed patch for key managment
Date: Sun, 20 Dec 2020 21:38:55 -0500
Message-ID: <20201221023855.GC27507@tamriel.snowman.net> (raw)
In-Reply-To: <CAC0Gmyzk-vcmiqn6Nxbu=A1kEifAgpftRSLdCA-jZ2AHQcQZcw@mail.gmail.com>
References: <CAC0GmyyVHstcMefpbCqXC25_Xg4V=Dy-q1ps1a06j9xUOL0SzQ@mail.gmail.com>
	<20201218213624.GG16415@tamriel.snowman.net>
	<20201219023844.GG28841@momjian.us>
	<CAC0GmywbXOWqnU7poYapfnSSd8JuZ0=-fGiumdwA-TumJNuEYg@mail.gmail.com>
	<20201219165837.GH28841@momjian.us>
	<CAC0GmyymnoQEUTzqi9wCCJdg96SbLja4Tc29Wc+xtRpu9Pv76w@mail.gmail.com>
	<20201220225909.GJ16415@tamriel.snowman.net>
	<CAC0GmyzT_90f6oHg8rBn-Eb8-Q=wHLsKripmadU2B4SkTKBbAg@mail.gmail.com>
	<20201221003321.GO16415@tamriel.snowman.net>
	<CAC0Gmyzk-vcmiqn6Nxbu=A1kEifAgpftRSLdCA-jZ2AHQcQZcw@mail.gmail.com>

Greetings,

* Alastair Turner (minion@decodable.me) wrote:
> On Mon, 21 Dec 2020 at 00:33, Stephen Frost <sfrost@snowman.net> wrote:
> > * Alastair Turner (minion@decodable.me) wrote:
> > > What I'd like specifically is to have the option of an external
> > > keyring as a first class key store, where the keys stored in the
> > > external keyring are used directly to encrypt the database contents.
> >
> > Right- understood, but that's not what the patch does today and there
> > isn't anyone who has proposed such a patch, nor explained why we
> > couldn't add that capability later.
> 
> I'm keen to propose a patch along those lines, even if just as a
> sample. Minimising the amount of code which would have to be unpicked
> in that effort would be great. Particularly avoiding any changes to
> data structures, since that may effectively block adding new
> capabilities.

Ok, sure, but are there such changes that would need to be made for this
case...?  Seems to only be speculation at this point.

> > > Regarding the on-disk format, separate storage of the key HMACs and
> > > the wrapped keys sounds like a requirement for implementing a fully
> > > external keyring or doing key wrapping externally via an OpenSSL or
> > > nss tls pluggable engine. I'm still looking through the code.
> >
> > This seems a bit confusing as the question at hand is the on-disk format
> > of the internal keyring, not anything to do with an external keyring
> > (which we wouldn't have any storage of and so I don't understand how it
> > makes sense to even discuss the idea of storage for the external
> > keyring..?).
> 
> A requirement for validating the keys, no matter which keyring they
> came from, was mentioned along the way. Since there would be no point
> in validating keys from the internal ring twice, storing the
> validation data (HMACs in the current design) separately from the
> internal keyring's keys seems like it would avoid changing the data
> structures for the internal keyring when adding an external option.

This doesn't strike me as very clear- specifically which HMACs are you
referring to which would need to be stored separately from the internal
keyring to make it possible for an external keyring to be used?

> > Again, we will need the ability to perform the encryption using a simple
> > passphrase provided by the user, while using multiple randomly generated
> > data encryption keys, and that's what the latest set of patches are
> > geared towards.  I'm generally in support of adding additional
> > capabilities in this area in the future, but I don't think we need to
> > bog down the current effort by demanding that be implemented today.
> 
> I'm really not looking to bog down the current effort.

Great, glad to hear that.

> I'll have a go at adding another keyring and/or abstracting the key
> wrap and see how well a true peer to the passphrase approach fits in.

Having patches to review and consider definitely helps, imv.

Thanks,

Stephen

Attachments:

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

view thread (93+ messages)  latest in thread

Message-ID: <20201221023855.GC27507@tamriel.snowman.net>
Permalink:  ../20201221023855.GC27507@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20201221023855.GC27507@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, minion@decodable.me, bruce@momjian.us, michael@paquier.xyz, masahiko.sawada@2ndquadrant.com
  Subject: Re: Proposed patch for key managment
  In-Reply-To: <20201221023855.GC27507@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