Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciUFn-0003Hq-Ov for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Feb 2017 22:58:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ciUFm-0005PA-ML for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Feb 2017 22:58:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ciUFl-0005OD-Ek for pgsql-bugs@postgresql.org; Mon, 27 Feb 2017 22:58:49 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ciUFi-0004Pu-7F for pgsql-bugs@postgresql.org; Mon, 27 Feb 2017 22:58:47 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1ciUFh-0000hr-7f; Mon, 27 Feb 2017 17:58:45 -0500 Date: Mon, 27 Feb 2017 17:58:45 -0500 From: Bruce Momjian To: postgres@freigeist.org Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14543: libpq fails with group readable ssl keys Message-ID: <20170227225845.GG421@momjian.us> References: <20170213184323.6099.18278@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170213184323.6099.18278@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Mon, Feb 13, 2017 at 06:43:23PM +0000, postgres@freigeist.org wrote: > The following bug has been logged on the website: > > Bug reference: 14543 > Logged by: Johannes Ziemke > Email address: postgres@freigeist.org > PostgreSQL version: 9.5.6 > Operating system: linux > Description: > > Hi, > > looks like libpq checks if a ssl key is group or world readable and aborts > if that's the case: > > # pg_basebackup -R -d > 'postgres://replication@db-rw?sslmode=verify-ca&sslcert=/etc/ssl/private/default.pem&sslkey=/etc/ssl/private/default-key.pem&sslrootcert=/etc/ssl/ca-trusted.pem' > -D /var/lib/postgresql/9.5/main --xlog-method=stream > pg_basebackup: could not connect to server: private key file > "/etc/ssl/private/default-key.pem" has group or world access; permissions > should be u=rw (0600) or less > > # ls -al /etc/ssl/private/default-key.pem > -rw-r----- 1 root ssl-cert 1675 Feb 13 18:04 > /etc/ssl/private/default-key.pem > > > While I agree this is reasonable to do if the key is world readable, it's > perfectly fine to make a SSL key group readable to share it with multiple > users on the same system. > > Ubuntu (and probably most other distributions) even creates a group for > exactly this scenario: > > # ls -l /etc/ssl/private/ > total 4 > -rw-r----- 1 root ssl-cert 1708 Apr 14 2016 ssl-cert-snakeoil.key We changed Postgres 9.6 to allow open group permissions on the _server_'s SSL key if it was owned by root: Allow the server's SSL key file to have group read access if it is owned by root (Christoph Berg) Is this something we should change on the client? I don't see why not, but the 'root' requirement would still remain. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs