Re: [Ace] EST over CoAP: Randomness

"Panos Kampanakis (pkampana)" <pkampana@cisco.com> Fri, 10 May 2019 20:05 UTC

Return-Path: <pkampana@cisco.com>
X-Original-To: ace@ietfa.amsl.com
Delivered-To: ace@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DDDB712011E for <ace@ietfa.amsl.com>; Fri, 10 May 2019 13:05:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.499
X-Spam-Level:
X-Spam-Status: No, score=-14.499 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=KX7KMeBC; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=erI/XEo/
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 6OPUAdWdhFfY for <ace@ietfa.amsl.com>; Fri, 10 May 2019 13:05:47 -0700 (PDT)
Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AD678120268 for <ace@ietf.org>; Fri, 10 May 2019 13:05:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=20583; q=dns/txt; s=iport; t=1557518746; x=1558728346; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=E4oPWLescDtiXPQGrU0Cj4wvX8uC3dGI35FRT6xmQUo=; b=KX7KMeBC0uSRw1mo0C0WGXy8n5Gj4D72CslRisB4Hs/ymmLPorx+pm81 8gYZ7n8rA88Dq6RsarLxQNoyhWgmGFJ+dPAaWnS5vqZTqEoT+m5n+h8Go zUVi8xCud+ZUIJHD17qtNrtQ5PBnOrok8eYRU3FiNZfjrOu+bBH/i1sau o=;
IronPort-PHdr: =?us-ascii?q?9a23=3AUqEm+xEeuaxS/cTiI6a+qJ1GYnJ96bzpIg4Y7I?= =?us-ascii?q?YmgLtSc6Oluo7vJ1Hb+e4z1Q3SRYuO7fVChqKWqK3mVWEaqbe5+HEZON0pNV?= =?us-ascii?q?cejNkO2QkpAcqLE0r+eebpZikiFcJLfFRk5Hq8d0NSHZW2ag=3D=3D?=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0B1AADI2NVc/5NdJa1bCRoBAQEBAQI?= =?us-ascii?q?BAQEBBwIBAQEBgVQCAQEBAQsBgQ4vJAUnA2lVIAQLKIRjgQ2BaAOOfoJXkli?= =?us-ascii?q?ETYFCgRADVAkBAQEMAQEYAQoKAgEBgwmBNwKCCyM3Bg4BAwEBBAEBAgEEbRw?= =?us-ascii?q?MhUoBAQEDAQEBEBsTAQEsAgoEBwQCAQgRBAEBLycLHQgBAQQBEggTB4MBgR1?= =?us-ascii?q?NAw4PAQ6iAAKBNYhfgiCCeQEBBYUAGIIPAwaBMgGKMIEeF4FAPyZrRoJMPoJ?= =?us-ascii?q?hAQGBJQkBCAoBCRgFBx8LgwSCJosGCIcfiA6MNGUJAoIJihWEJIQ7ghMuhh2?= =?us-ascii?q?NC4wxlQMCBAIEBQIOAQEFgWUiZnFwFTuCbIEXVCSBJAECgkiFFIU/coEpjQ2?= =?us-ascii?q?CQwEB?=
X-IronPort-AV: E=Sophos;i="5.60,454,1549929600"; d="scan'208,217";a="273939932"
Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 10 May 2019 20:05:45 +0000
Received: from xch-rcd-011.cisco.com (xch-rcd-011.cisco.com [173.37.102.21]) by rcdn-core-11.cisco.com (8.15.2/8.15.2) with ESMTPS id x4AK5jFx014180 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 10 May 2019 20:05:45 GMT
Received: from xhs-rcd-002.cisco.com (173.37.227.247) by XCH-RCD-011.cisco.com (173.37.102.21) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 10 May 2019 15:05:44 -0500
Received: from xhs-aln-002.cisco.com (173.37.135.119) by xhs-rcd-002.cisco.com (173.37.227.247) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 10 May 2019 15:05:44 -0500
Received: from NAM03-BY2-obe.outbound.protection.outlook.com (173.37.151.57) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 10 May 2019 15:05:44 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector1-cisco-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FR4uj5Dza3WN5xjhSk56NjF+NhIzoa0aff/Fn8ao0Ak=; b=erI/XEo/ebPYgxAGAPKKG5G/vmNj7yI1NLdEUmPgkCqcfU0VF5x2d10WCn/RrxvXdAdUOHDn5IxgMhz5YjUSfh5wvE7KhRUznv7ziB0o9rD+OuwiK3/kBS4qqB1QkOgl0AL+HiL5Kn+WfoVxPZCliRtBfbDhdl1xd5GlspMY3kY=
Received: from MWHPR11MB1838.namprd11.prod.outlook.com (10.175.53.141) by MWHPR11MB1742.namprd11.prod.outlook.com (10.175.52.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.21; Fri, 10 May 2019 20:05:42 +0000
Received: from MWHPR11MB1838.namprd11.prod.outlook.com ([fe80::4964:5495:9121:8f12]) by MWHPR11MB1838.namprd11.prod.outlook.com ([fe80::4964:5495:9121:8f12%7]) with mapi id 15.20.1878.022; Fri, 10 May 2019 20:05:42 +0000
From: "Panos Kampanakis (pkampana)" <pkampana@cisco.com>
To: Hannes Tschofenig <Hannes.Tschofenig@arm.com>, "ace@ietf.org" <ace@ietf.org>
Thread-Topic: [Ace] EST over CoAP: Randomness
Thread-Index: AdUGcOnxX76zbRm2S2qe/nEWIh3V6AAamrQAAAw3WYAACv9EMA==
Date: Fri, 10 May 2019 20:05:42 +0000
Message-ID: <MWHPR11MB18389FB713EB9DEDDC75BA99C90C0@MWHPR11MB1838.namprd11.prod.outlook.com>
References: <DBBPR08MB45393CDF71E7DB02F6C6938CFA330@DBBPR08MB4539.eurprd08.prod.outlook.com> <MWHPR11MB18386309CD27A19485A6B204C90C0@MWHPR11MB1838.namprd11.prod.outlook.com> <DBBPR08MB4539CB2F66FB6DB66E30776FFA0C0@DBBPR08MB4539.eurprd08.prod.outlook.com>
In-Reply-To: <DBBPR08MB4539CB2F66FB6DB66E30776FFA0C0@DBBPR08MB4539.eurprd08.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=pkampana@cisco.com;
x-originating-ip: [2001:420:c0c4:1002::276]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: b17d22f8-fe1d-4c72-2811-08d6d582e193
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:MWHPR11MB1742;
x-ms-traffictypediagnostic: MWHPR11MB1742:
x-microsoft-antispam-prvs: <MWHPR11MB174202A28351F3C95EA433BBC90C0@MWHPR11MB1742.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0033AAD26D
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(366004)(136003)(376002)(189003)(199004)(40434004)(53754006)(13464003)(55016002)(966005)(305945005)(229853002)(81166006)(7736002)(256004)(5024004)(14444005)(6436002)(8936002)(8676002)(316002)(478600001)(81156014)(14454004)(68736007)(74316002)(9686003)(6306002)(5660300002)(30864003)(110136005)(6116002)(11346002)(476003)(53936002)(446003)(25786009)(46003)(486006)(99286004)(52536014)(102836004)(76176011)(86362001)(7696005)(53546011)(6506007)(2906002)(71190400001)(71200400001)(76116006)(33656002)(6246003)(2501003)(73956011)(66946007)(66446008)(66556008)(66476007)(64756008)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1742; H:MWHPR11MB1838.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: isX6jtDGOhci3pGyRTtT38M3tUeha5c1mAG8DGKFQOHtGxnn8asnj22JIIaEYbfRr0kxF/HrGE7+ZDKCTRMOLAUTP3Ucoc4T7TH+zFj20bVIIxKpyg6IZSOZl+pulzbRKeQtUfKWMWb6lCQfnZLPot/BS/j9+xmCd3gVnt/BW+rE8mJOUvB3y9/sb3oVh3lFEFMYDN41kh3DEtBnebaqIYwy0N/6ge/0EaUKMKn4EIFUURXmA9LVDl1CeXSEnbPSu/iOC63sncr4MPa8xCG0DYBojwA+WdL/NQLifebyyOELkwNrU51a33iOxWr7tMjGIG6EFa87BadBMpleoUVCnBsGCFIB2RCRVq38F8vevrln8K4ZL4AWm5kqjzS9A449Sl2IbRhj24hBHtv1taRdFfI2YzUxiJPY4vbyNhPzS9w=
Content-Type: multipart/alternative; boundary="_000_MWHPR11MB18389FB713EB9DEDDC75BA99C90C0MWHPR11MB1838namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: b17d22f8-fe1d-4c72-2811-08d6d582e193
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2019 20:05:42.4814 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1742
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.37.102.21, xch-rcd-011.cisco.com
X-Outbound-Node: rcdn-core-11.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/ace/ZZi_64-7fnC76rHx8vkIeUxopUA>
Subject: Re: [Ace] EST over CoAP: Randomness
X-BeenThere: ace@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Authentication and Authorization for Constrained Environments \(ace\)" <ace.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ace>, <mailto:ace-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ace/>
List-Post: <mailto:ace@ietf.org>
List-Help: <mailto:ace-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ace>, <mailto:ace-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 May 2019 20:05:51 -0000

Hi Hannes,

> Hence, I believe it would be better to first shorten the following paragraph to a single line:

Note that this paragraph was added from feedback in the review process just to motivate server-side keygen. Given that your proposed text below practically moves the points made in this paragraph in the Sec considerations section, I am all for shortening the paragraph. I was thinking something close to what you wrote, but just to keep a couple of phrases as motivation about the feature without creating an inaccurate sense of security:
~~~~~~~~~~
5.8.  Server-side Key Generation

  In scenarios where it is desirable that the server obtains access to the private key the server-side
  key generation should be used. Such scenarios could be when it is considered more secure to
  generate at the server a long-lived random private key that identifies the client or when the
  resources spent to generate a random private key at the client are considered scarce.
~~~~~~~~~~

> In the security consideration section I would add a new section somewhere that talks about the random number generation.

I like your text. I will add it  with minor changes in orange.
~~~~~~~~~~
   Modern security protocols require random numbers to be available during
   the protocol run, for example for nonces, ephemeral EC Diffie-Hellman key
   generation. This capability to generate random numbers is also needed
   when the constrained device generates the private key (that corresponds
   to the public key enrolled in the CSR). When server-side key generation is
   used, the constrained device depends on the server to generate the
   private key randomly, but it still needs locally generated random numbers
   for use in security protocols, such as DTLS.

   It is important to note that sources contributing to the randomness
   pool used to generate random numbers on laptops or desktop PCs
   are not available on many constrained devices, such as mouse
   movement, timing of keystrokes, air turbulence on the
   movement of hard drive heads, as pointed out in [PsQs].  Other
   sources have to be used or dedicated hardware has to be added.
   Selecting hardware for an IoT device that is capable of producing
   high-quality random numbers is therefore important.
~~~~~~~~~~

I hope it makes sense.

Panos


-----Original Message-----
From: Hannes Tschofenig <Hannes.Tschofenig@arm.com>;
Sent: Friday, May 10, 2019 4:58 AM
To: Panos Kampanakis (pkampana) <pkampana@cisco.com>;; ace@ietf.org
Subject: RE: [Ace] EST over CoAP: Randomness

Hi Panos,

I had argued earlier that this feature shouldn't be in the draft but it seems that I will not get there.

Hence, I believe it would be better to first shorten the following paragraph to a single line:

FROM:

"
5.8.  Server-side Key Generation

   Constrained devices sometimes do not have the necessary hardware to
   generate statistically random numbers for private keys and DTLS
   ephemeral keys.  Past experience has also shown that low-resource
   endpoints sometimes generate numbers which could allow someone to
   decrypt the communication or guess the private key and impersonate as
   the device [PsQs] [RSAorig].  Additionally, random number key
   generation is costly, thus energy draining. Even though the random
   numbers that constitute the identity/cert do not get generated often,
   an endpoint may not want to spend time and energy generating
   keypairs, and just ask for one from the server.

   In these scenarios, server-side key generation can be used.
   ....
"

TO:

"
5.8.  Server-side Key Generation

  In scenarios where it is desirable that the server obtains access to the private key the server-side
  key generation should be used.
  ....
"

In the security consideration section I would add a new section somewhere that talks about the random number generation.

"
Random Number Generation

   Modern security protocol require random numbers to be available during
   the protocol run, for example for nonces, ephemeral Diffie-Hellman key
   generation. When the private key is generated by the IoT device then
   the capability to generate random numbers is also needed. When server-
   side key generation is used then the IoT device still needs random numbers
   for use in security protocols, such as DTLS.

   It is important to note that sources contributing to the randomness
   pool on laptops or desktop PCs are not available on many IoT devices,
   such as mouse movement, timing of keystrokes, air turbulence on the
   movement of hard drive heads, as pointed out in [PsQs].  Other
   sources have to be found or dedicated hardware has to be added.
   Selecting hardware for an IoT device that is capable of producing
   high-quality random numbers is therefore important.
"

Does this make sense?

Ciao
Hannes

PS: Note that I omitted the reference to RSA because ECC is so much more popular in the IoT space that there is no point in dealing with RSA these days.




-----Original Message-----
From: Panos Kampanakis (pkampana) <pkampana@cisco.com>;
Sent: Freitag, 10. Mai 2019 04:53
To: Hannes Tschofenig <Hannes.Tschofenig@arm.com>;; ace@ietf.org
Subject: RE: [Ace] EST over CoAP: Randomness

Thanks Hannes.
Before I try to address it, can you help me understand what you are proposing. To amend this paragraph maybe?

-----Original Message-----
From: Ace <ace-bounces@ietf.org>; On Behalf Of Hannes Tschofenig
Sent: Thursday, May 09, 2019 10:43 AM
To: ace@ietf.org
Subject: [Ace] EST over CoAP: Randomness

Hi all,

I am still a bit unhappy about this paragraph:

"
   Constrained devices sometimes do not have the necessary hardware to
   generate statistically random numbers for private keys and DTLS
   ephemeral keys.  Past experience has also shown that low-resource
   endpoints sometimes generate numbers which could allow someone to
   decrypt the communication or guess the private key and impersonate as
   the device [PsQs] [RSAorig].  Additionally, random number key
   generation is costly, thus energy draining.
"

If you get hardware that does not have a hardware-based RNG then you are in trouble. The main security protocols we look into do not work without a source of randomness. Hence, getting the certificate & private key from the server will not get you too far.

I believe we should encourage developers to pick the correct hardware for the task rather than making them believe we have come up with solutions that allow them to get away without a hardware-based RNG.

I also do not believe the statement that random number key generation is costly. Can you give me some number?

The references to [PsQs] [RSAorig] are IMHO also not appropriate because they are conveying a different message (at least that's my understanding from reading them). The message is that you have to be careful with designing and using a random number generator on embedded systems because the sources of entropy may just not be there (like keyboards, harddisk drive, processing scheduling, etc.).

Ciao
Hannes

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

_______________________________________________
Ace mailing list
Ace@ietf.org
https://www.ietf.org/mailman/listinfo/ace
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.