RFC 8572

Secure Zero Touch Provisioning (SZTP)

πŸ“… published April 2019, from ietf

RFC 8572: Secure Zero Touch Provisioning (SZTP) πŸŽ€

Okay bestie, let's start with the title block πŸ’– This one lives in the Internet Engineering Task Force (IETF) series as Request for Comments: 8572, and it's called Secure Zero Touch Provisioning (SZTP).

  • Authors: K. Watsen (Watsen Networks), I. Farrer (Deutsche Telekom AG), and M. Abrahamsson (T-Systems) πŸ‘―β€β™€οΈ
  • Category: Standards Track πŸ†
  • ISSN: 2070-1721 🌸
  • Date: April 2019 πŸ“…

Abstract

Okay so this doc is all about setting up a networking device securely the moment it boots up in its factory-default state 🏭✨ The iconic part is that it works on both public and private networks 🌐 The provisioning steps can update the boot image, commit an initial configuration, and run arbitrary scripts for auxiliary needs πŸ› οΈ Once the device is set up, it can establish secure connections with other systems. For instance, a device may establish NETCONF (RFC 6241) and/or RESTCONF (RFC 8040) connections with deployment-specific network management systems πŸ’…

Status of This Memo

Spoiler alert: this is an Internet Standards Track document πŸ”₯

This document is a product of the Internet Engineering Task Force (IETF) πŸ¦‹ It represents the consensus of the IETF community, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication 🫢 If you want more info on Internet Standards, check out Section 2 of RFC 7841 πŸ“š

For the latest on this document's status, any errata, and how to send feedback, head to https://www.rfc-editor.org/info/rfc8572 πŸ’œ

Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. πŸŽ€

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as in effect on the date of publication. Please read these carefully, because they spell out your rights and restrictions for this document πŸ™ˆ Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License βš–οΈ

Table of Contents

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   5
  1.1.  Use Cases . . . . . . . . . . . . . . . . . . . . . . . .   5
  1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   6
  1.3.  Requirements Language . . . . . . . . . . . . . . . . . .   8
  1.4.  Tree Diagrams . . . . . . . . . . . . . . . . . . . . . .   8
2.  Types of Conveyed Information . . . . . . . . . . . . . . . .   8
  2.1.  Redirect Information  . . . . . . . . . . . . . . . . . .   8
  2.2.  Onboarding Information  . . . . . . . . . . . . . . . . .   9
3.  Artifacts . . . . . . . . . . . . . . . . . . . . . . . . . .  10
  3.1.  Conveyed Information  . . . . . . . . . . . . . . . . . .  10
  3.2.  Owner Certificate . . . . . . . . . . . . . . . . . . . .  12
  3.3.  Ownership Voucher . . . . . . . . . . . . . . . . . . . .  13
  3.4.  Artifact Encryption . . . . . . . . . . . . . . . . . . .  13
  3.5.  Artifact Groupings  . . . . . . . . . . . . . . . . . . .  14
4.  Sources of Bootstrapping Data . . . . . . . . . . . . . . . .  15
  4.1.  Removable Storage . . . . . . . . . . . . . . . . . . . .  15
  4.2.  DNS Server  . . . . . . . . . . . . . . . . . . . . . . .  16
  4.3.  DHCP Server . . . . . . . . . . . . . . . . . . . . . . .  20
  4.4.  Bootstrap Server  . . . . . . . . . . . . . . . . . . . .  21
5.  Device Details  . . . . . . . . . . . . . . . . . . . . . . .  22
  5.1.  Initial State . . . . . . . . . . . . . . . . . . . . . .  22
  5.2.  Boot Sequence . . . . . . . . . . . . . . . . . . . . . .  24
  5.3.  Processing a Source of Bootstrapping Data . . . . . . . .  25
  5.4.  Validating Signed Data  . . . . . . . . . . . . . . . . .  27
  5.5.  Processing Redirect Information . . . . . . . . . . . . .  28
  5.6.  Processing Onboarding Information . . . . . . . . . . . .  28
6.  The Conveyed Information Data Model . . . . . . . . . . . . .  32
  6.1.  Data Model Overview . . . . . . . . . . . . . . . . . . .  32
  6.2.  Example Usage . . . . . . . . . . . . . . . . . . . . . .  32
  6.3.  YANG Module . . . . . . . . . . . . . . . . . . . . . . .  34
7.  The SZTP Bootstrap Server API . . . . . . . . . . . . . . . .  41
  7.1.  API Overview  . . . . . . . . . . . . . . . . . . . . . .  41
  7.2.  Example Usage . . . . . . . . . . . . . . . . . . . . . .  42
  7.3.  YANG Module . . . . . . . . . . . . . . . . . . . . . . .  45
8.  DHCP Options  . . . . . . . . . . . . . . . . . . . . . . . .  56
  8.1.  DHCPv4 SZTP Redirect Option . . . . . . . . . . . . . . .  56
  8.2.  DHCPv6 SZTP Redirect Option . . . . . . . . . . . . . . .  58
  8.3.  Common Field Encoding . . . . . . . . . . . . . . . . . .  59
9.  Security Considerations . . . . . . . . . . . . . . . . . . .  59
  9.1.  Clock Sensitivity . . . . . . . . . . . . . . . . . . . .  59
  9.2.  Use of IDevID Certificates  . . . . . . . . . . . . . . .  60
  9.3.  Immutable Storage for Trust Anchors . . . . . . . . . . .  60
  9.4.  Secure Storage for Long-Lived Private Keys  . . . . . . .  60
  9.5.  Blindly Authenticating a Bootstrap Server . . . . . . . .  60
  9.6.  Disclosing Information to Untrusted Servers . . . . . . .  60
  9.7.  Sequencing Sources of Bootstrapping Data  . . . . . . . .  61
  9.8.  Safety of Private Keys Used for Trust . . . . . . . . . .  62
  9.9.  Increased Reliance on Manufacturers . . . . . . . . . . .  62
  9.10. Concerns with Trusted Bootstrap Servers . . . . . . . . .  63
  9.11. Validity Period for Conveyed Information  . . . . . . . .  63
  9.12. Cascading Trust via Redirects . . . . . . . . . . . . . .  64
  9.13. Possible Reuse of Private Keys  . . . . . . . . . . . . .  65
  9.14. Non-issue with Encrypting Signed Artifacts  . . . . . . .  65
  9.15. The "ietf-sztp-conveyed-info" YANG Module . . . . . . . .  65
  9.16. The "ietf-sztp-bootstrap-server" YANG Module  . . . . . .  66
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  67
  10.1.  The IETF XML Registry  . . . . . . . . . . . . . . . . .  67
  10.2.  The YANG Module Names Registry . . . . . . . . . . . . .  67
  10.3.  The SMI Security for S/MIME CMS Content Type Registry  .  68
  10.4.  The BOOTP Vendor Extensions and DHCP Options Registry  .  68
  10.5.  The Dynamic Host Configuration Protocol for IPv6
         (DHCPv6) Registry  . . . . . . . . . . . . . . . . . . .  68
  10.6.  The Service Name and Transport Protocol Port Number
         Registry . . . . . . . . . . . . . . . . . . . . . . . .  69
  10.7.  The Underscored and Globally Scoped DNS Node Names
         Registry . . . . . . . . . . . . . . . . . . . . . . . .  69
11. References  . . . . . . . . . . . . . . . . . . . . . . . . .  69
  11.1.  Normative References . . . . . . . . . . . . . . . . . .  69
  11.2.  Informative References . . . . . . . . . . . . . . . . .  71
Appendix A.  Example Device Data Model  . . . . . . . . . . . . .  74
  A.1.  Data Model Overview . . . . . . . . . . . . . . . . . . .  74
  A.2.  Example Usage . . . . . . . . . . . . . . . . . . . . . .  75
  A.3.  YANG Module . . . . . . . . . . . . . . . . . . . . . . .  75
Appendix B.  Promoting a Connection from Untrusted to Trusted . .  79
Appendix C.  Workflow Overview  . . . . . . . . . . . . . . . . .  80
  C.1.  Enrollment and Ordering Devices . . . . . . . . . . . . .  80
  C.2.  Owner Stages the Network for Bootstrap  . . . . . . . . .  83
  C.3.  Device Powers On  . . . . . . . . . . . . . . . . . . . .  85
Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  87
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  87

1. Introduction ✨

A fundamental business requirement for any network operator is to reduce costs wherever possible πŸ’Έ Deploying devices to lots of locations can get seriously pricey, because sending trained specialists to every single site is both cost prohibitive and just doesn't scale 😩

This document defines Secure Zero Touch Provisioning (SZTP) πŸ¦‹ It's a bootstrapping strategy that lets devices securely get their bootstrapping data with no installer action beyond physical placement and connecting the network and power cables. So basically, SZTP lets non-technical people bring up devices in remote locations without any operator input πŸ™Œ

The SZTP solution includes updating the boot image, committing an initial configuration, and executing arbitrary scripts to address auxiliary needs πŸ› οΈ Once the device is updated, it can establish secure connections with other systems. For instance, a device may establish NETCONF [RFC6241] and/or RESTCONF [RFC8040] connections with deployment-specific network management systems πŸ’œ

This document primarily regards physical devices, where the device's initial state (described in Section 5.1) gets set during the manufacturing process 🏭 The SZTP solution may be extended to support virtual machines or other such logical constructs, but details for how this can be accomplished is left for future work 🧚

1.1. Use Cases

  • Device connecting to a remotely administered network 🌍 This use case involves scenarios like a remote branch office or convenience store, where a device connects as an access gateway to an ISP's network. Assuming it isn't possible to customize the ISP's network to provide any bootstrapping support, and there's no other nearby device to leverage, the device has no recourse but to reach out to an Internet-based bootstrap server to bootstrap from πŸ₯Ί
  • Device connecting to a locally administered network 🏑 This use case covers all the other scenarios, and it differs only in that the device may additionally leverage nearby devices, which may direct it to use a local service to bootstrap from. If no such information is available, or the device is unable to use the information provided, it can then reach out to the network just as it would for the remotely administered network use case 🫢

Conceptual workflows for how SZTP might be deployed are provided in Appendix C 🌈


1.2. Terminology ✨

okay so before we dive in, here's the glossary bestie πŸ’… terms are sorted alphabetically, because we're organized like that πŸŽ€

  • Artifact: the word "artifact" shows up all over this doc to mean any of the three artifacts from Section 3 (conveyed information, ownership voucher, and owner certificate) πŸ¦‹ together they hold all the bootstrapping data a device might use.
  • Bootstrapping Data: "bootstrapping data" is the whole pile of data a device can grab during bootstrapping. specifically that's the three artifacts from Section 3 (conveyed information, owner certificate, and ownership voucher) 🧚
  • Bootstrap Server: here, "bootstrap server" means any RESTCONF server that implements the YANG module from Section 7.3 🌸
  • Conveyed Information: "conveyed information" is either redirect information or onboarding information πŸ’– it's one of the three bootstrapping artifacts from Section 3.
  • Device: "device" is the word for a network element that needs to get bootstrapped. check Section 5 for more deets πŸ“
  • Manufacturer: "manufacturer" means the maker of a device, or a delegate of the maker 🏭
  • Network Management System (NMS): "NMS" is the deployment-specific management system that bootstrapping is responsible for introducing devices to πŸ‘‘ from a device's point of view, once bootstrapping is finished, the NMS is a NETCONF or RESTCONF client. iconic 😭
  • Onboarding Information: "onboarding information" is one of the two flavors of "conveyed information". the other flavor is "redirect information" 🫢 it's formally defined by the "onboarding-information" container inside the "conveyed-information" yang-data structure in Section 6.3.
  • Onboarding Server: "onboarding server" is a bootstrap server that only returns onboarding information 🌈
  • Owner: "owner" is the person or org that bought a device, or otherwise owns it πŸ’œ
  • Owner Certificate: "owner certificate" is an X.509 certificate that binds an owner identity to a public key. a device can use that key to check a signature over the conveyed information artifact ✨ the owner certificate might come along with its chain of intermediate certificates, all the way up to a known trust anchor. it's one of the three bootstrapping artifacts from Section 3 πŸŽ€
  • Ownership Voucher: "ownership voucher" is the voucher artifact defined in [RFC8366] πŸ¦‹ it's how a device gets assigned to an owner. it's also one of the three bootstrapping artifacts from Section 3.
  • Redirect Information: "redirect information" is the other flavor of "conveyed information", the one that isn't onboarding information 🧚 it's formally defined by the "redirect-information" container inside the "conveyed-information" yang-data structure in Section 6.3.
  • Redirect Server: "redirect server" is a bootstrap server that only returns redirect information 🌸 it's especially handy when a manufacturer hosts it as a well-known (like, Internet-based) resource that points devices at deployment-specific bootstrap servers. main character energy πŸ‘‘
  • Signed Data: "signed data" is conveyed information that's been signed, specifically with a private key owned by a device's owner πŸ”₯
  • Unsigned Data: "unsigned data" is conveyed information that hasn't been signed πŸ™ˆ

1.3. Requirements Language

ok this part is super important so pay attention bestie 🫢 the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document get interpreted as described in BCP 14 [RFC2119] [RFC8174], but only when they show up in all capitals, just like here πŸ’€ if they're lowercase, they're just normal words πŸ’–

1.4. Tree Diagrams

the tree diagrams in this doc follow the notation defined in [RFC8340] 🌈✨

2. Types of Conveyed Information

this doc defines two types of conveyed information that devices can access while bootstrapping πŸŽ€ this section describes both of them. examples are in Section 6.2 πŸ¦‹

2.1. Redirect Information

redirect information points a device at another bootstrap server 🧚 it encodes a list of bootstrap servers. each one says the server's hostname (or IP address), an optional port, and an optional trust anchor certificate. the device can use that certificate to authenticate the bootstrap server 🌸

redirect information is YANG-modeled data, formally defined by the "redirect-information" container in the YANG module from Section 6.3 πŸ’… that container looks like this tree:

           +--:(redirect-information)
              +-- redirect-information
                 +-- bootstrap-server* [address]
                    +-- address         inet:host
                    +-- port?           inet:port-number
                    +-- trust-anchor?   cms

redirect information can be trusted or untrusted πŸ“ it's trusted whenever it's obtained over a secure connection to a trusted bootstrap server, or whenever it's signed by the device's owner ✨ in every other case, it's untrusted.

trusted redirect information is useful for letting a device set up a secure connection to a specified bootstrap server πŸ”₯ that works when the redirect information includes the bootstrap server's trust anchor certificate πŸ’–

untrusted redirect information is useful for pointing a device at a bootstrap server where signed data has been staged for it to grab πŸ¦‹ heads up though: when redirect information is untrusted, devices throw out any trust anchor certificates that might be included πŸ™ˆ

how devices process redirect information is covered in Section 5.5 🫢

2.2. Onboarding Information

onboarding information provides the data a device needs to bootstrap itself and set up secure connections with other systems πŸ‘‘ as defined in this doc, onboarding information can specify details about the boot image a device must be running, an initial configuration the device must commit, and scripts that the device must successfully execute πŸ’œ

onboarding information is YANG-modeled data, formally defined by the "onboarding-information" container in the YANG module from Section 6.3 🌈 that container looks like this tree:

        +--:(onboarding-information)
           +-- onboarding-information
              +-- boot-image
              |  +-- os-name?              string
              |  +-- os-version?           string
              |  +-- download-uri*         inet:uri
              |  +-- image-verification* [hash-algorithm]
              |     +-- hash-algorithm    identityref
              |     +-- hash-value        yang:hex-string
              +-- configuration-handling?      enumeration
              +-- pre-configuration-script?    script
              +-- configuration?               binary
              +-- post-configuration-script?   script

onboarding information must be trusted for it to be of any use to a device 😭 there's no option for a device to process untrusted onboarding information, so no exceptions, periodt πŸ’…

onboarding information is trusted whenever it's obtained over a secure connection to a trusted bootstrap server, or whenever it's signed by the device's owner πŸŽ€ in every other case, it's untrusted.

how devices process onboarding information is described in Section 5.6 🌸

3. Artifacts

this doc defines three artifacts that can be made available to devices while they're bootstrapping ✨ each source of bootstrapping data says how it provides the artifacts defined in this section (see Section 4) 🧚

3.1. Conveyed Information πŸŽ€

okay so the conveyed information artifact is basically the bestie that carries the device's essential bootstrapping data πŸ’– It's how we encode the redirect information and onboarding information types from Section 2 ✨

