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 1kroy8-0005xs-MM for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Dec 2020 21:13:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kroy7-00012K-Cc for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Dec 2020 21:13:19 +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 1kroy6-00012D-NO for pgsql-hackers@lists.postgresql.org; Tue, 22 Dec 2020 21:13:18 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kroy0-0007oJ-3s for pgsql-hackers@postgresql.org; Tue, 22 Dec 2020 21:13:17 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kroxu-0002WX-2w; Tue, 22 Dec 2020 16:13:06 -0500 Date: Tue, 22 Dec 2020 16:13:06 -0500 From: Bruce Momjian To: Alastair Turner Cc: Stephen Frost , Michael Paquier , PostgreSQL-development , Masahiko Sawada Subject: Re: Proposed patch for key managment Message-ID: <20201222211306.GA9170@momjian.us> References: <20201218213624.GG16415@tamriel.snowman.net> <20201219023844.GG28841@momjian.us> <20201219165837.GH28841@momjian.us> <20201220225909.GJ16415@tamriel.snowman.net> <20201221213514.GK28841@momjian.us> <20201222030748.GN28841@momjian.us> <20201222154017.GO28841@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Dec 22, 2020 at 08:15:27PM +0000, Alastair Turner wrote: > Hi Bruce > > In ckey_passphrase.sh.sample > > + > +echo "$PASS" | sha256sum | cut -d' ' -f1 > + > > Under the threat model discussed, a copy of the keyfile could be > attacked offline. So getting from passphrase to DEKs should be as > resource intensive as possible to slow down brute-force attempts. > Instead of just a SHA hash, this should be at least a PBKDF2 (PKCS#5) I am satisfied with the security of SHA256. > On Tue, 22 Dec 2020 at 15:40, Bruce Momjian wrote: > > > > Here is an updated patch. Are people happy with the Makefile, its > > location in the source tree, and the install directory name? I used the > > directory name 'auth_commands' because I thought 'auth' was too easily > > misinterpreted. I put the scripts in /src/backend/utils/auth_commands. > > > > What's implemented in these patches is an internal keystore, wrapped > with a key derived from a passphrase. I'd think that the scripts > directory should reflect what they interact with, so > 'keystore_commands' or 'local_keystore_command' sounds more specific > and therefore better than 'auth_commands'. The point is that some commands are used for keystore and some for SSL certificate passphrase entry, hence "auth". -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee