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 1kuv59-0005wo-6R for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Dec 2020 10:21:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kuv58-0003zF-1j for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Dec 2020 10:21:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kuv57-0003z5-R9 for pgsql-hackers@lists.postgresql.org; Thu, 31 Dec 2020 10:21:21 +0000 Received: from sfr-1.cri.mines-paristech.fr ([77.158.180.225] helo=smtp.cri.ensmp.fr) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kuv51-0000SS-DZ for pgsql-hackers@postgresql.org; Thu, 31 Dec 2020 10:21:21 +0000 Received: from pseudo (19.237.219.88.rev.sfr.net [88.219.237.19]) by smtp.cri.ensmp.fr (Postfix) with ESMTPSA id 01C7AC046A; Thu, 31 Dec 2020 11:22:14 +0100 (CET) Date: Thu, 31 Dec 2020 11:21:12 +0100 (CET) From: Fabien COELHO X-X-Sender: fabien@pseudo To: Stephen Frost cc: Bruce Momjian , Alastair Turner , Michael Paquier , PostgreSQL-development , Masahiko Sawada Subject: Re: Proposed patch for key managment In-Reply-To: <20201230234933.GI27507@tamriel.snowman.net> Message-ID: References: <20201216001228.GC14807@momjian.us> <20201216213200.GS16415@tamriel.snowman.net> <20201216224331.GV16415@tamriel.snowman.net> <20201218213624.GG16415@tamriel.snowman.net> <20201227172526.GB17037@momjian.us> <20201230234933.GI27507@tamriel.snowman.net> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2056645051-20826515-1609410074=:3573723" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2056645051-20826515-1609410074=:3573723 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT Hello Stephen, >> The implementations should not have to be in any particular language: Shell, >> Perl, Python, C should be possible. > > I disagree that it makes any sense to pass actual encryption out to a > shell script. 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. >> 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… > > 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). Yep, but that is not what I'm trying to advocate. The "KEK" (if any), would stay in the process, not be given back to the database or command using it. Then the database/tool would interact with the command to get the actual per-file keys when needed. > [...] The API to fetch the KEK doesn't care at all about where it's > stored or how it's derived or anything like that. > 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 > something else and isn't able to really be used. I do not understand. Postgres should provide a working implementation, whether the functions are directly inside pg or though an external process, 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 made in the patch. -- Fabien. --2056645051-20826515-1609410074=:3573723--