Re: [saag] AD review of draft-iab-crypto-alg-agility-06

Viktor Dukhovni <ietf-dane@dukhovni.org> Tue, 25 August 2015 15:16 UTC

Return-Path: <ietf-dane@dukhovni.org>
X-Original-To: saag@ietfa.amsl.com
Delivered-To: saag@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E81AE1B3536 for <saag@ietfa.amsl.com>; Tue, 25 Aug 2015 08:16:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, J_CHICKENPOX_35=0.6, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v-68I7M2J64k for <saag@ietfa.amsl.com>; Tue, 25 Aug 2015 08:16:34 -0700 (PDT)
Received: from mournblade.imrryr.org (mournblade.imrryr.org [38.117.134.19]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CDC331B350C for <saag@ietf.org>; Tue, 25 Aug 2015 08:16:33 -0700 (PDT)
Received: by mournblade.imrryr.org (Postfix, from userid 1034) id EAB5D284B69; Tue, 25 Aug 2015 15:16:32 +0000 (UTC)
Date: Tue, 25 Aug 2015 15:16:32 +0000
From: Viktor Dukhovni <ietf-dane@dukhovni.org>
To: saag@ietf.org
Message-ID: <20150825151632.GF9021@mournblade.imrryr.org>
References: <20150728013020.GO4347@mournblade.imrryr.org> <DM2PR0301MB0655CF099FA7C56E9B9D24A9A88D0@DM2PR0301MB0655.namprd03.prod.outlook.com> <20150728053035.GR4347@mournblade.imrryr.org> <CAHbuEH7B3_G9vAhw=U2tuz-Uh8mKMUfL6s=H+BOG96FDZaACig@mail.gmail.com> <20150824212907.GN9021@mournblade.imrryr.org> <619ffebb05ba4e2a9af03a6dcc768d6e@ustx2ex-dag1mb2.msg.corp.akamai.com> <20150824215037.GO9021@mournblade.imrryr.org> <9A043F3CF02CD34C8E74AC1594475C73F4AE62A1@uxcn10-5.UoA.auckland.ac.nz> <20150825134333.GX9021@mournblade.imrryr.org> <9A043F3CF02CD34C8E74AC1594475C73F4AE6693@uxcn10-5.UoA.auckland.ac.nz>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <9A043F3CF02CD34C8E74AC1594475C73F4AE6693@uxcn10-5.UoA.auckland.ac.nz>
User-Agent: Mutt/1.5.23 (2014-03-12)
Archived-At: <http://mailarchive.ietf.org/arch/msg/saag/VO5xTwurTReYKXjtFv9Bz6M8IWs>
Subject: Re: [saag] AD review of draft-iab-crypto-alg-agility-06
X-BeenThere: saag@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: saag@ietf.org
List-Id: Security Area Advisory Group <saag.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/saag>, <mailto:saag-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/saag/>
List-Post: <mailto:saag@ietf.org>
List-Help: <mailto:saag-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/saag>, <mailto:saag-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 25 Aug 2015 15:16:40 -0000

On Tue, Aug 25, 2015 at 02:56:52PM +0000, Peter Gutmann wrote:

> Compare this to a cut&paste of:
> 
> openssl req -x509 -newkey rsa:2048 -nodes -keyout /etc/ssl/private/key.pem -out /etc/ssl/certs/cert.pem -days 3650 -subj '/CN=mail.example.com' 
> 

For Postfix,

    http://www.postfix.org/TLS_README.html#quick-start

it takes a one more 'postconf' command to actually turn on TLS
after the key and cert are generated:

    # dir="$(postconf -h config_directory)"
    # fqdn=$(postconf -h myhostname)
    # case $fqdn in /*) fqdn=$(cat "$fqdn");; esac
    # ymd=$(date +%Y-%m-%d)
    # key="${dir}/key-${ymd}.pem"; rm -f "${key}"
    # cert="${dir}/cert-${ymd}.pem"; rm -f "${cert}"
    # (umask 077; openssl genrsa -out "${key}" 2048) &&
      openssl req -new -key "${key}" \
	-x509 -subj "/CN=${fqdn}" -days 3650 -out "${cert}" &&
      postconf -e \
	"smtpd_tls_cert_file = ${cert}" \
	"smtpd_tls_key_file = ${key}" \
	'smtpd_tls_security_level = may' \
	'smtpd_tls_received_header = yes' \
	'smtpd_tls_loglevel = 1' \
	'smtp_tls_security_level = may' \
	'smtp_tls_loglevel = 1' \
	'smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache' \
	'tls_random_source = dev:/dev/urandom'

And the key/cert generation is done with a bit more finesse to set
a sensible umask, avoid clobbering previous key/cert files that
might be in live use, deal with Debian's "myhostname" in a file, etc.

> (I've long been an advocate of software auto-generating a key on install and
> allowing the user to override it if they want further customisation.

I concur, but am a bit worried about low entropy at system build
time.

-- 
	Viktor.