Re: [yang-doctors] Yangdoctors last call review of draft-ietf-netconf-keystore-02

Kent Watsen <kwatsen@juniper.net> Fri, 28 July 2017 15:01 UTC

Return-Path: <kwatsen@juniper.net>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4B124127B60; Fri, 28 Jul 2017 08:01:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.022
X-Spam-Level:
X-Spam-Status: No, score=-2.022 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=juniper.net
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 asYT6KMnJlCs; Fri, 28 Jul 2017 08:01:28 -0700 (PDT)
Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0099.outbound.protection.outlook.com [104.47.33.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8819B129A92; Fri, 28 Jul 2017 08:01:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=o0eht+wFwEc3NAPUSTRjHH1mu8Jl44FmnQ6CggqL0EQ=; b=Nw+Oz9AaiJ6ZMOE+VenBt/jE/8oJzdr6+S3IgaD4m2ff+yP+7Q6EiDIM76fXkyUm/lI/9os9un1IrMnGo5B9qsu/Us4VRC/I51Ixkdr/u6EtTvCW1w2ZHtfMAVa37gceT6XcDJ8XZb7LvzlwxipQvTWB/klFgUcaH9VdILycPIA=
Received: from CY1PR0501MB1450.namprd05.prod.outlook.com (10.160.149.11) by CY1PR0501MB1785.namprd05.prod.outlook.com (10.163.141.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.10; Fri, 28 Jul 2017 15:01:26 +0000
Received: from CY1PR0501MB1450.namprd05.prod.outlook.com ([10.160.149.11]) by CY1PR0501MB1450.namprd05.prod.outlook.com ([10.160.149.11]) with mapi id 15.01.1304.021; Fri, 28 Jul 2017 15:01:26 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
CC: "yang-doctors@ietf.org" <yang-doctors@ietf.org>, "draft-ietf-netconf-keystore.all@ietf.org" <draft-ietf-netconf-keystore.all@ietf.org>, "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: Yangdoctors last call review of draft-ietf-netconf-keystore-02
Thread-Index: AQHS/tjFB6LSB6mMA0ixt1H16U9uU6Jbyb8AgAEruACAC1e7gIAAnl+AgAA4dAA=
Date: Fri, 28 Jul 2017 15:01:26 +0000
Message-ID: <701F31A6-9941-4DE4-AE7E-00E859F103F8@juniper.net>
References: <150028100874.32703.14161403810529927281@ietfa.amsl.com> <B1AC6895-5681-48F8-B7E7-418118120B4E@juniper.net> <20170720165942.GB21506@elstar.local> <F5E9973C-FCCD-4A96-B0D3-8C735CE911D3@juniper.net> <20170728073923.GA28870@elstar.local>
In-Reply-To: <20170728073923.GA28870@elstar.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/f.20.0.170309
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kwatsen@juniper.net;
x-originating-ip: [66.129.241.12]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; CY1PR0501MB1785; 7:8VRUmIli85ueARxrfPzjTpDTU+6ZK3NTRsCrudbDRz6ghVQkvJgN6vIwbG/bs/GXOjXKAyRN2TBKaYsMqD/6ND3UfatWXQ35XX1i6B3/mpMS438Q6qGMzQXAfc5aZ5jScCpGAXyxkUExyu36JHWly44VxPZAXSsLiikaC+YBDbbl+nT/8xbwIUybpriGSfWcby/GTuH8YzlC9NOLJqOCNU0xm/llz2vBk/RI0iUG9c+SfqXwiekHK45lX0WnXaMKyUfiE1vDT2fVLSFJ4XrTbxNrWqvGO9rfZIZfRzdTiK4JTPYiV885cmGYK4Sk2NgisZfS+s5ByiBOyFv6UJuUpPLFIJfNBHgrrOjLQ/mIdrc0bJJOWVoys+JUap1qJ5EN8wCtV/Mlpl7CUFNSUEd3l5+7OyslUdxcmkiqbHKZsvuuNimpHcKYs4SNeZsyP21SgpjZEf+uFR1tJtSL7KXR1cB3IiyleEytk2imN3Mot9PWInzOY+EFGKb898UOMbwn2bDD+SQgCV8s7V9eeLBVHZpPBwGsZUmB08GvSzYzpgQVCx9yR3/VoPlXuD+UIwULLUH1WsUVQDG/UNFKByyEKWp+rjjMdec4HiZdsOV4bccdGhzOgg79V3dKDELEttQRMGoL11uCl4pw6p4imTHpfp9y5dkO5EssFbeo+Q4nDGZxLUiNiLHohakMfjnxjgW2OidgEqgBZXK2FVxrrG5ywN4xJWoyAdSoOmsg89NtIfIEzs9BksGJGp5fVU4qpzsovC1ScuiJq/EVu6cqCPM9GCst1e4oliDF70g1IBrByGI=
x-ms-office365-filtering-correlation-id: ac4e0fb6-1ab8-4cb9-4360-08d4d5c98511
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254127)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR0501MB1785;
x-ms-traffictypediagnostic: CY1PR0501MB1785:
x-exchange-antispam-report-test: UriScan:(158342451672863);
x-microsoft-antispam-prvs: <CY1PR0501MB178576C8017112A7BEBC6632A5BF0@CY1PR0501MB1785.namprd05.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0501MB1785; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0501MB1785;
x-forefront-prvs: 03827AF76E
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39840400002)(39860400002)(39410400002)(39850400002)(39400400002)(51444003)(76104003)(174864002)(199003)(189002)(105586002)(53936002)(6246003)(14454004)(38730400002)(106356001)(189998001)(110136004)(66066001)(101416001)(99286003)(4326008)(6436002)(5660300001)(25786009)(33656002)(50986999)(36756003)(54906002)(102836003)(6116002)(3846002)(966005)(54356999)(6512007)(76176999)(6306002)(83506001)(68736007)(229853002)(83716003)(81166006)(81156014)(97736004)(4001350100001)(8936002)(3280700002)(82746002)(6486002)(77096006)(230783001)(3660700001)(2906002)(6506006)(7736002)(86362001)(305945005)(93886004)(6916009)(2950100002)(2900100001)(478600001)(8676002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0501MB1785; H:CY1PR0501MB1450.namprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: juniper.net does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-ID: <77545109B36CD84A9127097E8E1FDAB2@namprd05.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2017 15:01:26.2632 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bea78b3c-4cdb-4130-854a-1d193232e5f4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1785
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/fnNrBi6W4Gsr6KAtysPwJL7P-VY>
Subject: Re: [yang-doctors] Yangdoctors last call review of draft-ietf-netconf-keystore-02
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Jul 2017 15:01:31 -0000

Hi Juergen,


> Using
>
>  <private-key>base64encoded===</private-key>
>
> sounds like an interesting option since this should allow tools
> to validate the instance documents (and this is what I am really
> looking for).

Great, and this thread forked already, so let's continue it there.


>> >> - I am not sure I understand trusted-host-keys. On systems that have
>> >>   multiple user accounts, you usually have a per account list of
>> >>   trusted host keys in addition to a global system wide list. Perhaps
>> >>   make it clear that this models the global known hosts list only?
>> >> 
>> >> <KENT> it's a list of lists, so there can be many different
>> >> sets a host-keys defined, with each application/use pointing
>> >> to its own entry.  The ietf-ssh-client module's grouping has
>> >> a leafref to a specific entry.  FWIW, this grouping is
>> >> used by ietf-netconf-client module.  At the moment, there
>> >> no other uses of this grouping.  I think that you may be
>> >> getting confused between the key the server presents (the
>> >> host-key) versus the key user presents.
>> >> .
>> >
>> > I though these are the authorized host keys? Yes, I am confused. If
>> > these are user public keys, they should not be called host keys. But
>> > yes, I am confused (but I started to read the other documents).
>> 
>> This leaf encodes an SSH public key (RFC4253, 6.6), same as used in 
>> /ietf-system/system/user/authorized-key/key-data (and I have changed
>> this leaf's type to match it in my local copy already), but the uses
>> are different.  In ietf-system, the authorized-key is configured on
>> a server in order to authenticate subsequent SSH-client connections.
>> Here, we're taking about the key that that SSH-server presents to
>> the client.  These are the host keys that OpenSSL often puts into the 
>> ~/.ssh/known-hosts file.
>
> I understand what you are modeling is /etc/ssh/ssh_host_rsa_key.pub
> and friends. Make sure it is described clearly. Or do you actually
> mean the clients cache of authenticated keys that goes into an
> account's known-hosts file? In this case, the keystore may be the
> wrong place.
 
/keystore/trusted-host-keys/trusted-host-key is in fact like the
known-hosts file.  That is, these are the host-keys that a client has
"pinned" or "trusted".  The ietf-ssh-client has a leafref to one of
these entries.  We could rename "trusted-host-key[s]" to 
"pinned-host-key[s]" if that helps. Ditto for trusted-certificate[s])

By contrast, /keystore/keys/key/name is referenced by ietf-ssh-server
to identify the host-key(s) the SSH server presents to SSH clients.
This is analogous to /etc/ssh/ssh_host_rsa_key.pub and friends.  This
node isn't called e.g. /keystore/keys/key/ssh-host-key because, AFAICT,
the system should be able to generate its host-key from the private-key
itself.  Thus, referencing the name is equivalent.  If there were a
/keystore/keys/key/ssh-host-key node, it would be a gratuitous config
false value that somehow encoded the host-key in a more SSH friendly
format.  But, it may have a subtler value in that, I think that your
confusion may be because it was NOT there and so, in its absence, 
you may have thought that the "trusted-host-keys" must serve that 
function.  Thoughts?

BTW, "host key" has a specific meaning, defined in RFC4251#4.1, not to
be confused with authorized keys.


>> >> - Should the document title be aligned with other YANG module
>> >>   definitions, so it is easier to spot it?
>> >> 
>> >> <KENT> I don't understand, what do you mean?
>> >
>> > We often use "[A] YANG Data Model for ....".
>> >
>> > https://en.wikipedia.org/wiki/YANG#Usage_in_Standards
>> >
>> > The current name does not say YANG (sometimes I search for YANG 
>> > in the RFC index) and Keystore is also pretty broad given the
>> > related work we have.
>> 
>> Gotcha, how about "YANG Data Model for Keystores"?
>
> Yes, except that 'keystores' leaves readers unclear about the scope. I
> commented several times that the names of this module and the other
> module for symmetric keys are unfortunate. Concerning the SSH keys, I
> am still concerned that we would be better off to have a separate SSH
> module that takes care about managing an SSH server's host keys and
> then this module would be X509 certificate specific, i.e., a 'YANG
> Data Model for Managing X.509 Keys and Certificates' would be a clear
> and well defined scope.

From a refactoring perspective, we could have a base module and then
two augmenting modules, one for SSH and the other for X.509.  I would
think to define all three modules in the same draft, but that wouldn't
help your draft-name issue.  We could put each module into own draft
(e.g. +2 drafts), but is it worth it for renaming sake?  Maybe an even
longer title?  "YANG Data Model for Managing Asymmetric Private Keys,
X.509 Certificates, and SSH Host Keys'?  Naming aside, what do you 
think about the module-factoring idea?


>> In another thread, we concluded that we might want to ask SecDir.
>
> Or just acknowledge that in the longer term an IANA solution may be
> needed but we do this later.

Maybe, and really I wonder who is in a better position to make the
call.  Sure, SecDir can confirm that there are common algorithms
used in cryptography, but they may not necessarily have a crystal
ball to know how many YANG modules will be coming in the near 
future for which it matters.  Is the NETCONF/NETMOD WGs more
able to make this call?  I'm personally unaware of any other 
work-in-progress having a need for these algorithm identities
such as are defined here, nor do I have a crystal ball for 
predicting the future.


>> >> - Since the certs of a key do not contain a signature, where are signed
>> >>   certificates stored or are they outside the scope of the model?
>> >> 
>> >> <KENT> I'm confused, certificates are signed structures already...
>> >
>> > Well, the description of certificates/certificate/value says:
>> >
>> >   An unsigned PKCS #7 SignedData structure, as specified
>> >   by Section 9.1 in RFC 2315, containing just certificates
>> >   (no content, signatures, or CRLs), encoded using ASN.1
>> >   distinguished encoding rules (DER), as specified in
>> >   ITU-T X.690.
>> >
>> > Yes, I am confused how this works.
>>  
>> Okay, now I understand your confusion.  I believe the text is 
>> accurate.  Think of the PKCS#7 structure being a little like a 
>> TAR file that contains a directory structure like this:
>> 
>>  pkcs7:
>>   /signed-info
>>   /signature   - this sig is only over 'signed-info' ...
>>   /extra-certificates
>>   /extra-revocation-objects
>> 
>> So, in this case, we're using a degenerate form of the pkcs7
>> structure that has no content (signed-info), signature, or CRLs 
>> (revocation-objects), it only contains the certificates. Perhaps
>> my use of the word "unsigned" isn't clear enough?
>
> So why pkcs7, is this what implementations use? The certificates

Why pkcs7 is because each certificate may have an associated chain
of certificates leading to a trust-anchor CA certificate.  For instance,
a vendor might have a CA called "foo-root" that signs an intermediate
CA called "foo-intermediate" that signs the "foo-entity" certificates.
So, a given foo-entity certificate (a single X.509 structure) is
commonly presented along with its chain of CA certs (more X.509 
structures), in this case, the "foo-intermediate" and "foo-root" CA
certs.  The pkcs7 structure is commonly used for this purpose in the
PKI world.  Yes, it could be just a TAR file having a flat list of
certs, but then we'd have to define that structure, whereas its 
already defined in pkcs7.

> I find in /etc/ssl/certs on my Debian system seem to be in PEM format.

PEM and DER are interchangeable formats.  PEM is essentially the base64
encoding of the DER surrounded by the "===== BEGIN/END CERTIFICATE
=====" header/footer.


K.