Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kuz8G-0005QH-PG for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Dec 2020 14:40:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kuz8F-0007Fp-Nf for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Dec 2020 14:40:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kuz8F-0007Fi-Ga for pgsql-hackers@lists.postgresql.org; Thu, 31 Dec 2020 14:40:51 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kuz8D-0004od-Fw for pgsql-hackers@postgresql.org; Thu, 31 Dec 2020 14:40:50 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 22F865F799; Thu, 31 Dec 2020 09:40:49 -0500 (EST) Date: Thu, 31 Dec 2020 09:40:49 -0500 From: Stephen Frost To: Fabien COELHO Cc: Bruce Momjian , Alastair Turner , Michael Paquier , PostgreSQL-development , Masahiko Sawada Subject: Re: Proposed patch for key managment Message-ID: <20201231144048.GL27507@tamriel.snowman.net> References: <20201216213200.GS16415@tamriel.snowman.net> <20201216224331.GV16415@tamriel.snowman.net> <20201218213624.GG16415@tamriel.snowman.net> <20201227172526.GB17037@momjian.us> <20201230234933.GI27507@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yY6OajYROBmoEVZC" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --yY6OajYROBmoEVZC Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Fabien COELHO (coelho@cri.ensmp.fr) wrote: > >>The implementations should not have to be in any particular language: S= hell, > >>Perl, Python, C should be possible. > > > >I disagree that it makes any sense to pass actual encryption out to a > >shell script. >=20 > Yes, sure. I'm talking about key management. For actual crypto functions, > ISTM that they should be "replaceable", i.e. if some institution does not > believe in AES then they could switch to something else. The proposed implementation makes it pretty straight-forward to add in other implementations and other crypto algorithms if people wish to do so. > >>After giving it more thought during the day, I think that only one > >>command and a basic protocol is needed. Maybe something as simple as > >> > >> /path/to/command --options arguments=E2=80=A6 > > > >This is what's proposed- a command is run to acquire the KEK (as a hex > >encoded set of bytes, making it possible to use a shell script, which is > >what the patch does too). >=20 > Yep, but that is not what I'm trying to advocate. The "KEK" (if any), wou= ld > stay in the process, not be given back to the database or command using i= t. > Then the database/tool would interact with the command to get the actual > per-file keys when needed. "When needed" is every single write that we do of any file in the entire backend. Reaching out to something external every time we go to use the key really isn't sensible- except, perhaps, in the case where we are doing full crypto off-loading and we don't actually have to deal with the KEK or the DEK at all, but that's all on the cluster encryption side, really, and isn't the focus of this patch and what it's bringing- all of which is needed anyway. > >[...] The API to fetch the KEK doesn't care at all about where it's stor= ed > >or how it's derived or anything like that. >=20 > >There's a relatively small change which could be made to have PG request > >all of the keys that it'll need on startup, if we want to go there as has > >been suggested elsewhere, but even if we do that, PG needs to be able to > >do that itself too, otherwise it's not a complete capability and there > >seems little point in doing something that's just a pass-thru to somethi= ng > >else and isn't able to really be used. >=20 > I do not understand. Postgres should provide a working implementation, > whether the functions are directly inside pg or though an external proces= s, > they need to be there anyway. I'm trying to fix a clean, possibly external > API so that it is possible to have something different from the choices m= ade > in the patch. Right, we need a working implementation that's part of core, that's what this effort is trying to bring. Thanks, Stephen --yY6OajYROBmoEVZC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJf7eLwAAoJEO1sijiDR2RV9H4P/05brEiVus0XRF8d6K54fhZR wZL49wuui2+3Xv92cJCn0j9LRwKvDntYVEEGExhLEZTwEvCg6qqj9qq/Soj+c0O8 HhsazthJIuclmStjRVtCEHyi9etySuRdd2LUlT2EQnGR2ezJgY+ME5Yk7ZT+JuEh wptCsHUF0OsgKcHWcUd0GVG3S/WImEooqbe5QJ2dbGHq3vAdYsDwsP43IF/m4SF6 u6T/QMM7zQSKMgvzg28zBVOsP3MlBSldV28PRB0J60rMLvt24knwXZgZ6+36YYMP 6h2hh/dXXwTqyUEuifza1u/2XKsi8iohbP0cRk4zpjeloAzaF5w8LiajpbpPiaUP Bqk3YvyOK6sHxj+31tK0xpH+9EUraYTIgLYBvdCMm0H6BaB3fni14RHJoV125QtD +KBDfSkZJN3NQyoK2P6PRWSTmjmiIyArfQ/dZGT/6ggBmmzPCAkb26a7eRrwd6Ts 28hdfmiYUd027NhgGemB21JzQ/Sn7xHZiTIgrsck3KGXdvZet5U0jsG0rRoxLR1Y v4eb7zAcXTMiHg5SJkP0duMgCLSK0+IJXNe4eWkHi3tkXS7sxsJ3P7YKmTcrXxJt yZAnZgByBNAGr6lOVdYTO0evBA1kgCDTMUShTbh4HRWsIj/Yct3VgYPwoU5//hDQ DPDx52PX1ediwR+qTRKF =VToy -----END PGP SIGNATURE----- --yY6OajYROBmoEVZC--