Re: [Netconf] WG LC for zerotouch

Kent Watsen <kwatsen@juniper.net> Thu, 28 September 2017 03:29 UTC

Return-Path: <kwatsen@juniper.net>
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 8778D133011 for <netconf@ietfa.amsl.com>; Wed, 27 Sep 2017 20:29:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.021
X-Spam-Level:
X-Spam-Status: No, score=-2.021 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 3IlKMxceBaSE for <netconf@ietfa.amsl.com>; Wed, 27 Sep 2017 20:29:37 -0700 (PDT)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0119.outbound.protection.outlook.com [104.47.36.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 494F3135299 for <netconf@ietf.org>; Wed, 27 Sep 2017 20:29:37 -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=yYRdwDCSMIlI66tVZ81AsE8CravMWZGGY8k7oSr9KOg=; b=RVhYL7dlrhMN2Tz9mwNEKvfGFNiIz0JDl6/hA7EolXFp1UzslsdxyRXyJWhFJkSe+g4qTefilvEFMK+wWnOGjNGJTAXRT/hAV5mJhvrT9vpYqJ2kB6JUyB2Hei3Q+BJY8q6l2AXWZXNlj5QHhZMzAWU8iykv+vaazSrQJejgNFE=
Received: from BLUPR05MB275.namprd05.prod.outlook.com (10.141.22.149) by BLUPR05MB275.namprd05.prod.outlook.com (10.141.22.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.3; Thu, 28 Sep 2017 03:29:34 +0000
Received: from BLUPR05MB275.namprd05.prod.outlook.com ([10.141.22.149]) by BLUPR05MB275.namprd05.prod.outlook.com ([10.141.22.149]) with mapi id 15.20.0035.010; Thu, 28 Sep 2017 03:29:34 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: Martin Bjorklund <mbj@tail-f.com>
CC: "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [Netconf] WG LC for zerotouch
Thread-Index: AQHTNmkgNr3NKKCDrEalHAYIEUO5aqLHbIGAgAH3n4A=
Date: Thu, 28 Sep 2017 03:29:34 +0000
Message-ID: <B08CEFF5-8E7E-4D67-A7E4-9C8992114623@juniper.net>
References: <9F33F0C4-7697-4774-B7F1-A8556A6A73A1@gmail.com> <20170926.192701.1726303533240950350.mbj@tail-f.com>
In-Reply-To: <20170926.192701.1726303533240950350.mbj@tail-f.com>
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; BLUPR05MB275; 6:PvaSceqxJC4WTV1FkDkAO2mjBAdUejOW9F9kAXDqU8s9gFzDnU+ueAH7hS4tWMMpKd8m2WvG/6Ln4MYYQ4fsKJ+1wRL9uUeBGYAqIvVYEcgfgubBwddK27At+58YEvhB4QpaYkY57eLlMh4kId9skmycQReL8ITN4PCL0GCbXaMkEXKqL246lVHfZvFRzMY4e+/45GgOVZ0Nh6Ca1jcqNZ8uLD1LNqm3dtlw4hGqhxEPki665nVjSa3zMd0TQ5hO+LKnXy1KCtQmt60fczvXxujDfXTs4kZyWKesQuH1PEU/ndtrOp8rJxTWSpvQd0dfmBfFR4ikCUSBvd2aWLtuTw==; 5:w5ehi0iLAcSR99+VVJsmLWez5C+RYWxUSEdmVb1qufKEn7pP7a5SfzEHhh4tyeLebChcaYcfjxnCM4r01yo95ksj9z5Yv+s8VNIrt2zn0z/P2D+HK2oaiXo2KKOukayR3VL06dQKaVEAhTva9+HavA==; 24:p9dk9DzRbroBAqIGOyG4QtJ+eqvhui2v1QzC6h66t/EI5l6OkaooTorog2T2CCtOXWsEdgQneFQqPlCqcAhIuLItlLRtPOTtua3IGZ0JSBM=; 7:cbhWwsJmAc4PrtMU2XUmZqjc9NQfBDAX24OkmAoITo/24fXdYZg1JquklQOjlmwziBnt44NhXNFhIpVdHtrbYlnsa/tLjYm1x9BNtfIE2CfFkLoKH3Lsqk0Tef5Ol+hBCxOF1IwuB69j40xkKJOYnhfxdBnfegTBpbFK4R3tYw7Y8pWVW8CzvR6GScqk+DN5uQdMDOX4J4mu6FV84b0Weeg0TcsuWtX/IkJ/rrJ7ecI=
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-correlation-id: 3c68423f-362e-4f25-4678-08d506212380
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR05MB275;
x-ms-traffictypediagnostic: BLUPR05MB275:
x-exchange-antispam-report-test: UriScan:(158342451672863)(192374486261705);
x-microsoft-antispam-prvs: <BLUPR05MB27595EF32EFD34444DC47D3A5790@BLUPR05MB275.namprd05.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR05MB275; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR05MB275;
x-forefront-prvs: 0444EB1997
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(376002)(39860400002)(346002)(189002)(43784003)(51444003)(199003)(40224003)(4326008)(229853002)(106356001)(189998001)(2950100002)(6486002)(6916009)(105586002)(33656002)(77096006)(5660300001)(3846002)(101416001)(2906002)(99286003)(68736007)(6116002)(6512007)(53936002)(102836003)(6436002)(66066001)(25786009)(14454004)(2900100001)(7736002)(305945005)(97736004)(81166006)(8936002)(8676002)(6246003)(54356999)(76176999)(3280700002)(50986999)(81156014)(83716003)(478600001)(316002)(86362001)(83506001)(82746002)(3660700001)(6506006)(58126008)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB275; H:BLUPR05MB275.namprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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: <609A49D218CBF44098C91F8A2C728A6A@namprd05.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2017 03:29:34.0996 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bea78b3c-4cdb-4130-854a-1d193232e5f4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB275
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/3isLrDx0Y-X76J6yogQ6xHq1dhs>
Subject: Re: [Netconf] WG LC for zerotouch
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Network Configuration WG mailing 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: Thu, 28 Sep 2017 03:29:39 -0000

Hi Martin,

Thanks for your review!  Comments below.

K.


> I have reviewed this document, and I believe the document is ready to
> be published after a couple of issues have been addressed (see below).

We're getting there.


> I don't have the expertise to tell if the solution is secure enough or
> not.

This comment has been made by others as well.  The assumption is that
SecDir will do that evaluation.  Is that fair?


> Here are my comments.
> 
> Major issues
> ------------
>
> o  Section 7.2
>
>  Adding custom query parameters like this breaks the normal YANG
>  contract.  If I understand this correctly, the instance data tree
>  presented to the client is supposed to change based on these query
>  parameters.

Correct.  The idea is that the response could vary based on the input
query params.  Of course, in case there was any doubt, the response 
would always conform to same YANG schema.


>  If you really need to have that functionality, it would better to
>  model the device-specific data as an action; input would be the
>  os-name, os-version etc, and output would be the
>  zerotouch-information and voucher etc.

I thought of this as well, but didn't do anything about it as my 
last message to the list said that we'd add "query parameters"
and I wanted to follow through on that statement.

But what is the issue?  Is it primarily that using query params 
on GET should be limited to returning different representations
of a resource, and this use seems to be returning different 
resources altogether?  I think that this is a grey area, but
appreciate the perspective.

Alternatively, is the issue more pragmatic, in that the list of
query params seems unbounded, and we might run out of room on
the URL string (1024 chars?) someday?  Or maybe perhaps that
input can be hierarchal whereas params can't?

I imagine the answer is "all of the above"  ;)

FWIW, if we were to do this, we might also consider moving the 
'serial-number' field from the URL to an input field, and make
a similar change to the 'update-progress' action.  But that then
would mess up your NACM rule below.  Thoughts?


>  Also, the draft doesn't discuss things like "one-time use voucher";
>  this term is just used here.  It seems to me that this requires more
>  descriptive text.

Good catch.  draft-ietf-anima-voucher informally calls it an "audit
voucher", which is an unfortunate misnomer.   Nonetheless, point taken,
the draft should tie into what's in the voucher draft.  Max Pritikin
told me a couple weeks ago that calling it a "nonced voucher" or a 
"voucher with a nonce" was probably best.  BTW, this seems like an
editorial fix to me, but I can see how it could look like a major
issue if you didn't know what the text was alluding to... 


> o  Section 4.4
>
>     When a device is
>     not able to trust a bootstrap server, it MUST NOT send its IDevID
>     certificate in the form of a TLS client certificate
>
>  How will the server authenticate the client in this case?

The idea is that the server doesn't auth the client in this case.
The goal behind not sending the IDevID certificate was so a rouge
bootstrap server wouldn't be able to discover the device's serial
number, which is why Appendix B suggests also masking the serial
number the device sends in the URL.  That said, we might need to
rethink this, especially in conjunction with your next comment.  
(continued below)  


>  I see that in section 7.3 you have:
>
>   Note that the bootstrap server MUST NOT process a progress update
>   from a device without first authenticating the device.  This is in
>   contrast to when a device is fetching data from the server, a read-
>   only operation, in which case device authentication is not strictly
>   required (e.g., when sending signed information).
>
>  But the server is a normal RESTCONF server, so it will follow
>  section 2.5 of RFC 8040; it will require clients to be
>  authenticated.

I was hoping that the draft could suppress this auth requirement
for this specific "untrusted" interaction.  In essence, reducing
the bootstrap server to a simple file server providing anonymous
read-access.

But in the security analysis of things, it comes down to what's 
more important to prevent:
 a) a rogue server discovering a valid device's serial number,
    while not being able to provide the device a response the
    device can trust, or
 b) a valid server giving signed redirect information to a
    rogue device, where the information given doesn't provide
    the device any more information than the device must have
    already had to make the request in the first place, other
    than a confirmation that indeed that serial number is one
    that the server is expecting.  

