Re: [netconf] draft-ietf-netconf-keystore-09.txt

Nick Hancock <nick.hancock@adtran.com> Fri, 10 May 2019 15:38 UTC

Return-Path: <nick.hancock@adtran.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 CCEFF12010E for <netconf@ietfa.amsl.com>; Fri, 10 May 2019 08:38:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 Cb5Sie8xSPPd for <netconf@ietfa.amsl.com>; Fri, 10 May 2019 08:38:56 -0700 (PDT)
Received: from us-smtp-delivery-128.mimecast.com (us-smtp-delivery-128.mimecast.com [216.205.24.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 872BD1201DB for <netconf@ietf.org>; Fri, 10 May 2019 08:38:50 -0700 (PDT)
Received: from ex-hc2.corp.adtran.com (ex-hc3.adtran.com [76.164.174.83]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-323-v_N-I3JHNmeXLUYMMI0zFw-1; Fri, 10 May 2019 11:38:44 -0400
Received: from ex-mb3.corp.adtran.com ([fe80::60aa:f95:ad49:a0f1]) by ex-hc2.corp.adtran.com ([fe80::a019:449b:3f62:28e5%10]) with mapi id 14.03.0382.000; Fri, 10 May 2019 10:38:43 -0500
From: Nick Hancock <nick.hancock@adtran.com>
To: Kent Watsen <kent+ietf@watsen.net>
CC: "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [netconf] draft-ietf-netconf-keystore-09.txt
Thread-Index: AdT/Ypeae5Jx2/tnSQGaoI1kbpVxTQBV+RMAAAPy5nABIM/7AABubAow
Date: Fri, 10 May 2019 15:38:43 +0000
Message-ID: <BD6D193629F47C479266C0985F16AAC7011EA7B419@ex-mb3.corp.adtran.com>
References: <BD6D193629F47C479266C0985F16AAC7011EA6CCF7@ex-mb1.corp.adtran.com> <0100016a766b430d-005d7041-a607-42d6-b91a-558bbb93e4c6-000000@email.amazonses.com> <BD6D193629F47C479266C0985F16AAC7011EA774DE@ex-mb3.corp.adtran.com> <0100016a9465d3e2-9e05e8e7-824c-41f8-985a-fc767147bc9c-000000@email.amazonses.com>
In-Reply-To: <0100016a9465d3e2-9e05e8e7-824c-41f8-985a-fc767147bc9c-000000@email.amazonses.com>
Accept-Language: en-US, en-GB
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0FEVFJBTiIsImlkIjoiODdiMjFhYjctYTdkYi00OTM2LWJkZTMtOTY5ZDVkNmJhZjg5IiwicHJvcHMiOlt7Im4iOiJDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiR0IifV19LHsibiI6IlF1ZXN0aW9uMSIsInZhbHMiOltdfSx7Im4iOiJRdWVzdGlvbjIiLCJ2YWxzIjpbXX0seyJuIjoiUXVlc3Rpb24zIiwidmFscyI6W119XX0sIlN1YmplY3RMYWJlbHMiOltdLCJUTUNWZXJzaW9uIjoiMTcuMi4xMS4wIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkkzdGRtUVlKXC8zbEtzN1U0ZlhkbDhPYkdQNUhDYStxUUJPZkMwbjhaSlFoYzZGcnUra2tGeGJxQlFqWG85WmZoIn0=
x-originating-ip: [172.20.62.169]
x-c2processedorg: 13f501ad-3ef3-410f-a3f9-976ea23ce952
MIME-Version: 1.0
X-MC-Unique: v_N-I3JHNmeXLUYMMI0zFw-1
X-Mimecast-Spam-Score: 0
Content-Type: text/plain; charset="WINDOWS-1252"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/HVrScKBJ0aPKkirhVEUZUgxJblI>
Subject: Re: [netconf] draft-ietf-netconf-keystore-09.txt
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: Fri, 10 May 2019 15:39:00 -0000

Hi Kent, 

> -----Original Message-----
> From: Kent Watsen <kent+ietf@watsen.net>
> Sent: 08 May 2019 00:24
> To: Nick Hancock <nick.hancock@adtran.com>
> Cc: netconf@ietf.org
> Subject: Re: [netconf] draft-ietf-netconf-keystore-09.txt
> 
> Hi Nick,
> 
> 
> > Given that a client has the required permissions, the current model
> > allows a client to create an entry in the list 'asymmetric-key'
> > without the 3-tuple leafs 'algorithm', 'public-key' and 'private-key'
> > as allowed via the must statement on the list. At this point there
> > would be no 3-tuple in <operational> either. Defining the 3-tuple in
> > <intended> or <operational> would be a second step, such as invoking
> > the action 'generate-hidden-key'. Since there is, as you indicated,
> > no 'must' statement relevant to the 'certificate' list, the model
> > also allows a client to configure a certificate (chain) on an entry
> > in the list 'asymmetric-key' without the 3-tuple in either <intended>
> > or <operational>. The asymmetric key entry would not be able to be
> > used to establish a TLS session due to the missing 3-tuple, of course.
> > 
> > Is this a valid use case? Possibly. I could argue that a client may
> > wish to 'park' certificate chains in the keystore without necessary
> > immediately using them on the server or even just pre-provision them
> > and then provide the actual public key later maybe through some other
> > process based on an operator's security policies? It makes no sense
> > to reference a certificate in the keystore that is missing the
> > 3-tuple as the server identity of a NETCONF server or client identity
> > of a NETCONF client as it cannot be used, so the question is whether
> > it would make more sense to constrain the actual reference to
> > reference certificates that have 3-tuple, if this is at all possible
> > considering that the 3-tuple may only be in <operational>?
> 
> If you look at my "wide-screen needed" email from last Friday, you'll see that I'm
> trying to make a case that these 3-tuple nodes should be "mandatory true".   If
> that discussion falls apart, then we can revisit your proposal here.
> 
> BTW, please jump into that discussion, as comments from implementations are
> highly valued.
> 
> 
> 
> > During analysis of deploying the keystore and truststore in our
> > implementation, I have made some further observations that may be of
> > interest:
> 
> I see you're calling it "truststore", which I take as a confirmation for the rename
> proposal sent out last Thursday.
> 
> 
> > 
> > 1. There is nothing in the model to prevent a client configuring a
> >  certificate to an asymmetric key that is not applicable to that
> >   asymmetric key or even a certificate chain in the keystore or
> >   truststore that is incompatible to the required type
> >   ('end-entity-cert-cms' or 'trust-anchor-cert-cms' respectively)
> >   or is this to be rejected by the implementation, in which case
> >  this behavior is not described in the YANG?
> 
> Such incompatibilities must not be allowed.  As neither issue can be enforced via
> YANG validation constraints, the best we can do is add comments to the
> description statements.
> 
> For the latter case, I believe that both the 'end-entity-cert-cms' or 'trust-anchor-
> cert-cms' description statements have a sufficient number of MUST statements.
> - agreed?
> 

Agreed.

> For the former, how about this:
> 
> @@ -1614,7 +1624,9 @@ module ietf-crypto-types {
> 
>    grouping asymmetric-key-pair-with-cert-grouping {
>      description
> -      "A private/public key pair and an associated certificate.";
> +      "A private/public key pair and an associated certificate.
> +       Implementations SHOULD assert that certificates contain
> +       the matching public key.";
> 
>      uses asymmetric-key-pair-grouping;
>      uses end-entity-cert-grouping;
> @@ -1692,7 +1704,9 @@ module ietf-crypto-types {
> 
>    grouping asymmetric-key-pair-with-certs-grouping {
>      description
> -      "A private/public key pair and associated certificates.";
> +      "A private/public key pair and associated certificates.
> +       Implementations SHOULD assert that certificates contain
> +       the matching public key.";
>      uses asymmetric-key-pair-grouping;
>      container certificates {
> 

Yes, but I believe that these SHOULD statements should also be 
included on the description statement of 'cert' leafs as well as they 
may get overlooked, if they are only to be found in the description 
statement on the groupings.

> 
> 
> 
> > 2. I am not convinced whether the use of the prefix 'pinned-' on the
> > containers and lists in ietf-trust-anchors is correct. The
> >  certificates are available in the truststore for pinning, yes, but
> >  does not the 'pinning' actually take place when the certificates
> >  are configured for client authentication on a server or server
> >  authentication on a client? So I would argue that a certificate
> >  may be in the trust store, but not necessarily pinned, so the name
> >  may be misleading or am I missing something? Thus, I would have
> >  expected the containers and lists to be without the 'pinned-'
> >  prefix within the truststore itself. The 'pinned-' prefix being
> >  only on the references, which is the case in the NETCONF client
> >  and server models.
> 
> 
> Agreed, especially with renaming the module and top-level container node to
> "truststore" (what else would a truststore contain, right?).  I just all the "pinned"
> prefixes in my local copy (s/pinned.//g)
> 
> 
> 
> 
> > 3. As an initial step we are analyzing the standalone use of the
> >   keystore in truststore modules and were considering some
> >  proprietary notifications that would include the certificate
> >  (chain) received during TLS session establishment, but could not
> >  'use' the groupings in ietf-crypt-types because they include
> >  actions and notifications, which are not allowed in notifications.
> >  Maybe it would be advantageous to provide basic groupings without
> >  actions and notifications for use in proprietary RPCs and
> >  notifications and provide refined versions of these groupings that
> >  include the actions and notifications? Obviously this would mean
> >  even more groupings, but wouldn't this increase their reusability?
> 
> I don't understand "standalone use of the keystore in truststore modules" -
> maybe you meant "and"?

Yes, I meant 'and'.

> 
> I know what you mean.   I recently wanted to use some groupings from another
> module but couldn't for a similar reason, and hence had a similar copy/paste
> yuck experience.
> 
> If I understand you correctly, you're saying that tooling such as `pyang` or
> `yanglint` is complaining because your notification "uses" the crypto-type
> grouping, which itself defines a notification - yes?

Yes, that is correct.

> 
> RFC 7950 Section 7.16 says"
> 
>    A notification MUST NOT be defined within an rpc, action, or another
>    notification, i.e., a notification node MUST NOT have an rpc, action,
>    or a notification node as one of its ancestors in the schema tree.
>    For example, this means that it is an error if a grouping that
>    contains a notification somewhere in its node hierarchy is used in an
>    rpc definition.
> 
> Ouch, that's rather specific.  I was hoping there might be some wiggle room
> allowing for "inner" notifications to just be ignored.  That sounds like a better
> solution, don't you think, perhaps a YANG-Next candidate?
> 

It would be a possible solution, but that is something for the future though.

> You're right in guessing we're reluctant to create more groupings unnecessarily
> and, in this case, these groupings are very small - just a single "leaf" or "leaf-
> list", so the yuck isn't all that much.  Copy/paste might be reasonable in this
> case, no?
> 

Yes, copy/paste is always an option, but this also has its drawbacks, 
including having multiple duplicate definitions within the YANG model; 
the opportunity to modify the copy, intentionally or unintentionally, 
such as to change the names of leafs; but most importantly copying and 
pasting would mean that copy will not follow any changes made to 
the original grouping, such as corrections and the addition of new 
nodes in newer revisions, meaning additional maintenance and possible 
discrepancies across YANG models going forward.  
And this is why I am a keen user of groupings to ensure consistency 
across models, even though it makes the YANG modules even harder to 
read. If something is the same then it should always be the same 
wherever is appears in the model and using a grouping does just that.

Regards
Nick


> 
> Kent // contributor
> 
> 
>