Re: [netconf] ietf-crypto-types: read-only nodes to provide fingerprints of public keys and certificates

"maurice.angermann@siemens.com" <maurice.angermann@siemens.com> Wed, 25 March 2020 13:38 UTC

Return-Path: <maurice.angermann@siemens.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BF2423A0474 for <netconf@ietfa.amsl.com>; Wed, 25 Mar 2020 06:38:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=siemens.onmicrosoft.com
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 f-AMbT59ZXG0 for <netconf@ietfa.amsl.com>; Wed, 25 Mar 2020 06:38:06 -0700 (PDT)
Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2075.outbound.protection.outlook.com [40.107.21.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E28473A017E for <netconf@ietf.org>; Wed, 25 Mar 2020 06:38:05 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kj6xTo17YFZL8n7WmaQ3O3xlK00cVxUmHwsNXi1KiMuIxPRTSZio9U5MlbfKdzt2ny0XRdzAKNkthCebRwCnBnn8PrwrsnOETkq4zsBq1q10sZ5sjLXSmnFgcn2m22i1sw8SABc6oR9dtxmZaAL8faLAurGQj8aEYxAtBCzqY3UuIteePoO2VSotCpK/DWrsn+9FwpFsUtLQELJZk0+d8VAFE8N/3eQOsSjFLcjk0PJpx/gA37v78JOiSt6tnTFtNiwvWZaGLcjOK0ZpkK+wdytJZstphP238fb4QOFnT5XRgl5hGzaS3eBLFZsACYeQ46OPVkfLqhq9xQKzk/nSDA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2NvTvuxY+VOf6sPdead3soYk3eQgSrJBiqhlmKWLxR0=; b=MoTv4PXiVmg4N8EAikR+3wGe9B6e2BET6391fH5sxWVVYn2btPm4rZP3scy6iql51ORV/8MR/KMtgMvGuKJe72cje9tCp66UYHrgm0+lhflOxjVzg3zB2oWTVqMtNPnivvmv+8IKDpQQ7BhONKi5uQhyo92gi1CQqFd21uYE46EyTvT6GPg2F82zQ2XBedCn4s/qWC+RYdNuG5S4U3oycwzXeENBtpXrL4fYPmPApuI3qn1ESgKOxFV0GDaWTEJDLoyQWloTe51/qcgsY/F/iX8ft5HMPEyu43zwEJdXJN0CCkzThJKYlnXjr+TP0mAkez7DN9tuB7zZTz5E32T3lQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.onmicrosoft.com; s=selector1-siemens-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2NvTvuxY+VOf6sPdead3soYk3eQgSrJBiqhlmKWLxR0=; b=mbaMaYH/Hgl/e3UHxt6iz5pCKHnG3B5EBnSFMksuTGXUEmDnz8fwhEkY9NSQEM86bY9OvNy+KrSZSVQZlYUzpP6mosQMXkdwigiGIs7iPkOpvyYxDDaUu1UJLNvjRsfem/ylTOLQW3FNReSrx9BzEgppVxOpbHszt3kfwiJEKcY=
Received: from AM0PR10MB3378.EURPRD10.PROD.OUTLOOK.COM (10.255.30.161) by AM0PR10MB2020.EURPRD10.PROD.OUTLOOK.COM (52.134.81.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20; Wed, 25 Mar 2020 13:38:03 +0000
Received: from AM0PR10MB3378.EURPRD10.PROD.OUTLOOK.COM ([fe80::783c:4827:7672:bdfd]) by AM0PR10MB3378.EURPRD10.PROD.OUTLOOK.COM ([fe80::783c:4827:7672:bdfd%4]) with mapi id 15.20.2835.023; Wed, 25 Mar 2020 13:38:03 +0000
From: "maurice.angermann@siemens.com" <maurice.angermann@siemens.com>
To: "kent@watsen.net" <kent@watsen.net>
CC: "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [netconf] ietf-crypto-types: read-only nodes to provide fingerprints of public keys and certificates
Thread-Index: AdX7jUN25LCA5qrYQ8icRH3S/nGkRgBGPY4AAXZkXAA=
Date: Wed, 25 Mar 2020 13:38:03 +0000
Message-ID: <AM0PR10MB3378E303B53D5AFEBB437F3BE6CE0@AM0PR10MB3378.EURPRD10.PROD.OUTLOOK.COM>
References: <AM0PR10MB3378F579924AE0D6A3EA79DDE6F90@AM0PR10MB3378.EURPRD10.PROD.OUTLOOK.COM> <01000170ea7b00ef-98396396-d6a5-40c0-bb44-58cf84422e10-000000@email.amazonses.com>
In-Reply-To: <01000170ea7b00ef-98396396-d6a5-40c0-bb44-58cf84422e10-000000@email.amazonses.com>
Accept-Language: de-DE, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-document-confidentiality: NotClassified
authentication-results: spf=none (sender IP is ) smtp.mailfrom=maurice.angermann@siemens.com;
x-originating-ip: [109.250.130.94]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 094926ea-bba0-4e95-dc03-08d7d0c1be24
x-ms-traffictypediagnostic: AM0PR10MB2020:
x-microsoft-antispam-prvs: <AM0PR10MB20207FB4272E723925B2CB19E6CE0@AM0PR10MB2020.EURPRD10.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0353563E2B
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(366004)(376002)(136003)(39860400002)(52536014)(478600001)(186003)(26005)(8936002)(81156014)(8676002)(4326008)(33656002)(5660300002)(2906002)(6916009)(81166006)(53546011)(7696005)(86362001)(71200400001)(6506007)(66446008)(64756008)(66556008)(66476007)(316002)(15974865002)(76116006)(66574012)(966005)(9686003)(55016002)(66946007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR10MB2020; H:AM0PR10MB3378.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords;
received-spf: None (protection.outlook.com: siemens.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: WfMjFuapJK7VKmDYPypIJpPqo2VFG9E1+/y3iBeKREejeNXuxPXF6d6vHNM0px9uwPA2WEeYugQt0lrPbckoa+uipT1OLRl7QFMu60hTdyehKg68kn1bvxLFfKHfS2/wzl0hi6+Tkd/ctJB9+O8xYypfGaptOMROTChnC69wrsG5SLq7rU7ZQgRgM2ktVVPBXdIEQztkcmR26OUfae6pl0BFsADniE5o4FDE8kCz35zHI3drOAqiPxkOUBvm0vPpSQYcVgY+dGEXGUnRIt4pVZ0ueel2os1GF0/ZagwhP13L2gGWm0G9Y1HXrI2jwycWuVn6hQs5jOuWE2xSI6uiq9bL5L9dqvkPJJC1CwOZfEZQAu5Tl6MlRUcAR1fXoBKee5kWBLw41e1LSuIC3kjhtTKaH0rGCzv02PVkfNCiqsuSvP55nbewlXAbBs7QMLv9rHZsPMZPd+2IN4PvLyV0tWsl0f4hGVB/EyNwh0IAA5B23gwo5WCSxLEvOFB1/aXxMd6XRfSVp1iMxbdC5Dltsw==
x-ms-exchange-antispam-messagedata: WBJJ9wNeeAFT0pnqPRfrRl5IugHxJBlbk/SQ7dLqsUsPspifzxFDkfiP5qwU9fJwXEjRLMH4mCnXxknvNH6EiQeKDOdjEC+S2XqQmYToRhCablZDcZqsob4GeuQXKESGCtJrmHox51qdWG0550M//w==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: siemens.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 094926ea-bba0-4e95-dc03-08d7d0c1be24
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2020 13:38:03.2447 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: tDrA5HE9RngGnEpYPd11cD5JJQOx0NEE0TYg63ioc7kRSfAQc3vdYJoTfLAnw3lCQJ34bzo8aQtAVmb4PbKzdLhkLcy6PWXtQJ1KlR9FhdE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB2020
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/ELwPCcpdYdPaIYoqPfdpRJJSCrQ>
Subject: Re: [netconf] ietf-crypto-types: read-only nodes to provide fingerprints of public keys and certificates
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Mar 2020 13:38:09 -0000

-----Original Message-----
From: Kent Watsen <kent@watsen.net>
Sent: Dienstag, 17. März 2020 22:52
To: Angermann, Maurice (DI PA CI R&D 2) <maurice.angermann@siemens.com>
Cc: netconf@ietf.org
Subject: Re: [netconf] ietf-crypto-types: read-only nodes to provide fingerprints of public keys and certificates

Hi Kent,

> Hi Maurice,
> > I would like to make a suggestion regarding the groupings for public keys and certificates in draft-ietf-netconf-crypto-types-14:
> >
> > Especially in case of manual server verification in applications like (Open)SSH or HTTPS (self-signed certs), it is quite common to compare fingerprints of an (remote) identity.
> > Therefore it might be useful to add operational data (“config false”) nodes to those groupings to provide the fingerprints of a public key/certificate.
>
> If I understand you correctly, you're describing a use case whereby a server is configured to listen for SSH and/or TLS connections, and the administrator of the server wishes to communicate the “fingerprint” value to clients that they should accept when establishing a connection to the server for the first time, as opposed to blindly accepting the presented fingerprint (i.e., the "trust on first use” problem).  Is this correct?

Yes, that could be one use case, but I agree with what you have mentioned in 1) below: In this case it would be to be preferred to send the whole public key or certificate.
But this is not necessarily about an administrator communicating the fingerprints to clients.

This might also be one administrator who wants to verify the certificate of an HTTPS server displayed by the client-side web browser.
I don't know if there is a web browser that supports to display the server's certificate (chain) as CMS structure, but web browsers display SHA1/SHA256 fingerprints.
The administrator could then access the operational datastore first through a "trusted" connection to get the fingerprint.
For instance, this could be a direct serial connection/console port, or a previously verified NETCONF/SSH connection.

Otherwise, in order to verify the certificate without fingerprints available, one would have to manually follow steps like the following.
Lets call this A):
- In the browser, export the certificate to a file.
- (If a certificate chain is used, additional intermediate/CA certificates would have to be exported as well)
- Create a CMS structure from the exported certificate file(s).
- Now he or she could start to compare the locally created CMS with the CMS stored in <running>.

Please correct me in case I have missed an easier way to do that.

Similar steps are required if an administrator wants to manually check fingerprints of a certificate chain in <running>, e.g. configured by a different administrator as a trust-anchor.
Lets call this B):
- Read the CMS from <running>
- Split the CMS to single X509 certs
- Create fingerprint per X509 cert

Thinking about these scenarios, I have noticed that the proposal I have sent wouldn't cover the case that one single CMS structure contains more than one certificate.
I will update it accordingly.

// <-- OT -->
BTW: In the NETCONF WG mail archive I have found the following question in a message from June 2019:
"Would it help if the crypto-types draft included an Appendix section to supply the `openssl` commands for just the 'trust-anchor-cert-cms' and 'end-entity-cert-cms' typedefs?"
(https://mailarchive.ietf.org/arch/msg/netconf/_CN84eZIZH1enQtI3DgZa-Xh4XI/)

I agree with Juergen, that it would be useful to have such an appendix.
Are there still plans to add it?
I only know "openssl crl2pkcs7" to create a PKCS7 structure with one or more PEM certs, but how can "openssl" be used to do the same for CMS?
// <-- OT -->



> Assuming this is the use case, some questions are:
>
> 1) why would’nt the administrator send the server’s entire public-key/certificate instead of a fingerprint?
>
> 2) do TLS-based applications ever use fingerprints, as opposed to the Issue’s cert, even if a certificate is self-signed?
>
> Assuming fingerprints are indeed needed/used:
>
> 3) is there a standard fingerprint formats to use, or does each app (e.g., OpenSSL) define its own?
>
> 4) instead of the administrator obtaining the fingerprint via operational state (config false) data, would it be just as well for them to connect to the server itself and get the value that way?
>
>
> Kent // as a contributor