Looking at it this way, (b) is more important to prevent and, 
besides:
1) there is already a Security Consideration related to the use
   of serial numbers in the solution, so (a) seems to be just
   more of the same, 
2) rogue connections could play havoc with the server's logs, and
3) (to your point) it would be tricky business to define an
   exception for the standard RESTCONF server to follow.

All this is to say that I think we should go back to the device
always sending its IDevID cert and, of course, the server always
authenticating the device.  But I also think that a device should
continue NOT sending any other information (i.e. query params,
progress updates, etc.), beyond its serial number & IDevID cert,
until it can fully authenticate the server.



> Normal issues
> -------------
>
> o  Section 1.2
>       The term "manufacturer" is used herein to refer to the
>       manufacturer of a device or a delegate of the manufacturer.
>
>  In the text you sometimes use "manufacturer" and sometimes
>  "manufacturer ot delegate".  Perhaps the term "manufacturer" should
>  be reserved to mean just the manufacturer, and then use
>  "manufacturer or delegate" in the places where that's appropriate.

I mean for it to always be "manufacturer or delegate".  The better
fix is to remove "or delegate" throughout the document.  Agreed?


> o  Section 3.2
>
>  In the first paragraph, maybe include a reference to RFC 5280.

Yes.


> o  Section 5.1
>
>  The numbers in the picture don't match the numbers in the list
>  (specifically 4-5).

