From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0@n0.is Subject: Re: Renewing certificates with certbot Date: Wed, 6 Mar 2019 16:26:12 +0000 Message-ID: <20190306162612.2clxbjrh6wipj4wp@uptimegirl> References: <87fts0i0ga.fsf@gnu.org> <2af1bc4240159d48ec7883b8c2fac590@lepiller.eu> <20190306141902.uja6n66hwjosqujt@uptimegirl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:41692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ZNY-0003eG-HR for guix-devel@gnu.org; Wed, 06 Mar 2019 11:26:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1ZNW-0006xC-Cj for guix-devel@gnu.org; Wed, 06 Mar 2019 11:26:47 -0500 Received: from aibo.runbox.com ([91.220.196.211]:49230) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1ZNQ-0006dy-Tc for guix-devel@gnu.org; Wed, 06 Mar 2019 11:26:42 -0500 Content-Disposition: inline In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Julien Lepiller Cc: guix-devel@gnu.org Julien Lepiller transcribed 2.1K bytes: > Le 2019-03-06 15:19, ng0@n0.is a écrit : > > Julien Lepiller transcribed 1.6K bytes: > > > Le 2019-03-06 14:42, Ludovic Courtès a écrit : > > > > Hi, > > > > > > > > Julien Lepiller skribis: > > > > > > > > > I use certificates from let's encrypt for my website and mail servers, > > > > > and found that there was an issue with certificates generated by the > > > > > certbot service in Guix: the generated private keys are world-readable > > > > > (in a directory that cannot be accessed by anyone but root, so it's OK > > > > > I guess). OpenSMTPD is not happy with that though, so I have to chmod > > > > > the files every time. I came up with a variant of the deploy-hook > > > > > that's presented in the manual, and I'd like to update the example > > > > > with it. Here it is: > > > > > > > > > > ;; Find running nginx and reload its configuration (for certificates) > > > > > (define %my-deploy-hook > > > > > (program-file > > > > > "my-deploy-hook" > > > > > #~(let* ((pid (call-with-input-file "/var/run/nginx/pid" read)) > > > > > (cert-dir (getenv "RENEWED_LINEAGE")) > > > > > (privkey (string-append cert-dir "/privkey.pem"))) > > > > > ;; certbot private keys are world-readable by default, and > > > > > smtpd complains > > > > > ;; about that, refusing to start otherwise > > > > > (chmod privkey #o600) > > > > > (kill pid SIGHUP)))) > > > > > > > > > > What do you think? > > > > > > > > It sounds like a serious issue that private keys are world-readable. Is > > > > it a bug on our side or in Certbot? I think we should fix it so that > > > > It's a certbot default, on all all systems. > > Actually, reading https://github.com/certbot/certbot/issues/1473 suggests > it's not the case anymore. I was probably running an older version > of certbot. Thanks for pointing me to this, I wasn't aware of this > > > > > > they are never world-readable, rather than document how to work around > > > > the bug. > > > > > > > > WDYT? > > > > > > > > Thanks, > > > > Ludo’. > > > > > > I don't think this is an issue: the file is world-readable, but the > > > directory > > > it's in is not accessible to anyone but root. OpenSMTPD still > > > complains, > > > but I think there's no security issue. > > > > > > > >