To 1): Absolutely, in the case of an administrator deploying certificates e.g. via email, that would be the better approach.

To 2): I think TLS-based applications should "internally" never use fingerprints. Please note that this proposal is primarily meant to simplify manual verifications, since TLS-based applications like web browser usually display fingerprints to the user instead of e.g. a PEM-encoded certificate or even a CMS structure.

To 3)
This is a very good question.

At least for X509 certificate fingerprints it is common to hash the DER-encoded representation. Unfortunately I haven't found this described as an official standardized approach.

But I'm afraid that for SSH public keys there is not such a de-facto standard.
I think OpenSSH-like formats as created by "ssh-keygen" might be most common.
So assuming fingerprints are also added to public keys in crypto-types, I think a YANG feature could give an implementation the choice to specify whether it supports OpenSSH-like fingerprints or not.

To 4) Should be the same use case as described in A).


Maurice



> > That would provide easy manual verification, e.g. of a whole certificate chain stored in <running>.
> >
> > Any feedback on this proposal is much appreciated.
> >
> > Please find an example of how a generic realization in the crypto-types module could look like below:
> >
> > Since “x509c2n:tls-fingerprint” is probably not an appropriate namespace to describe a public-key fingerprint, an according datatype could look like that:
> >   typedef fingerprint {
> >     type yang:hex-string {
> >       /* max string range of x509c2n:tls-fingerprint's pattern restriction */
> >       length "min .. 764";
> >     }
> >   }
> >
> > A new grouping to provide fingerprints depending on the available hashing algorithms:
> >   grouping fingerprints-grouping {
> >     description
> >       "A set of fingerprints of a public key or a certificate.
> >        Implementations SHOULD NOT provide a list entry for an algorithm
> >        that is not being listed as supported in iana-hash-algs.";
> >    container fingerprints {
> >       description
> >         "A set of fingerprints of a public key or a certificate.";
> >       list fingerprint {
> >         key "algorithm";
> >         description
> >           "A fingerprint.";
> >         leaf algorithm {
> >           type iha:hash-algorithm-type;
> >           description
> >             "The hashing algorithm.";
> >         }
> >         leaf hash {
> >           type fingerprint;
> >           description
> >             "The fingerprint value.";
> >         }
> >       }
> >     }
> >   }
> >
> > The resulting updated groupings would look like that: (*) indicates the new nodes
> >   grouping public-key-grouping
> >     +-- algorithm                 iasa:asymmetric-algorithm-type
> >  (*)+--ro fingerprints
> >  (*)|  +--ro fingerprint* [algorithm]
> >  (*)|     +--ro algorithm             iha:hash-algorithm-type
> >  (*)|     +--ro hash                  fingerprint
> >     +-- public-key-format?        identityref
> >     +-- public-key                binary
> >
> >   grouping trust-anchor-cert-grouping
> >     +-- cert?                     trust-anchor-cert-cms
> >  (*)+--ro fingerprints
> >  (*)|  +--ro fingerprint* [algorithm]
> >  (*)|     +--ro algorithm             iha:hash-algorithm-type
> >  (*)|     +--ro hash                  fingerprint
> >     +---n certificate-expiration
> >        +-- expiration-date    yang:date-and-time
> >
> >   grouping end-entity-cert-grouping
> >     +-- cert?                     end-entity-cert-cms
> >  (*)+--ro fingerprints
> >  (*)|  +--ro fingerprint* [algorithm]
> >  (*)|     +--ro algorithm             iha:hash-algorithm-type
> >  (*)|     +--ro hash                  fingerprint
> >     +---n certificate-expiration
> >        +-- expiration-date    yang:date-and-time
> >
> > Please note that leaf-lists as used in “trust-anchor-certs-grouping” or “end-entity-certs-grouping” wouldn’t be considered by that approach.
> >
> > Again, any feedback is appreciated.
> >
> > Thanks
> > BR Maurice
> >
> >
> >
> > With best regards,
> > Maurice Angermann
> >
> > Siemens AG
> > Digital Industries
> > Process Automation
> > Software House Khe
> > DI PA CI R&D 2
> > Oestliche Rheinbrueckenstr. 50
> > 76187 Karlsruhe, Germany
> > mailto:maurice.angermann@siemens.com
> > www.siemens.com/ingenuityforlife
> >
> > Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Jim Hagemann Snabe; Managing Board: Joe Kaeser, Chairman, President and Chief Executive Officer; Roland Busch, Lisa Davis, Klaus Helmrich, Cedrik Neike, Michael Sen, Ralf P. Thomas; Registered offices: Berlin and Munich, Germany; Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684; WEEE-Reg.-No. DE 23691322
> >
> >
> > _______________________________________________
> > netconf mailing list
> > netconf@ietf.org
> > https://www.ietf.org/mailman/listinfo/netconf