Ooops, I meant 2 & 3 to be 2a and 2b respectively.  Will fix, most
likely by flattening the (2) text into distinct 2 & 3 sections
again.


> o  Section 5.6
>
>     Upon rebooting, the device MUST still be
>     in its initial state, causing the bootstrapping process to run again,
>     which will eventually come to this very point,
>
>  Why this MUST?  What if the new boot image contains other factory
>  defaults that does not enable ZTP, would that be illegal?
>
>  I would think that implementations are free to do whatever they want
>  in case of errors.

Maybe not *illegal*, but it would certainly brick the device at that
point.  Would just reducing the "MUST" to a "must" suffice, or should
we add a qualifier along the lines of "in order for the solution to
work..." ?


>    In the case of errors, the device MUST reset
>    itself in such a way that forces a reinstallation of the boot image,
>    thereby wiping out any bad state the script may have left behind.
>
>  Is this also required?  Why can't stop and wait for manual
>  intervention be allowed?

It could, but again, it would brick the device.  Same question as above,
would reducing the "MUST" to a "must" suffice, or should we add a 
qualifier along the lines of "in order for the solution to work..." ?


> o  Section 7.3
>
>  The examples have "device=123456" in the URLs; it should be
>  "device=123456789".

Yes.


>  I suggest you shorten the lines of the examples even more, so that
>  the examples are properly indented in the draft (they are currently
>  outdented)