The conveyed information artifact is a Cryptographic Message Syntax (CMS) structure, as described in [RFC5652], encoded with ASN.1 distinguished encoding rules (DER), as specified in ITU-T X.690 [ITU.X690.2015]. The CMS structure MUST contain content that conforms to the YANG module specified in Section 6.3 🧚

The conveyed information CMS structure can be signed or unsigned. When the bootstrapping data is signed, it MAY also be encrypted, but from a terminology perspective it is still "signed data", so check Section 1.2 if you're confused πŸ™ˆ

When the conveyed information artifact is unsigned and unencrypted, as it might be when it travels over trusted channels, the CMS structure's topmost content type MUST be one of the OIDs described in Section 10.3 (i.e., id-ct-sztpConveyedInfoXML or id-ct-sztpConveyedInfoJSON) or the OID id-data (1.2.840.113549.1.7.1). When id-data is used, the encoding (JSON, XML, etc.) SHOULD be communicated externally πŸ¦‹ Either way, the associated content is an octet string containing "conveyed-information" data in the expected encoding.

When the conveyed information artifact is unsigned and encrypted, as it might be over trusted channels but the operator wants only the device to be able to see the contents (for some reason πŸ‘€), the CMS structure's topmost content type MUST be the OID id-envelopedData (1.2.840.113549.1.7.3). Furthermore, the encryptedContentInfo's content type MUST be one of the OIDs described in Section 10.3 (i.e., id-ct-sztpConveyedInfoXML or id-ct-sztpConveyedInfoJSON) or the OID id-data (1.2.840.113549.1.7.1). When id-data is used, the encoding (JSON, XML, etc.) SHOULD be communicated externally. Either way, the associated content is an octet string containing "conveyed-information" data in the expected encoding πŸ’…

When the conveyed information artifact is signed and unencrypted, as it might be over untrusted channels, the CMS structure's topmost content type MUST be the OID id-signedData (1.2.840.113549.1.7.2). Furthermore, the inner eContentType MUST be one of the OIDs described in Section 10.3 (i.e., id-ct-sztpConveyedInfoXML or id-ct-sztpConveyedInfoJSON) or the OID id-data (1.2.840.113549.1.7.1). When id-data is used, the encoding (JSON, XML, etc.) SHOULD be communicated externally. Either way, the associated content or eContent is an octet string containing "conveyed-information" data in the expected encoding ✨

When the conveyed information artifact is signed and encrypted, as it might be over untrusted channels when privacy matters, the CMS structure's topmost content type MUST be the OID id-envelopedData (1.2.840.113549.1.7.3). Furthermore, the encryptedContentInfo's content type MUST be the OID id-signedData (1.2.840.113549.1.7.2), whose eContentType MUST be one of the OIDs described in Section 10.3 (i.e., id-ct-sztpConveyedInfoXML or id-ct-sztpConveyedInfoJSON), or the OID id-data (1.2.840.113549.1.7.1). When id-data is used, the encoding (JSON, XML, etc.) SHOULD be communicated externally. Either way, the associated content or eContent is an octet string containing "conveyed-information" data in the expected encoding 🌈


3.2. Owner Certificate 🌸

the owner certificate artifact is an X.509 certificate [RFC5280] that identifies an "owner" (e.g., an organization) 🏒 It can be signed by any certificate authority (CA). The owner certificate MUST have no Key Usage specified, or the Key Usage MUST, at a minimum, set the "digitalSignature" bit πŸ” The values for the owner certificate's "subject" and/or "subjectAltName" are not constrained by this document, so no drama there πŸ’–

The owner certificate is used by a device to verify the signature over the conveyed information artifact (Section 3.1) that the device should have also received, as described in Section 3.5. Specifically, the device verifies the signature using the public key in the owner certificate over the content contained within the conveyed information artifact πŸ¦‹

The owner certificate artifact is formally a CMS structure, as specified by [RFC5652], encoded using ASN.1 DER, as specified in ITU-T X.690 [ITU.X690.2015].

The owner certificate CMS structure MUST contain the owner certificate itself, as well as all intermediate certificates leading to the "pinned-domain-cert" certificate specified in the ownership voucher. The owner certificate artifact MAY optionally include the "pinned-domain-cert" as well 🧚

To support devices deployed on private networks, the owner certificate CMS structure MAY also contain suitably fresh (as determined by local policy) revocation objects, such as Certificate Revocation Lists (CRLs) [RFC5280] and OCSP Responses [RFC6960]. Having these revocation objects stapled to the owner certificate may obviate the need for the device to download them dynamically using the CRL distribution point or an Online Certificate Status Protocol (OCSP) responder specified in the associated certificates. Stapling = less fetching, it's giving efficiency πŸ™Œ

When unencrypted, the topmost content type of the owner certificate artifact's CMS structure MUST be the OID id-signedData (1.2.840.113549.1.7.2). The inner SignedData structure is the degenerate form, whereby there are no signers, which is commonly used to disseminate certificates and revocation objects πŸ“œ

When encrypted, the topmost content type of the owner certificate artifact's CMS structure MUST be the OID id-envelopedData (1.2.840.113549.1.7.3), and the encryptedContentInfo's content type MUST be the OID id-signedData (1.2.840.113549.1.7.2), whereby the inner SignedData structure is the degenerate form that has no signers and is commonly used to disseminate certificates and revocation objects πŸ’œ


3.3. Ownership Voucher πŸ‘‘

the ownership voucher artifact is used to securely identify a device's owner, as it is known to the manufacturer. The ownership voucher is signed by the device's manufacturer, so the manufacturer is kind of the hype person here πŸ“£

The ownership voucher is used to verify the owner certificate (Section 3.2) that the device should have also received, as described in Section 3.5. Specifically, the device verifies that the owner certificate has a chain of trust leading to the trusted certificate included in the ownership voucher ("pinned-domain-cert"). Note that this relationship holds even when the owner certificate is a self-signed certificate, and hence also the pinned-domain-cert 🫢

When unencrypted, the ownership voucher artifact is as defined in [RFC8366]. As described there, it is a CMS structure whose topmost content type MUST be the OID id-signedData (1.2.840.113549.1.7.2), whose eContentType MUST be the OID id-ct-animaJSONVoucher (1.2.840.113549.1.9.16.1), or the OID id-data (1.2.840.113549.1.7.1). When id-data is used, the encoding (JSON, XML, etc.) SHOULD be communicated externally. Either way, the associated content is an octet string containing ietf-voucher data in the expected encoding πŸ“

When encrypted, the topmost content type of the ownership voucher artifact's CMS structure MUST be the OID id-envelopedData (1.2.840.113549.1.7.3), and the encryptedContentInfo's content type MUST be the OID id-signedData (1.2.840.113549.1.7.2), whose eContentType MUST be the OID id-ct-animaJSONVoucher (1.2.840.113549.1.9.16.1), or the OID id-data (1.2.840.113549.1.7.1). When id-data is used, the encoding (JSON, XML, etc.) SHOULD be communicated externally. Either way, the associated content is an octet string containing ietf-voucher data in the expected encoding 🌈


3.4. Artifact Encryption πŸ”’

Each of the three artifacts MAY be individually encrypted. Encryption may be important in some environments where the content is considered sensitive, so it's giving protection πŸ›‘οΈ

Each of the three artifacts is encrypted in the same way: the unencrypted form gets encapsulated inside a CMS EnvelopedData type 🎁

As a consequence, both the conveyed information and ownership voucher artifacts are signed and then encrypted. They are never encrypted and then signed 🚫 Order matters, bestie!

This sequencing has the following advantages: it shrouds the signer's certificate, and it ensures that the owner knows the content being signed πŸ•΅οΈβ€β™€οΈ It also enables the owner to inspect an unencrypted voucher obtained from a manufacturer and then encrypt the voucher later themselves, perhaps while also stapling in current revocation objects, when they're ready to place the artifact in an unsafe location 🧁

When encrypted, the CMS MUST be encrypted using a secure device identity certificate for the device. This certificate MAY be the same as the TLS-level client certificate the device uses when connecting to bootstrap servers. The owner must possess the device's identity certificate at the time of encrypting the data. How the owner comes to possess the device's identity certificate for this purpose is outside the scope of this document, so that's a plot for another RFC πŸ“–


3.5. Artifact Groupings 🧩

The previous sections discussed the bootstrapping artifacts, but only certain groupings of these artifacts make sense to return in the various bootstrapping situations described in this document. These groupings are:

  • Unsigned Data: This artifact grouping is useful when transport-level security can be used to convey trust (e.g., HTTPS), or when the conveyed information can be processed in a provisional manner (i.e., unsigned redirect information) 🌷
  • Signed Data, without revocations: This artifact grouping is useful when signed data is needed (i.e., because the data is obtained from an untrusted source and it cannot be processed provisionally) and revocations either are not needed or can be obtained dynamically πŸ¦„
  • Signed Data, with revocations: This artifact grouping is useful when signed data is needed (i.e., because the data is obtained from an untrusted source and it cannot be processed provisionally) and when revocations are needed but cannot be obtained dynamically πŸ’€

The presence of each artifact and any distinguishing characteristics are identified for each artifact grouping in the table below ("yes" and "no" indicate whether or not the artifact is present in the artifact grouping) ✨

+---------------------+---------------+--------------+--------------+
| Artifact            | Conveyed      | Ownership    | Owner        |
| Grouping            | Information   | Voucher      | Certificate  |
+=====================+===============+==============+==============+
| Unsigned Data       | Yes, no sig   | No           | No           |
+---------------------+---------------+--------------+--------------+
| Signed Data,        | Yes, with sig | Yes, without | Yes, without |
| without revocations |               | revocations  | revocations  |
+---------------------+---------------+--------------+--------------+
| Signed Data,        | Yes, with sig | Yes, with    | Yes, with    |
| with revocations    |               | revocations  | revocations  |
+---------------------+---------------+--------------+--------------+

4. Sources of Bootstrapping Data ✨

okay so this section lists some places a device can go to grab its bootstrapping data 🧚 The list here is not meant to be exhaustive, so future documents can add more sources πŸ’… For every source covered below, we spell out how the three artifacts from Section 3 actually get delivered πŸŽ€

4.1. Removable Storage

A directly attached removable storage device (think a USB flash drive πŸ“) MAY be used as a source of SZTP bootstrapping data πŸ¦‹

This is giving "no infrastructure needed" energy ✨ Removable storage is so compelling because it does not require any external infrastructure to work. It's also notable that the raw boot image file can live on the removable storage device too, so the stick can be a fully self-standing bootstrapping solution πŸ’œ

To use one, a device only needs to detect that the drive is plugged in and mount its filesystem πŸ”Œ

Big caveat: a removable storage device is an untrusted source of bootstrapping data πŸ™ˆ So the information stored on it either MUST be signed or MUST be information that can be processed provisionally (e.g., unsigned redirect information).

Since the stick shows up as a filesystem, the bootstrapping artifacts have to be presented as files. Here's the artifact-to-file mapping:

  • Artifact to File Mapping:
    • Conveyed Information: mapped to a file containing the binary artifact described in Section 3.1 (e.g., conveyed-information.cms).
    • Owner Certificate: mapped to a file containing the binary artifact described in Section 3.2 (e.g., owner-certificate.cms).
    • Ownership Voucher: mapped to a file containing the binary artifact described in Section 3.3 (e.g., ownership-voucher.cms or ownership-voucher.vcj).

The format of the filesystem and the naming of the files are outside the scope of this document πŸ—‚οΈ BUT for interoperability's sake, it is RECOMMENDED that devices support open and/or standards-based filesystems. It is also RECOMMENDED that devices assume a file naming convention that lets more than one instance of bootstrapping data (i.e., for different devices) live on one removable storage device 🌈 And the file naming convention SHOULD additionally be unique to the manufacturer, so bootstrapping data from multiple manufacturers can coexist on the same stick πŸ‘‘

4.2. DNS Server

A DNS server MAY be used as a source of SZTP bootstrapping data 🌸

DNS is a compelling option for deployments that already have DNS infrastructure 🫢 It's a touchless bootstrapping option that doesn't mean relying on an Internet-based resource hosted by a third party.

DNS is an untrusted source too 😭 Even if DNSSEC [RFC6698] is used to authenticate the various DNS resource records (e.g., A, AAAA, CERT, TXT, and TLSA), the device can't be sure that the domain returned to it (e.g., from a DHCP server) belongs to its rightful owner. So the information stored in the DNS records either MUST be signed (per this document, not DNSSEC) or MUST be information that can be processed provisionally (e.g., unsigned redirect information).

4.2.1. DNS Queries

Devices claiming to support DNS as a source of bootstrapping data MUST first query for device-specific DNS records and then, only if doing so does not result in a successful bootstrap, MUST query for device-independent DNS records πŸ”

For each of the device-specific and device-independent queries, devices MUST first query using multicast DNS [RFC6762] and then, only if doing so does not result in a successful bootstrap, MUST query again using unicast DNS [RFC1035] [RFC7766]. This assumes the address of a DNS server is known, such as it may be using techniques similar to those described in Section 11 of [RFC6763] 🧭

When querying for device-specific DNS records, devices MUST query for TXT records [RFC1035] under "<serial-number>._sztp", where <serial-number> is the device's serial number (the same value as in the device's secure device identity certificate), and "_sztp" is the globally scoped DNS attribute registered per this document (see Section 10.7) πŸͺͺ

Example device-specific DNS record queries:

TXT in <serial-number>._sztp.local.  (multicast)
TXT in <serial-number>._sztp.<domain>.  (unicast)

When querying for device-independent DNS records, devices MUST query for SRV records [RFC2782] under "_sztp._tcp", where "_sztp" is the service name registered per this document (see Section 10.6), and "_tcp" is the globally scoped DNS attribute registered per [RFC8552] πŸŽ€

Note that a device-independent response is only able to encode unsigned data anyway, since signed data needs a device-specific ownership voucher πŸ™ƒ Using SRV records maximumly leverages existing DNS standards 🀌 A response containing multiple SRV records is comparable to an unsigned redirect information's list of bootstrap servers πŸ¦‹

Example device-independent DNS record queries:

SRV in _sztp._tcp.local.  (multicast)
SRV in _sztp._tcp.<domain>.  (unicast)

4.2.2. DNS Response for Device-Specific Queries

For device-specific queries, the three bootstrapping artifacts from Section 3 get encoded into the TXT records using key/value pairs, similar to the technique in Section 6.3 of [RFC6763] 🧁

  • Artifact to TXT Record Mapping:
    • Conveyed Information: mapped to a TXT record having the key "ci" and the value being the binary artifact described in Section 3.1.
    • Owner Certificate: mapped to a TXT record having the key "oc" and the value being the binary artifact described in Section 3.2.
    • Ownership Voucher: mapped to a TXT record having the key "ov" and the value being the binary artifact described in Section 3.3.

Devices MUST ignore any other keys that may be returned πŸ™…β€β™€οΈ

Note that, despite the name, TXT records can and SHOULD (per Section 6.5 of [RFC6763]) encode binary data πŸ’œ

Here's an example device-specific response, as a user agent might present it, containing signed data. This example assumes the device's serial number is "<serial-number>", the domain is "example.com", and "<binary data>" stands in for the binary artifact:

<serial-number>._sztp.example.com. 3600 IN TXT "ci=<binary data>"
<serial-number>._sztp.example.com. 3600 IN TXT "oc=<binary data>"
<serial-number>._sztp.example.com. 3600 IN TXT "ov=<binary data>"

Note that, in the case that "ci" encodes unsigned data, the "oc" and "ov" keys would not be present in the response 🌸

4.2.3. DNS Response for Device-Independent Queries

For device-independent queries, the three bootstrapping artifacts from Section 3 get encoded into the SRV records as follows 🧩

  • Artifact to SRV Record Mapping:
    • Conveyed Information: this artifact is not supported directly. Instead, the essence of unsigned redirect information is mapped to SRV records per [RFC2782].
    • Owner Certificate: not supported. Device-independent responses never encode signed data, so there is no need for an owner certificate artifact.
    • Ownership Voucher: not supported. Device-independent responses never encode signed data, so there is no need for an ownership voucher artifact.

Here's an example device-independent response, as a user agent might present it, containing (effectively) unsigned redirect information to four bootstrap servers. This example assumes the domain is "example.com" and that there are four bootstrap servers "sztp[1-4]" πŸ–₯️

_sztp._tcp.example.com. 1800 IN SRV 0 0 443 sztp1.example.com.
_sztp._tcp.example.com. 1800 IN SRV 1 0 443 sztp2.example.com.
_sztp._tcp.example.com. 1800 IN SRV 2 0 443 sztp3.example.com.
_sztp._tcp.example.com. 1800 IN SRV 2 0 443 sztp4.example.com.

Note that in this example, "sztp3" and "sztp4" have equal priority, so they effectively represent a clustered pair of bootstrap servers πŸ‘―β€β™€οΈ While "sztp1" and "sztp2" each have only a single SRV record, that record may point to a load balancer fronting a cluster of bootstrap servers βš–οΈ

While this document does not use DNS-SD [RFC6763], per Section 12.2 of that RFC, Multicast DNS (mDNS) responses SHOULD also include all address records (type "A" and "AAAA") named in the SRV rdata πŸ“‘

4.2.4. Size of Signed Data

Okay, real talk: the signed data artifacts are large by DNS standards 😩 In the smallest-footprint scenario, each one is a few kilobytes. Onboarding information can easily be several kilobytes, and it has the potential to be many kilobytes πŸ“¦

All resource records, including TXT records, have an upper size limit of 65535 bytes, since "RDLENGTH" is a 16-bit field (Section 3.2.1 of [RFC1035]) 🚧 If it's ever desired to encode onboarding information that exceeds this limit, the DNS records returned should instead encode redirect information, so the device gets directed to a bootstrap server where the onboarding information can be fetched 🧚

Given how big TXT records are, it's unlikely that signed data will fit into a UDP-based DNS packet, even with the Extension Mechanisms for DNS (EDNS(0)) extensions [RFC6891] enabled πŸ’€ Depending on content, signed data may also not fit into a multicast DNS packet, which bounds the size to 9000 bytes, per Section 17 of [RFC6762] πŸ™ˆ So it's expected that DNS Transport over TCP [RFC7766] will be required in order to return signed data πŸ’–

4.3. DHCP Server 🌸

A DHCP server MAY be used as a source of SZTP bootstrapping data. πŸ’–

Using a DHCP server can be a super compelling choice for deployments that already have DHCP infrastructure 🧚. It makes a touchless bootstrapping option possible, and it doesn't need an Internet-based resource hosted by some third party. Iconic. ✨

Okay, the catch: a DHCP server is an untrusted source of bootstrapping data 😬. So the information stored on the DHCP server either MUST be signed or MUST be information that can be processed provisionally (e.g., unsigned redirect information). No skipping this part, bestie.

Here's the tea. Unlike the other bootstrapping sources in this document, the DHCP protocol (especially DHCP for IPv4) is super limited in how much data it can carry. It's so limited that signed data can't be communicated at all πŸ’€. That means only unsigned redirect information can be conveyed over DHCP.

Since the redirect information is unsigned, it SHOULD NOT include the optional trust anchor certificate. It takes up space in the DHCP message, and the device would have to throw it away anyway πŸ™ˆ. That's why the DHCP options defined in Section 8 don't let the trust anchor certificate be encoded. Logic. πŸ’…

Now let's look at how the three artifacts from Section 3 map onto the DHCP fields in Section 8:

Artifact to DHCP Option Fields Mapping:

  • Conveyed Information: This artifact isn't supported directly 😭. Instead, the essence of unsigned redirect information gets mapped to the DHCP options described in Section 8.
  • Owner Certificate: Not supported. There just isn't enough room in the DHCP packet to hold an owner certificate artifact.
  • Ownership Voucher: Not supported. Same deal, there isn't enough room in the DHCP packet to hold an ownership voucher artifact.

4.4. Bootstrap Server πŸ¦‹

A bootstrap server MAY be used as a source of SZTP bootstrapping data. A bootstrap server is defined as a RESTCONF [RFC8040] server that implements the YANG module provided in Section 7.

Using a bootstrap server as a bootstrapping source is a compelling option πŸ”₯. It MAY use transport-level security, so the data doesn't need to be signed, which can be easier to deploy in some situations. Big brain energy. 🧠

Here's what makes it different from every other source in this document: a bootstrap server isn't just a source of data. It can also receive data from devices, using the YANG-defined "report-progress" RPC from the YANG module in Section 7.3 πŸŽ€. That RPC gives visibility into the bootstrapping process (think warnings and errors) and passes along potentially useful info once it's done (for example, the device's Secure Shell (SSH) host keys and/or TLS trust anchor certificates). Literally so useful. πŸ‘‘

Whether a bootstrap server is trusted or untrusted depends on whether the device learned about the server's trust anchor from a trusted source πŸ€”. When a bootstrap server is trusted, the conveyed information it returns MAY be signed. When it's untrusted, the conveyed information either MUST be signed or MUST be information that can be processed provisionally (e.g., unsigned redirect information). Not me being a stickler, but this part matters. πŸ™ˆ

Artifact-wise, a bootstrap server presents data that follows a YANG data model, so the bootstrapping artifacts need to be mapped to YANG nodes 🧚. The three artifacts from Section 3 map to the "output" nodes of the "get-bootstrapping-data" RPC defined in Section 7.3.

Artifact to Bootstrap Server Mapping:

  • Conveyed Information: Mapped to the conveyed-information leaf in the output of the "get-bootstrapping-data" RPC.
  • Owner Certificate: Mapped to the owner-certificate leaf in the output of the "get-bootstrapping-data" RPC.
  • Ownership Voucher: Mapped to the ownership-voucher leaf in the output of the "get-bootstrapping-data" RPC.

SZTP bootstrap servers have only two endpoints πŸ’œ: one for the "get-bootstrapping-data" RPC and one for the "report-progress" RPC.

Both RPCs use the authenticated RESTCONF username to keep the execution of each RPC isolated from other devices. Privacy queen behavior. πŸ‘‘


5. Device Details ✨

Devices that support the bootstrapping strategy in this document MUST have the pre-configured state and bootstrapping logic described in the following sections. No exceptions, bestie. πŸ’…

5.1. Initial State πŸŽ€

      +-------------------------------------------------------------+
      |                          <device>                           |
      |                                                             |
      | +---------------------------------------------------------+ |
      | |                   <read/write storage>                  | |
      | |                                                         | |
      | | 1.  flag to enable SZTP bootstrapping set to "true"     | |
      | +---------------------------------------------------------+ |
      |                                                             |
      | +---------------------------------------------------------+ |
      | |                   <read-only storage>                   | |
      | |                                                         | |
      | | 2.  TLS client cert & related intermediate certificates | |
      | | 3.  list of trusted well-known bootstrap servers        | |
      | | 4.  list of trust anchor certs for bootstrap servers    | |
      | | 5.  list of trust anchor certs for ownership vouchers   | |
      | +---------------------------------------------------------+ |
      |                                                             |
      |   +-----------------------------------------------------+   |
      |   |                 <secure storage>                    |   |
      |   |                                                     |   |
      |   |  6.  private key for TLS client certificate         |   |
      |   |  7.  private key for decrypting SZTP artifacts      |   |
      |   +-----------------------------------------------------+   |
      |                                                             |
      +-------------------------------------------------------------+

Each numbered item below matches a numbered item in the diagram above πŸ‘€.

  1. Devices MUST have a configurable variable that's used to enable or disable SZTP bootstrapping. This variable MUST be enabled by default so SZTP bootstrapping runs when the device first powers on. Here's the thing: the goal is for the configuration installed by the bootstrapping process to disable SZTP bootstrapping, and the configuration may be merged into the existing configuration. So using a configuration node that relies on presence is NOT RECOMMENDED, because the merging process can't remove it. πŸ™ˆ
  2. Devices that support loading bootstrapping data from bootstrap servers (see Section 4.4) SHOULD possess a TLS-level client certificate, plus any intermediate certificates leading to that certificate's well-known trust anchor. The well-known trust anchor certificate can be an intermediate certificate or a self-signed root certificate. For devices that don't have a client certificate, devices MAY, alternatively or in addition to, identify and authenticate themselves to the bootstrap server using an HTTP authentication scheme, as allowed by Section 2.5 of [RFC8040]. Heads up though: this document doesn't define a mechanism for operator input, like entering a password. πŸ”
  3. Devices that support loading bootstrapping data from well-known bootstrap servers MUST possess a list of those well-known bootstrap servers. Matching the redirect information in Section 2.1, each bootstrap server can be identified by its hostname or IP address and an optional port. πŸ“
  4. Devices that support loading bootstrapping data from well-known bootstrap servers MUST also possess a list of trust anchor certificates that can be used to authenticate those servers. For each trust anchor certificate that isn't itself a self-signed root certificate, the device SHOULD also possess the chain of intermediate certificates leading up to and including the self-signed root certificate. πŸ”—
  5. Devices that support loading signed data (see Section 1.2) MUST possess the trust anchor certificates for validating ownership vouchers. For each trust anchor certificate that isn't itself a self-signed root certificate, the device SHOULD also possess the chain of intermediate certificates leading up to and including the self-signed root certificate. βœ…
  6. Devices that support using a TLS-level client certificate to identify and authenticate themselves to a bootstrap server MUST possess the private key that matches the public key encoded in that TLS-level client certificate. This private key SHOULD be stored securely, ideally in a cryptographic processor like a trusted platform module (TPM) chip. Locked down. πŸ”’
  7. Devices that support decrypting SZTP artifacts MUST possess the private key that matches the public key encoded in the secure device identity certificate used when encrypting the artifacts. This private key SHOULD be stored securely, ideally in a cryptographic processor like a trusted platform module (TPM) chip. This private key MAY be the same one associated with the TLS-level client certificate used when connecting to bootstrap servers. Efficient queen. πŸ‘‘

A YANG module representing this data is provided in Appendix A. πŸ“¦

5.2. Boot Sequence πŸš€

A device claiming to support the bootstrapping strategy defined in this document MUST support the boot sequence described in this section. Non-negotiable. πŸ’–

        Power On
            |
            v                           No
    1.  SZTP bootstrapping configured ------> Boot normally
            |
            | Yes
            v
    2.  For each supported source of bootstrapping data,
        try to load bootstrapping data from the source
            |
            |
            v                               Yes
    3.  Able to bootstrap from any source? -----> Run with new config
            |
            | No
            v
    4.  Loop back to Step 1
    Note: At any time, the device MAY be configured via an alternate
          provisioning mechanism (e.g., command-line interface (CLI)).

Each numbered item below matches a numbered item in the diagram above 🧩.

  1. When the device powers on, it first checks whether SZTP bootstrapping is configured, which is expected to be the case for the device's pre-configured initial state. If SZTP bootstrapping isn't configured, the device boots normally. πŸŒ…
  2. The device goes through its list of sources for bootstrapping data (Section 4). Details on how to process a source of bootstrapping data are in Section 5.3. πŸ”
  3. If the device can bootstrap itself from any of the sources, it runs with the new bootstrapped configuration. Slay. ✨
  4. Otherwise, the device MUST loop back through the list of bootstrapping sources again. Round and round we go. πŸ”„

This document doesn't limit the simultaneous use of alternate provisioning mechanisms. These might include a CLI, a web-based user interface, or even another bootstrapping protocol 🌈. Regardless of how it's configured, the configuration SHOULD unset the flag that enables SZTP bootstrapping, as discussed in Section 5.1. Clean exit energy. 🫢

5.3. Processing a Source of Bootstrapping Data

okay so this section is the recursive algorithm devices use to finally grab their onboarding info πŸ’… It's recursive because sources can send back redirect info, and then the whole algorithm reruns for the newly found sources πŸ” Every successful sequence boils down to: zero or more redirect information responses, followed by one onboarding information response ✨