It's hard to make the lines much shorter with the URN being so long.
Options are 1) don't indent just the xmlns line or 2) move from two-
space indent to single-space indent.  Do you have a preference?


> o  Section 9
>
>  Should you also mention that /device list should be protected by
>  nacm rules?

Yes, indeed, I left out the standard security template for the bootstrap
server YANG module.  Will add.


>  If the RESTCONF user name is the device's unique-id, then a single
>  NACM rule can be used:
>
>       <rule>
>         <name>allow-device</name>
>         <path xmlns:ztbs="urn:ietf:params:xml:ns:yang:\ietf-zerotouch-bootstrap-server">
>           /ztbs:device[ztbs:unique-id=$USER]
>         </path>
>         <access-operations>read</access-operations>
>         <action>permit</action>
>       </rule>

Yes, but would you expect this to appear in the draft?  Typically, the specific
NACM rule syntax is left as an exercise to the reader...


> o  ietf-zerotouch-information.yang
>
>  o sha256 is defined like this:
>
>             leaf sha256 {
>                type string;
>                  "The hex-encoded SHA-256 hash over the boot
>                   image file.
>
>    Should this be type yang:hex-string?  If not, I think you need to
>    specify how the hex-chars are encoded in the string.

Yes, it should be yang:hex-string.


>   o uri is defined like this:
>
>          leaf-list uri {
>            type inet:uri;
>            min-elements 1;
>            description
>              "An ordered list of URIs to where the boot-image file MAY
>               be obtained.
>
>   This leaf-list should be ordered-by user to indicate that the order is
>   significant.

Yes, it should be ordered-by user.


> o  ietf-zerotouch-bootstrap-server.yang
>
>  o the action "update-progress" should have a description

Strange, this wasn't caught by any of:
  pyang --ietf --strict ...
  pyang --canonical ...
  yanglint ...

But will add anyways.


>  o     If a script is erroneously provided to a device that does not
>        support the execution of scripts, the device SHOULD send a
>        'script-warning' notification message
>
>    Rephrase to avoid the term "notification message"
>    Also, the types are "pre-script-warning" and "post-script-warning".

Will fix.


>   o The description of the "script" typedef says:
>
>       No attempt is made to standardize the contents, running context,
>       or programming language of the script.
>       [...]
>       The script returns exit status code '0' on success and non-zero
>       on error, with accompanying stderr/stdout for logging purposes.
>
>     I think the last quoted sentence contradicts the first - it does in
>     fact make assumptions about the running context of the script.
>
>     I suggest the latter sentence is removed, and the rest of the test
>     adjusted.  Don't talk about exit codes, but instead talk about
>     "success" or "error" etc.

Will do.


> o  Other comment
>
>  Is it assumed that there will be a vendor-specific YANG module to
>  enable the zero-touch process?  Did you consider an
>  ietf-zerotouch-device module for this purpose?  Such a configuration
>  must be carefully designed to allow for a "merge" configuration file
>  to actually disable the zero touch process.

It is assumed to be vendor-specific currently.  I have not thought to
define a ietf-zerotouch-device module as of yet that, presumably, would
contain a boolean or an enum (but not a p-container) for enabling the
service.  Do you think we should add such a module to the draft, or just
put a note somewhere about it?


> Editorial nits:
> ---------------
>
> o  use "" instead of '' consistently  (except in YANG strings)

Thanks. Will double-check all.


> o  you probably should include a reference to ITU-T X.690.

Will do.


> o  s/bootstrap data/bootstrapping data/

Good catch, thought I got them all before.


> o  I suggest you run the modules through 'pyang -f yang
>   --keep-comments' in order to fix some inconsistent indentations

Will do.


Thanks again!
Kent