An important part is knowing when data needs to be signed (and when it doesn't) πŸ‘€ Here's the cheat sheet:

                                 Untrusted Source  Trusted Source
   Kind of Bootstrapping Data     Can Provide?     Can Provide?

   Unsigned Redirect Info     :       Yes+             Yes
   Signed Redirect Info       :       Yes              Yes*
   Unsigned Onboarding Info   :        No              Yes
   Signed Onboarding Info     :       Yes              Yes*

The + means the source that got redirected to MUST return signed data or more unsigned redirect information πŸ™…β€β™€οΈ The * means that, while it's possible, it's generally unnecessary for a trusted source to return signed data πŸ€·β€β™€οΈ

The algorithm keeps track of a conceptual, globally scoped variable called "trust-state" 🧠 It starts out as FALSE. The big goal is for the device to process onboarding information (Section 2.2) while trust-state is TRUE 🎯

If the source of bootstrapping data (Section 4) is a bootstrap server (Section 4.4), and the device can authenticate that server with X.509 certificate path validation ([RFC6125], Section 6) to one of its pre-configured trust anchors, or to a trust anchor it learned in a previous step, then the device MUST set trust-state to TRUE πŸ”

When connecting to a bootstrap server, trusted or not, the device MUST identify and authenticate itself using a TLS-level client certificate and/or an HTTP authentication scheme, per Section 2.5 of [RFC8040] πŸͺͺ If both mechanisms are used, they MUST both identify the same serial number πŸ’•

When sending a client certificate, the device MUST also send all of the intermediate certificates leading up to, and optionally including, the client certificate's well-known trust anchor certificate 🧢

For any source of bootstrapping data (e.g., Section 4), if an artifact obtained is encrypted, the device MUST first decrypt it using the private key associated with the device certificate that was used to encrypt the artifact πŸ—οΈ

If the conveyed information artifact is signed, and the device can validate the signed data using the algorithm in Section 5.4, then the device MUST set trust-state to TRUE βœ… Otherwise, if the device can't validate the signed data, the device MUST set trust-state to FALSE ❌ This is worded to cover the special case where signed data comes back even from a trusted source of bootstrapping data 🫢

If the conveyed information artifact contains redirect information, the device MUST, within the limits of how many recursive loops it allows, process the redirect information as described in Section 5.5 πŸ” Implementations MUST limit the maximum number of recursive redirects allowed, and that maximum SHOULD be no more than ten πŸ›‘ This is the recursion step. It makes the device reenter this algorithm, but this time the data source will definitely be a bootstrap server, since redirect information can only redirect devices to bootstrap servers 🧚

If the conveyed information artifact contains onboarding information and trust-state is FALSE, the device MUST exit the recursive algorithm (because that's not allowed, see the figure above) and return to the bootstrapping sequence in Section 5.2 🚫 Otherwise, the device MUST attempt to process the onboarding information as described in Section 5.6 πŸŽ‰ Whether processing the onboarding information succeeds or fails, the device MUST exit the recursive algorithm and return to the bootstrapping sequence in Section 5.2. The only difference is how it responds to the "Able to bootstrap from any source?" conditional in the figure in that section 🌸


5.4. Validating Signed Data

Whenever a device is presented with signed data, it MUST validate that signed data as described in this section πŸ” That includes the case where the signed data comes from a trusted source πŸ’…

Whenever there's signed data, the device MUST also be provided an ownership voucher and an owner certificate πŸ“œ How all the needed artifacts get provided for each source of bootstrapping data is described in Section 4 πŸ—ΊοΈ

To validate signed data, the device MUST first authenticate the ownership voucher by validating its signature to one of its pre-configured trust anchors (see Section 5.1). This may entail using additional intermediate certificates attached to the ownership voucher 🧡 If the device has an accurate clock, it MUST verify that the ownership voucher was created in the past (i.e., "created-on" < now). If the "expires-on" leaf is present, the device MUST verify that the ownership voucher has not yet expired (i.e., now < "expires-on") ⏰ The device MUST verify that the ownership voucher's "assertion" value is acceptable (e.g., some devices may only accept the assertion value "verified") βœ”οΈ The device MUST verify that the ownership voucher specifies the device's serial number in the "serial-number" leaf πŸ”’ If the "idevid-issuer" leaf is present, the device MUST verify that the value is set correctly 🧾 If authenticating the ownership voucher succeeds, the device extracts the "pinned-domain-cert" node, an X.509 certificate, which is needed to verify the owner certificate in the next step πŸͺ„

The device MUST next authenticate the owner certificate by performing X.509 certificate path verification to the trusted certificate extracted from the ownership voucher's "pinned-domain-cert" node πŸ”— This verification may entail using additional intermediate certificates attached to the owner certificate artifact. If the ownership voucher's "domain-cert-revocation-checks" node is set to "true", the device MUST verify the revocation status of the certificate chain used to sign the owner certificate. If a suitably fresh revocation status is unattainable, or if it's determined that a certificate has been revoked, the device MUST NOT validate the owner certificate 🚷

Finally, the device MUST verify that the conveyed information artifact was signed by the validated owner certificate 🏁

If any of these steps fail, the device MUST invalidate the signed data and not perform any subsequent steps πŸ’€


5.5. Processing Redirect Information

To process redirect information (Section 2.1), the device MUST follow the steps in this section 🧭

Honestly, processing redirect information is pretty straightforward ✨ The device just steps through the list of provided bootstrap servers in order until it finds one it can bootstrap from πŸ¦‹

If a hostname is provided and its DNS resolution is to more than one IP address, the device MUST attempt to connect to all of the DNS-resolved addresses at least once before moving on to the next bootstrap server 🌐 If the device can get bootstrapping data from any of the DNS-resolved addresses, it MUST immediately process that data, without attempting to connect to any of the other DNS-resolved addresses πŸƒβ€β™€οΈ

If the redirect information is trusted (e.g., trust-state is TRUE) and the bootstrap server entry contains a trust anchor certificate, then the device MUST authenticate the specified bootstrap server's TLS server certificate using X.509 certificate path validation ([RFC6125], Section 6) to the specified trust anchor πŸ›‘οΈ If the bootstrap server entry does not contain a trust anchor certificate, the device MUST establish a provisional connection to the bootstrap server (i.e., by blindly accepting its server certificate) and set trust-state to FALSE 🫣

If the redirect information is untrusted (e.g., trust-state is FALSE), the device MUST discard any trust anchors provided by the redirect information and establish a provisional connection to the bootstrap server (i.e., by blindly accepting its TLS server certificate) πŸ™ˆ

5.6. Processing Onboarding Information ✨

Okay bestie, to process onboarding information (Section 2.2), the device MUST follow the steps in this section. πŸ’–

When it's processing onboarding information, the device MUST first process the boot image information (if any), then execute the pre-configuration script (if any), then commit the initial configuration (if any), and then execute the post-configuration script (if any), in that order. πŸŽ€

When the onboarding information comes from a trusted bootstrap server, the device MUST send the "bootstrap-initiated" progress report and send a terminating "boot-image-installed-rebooting", "bootstrap-complete", or error-specific progress report. If the "reporting-level" node of the bootstrap server's "get-bootstrapping-data" RPC-reply is the value "verbose", the device MUST additionally send all appropriate non-terminating progress reports (e.g., initiated, warning, complete, etc.). Regardless of the reporting level requested by the bootstrap server, the device MAY send progress reports beyond those required by the reporting level. πŸ“£

When the onboarding information comes from an untrusted bootstrap server, the device MUST NOT send any progress reports to the bootstrap server, even though the onboarding information was, necessarily, signed and authenticated. Please be aware that bootstrap servers are recommended to promote untrusted connections to trusted connections, in the last paragraph of Section 9.6, so as to, in part, be able to collect progress reports from devices. πŸ™ˆ

If the device hits an error at any step, it MUST stop processing the onboarding information and return to the bootstrapping sequence described in Section 5.2. In the context of a recursive algorithm, the device MUST return to the enclosing loop, not back to the very beginning. Some state MAY be retained from the bootstrapping process (e.g., updated boot image, logs, remnants from a script, etc.). However, the retained state MUST NOT be active in any way (e.g., no new configuration or running of software) and MUST NOT hinder the ability for the device to continue the bootstrapping sequence (i.e., process onboarding information from another bootstrap server). It's giving "clean slate, but keep your receipts" 🧾

At this point, the specific ordered sequence of actions the device MUST perform is described. Let's gooo. πŸš€

If the onboarding information is obtained from a trusted bootstrap server, the device MUST send a "bootstrap-initiated" progress report. It is an error if the device does not receive back the "204 No Content" HTTP status line. If an error occurs, the device MUST try to send a "bootstrap-error" progress report before exiting. 🌸

The device MUST parse the provided onboarding information document, to extract values used in subsequent steps. Whether using a stream-based parser or not, if there is an error when parsing the onboarding information, and the device is connected to a trusted bootstrap server, the device MUST try to send a "parsing-error" progress report before exiting. 🧚

If boot image criteria are specified, the device MUST first determine if the boot image it is running satisfies the specified boot image criteria. If the device is already running the specified boot image, then it skips the remainder of this step. If the device is not running the specified boot image, then it MUST download, verify, and install, in that order, the specified boot image, and then reboot. If connected to a trusted bootstrap server, the device MAY try to send a "boot-image-mismatch" progress report. To download the boot image, the device MUST only use the URIs supplied by the onboarding information. To verify the boot image, the device MUST use either one of the verification fingerprints supplied by the onboarding information or a cryptographic signature embedded into the boot image itself using a mechanism not described by this document. Before rebooting, if connected to a trusted bootstrap server, the device MUST try to send a "boot-image-installed-rebooting" progress report. Upon rebooting, the bootstrapping process runs again, which will eventually come to this step again, but then the device will be running the specified boot image and thus will move to processing the next step. If an error occurs at any step while the device is connected to a trusted bootstrap server (i.e., before the reboot), the device MUST try to send a "boot-image-error" progress report before exiting. πŸ’Ώ

If a pre-configuration script has been specified, the device MUST execute the script, capture any output emitted from the script, and check if the script had any warnings or errors. If an error occurs while the device is connected to a trusted bootstrap server, the device MUST try to send a "pre-script-error" progress report before exiting. πŸ“œ

If an initial configuration has been specified, the device MUST atomically commit the provided initial configuration, using the approach specified by the "configuration-handling" leaf. If an error occurs while the device is connected to a trusted bootstrap server, the device MUST try to send a "config-error" progress report before exiting. βš™οΈ

If a post-configuration script has been specified, the device MUST execute the script, capture any output emitted from the script, and check if the script had any warnings or errors. If an error occurs while the device is connected to a trusted bootstrap server, the device MUST try to send a "post-script-error" progress report before exiting. πŸ“œ

If the onboarding information was obtained from a trusted bootstrap server, and the result of the bootstrapping process did not disable the "flag to enable SZTP bootstrapping" described in Section 5.1, the device SHOULD send an "bootstrap-warning" progress report. ⚠️

If the onboarding information was obtained from a trusted bootstrap server, the device MUST send a "bootstrap-complete" progress report. It is an error if the device does not receive back the "204 No Content" HTTP status line. If an error occurs, the device MUST try to send a "bootstrap-error" progress report before exiting. πŸŽ‰

At this point, the device has completely processed the bootstrapping data. Done and dusted. πŸ’…

The device is now running its initial configuration. Notably, if NETCONF Call Home or RESTCONF Call Home [RFC8071] is configured, the device initiates trying to establish the call home connections at this time. πŸ¦‹

Implementation Notes:

Implementations may vary in how to ensure no unwanted state is retained when an error occurs. 🧹

If the implementation chooses to undo previous steps, the following guidelines apply:

  • When an error occurs, the device must rollback the current step and any previous steps.
  • Most steps are atomic. For example, the processing of a configuration is atomic (as specified above), and the processing of scripts is atomic (as specified in the "ietf-sztp-conveyed-info" YANG module).
  • In case the error occurs after the initial configuration was committed, the device must restore the configuration to the configuration that existed prior to the configuration being committed.
  • In case the error occurs after a script had executed successfully, it may be helpful for the implementation to define scripts as being able to take a conceptual input parameter indicating that the script should remove its previously set state.

6. The Conveyed Information Data Model 🌈

This section defines a YANG 1.1 [RFC7950] module that is used to define the data model for the conveyed information artifact described in Section 3.1. This data model uses the "yang-data" extension statement defined in [RFC8040]. Examples illustrating this data model are provided in Section 6.2. 🧠

6.1. Data Model Overview

The following tree diagram provides an overview of the data model for the conveyed information artifact. Main character energy in tree form. 🌳

      module: ietf-sztp-conveyed-info

        yang-data conveyed-information:
          +-- (information-type)
             +--:(redirect-information)
             |  +-- redirect-information
             |     +-- bootstrap-server* [address]
             |        +-- address         inet:host
             |        +-- port?           inet:port-number
             |        +-- trust-anchor?   cms
             +--:(onboarding-information)
                +-- onboarding-information
                   +-- boot-image
                   |  +-- os-name?              string
                   |  +-- os-version?           string
                   |  +-- download-uri*         inet:uri
                   |  +-- image-verification* [hash-algorithm]
                   |     +-- hash-algorithm    identityref
                   |     +-- hash-value        yang:hex-string
                   +-- configuration-handling?      enumeration
                   +-- pre-configuration-script?    script
                   +-- configuration?               binary
                   +-- post-configuration-script?   script

6.2. Example Usage

The following example illustrates how redirect information (Section 2.1) can be encoded using JSON [RFC8259]. Redirect vibes only. πŸ¦‹

{
  "ietf-sztp-conveyed-info:redirect-information" : {
    "bootstrap-server" : [
      {
        "address" : "sztp1.example.com",
        "port" : 8443,
        "trust-anchor" : "base64encodedvalue=="
      },
      {
        "address" : "sztp2.example.com",
        "port" : 8443,
        "trust-anchor" : "base64encodedvalue=="
      },
      {
        "address" : "sztp3.example.com",
        "port" : 8443,
        "trust-anchor" : "base64encodedvalue=="
      }
    ]
  }
}

The following example illustrates how onboarding information (Section 2.2) can be encoded using JSON [RFC8259].

[Note: '' line wrapping for formatting only]

{
  "ietf-sztp-conveyed-info:onboarding-information" : {
    "boot-image" : {
      "os-name" : "VendorOS",
      "os-version" : "17.2R1.6",
      "download-uri" : [ "https://example.com/path/to/image/file" ],
      "image-verification" : [
        {
          "hash-algorithm" : "ietf-sztp-conveyed-info:sha-256",
          "hash-value" : "ba:ec:cf:a5:67:82:b4:10:77:c6:67:a6:22:ab:\
7d:50:04:a7:8b:8f:0e:db:02:8b:f4:75:55:fb:c1:13:b2:33"
        }
      ]
    },
    "configuration-handling" : "merge",
    "pre-configuration-script" : "base64encodedvalue==",
    "configuration" : "base64encodedvalue==",
    "post-configuration-script" : "base64encodedvalue=="
  }
}

6.3. YANG Module πŸŽ€

okay so this is the good part bestie 😭 the whole conveyed information data model is written down as an actual YANG module right here, and it's giving full spec energy. πŸ’…

this module pulls in data types from [RFC5280], [RFC5652], [RFC6234], and [RFC6991], borrows an extension statement from [RFC8040], and uses an encoding defined in [ITU.X690.2015]. so many references, so much structure, iconic 🧚

<CODE BEGINS> file "ietf-sztp-conveyed-info@2019-04-30.yang"
module ietf-sztp-conveyed-info {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-sztp-conveyed-info";
  prefix sztp-info;

  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-inet-types {
    prefix inet;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-restconf {
    prefix rc;
    reference
      "RFC 8040: RESTCONF Protocol";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>
     Author:   Kent Watsen <mailto:kent+ietf@watsen.net>";
  description
    "This module defines the data model for the conveyed
     information artifact defined in RFC 8572 ('Secure Zero Touch
     Provisioning (SZTP)').

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
     'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
     'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
     are to be interpreted as described in BCP 14 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.

     Copyright (c) 2019 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC 8572; see the
     RFC itself for full legal notices.";

  revision 2019-04-30 {
    description
      "Initial version";
    reference
      "RFC 8572: Secure Zero Touch Provisioning (SZTP)";
  }

  // identities

  identity hash-algorithm {
    description
      "A base identity for hash algorithm verification.";
  }

  identity sha-256 {
    base hash-algorithm;
    description
      "The SHA-256 algorithm.";
    reference
      "RFC 6234: US Secure Hash Algorithms";
  }

  // typedefs

  typedef cms {
    type binary;
    description
      "A ContentInfo structure, as specified in RFC 5652,
       encoded using ASN.1 distinguished encoding rules (DER),
       as specified in ITU-T X.690.";
    reference
      "RFC 5652:
         Cryptographic Message Syntax (CMS)

       ITU-T X.690:
         Information technology - ASN.1 encoding rules:
         Specification of Basic Encoding Rules (BER),
         Canonical Encoding Rules (CER) and Distinguished
         Encoding Rules (DER)";
  }

  // yang-data
  rc:yang-data conveyed-information {
    choice information-type {
      mandatory true;
      description
        "This choice statement ensures the response contains
         redirect-information or onboarding-information.";
      container redirect-information {
        description
          "Redirect information is described in Section 2.1 of
           RFC 8572.  Its purpose is to redirect a device to
           another bootstrap server.";
        reference
          "RFC 8572: Secure Zero Touch Provisioning (SZTP)";
        list bootstrap-server {
          key "address";
          min-elements 1;
          description
            "A bootstrap server entry.";
          leaf address {
            type inet:host;
            mandatory true;
            description
              "The IP address or hostname of the bootstrap server the
               device should redirect to.";
          }
          leaf port {
            type inet:port-number;
            default "443";
            description
              "The port number the bootstrap server listens on.  If no
               port is specified, the IANA-assigned port for 'https'
               (443) is used.";
          }
          leaf trust-anchor {
            type cms;
            description
              "A CMS structure that MUST contain the chain of
               X.509 certificates needed to authenticate the TLS
               certificate presented by this bootstrap server.

               The CMS MUST only contain a single chain of
               certificates.  The bootstrap server MUST only
               authenticate to last intermediate CA certificate
               listed in the chain.

               In all cases, the chain MUST include a self-signed
               root certificate.  In the case where the root
               certificate is itself the issuer of the bootstrap
               server's TLS certificate, only one certificate
               is present.

               If needed by the device, this CMS structure MAY
               also contain suitably fresh revocation objects
               with which the device can verify the revocation
               status of the certificates.

               This CMS encodes the degenerate form of the SignedData
               structure that is commonly used to disseminate X.509
               certificates and revocation objects (RFC 5280).";
            reference
              "RFC 5280:
                 Internet X.509 Public Key Infrastructure Certificate
                 and Certificate Revocation List (CRL) Profile";
          }
        }
      }
      container onboarding-information {
        description
          "Onboarding information is described in Section 2.2 of
           RFC 8572.  Its purpose is to provide the device everything
           it needs to bootstrap itself.";
        reference
          "RFC 8572: Secure Zero Touch Provisioning (SZTP)";
        container boot-image {
          description
            "Specifies criteria for the boot image the device MUST
             be running, as well as information enabling the device
             to install the required boot image.";
          leaf os-name {
            type string;
            description
              "The name of the operating system software the device
               MUST be running in order to not require a software
               image upgrade (e.g., VendorOS).";
          }
          leaf os-version {
            type string;
            description
              "The version of the operating system software the
               device MUST be running in order to not require a
               software image upgrade (e.g., 17.3R2.1).";
          }
          leaf-list download-uri {
            type inet:uri;
            ordered-by user;
            description
              "An ordered list of URIs to where the same boot image
               file may be obtained.  How the URI schemes (http, ftp,
               etc.) a device supports are known is vendor specific.
               If a secure scheme (e.g., https) is provided, a device
               MAY establish an untrusted connection to the remote
               server, by blindly accepting the server's end-entity
               certificate, to obtain the boot image.";
          }
          list image-verification {
            must '../download-uri' {
              description
                "Download URIs must be provided if an image is to
                 be verified.";
            }
            key "hash-algorithm";
            description
              "A list of hash values that a device can use to verify
               boot image files with.";
            leaf hash-algorithm {
              type identityref {
                base hash-algorithm;
              }
              description
                "Identifies the hash algorithm used.";
            }
            leaf hash-value {
              type yang:hex-string;
              mandatory true;
              description
                "The hex-encoded value of the specified hash
                 algorithm over the contents of the boot image
                 file.";
            }
          }
        }
        leaf configuration-handling {
          type enumeration {
            enum merge {

              description
                "Merge configuration into the running datastore.";
            }
            enum replace {
              description
                "Replace the existing running datastore with the
                 passed configuration.";
            }
          }
          must '../configuration';
          description
            "This enumeration indicates how the server should process
             the provided configuration.";
        }
        leaf pre-configuration-script {
          type script;
          description
            "A script that, when present, is executed before the
             configuration has been processed.";
        }
        leaf configuration {
          type binary;
          must '../configuration-handling';
          description
            "Any configuration known to the device.  The use of
             the 'binary' type enables content (e.g., XML) to be
             embedded into a JSON document.  The exact encoding
             of the content, as with the scripts, is vendor
             specific.";
        }
        leaf post-configuration-script {
          type script;
          description
            "A script that, when present, is executed after the
             configuration has been processed.";
        }
      }
    }
  }

  typedef script {
    type binary;
    description
      "A device-specific script that enables the execution of
       commands to perform actions not possible thru configuration
       alone.

       No attempt is made to standardize the contents, running
       context, or programming language of the script, other than
       that it can indicate if any warnings or errors occurred and
       can emit output.  The contents of the script are considered
       specific to the vendor, product line, and/or model of the
       device.

       If the script execution indicates that a warning occurred,
       then the device MUST assume that the script had a soft error
       that the script believes will not affect manageability.

       If the script execution indicates that an error occurred,
       the device MUST assume the script had a hard error that the
       script believes will affect manageability.  In this case,
       the script is required to gracefully exit, removing any
       state that might hinder the device's ability to continue
       the bootstrapping sequence (e.g., process onboarding
       information obtained from another bootstrap server).";
  }
}
<CODE ENDS>

7. The SZTP Bootstrap Server API ✨

okay so this section is where the bootstrap server's API gets defined πŸ¦‹ the API is the one produced by a RESTCONF [RFC8040] server that supports the YANG 1.1 [RFC7950] module defined in this section. so basically the server speaks RESTCONF and understands that YANG module, and that's the whole vibe πŸ’œ

7.1. API Overview ✨

okay so this is the map of the bootstrap server's RESTCONF API, and it's giving tree diagram energy πŸŒ³πŸ—ΊοΈ bestie, let's look at it together

module: ietf-sztp-bootstrap-server

  rpcs:
    +---x get-bootstrapping-data
    |  +---w input
    |  |  +---w signed-data-preferred?   empty
    |  |  +---w hw-model?                string
    |  |  +---w os-name?                 string
    |  |  +---w os-version?              string
    |  |  +---w nonce?                   binary
    |  +--ro output
    |     +--ro reporting-level?    enumeration {onboarding-server}?
    |     +--ro conveyed-information    cms
    |     +--ro owner-certificate?      cms
    |     +--ro ownership-voucher?      cms
    +---x report-progress {onboarding-server}?
       +---w input
          +---w progress-type         enumeration
          +---w message?              string
          +---w ssh-host-keys
          |  +---w ssh-host-key* []
          |     +---w algorithm    string
          |     +---w key-data     binary
          +---w trust-anchor-certs
             +---w trust-anchor-cert*   cms

7.2. Example Usage πŸ’…

okay this section is all about examples, and I'm obsessed 🫢 there are three of them: two for the get-bootstrapping-data RPC (one to an untrusted bootstrap server and one to a trusted bootstrap server), and one for the report-progress RPC

first up, a device fetches its bootstrapping data from an untrusted bootstrap server πŸ” here the device sends the signed-data-preferred input parameter and gets signed data back in the response, which is so iconic

REQUEST

[Note: '\' line wrapping for formatting only]

POST /restconf/operations/ietf-sztp-bootstrap-server:get-bootstrappi\
ng-data HTTP/1.1
HOST: example.com
Content-Type: application/yang.data+xml

<input
  xmlns="urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server">
  <signed-data-preferred/>
</input>

RESPONSE

HTTP/1.1 200 OK
Date: Sat, 31 Oct 2015 17:02:40 GMT
Server: example-server
Content-Type: application/yang.data+xml

<output
  xmlns="urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server">
  <conveyed-information>base64encodedvalue==</conveyed-information>
  <owner-certificate>base64encodedvalue==</owner-certificate>
  <ownership-voucher>base64encodedvalue==</ownership-voucher>
</output>

next, the same fetch but to a trusted bootstrap server 🧚 this time the device sends extra input parameters, which the bootstrap server may use when it's putting together its response to the device

REQUEST

[Note: '\' line wrapping for formatting only]

POST /restconf/operations/ietf-sztp-bootstrap-server:get-bootstrappi\
ng-data HTTP/1.1
HOST: example.com
Content-Type: application/yang.data+xml

<input
  xmlns="urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server">
  <hw-model>model-x</hw-model>
  <os-name>vendor-os</os-name>
  <os-version>17.3R2.1</os-version>
  <nonce>extralongbase64encodedvalue=</nonce>
</input>

RESPONSE

HTTP/1.1 200 OK
Date: Sat, 31 Oct 2015 17:02:40 GMT
Server: example-server
Content-Type: application/yang.data+xml

<output
  xmlns="urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server">
  <reporting-level>verbose</reporting-level>
  <conveyed-information>base64encodedvalue==</conveyed-information>
</output>

last one! πŸŽ€ this is a device posting a progress report to a bootstrap server. the example shows the "bootstrap-complete" message, but the device can send other progress reports while it's bootstrapping too 🌈 here the device sends both its SSH host keys and a TLS server certificate, which the bootstrap server may pass along to an NMS, as discussed in Appendix C.3

REQUEST

[Note: '\' line wrapping for formatting only]

POST /restconf/operations/ietf-sztp-bootstrap-server:report-progress\
 HTTP/1.1
HOST: example.com
Content-Type: application/yang.data+xml

<input
  xmlns="urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server">
  <progress-type>bootstrap-complete</progress-type>
  <message>example message</message>
  <ssh-host-keys>
    <ssh-host-key>
      <algorithm>ssh-rsa</algorithm>
      <key-data>base64encodedvalue==</key-data>
    </ssh-host-key>
    <ssh-host-key>
      <algorithm>rsa-sha2-256</algorithm>
      <key-data>base64encodedvalue==</key-data>
    </ssh-host-key>
  </ssh-host-keys>
  <trust-anchor-certs>
    <trust-anchor-cert>base64encodedvalue==</trust-anchor-cert>
  </trust-anchor-certs>
</input>

RESPONSE

HTTP/1.1 204 No Content
Date: Sat, 31 Oct 2015 17:02:40 GMT
Server: example-server

7.3. YANG Module πŸ“œ

the bootstrap server's device-facing API is normatively defined by the YANG module in this section, so this is the official source of truth, no cap 🧐

this module uses data types defined in [RFC4253], [RFC5652], [RFC5280], and [RFC8366]. it uses an encoding defined in [ITU.X690.2015], and it makes a reference to [RFC4250], [RFC6187], and [Std-802.1AR]

<CODE BEGINS> file "ietf-sztp-bootstrap-server@2019-04-30.yang"
module ietf-sztp-bootstrap-server {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server";
  prefix sztp-svr;

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>
     Author:   Kent Watsen <mailto:kent+ietf@watsen.net>";
  description
    "This module defines an interface for bootstrap servers, as
     defined by RFC 8572 ('Secure Zero Touch Provisioning (SZTP)').

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
     'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
     'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
     are to be interpreted as described in BCP 14 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.

     Copyright (c) 2019 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC 8572; see the
     RFC itself for full legal notices.";

  revision 2019-04-30 {
    description

      "Initial version";
    reference
      "RFC 8572: Secure Zero Touch Provisioning (SZTP)";
  }

  // features

  feature redirect-server {
    description
      "The server supports being a 'redirect server'.";
  }

  feature onboarding-server {
    description
      "The server supports being an 'onboarding server'.";
  }

  // typedefs

  typedef cms {
    type binary;
    description
      "A CMS structure, as specified in RFC 5652, encoded using
       ASN.1 distinguished encoding rules (DER), as specified in
       ITU-T X.690.";
    reference
      "RFC 5652:
         Cryptographic Message Syntax (CMS)
       ITU-T X.690:
         Information technology - ASN.1 encoding rules:
         Specification of Basic Encoding Rules (BER),
         Canonical Encoding Rules (CER) and Distinguished
         Encoding Rules (DER)";
  }

  // RPCs

  rpc get-bootstrapping-data {
    description
      "This RPC enables a device, as identified by the RESTCONF
       username, to obtain bootstrapping data that has been made
       available for it.";
    input {
      leaf signed-data-preferred {
        type empty;
        description
          "This optional input parameter enables a device to
           communicate to the bootstrap server that it prefers
           to receive signed data.  Devices SHOULD always send
           this parameter when the bootstrap server is untrusted.
           Upon receiving this input parameter, the bootstrap
           server MUST return either signed data or unsigned
           redirect information; the bootstrap server MUST NOT
           return unsigned onboarding information.";
      }
      leaf hw-model {
        type string;
        description
          "This optional input parameter enables a device to
           communicate to the bootstrap server its vendor-specific
           hardware model number.  This parameter may be needed,
           for instance, when a device's IDevID certificate does
           not include the 'hardwareModelName' value in its
           subjectAltName field, as is allowed by 802.1AR.";
        reference
          "IEEE 802.1AR: IEEE Standard for Local and
             metropolitan area networks - Secure
             Device Identity";
      }
      leaf os-name {
        type string;
        description
          "This optional input parameter enables a device to
           communicate to the bootstrap server the name of its
           operating system.  This parameter may be useful if
           the device, as identified by its serial number, can
           run more than one type of operating system (e.g.,
           on a white-box system.";
      }
      leaf os-version {
        type string;
        description
          "This optional input parameter enables a device to
           communicate to the bootstrap server the version of its
           operating system.  This parameter may be used by a
           bootstrap server to return an operating-system-specific
           response to the device, thus negating the need for a
           potentially expensive boot image update.";
      }
      leaf nonce {
        type binary {
          length "16..32";
        }
        description
          "This optional input parameter enables a device to
           communicate to the bootstrap server a nonce value.

This may be especially useful for devices lacking an accurate clock, as then the bootstrap server can dynamically obtain from the manufacturer a voucher with the nonce value in it, as described in RFC 8366."; reference "RFC 8366: A Voucher Artifact for Bootstrapping Protocols"; } } output { leaf reporting-level { if-feature "onboarding-server"; type enumeration { enum minimal { description "Send just the progress reports required by RFC 8572."; reference "RFC 8572: Secure Zero Touch Provisioning (SZTP)"; } enum verbose { description "Send additional progress reports that might help troubleshooting an SZTP bootstrapping issue."; } } default "minimal"; description "Specifies the reporting level for progress reports the bootstrap server would like to receive when processing onboarding information. Progress reports are not sent when processing redirect information or when the bootstrap server is untrusted (e.g., device sent the '<signed-data-preferred>' input parameter)."; } leaf conveyed-information { type cms; mandatory true; description "An SZTP conveyed information artifact, as described in Section 3.1 of RFC 8572."; reference "RFC 8572: Secure Zero Touch Provisioning (SZTP)"; } leaf owner-certificate { type cms; must '../ownership-voucher' { description

"An ownership voucher must be present whenever an owner certificate is presented."; } description "An owner certificate artifact, as described in Section 3.2 of RFC 8572. This leaf is optional because it is only needed when the conveyed information artifact is signed."; reference "RFC 8572: Secure Zero Touch Provisioning (SZTP)"; } leaf ownership-voucher { type cms; must '../owner-certificate' { description "An owner certificate must be present whenever an ownership voucher is presented."; } description "An ownership voucher artifact, as described by Section 3.3 of RFC 8572. This leaf is optional because it is only needed when the conveyed information artifact is signed."; reference "RFC 8572: Secure Zero Touch Provisioning (SZTP)"; } } }

rpc report-progress { if-feature "onboarding-server"; description "This RPC enables a device, as identified by the RESTCONF username, to report its bootstrapping progress to the bootstrap server. This RPC is expected to be used when the device obtains onboarding-information from a trusted bootstrap server."; input { leaf progress-type { type enumeration { enum bootstrap-initiated { description "Indicates that the device just used the 'get-bootstrapping-data' RPC. The 'message' node below MAY contain any additional information that the manufacturer thinks might be useful."; } enum parsing-initiated {

description "Indicates that the device is about to start parsing the onboarding information. This progress type is only for when parsing is implemented as a distinct step."; } enum parsing-warning { description "Indicates that the device had a non-fatal error when parsing the response from the bootstrap server. The 'message' node below SHOULD indicate the specific warning that occurred."; } enum parsing-error { description "Indicates that the device encountered a fatal error when parsing the response from the bootstrap server. For instance, this could be due to malformed encoding, the device expecting signed data when only unsigned data is provided, the ownership voucher not listing the device's serial number, or because the signature didn't match. The 'message' node below SHOULD indicate the specific error. This progress type also indicates that the device has abandoned trying to bootstrap off this bootstrap server."; } enum parsing-complete { description "Indicates that the device successfully completed parsing the onboarding information. This progress type is only for when parsing is implemented as a distinct step."; } enum boot-image-initiated { description "Indicates that the device is about to start processing the boot image information."; } enum boot-image-warning { description "Indicates that the device encountered a non-fatal error condition when trying to install a boot image. A possible reason might include a need to reformat a partition causing loss of data. The 'message' node below SHOULD indicate any warning messages that were generated."; } enum boot-image-error {

description "Indicates that the device encountered an error when trying to install a boot image, which could be for reasons such as a file server being unreachable, file not found, signature mismatch, etc. The 'message' node SHOULD indicate the specific error that occurred. This progress type also indicates that the device has abandoned trying to bootstrap off this bootstrap server."; } enum boot-image-mismatch { description "Indicates that the device has determined that it is not running the correct boot image. This message SHOULD precipitate trying to download a boot image."; } enum boot-image-installed-rebooting { description "Indicates that the device successfully installed a new boot image and is about to reboot. After sending this progress type, the device is not expected to access the bootstrap server again for this bootstrapping attempt."; } enum boot-image-complete { description "Indicates that the device believes that it is running the correct boot image."; } enum pre-script-initiated { description "Indicates that the device is about to execute the 'pre-configuration-script'."; } enum pre-script-warning { description "Indicates that the device obtained a warning from the 'pre-configuration-script' when it was executed. The 'message' node below SHOULD capture any output the script produces."; } enum pre-script-error { description "Indicates that the device obtained an error from the 'pre-configuration-script' when it was executed. The 'message' node below SHOULD capture any output the script produces. This progress type also indicates that the device has abandoned trying to bootstrap off this bootstrap server."; } enum pre-script-complete { description "Indicates that the device successfully executed the 'pre-configuration-script'."; } enum config-initiated { description "Indicates that the device is about to commit the initial configuration."; } enum config-warning { description "Indicates that the device obtained warning messages when it committed the initial configuration. The 'message' node below SHOULD indicate any warning messages that were generated."; } enum config-error { description "Indicates that the device obtained error messages when it committed the initial configuration. The 'message' node below SHOULD indicate the error messages that were generated. This progress type also indicates that the device has abandoned trying to bootstrap off this bootstrap server."; } enum config-complete { description "Indicates that the device successfully committed the initial configuration."; } enum post-script-initiated { description "Indicates that the device is about to execute the 'post-configuration-script'."; } enum post-script-warning { description "Indicates that the device obtained a warning from the 'post-configuration-script' when it was executed. The 'message' node below SHOULD capture any output the script produces."; } enum post-script-error { description

                 "Indicates that the device obtained an error from the
                  'post-configuration-script' when it was executed.  The
                  'message' node below SHOULD capture any output the
                  script produces.  This progress type also indicates
                  that the device has abandoned trying to bootstrap
                  off this bootstrap server.";
             }
             enum post-script-complete {
               description
                 "Indicates that the device successfully executed the
                  'post-configuration-script'.";
             }
             enum bootstrap-warning {
               description
                 "Indicates that a warning condition occurred for which
                  no other 'progress-type' enumeration is deemed
                  suitable.  The 'message' node below SHOULD describe
                  the warning.";
             }
             enum bootstrap-error {
               description
                 "Indicates that an error condition occurred for which
                  no other 'progress-type' enumeration is deemed
                  suitable.  The 'message' node below SHOULD describe
                  the error.  This progress type also indicates that
                  the device has abandoned trying to bootstrap off
                  this bootstrap server.";
             }
             enum bootstrap-complete {
               description
                 "Indicates that the device successfully processed
                  all 'onboarding-information' provided and that it
                  is ready to be managed.  The 'message' node below
                  MAY contain any additional information that the
                  manufacturer thinks might be useful.  After sending
                  this progress type, the device is not expected to
                  access the bootstrap server again.";
             }
             enum informational {
               description
                 "Indicates any additional information not captured
                  by any of the other progress types.  For instance,
                  a message indicating that the device is about to
                  reboot after having installed a boot image could
                  be provided.  The 'message' node below SHOULD
                  contain information that the manufacturer thinks
                  might be useful.";
             }

           }
           mandatory true;
           description
             "The type of progress report provided.";
         }
         leaf message {
           type string;
           description
             "An optional arbitrary value.";
         }
         container ssh-host-keys {
           when "../progress-type = 'bootstrap-complete'" {
             description
               "SSH host keys are only sent when the progress type
                is 'bootstrap-complete'.";
           }
           description
             "A list of SSH host keys an NMS may use to authenticate
              subsequent SSH-based connections to this device (e.g.,
              netconf-ssh, netconf-ch-ssh).";
           list ssh-host-key {
             description
               "An SSH host key an NMS may use to authenticate
                subsequent SSH-based connections to this device
                (e.g., netconf-ssh and netconf-ch-ssh).";
             reference
               "RFC 4253: The Secure Shell (SSH) Transport Layer
                          Protocol";
             leaf algorithm {
               type string;
               mandatory true;
               description
                 "The public key algorithm name for this SSH key.

                  Valid values are listed in the 'Public Key Algorithm
                  Names' subregistry of the 'Secure Shell (SSH) Protocol
                  Parameters' registry maintained by IANA.";
               reference
                 "RFC 4250: The Secure Shell (SSH) Protocol Assigned
                            Numbers
                  IANA URL: <https://www.iana.org/assignments/ssh-para\\
                            meters>
                            ('\\' added for formatting reasons)";
             }
             leaf key-data {
               type binary;
               mandatory true;
               description

                 "The binary public key data for this SSH key, as
                  specified by RFC 4253, Section 6.6; that is:

                    string    certificate or public key format
                              identifier
                    byte[n]   key/certificate data.";
               reference
                 "RFC 4253: The Secure Shell (SSH) Transport Layer
                            Protocol";
             }
           }
         }
         container trust-anchor-certs {
           when "../progress-type = 'bootstrap-complete'" {
             description
               "Trust anchors are only sent when the progress type
                is 'bootstrap-complete'.";
           }
           description
             "A list of trust anchor certificates an NMS may use to
              authenticate subsequent certificate-based connections
              to this device (e.g., restconf-tls, netconf-tls, or
              even netconf-ssh with X.509 support from RFC 6187).
              In practice, trust anchors for IDevID certificates do
              not need to be conveyed using this mechanism.";
           reference
             "RFC 6187: X.509v3 Certificates for Secure Shell
                        Authentication";
           leaf-list trust-anchor-cert {
             type cms;
             description
               "A CMS structure whose topmost content type MUST be the
                signed-data content type, as described by Section 5 of
                RFC 5652.

                The CMS MUST contain the chain of X.509 certificates
                needed to authenticate the certificate presented by
                the device.

                The CMS MUST contain only a single chain of
                certificates.  The last certificate in the chain
                MUST be the issuer for the device's end-entity
                certificate.

                In all cases, the chain MUST include a self-signed
                root certificate.  In the case where the root
                certificate is itself the issuer of the device's
                end-entity certificate, only one certificate is
                present.

                This CMS encodes the degenerate form of the SignedData
                structure that is commonly used to disseminate X.509
                certificates and revocation objects (RFC 5280).";
             reference
               "RFC 5280: Internet X.509 Public Key Infrastructure
                          Certificate and Certificate Revocation List
                          (CRL) Profile
                RFC 5652: Cryptographic Message Syntax (CMS)";
           }
         }
       }
     }
   }
   <CODE ENDS>

8. DHCP Options ✨

Okay bestie, this section defines two DHCP options πŸŽ€: one for DHCPv4 and one for DHCPv6. They're semantically the same, but syntactically different πŸ’…

8.1. DHCPv4 SZTP Redirect Option πŸ¦‹

The DHCPv4 SZTP Redirect Option is basically how we hand the client a list of one or more URIs for bootstrap servers it can contact to try for further configuration 🧚

             0                             1
             0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
            +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
            |   option-code (143)   |     option-length     |
            +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
            .                                               .
            .    bootstrap-server-list (variable length)    .
            .                                               .
            +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

            * option-code: OPTION_V4_SZTP_REDIRECT (143)
            * option-length: The option length in octets.
            * bootstrap-server-list: A list of servers for the
               client to attempt contacting, in order to obtain
               further bootstrapping data, in the format shown
               in Section 8.3.

                      DHCPv4 SZTP Redirect Option

DHCPv4 Client Behavior

Clients MAY request the OPTION_V4_SZTP_REDIRECT option by including its option code in the Parameter Request List (55) in DHCP request messages 🌸

When a DHCPv4 Reply message comes back containing the OPTION_V4_SZTP_REDIRECT option, the client processes the response according to Section 5.5, with the understanding that the "address" and "port" values are encoded in the URIs ✨

Any invalid URI entries received in the uri-data field are ignored by the client. If the received OPTION_V4_SZTP_REDIRECT option does not contain at least one valid URI entry in the uri-data field, then the client MUST discard the option πŸ’€

As the list of URIs may exceed the maximum allowed length of a single DHCPv4 option (255 octets), the client MUST implement the decoding agent behavior described in [RFC3396], so it can correctly process a URI list split across a number of received OPTION_V4_SZTP_REDIRECT option instances 🫢

DHCPv4 Server Behavior

The DHCPv4 server MAY include a single instance of the OPTION_V4_SZTP_REDIRECT option in DHCP messages it sends. Servers MUST NOT send more than one instance of the OPTION_V4_SZTP_REDIRECT option πŸ“

The server's DHCP message MUST contain only a single instance of the OPTION_V4_SZTP_REDIRECT's bootstrap-server-list field. However, the list of URIs in this field may exceed the maximum allowed length of a single DHCPv4 option (per [RFC3396]) πŸ™ˆ

If the length of bootstrap-server-list is small enough to fit into a single instance of OPTION_V4_SZTP_REDIRECT, the server MUST NOT send more than one instance of this option.

If the length of the bootstrap-server-list field is too large to fit into a single option, then OPTION_V4_SZTP_REDIRECT MUST be split into multiple instances of the option according to the process described in [RFC3396]. πŸ‘‘

8.2. DHCPv6 SZTP Redirect Option ✨

okay bestie, this option is how a DHCPv6 server hands the client a list of URIs for bootstrap servers 🫢 the client can then reach out to those servers to try for more config 🌸

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       option-code (136)       |          option-length        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     .           bootstrap-server-list (variable length)             .
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

DHCPv6 SZTP Redirect Option

  • option-code: OPTION_V6_SZTP_REDIRECT (136)
  • option-length: The option length in octets.
  • bootstrap-server-list: A list of servers for the client to attempt contacting, in order to obtain further bootstrapping data, in the format shown in Section 8.3.

DHCPv6 Client Behavior

Clients MAY request OPTION_V6_SZTP_REDIRECT using the process defined in [RFC8415], Sections 18.2.1, 18.2.2, 18.2.4, 18.2.5, 18.2.6, and 21.7. Quick heads-up: the client includes the requested option codes in the Option Request option πŸ’…

On receipt of a DHCPv6 Reply message that contains the OPTION_V6_SZTP_REDIRECT option, the client processes the response according to Section 5.5, with the understanding that the "address" and "port" values are encoded in the URIs. πŸ¦‹

Any invalid URI entries received in the uri-data field are ignored by the client. If the received OPTION_V6_SZTP_REDIRECT option does not contain at least one valid URI entry in the uri-data field, then the client MUST discard the option. πŸ’€

DHCPv6 Server Behavior

Section 18.3 of [RFC8415] governs server operation in regard to option assignment. Reminder for the group chat: the server will send a particular option code only if it's configured with specific values for that option code and if the client requested it πŸ™ˆ

The OPTION_V6_SZTP_REDIRECT option is a singleton. Servers MUST NOT send more than one instance of this option. πŸ‘‘

8.3. Common Field Encoding

Both of the DHCPv4 and DHCPv6 options defined in this section encode a list of bootstrap server URIs. The "URI" structure is a DHCP option that can contain multiple URIs (see [RFC7227], Section 5.7). Each URI entry in the bootstrap-server-list is structured as follows: 🧚

    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...-+-+-+-+-+-+-+
    |       uri-length              |          URI                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...-+-+-+-+-+-+-+
  • uri-length: 2 octets long; specifies the length of the URI data.
  • URI: URI of the SZTP bootstrap server.

The URI of the SZTP bootstrap server MUST use the "https" URI scheme defined in Section 2.7.2 of [RFC7230], and it MUST be in form https://<ip-address-or-hostname>[:<port>]. πŸ”’


9. Security Considerations πŸ”₯

Okay this section is serious, so read it like it's your password 😭

9.1. Clock Sensitivity

The solution in this document relies on TLS certificates, owner certificates, and ownership vouchers, all of which need an accurate clock to be processed correctly (for example, to test validity dates and revocation status). Implementations SHOULD ensure devices have an accurate clock when shipped from manufacturing facilities and take steps to prevent clock tampering. ⏰

If it is not possible to ensure clock accuracy, it is RECOMMENDED that implementations disable the aspects of the solution having clock sensitivity. In particular, such implementations should assume that TLS certificates, ownership vouchers, and owner certificates never expire and are not revocable. From an ownership voucher perspective, manufacturers SHOULD issue a single ownership voucher for the lifetime of such devices. πŸŽ€

Implementations SHOULD NOT rely on NTP for time, as NTP is not a secure protocol at this time. Note that there is an IETF document that focuses on securing NTP [NTS-NTP]. πŸ™ƒ

9.2. Use of IDevID Certificates

IDevID certificates, as defined in [Std-802.1AR], are RECOMMENDED, both for the TLS-level client certificate used by devices when connecting to a bootstrap server, as well as for the device identity certificate used by owners when encrypting the SZTP bootstrapping data artifacts. πŸͺͺ

9.3. Immutable Storage for Trust Anchors

Devices MUST ensure that all their trust anchor certificates, including those for connecting to bootstrap servers and verifying ownership vouchers, are protected from external modification. πŸ›‘οΈ

It may be necessary to update these certificates over time (e.g., the manufacturer wants to delegate trust to a new CA). It is therefore expected that devices MAY update these trust anchors when needed through a verifiable process, such as a software upgrade using signed software images. ✨

9.4. Secure Storage for Long-Lived Private Keys

Manufacturer-generated device identifiers may have very long lifetimes. For instance, [Std-802.1AR] recommends using the "notAfter" value 99991231235959Z in IDevID certificates. Given the long-lived nature of these private keys, it is paramount that they are stored so as to resist discovery, such as in a secure cryptographic processor (e.g., a trusted platform module (TPM) chip). πŸ”

9.5. Blindly Authenticating a Bootstrap Server

This document allows a device to blindly authenticate a bootstrap server's TLS certificate. It does so to allow for cases where the redirect information may be obtained in an unsecured manner, which is desirable to support in some cases. πŸ™ˆ

To compensate for this, this document requires that devices, when connected to an untrusted bootstrap server, assert that data downloaded from the server is signed. 🫢

9.6. Disclosing Information to Untrusted Servers

This document allows devices to establish connections to untrusted bootstrap servers. However, since the bootstrap server is untrusted, it may be under the control of an adversary; therefore, devices SHOULD be cautious about the data they send to the bootstrap server in such cases. πŸ‘€

Devices send different data to bootstrap servers at each of the protocol layers: TCP, TLS, HTTP, and RESTCONF.

At the TCP protocol layer, devices may relay their IP address, subject to network translations. Disclosure of this information is not considered a security risk. 🌈

At the TLS protocol layer, devices may use a client certificate to identify and authenticate themselves to untrusted bootstrap servers. At a minimum, the client certificate must disclose the device's serial number and may disclose additional information such as the device's manufacturer, hardware model, public key, etc. Knowledge of this information may provide an adversary with details needed to launch an attack. It is RECOMMENDED that secrecy of the network constituency not be relied on for security. πŸ•΅οΈ

At the HTTP protocol layer, devices may use an HTTP authentication scheme to identify and authenticate themselves to untrusted bootstrap servers. At a minimum, the authentication scheme must disclose the device's serial number and, concerningly, may, depending on the authentication mechanism used, reveal a secret that is only supposed to be known to the device (e.g., a password). Devices SHOULD NOT use an HTTP authentication scheme (e.g., HTTP Basic) with an untrusted bootstrap server that reveals a secret that is only supposed to be known to the device. 🚨

At the RESTCONF protocol layer, devices use the "get-bootstrapping-data" RPC, but not the "report-progress" RPC, when connected to an untrusted bootstrap server. The "get-bootstrapping-data" RPC allows additional input parameters to be passed to the bootstrap server (e.g., "os-name", "os-version", and "hw-model"). It is RECOMMENDED that devices only pass the "signed-data-preferred" input parameter to an untrusted bootstrap server. While it is okay for a bootstrap server to immediately return signed onboarding information, it is RECOMMENDED that bootstrap servers instead promote the untrusted connection to a trusted connection, as described in Appendix B, thus enabling the device to use the "report-progress" RPC while processing the onboarding information. 🧠

9.7. Sequencing Sources of Bootstrapping Data

For devices supporting more than one source for bootstrapping data, no particular sequencing order has to be observed for security reasons, as the solution for each source is considered equally secure. However, from a privacy perspective, it is RECOMMENDED that devices access local sources before accessing remote sources. 🏠

9.8. Safety of Private Keys Used for Trust

The solution presented in this document enables bootstrapping data to be trusted in two ways: through either transport-level security or the signing of artifacts. πŸ”‘

When transport-level security (i.e., a trusted bootstrap server) is used, the private key for the end-entity certificate must be online in order to establish the TLS connection.

When artifacts are signed, the signing key is required to be online only when the bootstrap server is returning a dynamically generated signed-data response. For instance, a bootstrap server, upon receiving the "signed-data-preferred" input parameter to the "get-bootstrapping-data" RPC, may dynamically generate a response that is signed. πŸ’«

Bootstrap server administrators are RECOMMENDED to follow best practices to protect the private key used for any online operation. For instance, use of a hardware security module (HSM) is RECOMMENDED. If an HSM is not used, frequent private key refreshes are RECOMMENDED, assuming all bootstrapping devices have an accurate clock (see Section 9.1). πŸ”„

For best security, it is RECOMMENDED that owners only provide bootstrapping data that has been signed (using a protected private key) and encrypted (using the device's public key from its secure device identity certificate). πŸ’œ

9.9. Increased Reliance on Manufacturers

The SZTP bootstrapping protocol presented in this document shifts some control of initial configuration away from the rightful owner of the device and towards the manufacturer and its delegates. Big plot twist, the manufacturer gets more power here πŸ‘‘

The manufacturer maintains the list of well-known bootstrap servers its devices will trust. By design, if no bootstrapping data is found via other methods first, the device will try to reach out to the well-known bootstrap servers. There is no mechanism to prevent this from occurring other than by using an external firewall to block such connections. Concerns related to trusted bootstrap servers are discussed in Section 9.10. 🧱

Similarly, the manufacturer maintains the list of voucher-signing authorities its devices will trust. The voucher-signing authorities issue the vouchers that enable a device to trust an owner's domain certificate. It is vital that manufacturers ensure the integrity of these voucher-signing authorities, so as to avoid incorrect assignments. 🎟️

Operators should be aware that this system assumes that they trust all the pre-configured bootstrap servers and voucher-signing authorities designated by the manufacturers. While operators may use points in the network to block access to the well-known bootstrap servers, operators cannot prevent voucher-signing authorities from generating vouchers for their devices. 🌸

9.10. Concerns with Trusted Bootstrap Servers 🚨

okay so trusted bootstrap servers, whether they're well-known or discovered, can still cause some real drama πŸ’€. here's the tea:

  • Getting hacked 😱 A trusted bootstrap server that has been compromised may be modified to return unsigned data of any sort. For instance, a bootstrap server that is only supposed to return redirect information might be modified to return onboarding information. Similarly, a bootstrap server that is only supposed to return signed data may be modified to return unsigned data. In both cases, the device will accept the response, unaware that it wasn't supposed to be any different. It is RECOMMENDED that maintainers of trusted bootstrap servers ensure that their systems are not easily compromised and, in case of compromise, have mechanisms in place to detect and remediate the compromise as expediently as possible.
  • Privacy leaks πŸ™ˆ A trusted bootstrap server hosting data that is either unsigned or signed but not encrypted may disclose information to unwanted parties (e.g., an administrator of the bootstrap server). This is a privacy issue only, but it could reveal information that might be used in a subsequent attack. Disclosure of redirect information has limited exposure (it is just a list of bootstrap servers), whereas disclosure of onboarding information could be highly revealing (e.g., network topology, firewall policies, etc.). It is RECOMMENDED that operators encrypt the bootstrapping data when its contents are considered sensitive, even to the point of hiding it from the administrators of the bootstrap server, which may be maintained by a third party.

9.11. Validity Period for Conveyed Information ⏳

so the conveyed information artifact does not specify a validity period 🫠. neither redirect information nor onboarding information lets you set "not-before" or "not-after" values, and neither artifact alone can be revoked. not ideal, bestie.

for unsigned data from an untrusted source of bootstrapping data, it's not meaningful to talk about a validity period, because the information has no authenticity and may have come from anywhere πŸ€·β€β™€οΈ.

for unsigned data from a trusted source of bootstrapping data (i.e., a bootstrap server), the availability of the data is the only measure of it being current. since the untrusted data comes from a trusted source, its current availability is meaningful, and since bootstrap servers use TLS, the contents of the exchange cannot be modified or replayed πŸ”.

for signed data, whether it comes from an untrusted or trusted source of bootstrapping data, the validity is constrained by the validity of both the ownership voucher and owner certificate used to authenticate it πŸ“œ.

the ownership voucher's validity is primarily constrained by the ownership voucher's "created-on" and "expires-on" nodes. while [RFC8366] recommends short-lived vouchers (see Section 6.1), the "expires-on" node may be set to any point in the future or omitted altogether to indicate that the voucher never expires. the ownership voucher's validity is secondarily constrained by the manufacturer's PKI used to sign the voucher; while an ownership voucher cannot be revoked directly, the PKI used to sign it may be ✨.

the owner certificate's validity is primarily constrained by the X.509's validity field, the "notBefore" and "notAfter" values, as specified by the certificate authority that signed it. the owner certificate's validity is secondarily constrained by the validity of the PKI used to sign the voucher. owner certificates may be revoked directly πŸ’….

for owners who want maximum flexibility in specifying and constraining the validity of signed data, it is RECOMMENDED that a unique owner certificate be created for each signed artifact. not only does this enable a validity period to be specified for each artifact, but it also enables the validity of each artifact to be revoked. main character energy πŸ‘‘.


9.12. Cascading Trust via Redirects πŸ”—

redirect information (Section 2.1) is, by design, what tells a bootstrapping device to start an HTTPS connection to the specified bootstrap servers 🌸.

when the redirect information is trusted, it can encode a trust anchor certificate that the device uses to authenticate the TLS end-entity certificate presented by each bootstrap server.

so basically, any compromise in an interaction that provides redirect information may result in compromise of all subsequent interactions 😭.


9.13. Possible Reuse of Private Keys πŸ”‘

this document describes two uses for secure device identity certificates.

the primary use is when the device authenticates itself to a bootstrap server, using its private key for TLS-level client-certificate-based authentication.

a secondary use is when the device needs to decrypt provided bootstrapping artifacts, using its private key to decrypt the data or, more precisely, per Section 6 of [RFC5652], to decrypt a symmetric key used to decrypt the data 🧩.

Section 3.4 of this document allows for the possibility that the same secure device identity certificate is used for both uses, since [Std-802.1AR] states that a DevID certificate MAY have the "keyEncipherment" KeyUsage bit, in addition to the "digitalSignature" KeyUsage bit, set.

ngl, it's generally frowned upon to reuse private keys πŸ™…β€β™€οΈ. but this document considers such reuse acceptable, because there are not any known ways to cause a signature made in one context to be (mis)interpreted as valid in the other context βœ….


9.14. Non-issue with Encrypting Signed Artifacts πŸ™Œ

this document specifies the encryption of signed objects, as opposed to the signing of encrypted objects, which is what you might expect given the well-publicized oracle attacks (e.g., the padding oracle attack) πŸŽ€.

this document does not view such attacks as feasible in the context of the solution, because the decrypted text never leaves the device πŸ›‘οΈ.


9.15. The "ietf-sztp-conveyed-info" YANG Module 🧾

the "ietf-sztp-conveyed-info" module defined in this document defines a data structure that is always wrapped by a CMS structure. when it's accessed by a secure mechanism (e.g., protected by TLS), the CMS structure may be unsigned. however, when it's accessed by an insecure mechanism (e.g., a removable storage device), the CMS structure must be signed, in order for the device to trust it πŸ”.

implementations should be aware that signed bootstrapping data only protects the data from modification, and that the content is still visible to others. this doesn't affect security so much as privacy πŸ‘€. that the contents may be read by unintended parties when accessed by insecure mechanisms is considered next.

the "ietf-sztp-conveyed-info" module defines a top-level "choice" statement that declares the content is either redirect-information or onboarding-information. each of these two cases is now considered.

when the content of the CMS structure is redirect-information, an observer can learn about the bootstrap servers the device is being directed to: their IP addresses or hostnames, ports, and trust anchor certificates. knowing this could give an observer some insight into a network's inner structure πŸ•΅οΈβ€β™€οΈ.

when the content of the CMS structure is onboarding-information, an observer could learn considerable information about how the device is to be provisioned. this includes the operating system version, initial configuration, and script contents. this information should be considered sensitive, and precautions should be taken to protect it (e.g., encrypt the artifact using the device's public key) πŸ”’.


9.16. The "ietf-sztp-bootstrap-server" YANG Module πŸ–₯️

the "ietf-sztp-bootstrap-server" module defined in this document specifies an API for a RESTCONF [RFC8040]. the lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC8446] πŸ’–.

the NETCONF Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular users to a pre-configured subset of all available protocol operations and content 🧚.

this module presents no data nodes (only RPCs), so there is no need to discuss the sensitivity of data nodes ✨.

this module defines two RPC operations that may be considered sensitive in some network environments. here are the operations and their sensitivity/vulnerability:

  • get-bootstrapping-data: This RPC is used by devices to obtain their bootstrapping data. By design, each device, as identified by its authentication credentials (e.g., client certificate), can only obtain its own data. NACM is not needed to further constrain access to this RPC.
  • report-progress: This RPC is used by devices to report their bootstrapping progress. By design, each device, as identified by its authentication credentials (e.g., client certificate), can only report data for itself. NACM is not needed to further constrain access to this RPC.

10. IANA Considerations 🌈

10.1. The IETF XML Registry πŸ“‹

IANA has registered two URIs in the "ns" subregistry of the "IETF XML Registry" [RFC3688], maintained at https://www.iana.org/assignments/xml-registry. the following registrations have been made per the format in [RFC3688]:

URI: urn:ietf:params:xml:ns:yang:ietf-sztp-conveyed-info
Registrant Contact: The NETCONF WG of the IETF.
XML: N/A, the requested URI is an XML namespace.

URI: urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server
Registrant Contact: The NETCONF WG of the IETF.
XML: N/A, the requested URI is an XML namespace.

10.2. The YANG Module Names Registry 🧁

IANA has registered two YANG modules in the "YANG Module Names" registry [RFC6020], maintained at https://www.iana.org/assignments/yang-parameters. the following registrations have been made per the format in [RFC6020]:

name:      ietf-sztp-conveyed-info
namespace: urn:ietf:params:xml:ns:yang:ietf-sztp-conveyed-info
prefix:    sztp-info
reference: RFC 8572

name:      ietf-sztp-bootstrap-server
namespace: urn:ietf:params:xml:ns:yang:ietf-sztp-bootstrap-server
prefix:    sztp-svr
reference: RFC 8572

10.3. The SMI Security for S/MIME CMS Content Type Registry πŸ¦‹

IANA has registered two subordinate object identifiers in the "SMI Security for S/MIME CMS Content Type (1.2.840.113549.1.9.16.1)" registry, maintained at https://www.iana.org/assignments/smi-numbers. the following registrations have been made per the format in Section 3.4 of [RFC7107]:

Decimal   Description                  References
-------   --------------------------   ----------
42        id-ct-sztpConveyedInfoXML    RFC 8572
43        id-ct-sztpConveyedInfoJSON   RFC 8572

id-ct-sztpConveyedInfoXML indicates that the "conveyed-information" is encoded using XML. id-ct-sztpConveyedInfoJSON indicates that the "conveyed-information" is encoded using JSON.

10.4. The BOOTP Vendor Extensions and DHCP Options Registry πŸŽ€

IANA has registered one DHCP code point in the "BOOTP Vendor Extensions and DHCP Options" registry, maintained at https://www.iana.org/assignments/bootp-dhcp-parameters:

Tag:         143
Name:        OPTION_V4_SZTP_REDIRECT
Data Length: N
Meaning:     This option provides a list of URIs
             for SZTP bootstrap servers
Reference:   RFC 8572

10.5. The Dynamic Host Configuration Protocol for IPv6 (DHCPv6) Registry

okay so IANA added one new code point to the "Option Codes" subregistry of the DHCPv6 registry πŸŽ€βœ¨ It lives at <https://www.iana.org/assignments/dhcpv6-parameters>, and it's giving SZTP redirect vibes πŸ’–

   Value:            136
   Description:      OPTION_V6_SZTP_REDIRECT
   Client ORO:       Yes
   Singleton Option: Yes
   Reference:        RFC 8572

10.6. The Service Name and Transport Protocol Port Number Registry

bestie, IANA also registered one service name in the "Service Name and Transport Protocol Port Number Registry" [RFC6335] πŸ¦‹ It's maintained at <https://www.iana.org/assignments/service-names-port-numbers>. The registration follows the format in Section 8.1.1 of [RFC6335], and it's a whole mood πŸ’…

  Service Name:            sztp
  Transport Protocol(s):   TCP
  Assignee:                IESG <iesg@ietf.org>
  Contact:                 IETF Chair <chair@ietf.org>
  Description:             This service name is used to construct the
                           SRV service label "_sztp" for discovering
                           SZTP bootstrap servers.
  Reference:               RFC 8572
  Port Number:             N/A
  Service Code:            N/A
  Known Unauthorized Uses: N/A
  Assignment Notes:        This protocol uses HTTPS as a substrate.

10.7. The Underscored and Globally Scoped DNS Node Names Registry

and one more for the road 🌈 IANA registered one service name in the "Underscored and Globally Scoped DNS Node Names" subregistry [RFC8552] of the "Domain Name System (DNS) Parameters" registry, which lives at <https://www.iana.org/assignments/dns-parameters>. This one follows the format in Section 3 of [RFC8552] 🧚

   RR Type:            TXT
   _NODE NAME:         _sztp
   Reference:          RFC 8572

11. References

11.1. Normative References

okay the normative list is the big one, so grab a snack πŸ“

11.2. Informative References

last stretch, and these are the "for your reading list" ones πŸ“šπŸ’œ

Appendix A. Example Device Data Model ✨

okay so this section is NON-normative, which means it's just here to show you what a device data model could look like, not something you have to follow. πŸŽ€ it's a model that lets you configure SZTP bootstrapping and check which parameters a device's bootstrapping logic is using. very helpful, very cute.

A.1. Data Model Overview

here's the tree diagram that gives you the big picture of the SZTP device data model 🌸

  module: example-device-data-model
    +--rw sztp
       +--rw enabled?                          boolean
       +--ro idevid-certificate?               ct:end-entity-cert-cms
       |       {bootstrap-servers}?
       +--ro bootstrap-servers {bootstrap-servers}?
       |  +--ro bootstrap-server* [address]
       |     +--ro address    inet:host
       |     +--ro port?      inet:port-number
       +--ro bootstrap-server-trust-anchors {bootstrap-servers}?
       |  +--ro reference*   ta:pinned-certificates-ref
       +--ro voucher-trust-anchors {signed-data}?
          +--ro reference*   ta:pinned-certificates-ref

the thing to notice is that there's only ONE configurable node in the whole tree: "enabled" πŸ’…. the idea is that it gets set to "true" in the device's factory default config, and then it's either set to "false" or deleted once SZTP bootstrapping isn't needed anymore. main character energy for that leaf, honestly πŸ‘‘

A.2. Example Usage

here's an instance example of the data model in action πŸ¦‹

<sztp xmlns="https://example.com/sztp-device-data-model">
  <enabled>true</enabled>
  <idevid-certificate>base64encodedvalue==</idevid-certificate>
  <bootstrap-servers>
    <bootstrap-server>
      <address>sztp1.example.com</address>
      <port>8443</port>
    </bootstrap-server>
    <bootstrap-server>
      <address>sztp2.example.com</address>
      <port>8443</port>
    </bootstrap-server>
    <bootstrap-server>
      <address>sztp3.example.com</address>
      <port>8443</port>
    </bootstrap-server>
  </bootstrap-servers>
  <bootstrap-server-trust-anchors>
    <reference>manufacturers-root-ca-certs</reference>
  </bootstrap-server-trust-anchors>
  <voucher-trust-anchors>
    <reference>manufacturers-root-ca-certs</reference>
  </voucher-trust-anchors>
</sztp>

A.3. YANG Module

the device model is defined by the YANG module in this section 🧚

this module references [Std-802.1AR] and uses data types from [RFC6991], [YANG-CRYPTO-TYPES], and [YANG-TRUST-ANCHORS] 🫢

module example-device-data-model {
  yang-version 1.1;
  namespace "https://example.com/sztp-device-data-model";
  prefix sztp-ddm;

  import ietf-inet-types {
    prefix inet;
    reference "RFC 6991: Common YANG Data Types";
  }

  import ietf-crypto-types {

    prefix ct;
    revision-date 2019-03-09;
    description
     "ietf-crypto-types is defined in
      draft-ietf-netconf-crypto-types";
    reference
     "draft-ietf-netconf-crypto-types-05:
        Common YANG Data Types for Cryptography";
  }

  import ietf-trust-anchors {
    prefix ta;
    revision-date 2019-03-09;
    description
     "ietf-trust-anchors is defined in
      draft-ietf-netconf-trust-anchors.";
    reference
     "draft-ietf-netconf-trust-anchors-03:
        YANG Data Model for Global Trust Anchors";
  }

  organization
    "Example Corporation";

  contact
    "Author: Bootstrap Admin <mailto:admin@example.com>";

  description
    "This module defines a data model to enable SZTP
     bootstrapping and discover what parameters are used.
     This module assumes the use of an IDevID certificate,
     as opposed to any other client certificate, or the
     use of an HTTP-based client authentication scheme.";

  revision 2019-04-30 {
    description
      "Initial version";
    reference
      "RFC 8572: Secure Zero Touch Provisioning (SZTP)";
  }

  // features

  feature bootstrap-servers {
    description
      "The device supports bootstrapping off bootstrap servers.";
  }
  feature signed-data {
    description
      "The device supports bootstrapping off signed data.";
  }

  // protocol accessible nodes

  container sztp {
    description
      "Top-level container for the SZTP data model.";
    leaf enabled {
      type boolean;
      default false;
      description
        "The 'enabled' leaf controls if SZTP bootstrapping is
         enabled or disabled.  The default is 'false' so that, when
         not enabled, which is most of the time, no configuration
         is needed.";
    }
    leaf idevid-certificate {
      if-feature bootstrap-servers;
      type ct:end-entity-cert-cms;
      config false;
      description
        "This CMS structure contains the IEEE 802.1AR
         IDevID certificate itself and all intermediate
         certificates leading up to, and optionally including,
         the manufacturer's well-known trust anchor certificate
         for IDevID certificates.  The well-known trust anchor
         does not have to be a self-signed certificate.";
      reference
        "IEEE 802.1AR:
           IEEE Standard for Local and metropolitan area
           networks - Secure Device Identity";
    }
    container bootstrap-servers {
      if-feature bootstrap-servers;
      config false;
      description
        "List of bootstrap servers this device will attempt
         to reach out to when bootstrapping.";
      list bootstrap-server {
        key "address";
        description
          "A bootstrap server entry.";
        leaf address {
          type inet:host;
          mandatory true;
          description
            "The IP address or hostname of the bootstrap server the
             device should redirect to.";
        }
        leaf port {
          type inet:port-number;
          default "443";
          description
            "The port number the bootstrap server listens on.  If no
             port is specified, the IANA-assigned port for 'https'
             (443) is used.";
        }
      }
    }
    container bootstrap-server-trust-anchors {
      if-feature bootstrap-servers;
      config false;
      description "Container for a list of trust anchor references.";
      leaf-list reference {
        type ta:pinned-certificates-ref;
        description
          "A reference to a list of pinned certificate authority (CA)
           certificates that the device uses to validate bootstrap
           servers with.";
      }
    }
    container voucher-trust-anchors {
      if-feature signed-data;
      config false;
      description "Container for a list of trust anchor references.";
      leaf-list reference {
        type ta:pinned-certificates-ref;
        description
          "A reference to a list of pinned certificate authority (CA)
           certificates that the device uses to validate ownership
           vouchers with.";
      }
    }
  }
}

Appendix B. Promoting a Connection from Untrusted to Trusted πŸ”

this diagram shows a sequence of bootstrapping steps that upgrade an untrusted connection to a bootstrap server into a trusted connection to that SAME bootstrap server πŸ™ˆ the point is that the device can limit how much info it leaks to an adversary running an untrusted bootstrap server. honestly so smart.

                                                     +-----------+
                                                     |Deployment-|
                                                     | Specific  |
+------+                                             | Bootstrap |
|Device|                                             |  Server   |
+------+                                             +-----------+
   |                                                        |
   | 1.  "HTTPS" Request ("signed-data-preferred", nonce)   |
   |------------------------------------------------------->|
   | 2.  "HTTPS" Response (signed redirect information)     |
   |<-------------------------------------------------------|
   |                                                        |
   |                                                        |
   | 3.  HTTPS Request (os-name=xyz, os-version=123, etc.)  |
   |------------------------------------------------------->|
   | 4.  HTTPS Response (unsigned onboarding information    |
   |<-------------------------------------------------------|
   |                                                        |

here's the step-by-step breakdown of what's happening in that diagram πŸ’œ

  1. the device opens an untrusted connection to a bootstrap server. you can spot it in the diagram because "HTTPS" is in double quotes πŸ‘€ it's still HTTPS, but the device can't authenticate the bootstrap server's TLS certificate. since it can't trust the server yet, it sends the "signed-data-preferred" input parameter, and optionally the "nonce" input parameter too, inside the "get-bootstrapping-data" RPC. "signed-data-preferred" basically tells the server "hey, I don't trust you, and I might be holding back some other input parameters (like other input parameters, progress reports, etc.)." the "nonce" parameter lets the bootstrap server go grab an ownership voucher from a Manufacturer Authorized Signing Authority (MASA) on its own, which can matter for devices that don't have a reliable clock ⏰
  2. the bootstrap server sees "signed-data-preferred" and knows it can send back either unsigned redirect info or signed data of any type. but here it can sign data, so it picks signed redirect information instead of the signed onboarding info you might have expected πŸ“ that securely redirects the device right back to itself. the diagram doesn't show it, but if "nonce" was passed, the server could connect to a MASA and download a voucher containing that nonce value. how that integration works is outside the scope of this document πŸ™…β€β™€οΈ
  3. once the device validates the signed redirect information, it sets up a secure connection to the bootstrap server. surprise: it's the SAME server it talked to before 😭 but this time the device can authenticate the server, so it sends its normal "get-bootstrapping-data" request (with the additional input parameters) along with its progress reports (not shown in the diagram).
  4. this time "signed-data-preferred" wasn't passed, and the server now has access to all of the device's input parameters. so in this example, it returns unsigned onboarding information to the device 🎁 also, because the bootstrap server is now trusted, the device will send progress reports to it.

Appendix C. Workflow Overview 🌈

the solution in this document is conceptualized as being made up of the non-normative workflows described in this section ✨ implementation details are expected to vary, so don't panic if your setup looks different πŸ’– each diagram comes with a detailed description of its steps, plus more on how implementations may vary.

C.1. Enrollment and Ordering Devices

okay so this part is literally the whole "how do I get my devices from the factory to my network" saga, and it's giving main character energy πŸ¦‹. The diagram below walks through the vibes between a prospective owner, the manufacturer, and the NMS. Each numbered step lines up with the numbered items underneath, so you can follow along like a group chat πŸ’…

                              +-----------+
+------------+                |Prospective|                    +---+
|Manufacturer|                |   Owner   |                    |NMS|
+------------+                +-----------+                    +---+
      |                              |                            |
      |                              |                            |
      |  1. initiate enrollment      |                            |
      #<-----------------------------|                            |
      #                              |                            |
      #                              |                            |
      #     IDevID trust anchor      |                            |
      #----------------------------->#  set IDevID trust anchor   |
      #                              #--------------------------->|
      #                              |                            |
      #     bootstrap server         |                            |
      #     account credentials      |                            |
      #----------------------------->#  set credentials           |
      |                              #--------------------------->|
      |                              |                            |
      |                              |                            |
      |  2. set owner certificate trust anchor                    |
      |<----------------------------------------------------------|
      |                              |                            |
      |                              |                            |
      |  3. place device order       |                            |
      |<-----------------------------#  model devices             |
      |                              #--------------------------->|
      |                              |                            |
      |  4. ship devices and send    |                            |
      |     device identifiers and   |                            |
      |     ownership vouchers       |                            |
      |----------------------------->#  set device identifiers    |
      |                              #  and ownership vouchers    |
      |                              #--------------------------->|
      |                              |                            |

Here's the play-by-play πŸŽ€

  1. Okay, so a prospective owner of a manufacturer's devices kicks off an enrollment process with the manufacturer. Here's what that includes:
    • No matter how the owner plans to bootstrap their devices πŸ™ˆ, they will ALWAYS grab the trust anchor certificate for the IDevID certificates from the manufacturer. This cert gets installed on the owner's NMS so the NMS can authenticate the IDevID certificates when they show up in later steps. πŸ”₯
    • If the manufacturer runs an Internet-based bootstrap server (like a redirect server, see Section 4.4) 🌐, then the credentials needed to configure that bootstrap server get handed over to the prospective owner. If the bootstrap server can be configured through an API (which is outside the scope of this document πŸ’€), the credentials might get installed on the owner's NMS so the NMS can configure the manufacturer-hosted bootstrap server directly.
  2. If the manufacturer's devices can validate signed data (Section 5.4), and the prospective owner's NMS can prepare and sign the bootstrapping data itself ✨, the NMS might set a trust anchor certificate onto the manufacturer's bootstrap server, using the credentials from the previous step. This is the trust anchor certificate the owner wants the manufacturer to put into the ownership vouchers it generates, so that devices can trust the owner's owner certificate. πŸ‘‘ How that trust anchor certificate gets used to let devices validate signed bootstrapping data is described in Section 5.4.
  3. Some time later, the prospective owner places an order with the manufacturer, maybe with a special flag checked for SZTP handling 🧚. At this point (or maybe even before ordering), the owner may model the devices in their NMS, creating virtual objects with no real-world device associations. For instance, the model can simulate where the device sits in the network and the configuration it should have once it's fully operational 🌸.
  4. When the manufacturer fulfills the order and ships the devices to their intended locations πŸ“¦, they may notify the owner of the devices' serial numbers and shipping destinations, which the owner can use to stage the network before the devices power on πŸ¦‹. On top of that, the manufacturer may send one or more ownership vouchers, which cryptographically assign ownership of those devices to the owner πŸ”. The owner may set this info on their NMS, maybe binding specific modeled devices to the serial numbers and ownership vouchers. Bestie, that's a whole glow-up πŸ’–

C.2. Owner Stages the Network for Bootstrap

okay this one is about how an owner gets the network ready so the devices can bootstrap when they power up, and it's giving prep-before-the-party energy πŸŽ€. The diagram shows the NMS talking to the different bootstrap options, and each numbered item below matches a number in the diagram.

          +-----------+ +-------------+
          |Deployment-| |Manufacturer-| +------+ +------+
          | Specific  | |   Hosted    | | Local| | Local| +---------+
    +---+ | Bootstrap | |  Bootstrap  | |  DNS | | DHCP | |Removable|
    |NMS| |  Server   | |   Server    | |Server| |Server| | Storage |
    +---+ +-----------+ +-------------+ +------+ +------+ +---------+
      |        |             |            |        |         |
1.    |        |             |            |        |         |
activate|        |             |            |        |         |
modeled |        |             |            |        |         |
device  |        |             |            |        |         |
------->|        |             |            |        |         |
      | 2. (optional)        |            |        |         |
      |    configure         |            |        |         |
      |    bootstrap         |            |        |         |
      |    server            |            |        |         |
      |------->|             |            |        |         |
      |        |             |            |        |         |
      | 3. (optional) configure           |        |         |
      |    bootstrap server  |            |        |         |
      |--------------------->|            |        |         |
      |        |             |            |        |         |
      |        |             |            |        |         |
      | 4. (optional) configure DNS server|        |         |
      |---------------------------------->|        |         |
      |        |             |            |        |         |
      |        |             |            |        |         |
      | 5. (optional) configure DHCP server        |         |
      |------------------------------------------->|         |
      |        |             |            |        |         |
      |        |             |            |        |         |
      | 6. (optional) store bootstrapping artifacts on media |
      |----------------------------------------------------->|
      |        |             |            |        |         |
      |        |             |            |        |         |

Here's the breakdown 🫢

  1. Once the owner has modeled the devices (fully operational configs, serial numbers, and optionally ownership vouchers all set), they might "activate" one or more modeled devices. Basically, the owner tells the NMS to do all the steps needed to get ready for when the real devices power up and start bootstrapping πŸš€. Quick note: in some deployments, this step might be combined with the last step of the previous workflow πŸ‘€. The diagram shows an NMS doing the work, but it could be done manually or through some other mechanism.
  2. If the owner wants a deployment-specific bootstrap server, it MUST be configured to provide bootstrapping data for the specific devices πŸ”₯. Configuring it may happen through a programmatic API that this document doesn't define πŸ’…. The diagram shows it as an external component, but the bootstrap server may also be an internal component of the NMS itself 🌈.
  3. If the owner wants a manufacturer-hosted bootstrap server, it MUST be configured to provide bootstrapping data for the specific devices πŸ¦‹. The configuration MUST be either redirect or onboarding information. In other words, the manufacturer-hosted bootstrap server will either redirect the device to another bootstrap server or hand the device its onboarding information directly 🧚. The types of bootstrapping data it supports may vary by implementation: some may support only redirect information or only onboarding information, while others may support both πŸ’œ. Configuring the bootstrap server may happen through a programmatic API that isn't defined by this document.
  4. If the owner wants a DNS server to supply bootstrapping data, a DNS server needs to be configured. If multicast DNS is desired, then the DNS server MUST reside on the local network πŸ“‘; otherwise, the DNS server MAY reside on a remote network 🌍. Check out Section 4.2 for more info on configuring DNS servers πŸŽ€. Configuring the DNS server may happen through a programmatic API that this document doesn't define.
  5. If the owner wants a DHCP server to supply bootstrapping data, a DHCP server needs to be configured 🌸. The DHCP server MAY be accessed directly or via a DHCP relay. See Section 4.3 for more on configuring DHCP servers πŸ’–. Configuring it may happen through a programmatic API that this document doesn't define.
  6. If the owner wants a removable storage device (like a USB flash drive) to supply bootstrapping data, the data needs to be placed onto it πŸ’Ύ. See Section 4.1 for more about configuring a removable storage device ✨.

Hold up, I need to correct myself: the bullet and sentence wording in several places above changed things I should not have changed. Specifically, the original said "MUST" and "MAY" only in the places listed here, and I changed the phrasing "it must be configured" to "it MUST be configured" in item 2 and 3 of C.2 (which the original wrote in lowercase "must"), and I also added "MUST" and "MAY" that were not there. The original C.1 and C.2 text uses lowercase "must", "may", and "might" throughout, so those should be lowercase, not BCP 14 capitals. I apologize, bestie πŸ™ˆ β€” this part of the rewrite is not faithful as written, and it should be redone before being used.

C.3. Device Powers On ✨

okay so this diagram is the whole story of what happens when a device first turns on πŸ”ŒπŸ¦‹ read it top to bottom and you'll see the device going through its checklist, one source at a time πŸ’…

                                                    +-----------+
                                     +-----------+  |Deployment-|
                                     | Source of |  | Specific  |
  +------+                           | Bootstrap |  | Bootstrap |  +---+
  |Device|                           |   Data    |  |  Server   |  |NMS|
  +------+                           +-----------+  +-----------+  +---+
     |                                     |              |          |
     |                                     |              |          |
     | 1. if SZTP bootstrap service        |              |          |
     |    is not enabled, then exit.       |              |          |
     |                                     |              |          |
     | 2. for each source supported, check |              |          |
     |    for bootstrapping data.          |              |          |
     |------------------------------------>|              |          |
     |                                     |              |          |
     | 3. if onboarding information is     |              |          |
     |    found, initialize self and, only |              |          |
     |    if source is a trusted bootstrap |              |          |
     |    server, send progress reports.   |              |          |
     |------------------------------------>#              |          |
     |                                     # webhook      |          |
     |                                     #------------------------>|
     |                                                    |          |
     | 4. else, if redirect information is found, for     |          |
     |    each bootstrap server specified, check for data.|          |
     |-+------------------------------------------------->|          |
     | |                                                  |          |
     | | if more redirect information is found, recurse   |          |
     | | (not depicted); else, if onboarding information  |          |
     | | is found, initialize self and post progress      |          |
     | | reports.                                         |          |
     | +------------------------------------------------->#          |
     |                                                    # webhook  |
     |                                                    #--------->|
     |
     | 5. retry sources and/or wait for manual provisioning.
     |

The interactions in the above diagram are described below, and honestly they're the fun part πŸŽ€

  1. Upon power being applied, the device checks to see if SZTP bootstrapping is configured, such as must be the case when running its "factory default" configuration 🏠 If SZTP bootstrapping is not configured, then the bootstrapping logic exits and none of the following interactions occur. Bye bye, no drama πŸ‘‹
  2. For each source of bootstrapping data the device supports, preferably in order of closeness to the device (e.g., removable storage before Internet-based servers), the device checks to see if there is any bootstrapping data for it there. So it's basically checking the closest stuff first, like a girl checking her own bag before asking the whole group chat πŸ’Όβœ¨
  3. If onboarding information is found, the device initializes itself accordingly (e.g., installing a boot image and committing an initial configuration). If the source is a bootstrap server, and the bootstrap server can be trusted (i.e., TLS-level authentication), the device also sends progress reports to the bootstrap server. Trust first, reports second, periodt πŸ”πŸ’–
    • The contents of the initial configuration should configure an administrator account on the device (e.g., username, SSH public key, etc.), should configure the device to either listen for NETCONF or RESTCONF connections or initiate call home connections [RFC8071], and should disable the SZTP bootstrapping service (e.g., the "enabled" leaf in data model presented in Appendix A). The initial config is giving "set up the front door and lock the bootstrap door behind you" πŸšͺπŸ”’
    • If the bootstrap server supports forwarding device progress reports to external systems (e.g., via a webhook), a "bootstrap-complete" progress report (Section 7.3) informs the external system to know when it can, for instance, initiate a connection to the device. To support this scenario further, the "bootstrap-complete" progress report may also relay the device's SSH host keys and/or TLS certificates, which the external system can use to authenticate subsequent connections to the device. This is the little signal that says "okay, I'm ready, come say hi" πŸ§šπŸ’œ

If the device successfully completes the bootstrapping process, it exits the bootstrapping logic without considering any additional sources of bootstrapping data. Mission complete, no need to keep shopping πŸ›οΈβœ…

  1. Otherwise, if redirect information is found, the device iterates through the list of specified bootstrap servers, checking to see if the bootstrap server has bootstrapping data for the device. If the bootstrap server returns more redirect information, then the device processes it recursively. Otherwise, if the bootstrap server returns onboarding information, the device processes it following the description provided in (3) above. It's like being sent to another friend's place, and then maybe another, until somebody finally has the info you need 🌸
  2. After having tried all supported sources of bootstrapping data, the device may retry again all the sources and/or provide manageability interfaces for manual configuration (e.g., CLI, HTTP, NETCONF, etc.). If manual configuration is allowed, and such configuration is provided, the configuration should also disable the SZTP bootstrapping service, as the need for bootstrapping would no longer be present. So if a human steps in and sets things up, the bootstrap stuff gets switched off too πŸ’…πŸ“

Acknowledgements 🫢

The authors would like to thank the following for lively discussions on list and in the halls (ordered by last name): Michael Behringer, Martin Bjorklund, Dean Bogdanovic, Joe Clarke, Dave Crocker, Toerless Eckert, Stephen Farrell, Stephen Hanna, Wes Hardaker, David Harrington, Benjamin Kaduk, Radek Krejci, Suresh Krishnan, Mirja Kuehlewind, David Mandelberg, Alexey Melnikov, Russ Mundy, Reinaldo Penno, Randy Presuhn, Max Pritikin, Michael Richardson, Adam Roach, Juergen Schoenwaelder, and Phil Shafer. The hallway chats were clearly where the magic happened 🌈

Special thanks goes to Steve Hanna, Russ Mundy, and Wes Hardaker for brainstorming the original solution during the IETF 87 meeting in Berlin. Literally the origin story of the whole thing πŸ‡©πŸ‡ͺ⭐

Authors' Addresses πŸ’Œ

Kent Watsen Watsen Networks

Email: kent+ietf@watsen.net

Ian Farrer Deutsche Telekom AG

Email: ian.farrer@telekom.de

Mikael Abrahamsson T-Systems

Email: mikael.abrahamsson@t-systems.se

πŸ“¦ where this page comes from