<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY I-D.behringer-autonomic-network-framework PUBLIC "" "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.behringer-homenet-trust-bootstrap.xml">
<!ENTITY I-D.draft-ietf-anima-autonomic-control-plane PUBLIC "" "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.behringer-anima-autonomic-control-plane.xml">
<!ENTITY I-D.vanderstok-ace-coap-est PUBLIC "" "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.vanderstok-ace-coap-est.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC7030 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7030.xml">
<!ENTITY RFC5246 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC5280 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml">
<!ENTITY RFC5652 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5652.xml">
<!ENTITY RFC7159 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7159.xml">
<!ENTITY RFC7575 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7575.xml">
<!ENTITY RFC7950 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml">
<!ENTITY RFC7951 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7951.xml">
<!ENTITY RFC3748 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3748.xml">
]>

<rfc category="std" docName="draft-ietf-anima-bootstrapping-keyinfra-08"
    ipr="trust200902">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

  <?rfc toc="yes" ?>

  <?rfc compact="yes" ?>

  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes"?>

  <?rfc iprnotified="no" ?>

  <?rfc strict="yes" ?>

  <front>
    <title abbrev="BRSKI">Bootstrapping Remote Secure Key Infrastructures
    (BRSKI)</title>

    <author fullname="Max Pritikin" initials="M." surname="Pritikin">
      <organization>Cisco</organization>
      <address>
        <email>pritikin@cisco.com</email>
      </address>
    </author>

    <author fullname="Michael C. Richardson" initials="M."
            surname="Richardson">
      <organization abbrev="SSW">Sandelman Software Works</organization>

      <address>
        <email>mcr+ietf@sandelman.ca</email>

        <uri>http://www.sandelman.ca/</uri>
      </address>
    </author>

    <author fullname="Michael H. Behringer" initials="M.H."
            surname="Behringer">
      <organization>Cisco</organization>

      <address>
        <email>mbehring@cisco.com</email>
      </address>
    </author>

    <author fullname="Steinthor Bjarnason" initials="S." surname="Bjarnason">
      <organization>Arbor Networks</organization>

      <address>
        <email>sbjarnason@arbor.net</email>
      </address>
    </author>

    <author fullname="Kent Watsen" initials="K.W." surname="Watsen">
      <organization>Juniper Networks</organization>

      <address>
        <email>kwatsen@juniper.net</email>
      </address>
    </author>

    <date year="2017" />

    <area>Operations and Management</area>

    <workgroup>ANIMA WG</workgroup>

    <abstract>
      <t>This document specifies automated bootstrapping of a remote secure
      key infrastructure (BRSKI) using vendor installed X.509 certificate, in
      combination with a vendor's authorizing service, both online and offline.
      Bootstrapping a new device can occur using a routable address and a
      cloud service, or using only link-local connectivity, or on
      limited/disconnected networks. Support for lower security models,
      including devices with minimal identity, is described for legacy reasons
      but not encouraged. Bootstrapping is complete when the cryptographic
      identity of the new key infrastructure is successfully deployed to the
      device but the established secure connection can be used to deploy a
      locally issued certificate to the device as well.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
        <t>BRSKI provides a foundation to securely answer the following
        questions between an element of the network domain called the
        "Registrar" and an unconfigured and untouched device called a
        "Pledge":</t>

      <t><list style="symbols">
          <t>Registrar authenticating the Pledge: "Who is this device? What is
          its identity?"</t>

          <t>Registrar authorization the Pledge: "Is it mine? Do I want it?
          What are the chances it has been compromised?"</t>

          <t>Pledge authenticating the Registrar/Domain: "What is this
          domain's identity?"</t>

          <t>Pledge authorization the Registrar: "Should I join it?"</t>
        </list></t>

      <t>This document details protocols and messages to the endpoints to
      answer the above questions. The Registrar actions derive from Pledge identity,
      third party cloud service communications, and local access control
      lists. The Pledge actions derive from a cryptographically protected
      "voucher" message delivered through the Registrar but originating
      at a Manufacturer Authorized Signing Authority.</t>

      <t>The syntactic details of vouchers are described in detail in <xref
      target="I-D.ietf-anima-voucher" />. This document details automated
      protocol mechanisms to obtain vouchers, including the definition
      of a necessary 'voucher request' message that is a minor extension
      to the voucher format (see <xref target="voucher-request" />).</t>

     <t>BRSKI results in the Pledge storing an X.509 root
    certificate sufficient for verifying the Registrar identity. In the
    process a TLS connection is established which can be directly used for
    Enrollment over Secure Transport (EST). In effect BRSKI provides
    an automated mechanism for the "Bootstrap Distribution of CA Certificates"
    described in <xref target="RFC7030"></xref> Section 4.1.1 wherein
    the Pledge "MUST [...]. engage a human user to authorize the CA certificate using
    out-of-band" information". With BRSKI the Pledge now can automate
    this process using the voucher. Integration with a complete EST
    enrollment is optional but trivial.</t>

      <t>BRSKI is agile enough to support
      bootstrapping alternative key infrastructures, such as a symmetric key
      solutions, but no such system is described in this document.</t>

      <section title="Other Bootstrapping Approaches">

         <t>To literally "pull yourself up by the bootstraps" is an impossible
        action. Similarly the secure establishment of a key infrastructure
        without external help is also an impossibility. Today it is commonly
        accepted that the initial connections between nodes are insecure, until
        key distribution is complete, or that domain-specific keying material
        is pre-provisioned on each new device in a costly and non-scalable
        manner. Existing mechanisms are known as non-secured 'Trust on
        First Use' (TOFU) <xref target="RFC7435" />, 'resurrecting duckling'
        <xref target="Stajano99theresurrecting" /> or 'pre-staging'.</t>

        <t>Another approach is to try and minimize user actions during
        bootstrapping. The enrollment protocol EST <xref
        target="RFC7030"></xref> details a set of non-autonomic bootstrapping
        methods in this vein:</t>

          <t><list style="symbols">
              <t>using the Implicit Trust Anchor database (not an autonomic
                  solution because the URL must be securely distributed),</t>

              <t>engaging a human user to authorize the CA certificate using
                  out-of-band data (not an autonomic solution because the human user
                  is involved),</t>

              <t>using a configured Explicit TA database (not an autonomic
                  solution because the distribution of an explicit TA database is
                  not autonomic),</t>

              <t>and using a Certificate-Less TLS mutual authentication method
                  (not an autonomic solution because the distribution of symmetric
                  key material is not autonomic).</t>
          </list>These "touch" methods do not meet the requirements for
          zero-touch.</t>

          <t>There are "call home" technologies where the Pledge first
              establishes a connection to a well known vendor service using a common
              client-server authentication model. After mutual authentication
              appropriate credentials to authenticate the target domain are
              transfered to the Pledge. This creates serveral problems and
              limitations:</t>

          <t><list style="symbols">
              <t>the pledge requires realtime connectivity to the vendor
                  service,</t>

              <t>the domain identity is exposed to the vendor service (this is a
                  privacy concern),</t>

              <t>the vendor is responsible for making the authorization
                  decisions (this is a liability concern),</t>
          </list></t>

         <t>BRSKI addresses these issues by defining extensions to the EST protocol
             for the automated distribution of vouchers.
         </t>
      </section>

      <section title="Terminology">
        <t>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
        <xref target="RFC2119"></xref>.</t>

        <t>The following terms are defined for clarity:</t>

        <t><list style="hanging">
            <t hangText="DomainID:">The domain identity is the 160-bit SHA-1
            hash of the BIT STRING of the subjectPublicKey of the domain trust
            anchor that is stored by the Domain CA. This is consistent with
            the Certification Authority subject key identifier (<xref
            target="RFC5280">Section 4.2.1.2</xref>) of the Domain CA's self
            signed root certificate. (A string value bound to the Domain CA's
            self signed root certificate subject and issuer fields is often
            colloquially used as a humanized identity value but during
            protocol discussions the more exact term as defined here is
            used).</t>

            <t hangText="drop ship:">The physical distribution of equipment
            containing the "factory default" configuration to a final
            destination. In zero-touch scenarios there is no staging or
            pre-configuration during drop-ship.</t>

            <t hangText="imprint:">The process where a device obtains the
            cryptographic key material to identify and trust future
            interactions with a network. This term is taken from Konrad
            Lorenz's work in biology with new ducklings: during a critical
            period, the duckling would assume that anything that looks like a
            mother duck is in fact their mother. An equivalent for a device is
            to obtain the fingerprint of the network's root certification
            authority certificate. A device that imprints on an attacker
            suffers a similar fate to a duckling that imprints on a hungry
            wolf. Securely imprinting is a primary focus of this
            document.<xref target="imprinting"></xref>. The analogy to
            Lorenz's work was first noted in <xref
            target="Stajano99theresurrecting"></xref>.</t>

            <t hangText="enrollment:">The process where a device presents key
            material to a network and acquires a network specific identity.
            For example when a certificate signing request is presented to a
            certification authority and a certificate is obtained in
            response.</t>

            <t hangText="Pledge:">The prospective device, which has an
            identity installed by a third-party (e.g., vendor, manufacturer or
            integrator).</t>

            <t hangText="Voucher">A signed statement from the MASA service
            that indicates to a Pledge the cryptographic identity of the
            Registrar it should trust. There are different types of vouchers
            depending on how that trust asserted. Multiple voucher types are
            defined in <xref target="I-D.ietf-anima-voucher" /></t>

            <t hangText="Domain:">The set of entities that trust a common key
            infrastructure trust anchor. This includes the Proxy, Registrar,
            Domain Certificate Authority, Management components and any
            existing entity that is already a member of the domain.</t>

            <t hangText="Domain CA:">The domain Certification Authority (CA)
            provides certification functionalities to the domain. At a minimum
            it provides certification functionalities to a Registrar and
            stores the trust anchor that defines the domain. Optionally, it
            certifies all elements.</t>

            <t hangText="Join Registrar (and Coordinator):">A representative of the domain that is
            configured, perhaps autonomically, to decide whether a new device
            is allowed to join the domain. The administrator of the domain
            interfaces with a Join Registrar (and Coordinator) to control this process. Typically a
            Join Registrar is "inside" its domain. For simplicity this document
            often refers to this as just "Registrar". The term JRC is used in
            common with other bootstrap mechanisms.</t>

            <t hangText="Join Proxy:">A domain entity that helps the pledge join
            the domain. A Proxy facilitates communication for devices that
            find themselves in an environment where they are not provided
            connectivity until after they are validated as members of the
            domain. The pledge is unaware that they are communicating with a
            proxy rather than directly with a Registrar.</t>

            <t hangText="MASA Service:">A third-party Manufacturer Authorized
            Signing Authority (MASA) service on the global Internet. The MASA
            signs vouchers. It also provides a repository for audit log
            information of privacy protected bootstrapping events. It does
            not track ownership. </t>

            <t hangText="Ownership Tracker:">An Ownership Tracker service on
            the global internet. The Ownership Tracker uses business processes
            to accurately track ownership of all devices shipped against
            domains that have purchased them. Although optional this component
            allows vendors to provide additional value in cases where their
            sales and distribution channels allow for accurately tracking of
            such ownership. Ownership tracking information is indicated in
            vouchers as described in <xref target="I-D.ietf-anima-voucher"/></t>

            <t hangText="IDevID:">An Initial Device Identity X.509 certificate
            installed by the vendor on new equipment.</t>

            <t hangText="TOFU:">Trust on First Use. Used similarly to <xref
            target="RFC7435" />. This is where a Pledge
            device makes no security decisions but rather simply trusts the
            first Registrar it is contacted by. This is also known as the
            "resurrecting duckling" model.</t>
          </list></t>
      </section>

      <section title="Scope of solution">
        <t>Questions have been posed as to whether this solution is suitable
        in general for Internet of Things (IoT) networks. This depends on the
        capabilities of the devices in question. The terminology of <xref
        target="RFC7228"></xref> is best used to describe the boundaries.</t>

        <t>The solution described in this document is aimed in general at
        non-constrained (i.e. class 2+) devices operating on a non-Challenged
        network. The entire solution as described here is not intended to be
        useable as-is by constrained devices operating on challenged networks
        (such as 802.15.4 LLNs).</t>

        <t>In many target applications, the systems involved are large router
        platforms with multi-gigabit inter-connections, mounted in controlled
        access data centers. But this solution is not exclusive to the large,
        it is intended to scale to thousands of devices located in hostile
        environments, such as ISP provided CPE devices which are drop-shipped
        to the end user. The situation where an order is fulfilled from
        distributed warehouse from a common stock and shipped directly to the
        target location at the request of the domain owner is explicitly
        supported. That stock ("SKU") could be provided to a number of
        potential domain owners, and the eventual domain owner will not know
        a-priori which device will go to which location.</t>

        <t>The bootstrapping process can take minutes to complete depending on
        the network infrastructure and device processing speed. The network
        communication itself is not optimized for speed; for privacy reasons,
        the discovery process allows for the Pledge to avoid announcing it's
        presence through broadcasting.
        </t>
        <t>
          This
          protocol is not intended for low latency handoffs. In networks
          requiring such things, the pledge SHOULD already have been
          enrolled.
        </t>

        <t>Specifically, there are protocol aspects described here which might
        result in congestion collapse or energy-exhaustion of intermediate
        battery powered routers in an LLN. Those types of networks SHOULD NOT
        use this solution. These limitations are predominately related to the
        large credential and key sizes required for device authentication.
        Defining symmetric key techniques that meet the operational
        requirements is out-of-scope but the underlying protocol operations
        (TLS handshake and signing structures) have sufficient algorithm
        agility to support such techniques when defined.</t>

        <t>The imprint protocol described here could, however, be used by
        non-energy constrained devices joining a non-constrained network (for
        instance, smart light bulbs are usually mains powered, and speak
        802.11). It could also be used by non-constrained devices across a
        non-energy constrained, but challenged network (such as 802.15.4). The
        certificate contents, and the process by which the four
        questions above are resolved do apply to constrained devices. It is
        simply the actual on-the-wire imprint protocol which could be inappropriate.</t>

        <t>This document presumes that network access control has either
        already occurred, is not required, or is integrated by the proxy
        and registrar in such a way that the device itself does not need to
        be aware of the details. Although the use of an X.509 Initial
        Device Identity is consistant with IEEE 802.1AR <xref
        target="IDevID"></xref>, and allows for alignment with 802.1X
        network access control methods, its use here is for Pledge
        authentication rather than network access control. Integrating
        this protocol with network access control, perhaps as an
        Extensible Authentication Protocol (EAP) method
        (see <xref target="RFC3748"></xref>), is out-of-scope.</t>
      </section>

      <section anchor="PostEnrollment"
               title="Leveraging the new key infrastructure / next steps">

        <t>
          As a result of the protocol described herein the bootstrapped devices
          have a common trust anchor and a certificate has 
          optionally been issued from a local PKI. This makes it possible 
          to automatically deploy services across the domain in a secure manner.
        </t>

        <t>Services which benefit from this:<list style="symbols">
            <t>Device management.</t>
            <t>Routing authentication.</t>
            <t>Service discovery.</t>
          </list>
        </t>

        <t>
          The major beneficiary is that it possible to use the credentials
          deployed by this protocol to secure the Autonomic Control Plane
          (ACP) (<xref target="I-D.ietf-anima-autonomic-control-plane" />).
        </t>
      </section>

    </section>

    <section title="Architectural Overview">
      <t>The logical elements of the bootstrapping framework are described in
      this section. Figure 1 provides a simplified overview of the components.
      Each component is logical and may be combined with other components as
      necessary.</t>

      <t></t>

<figure>
<artwork><![CDATA[
                                           +------------------------+
   +--------------Drop Ship--------------->| Vendor Service         |
   |                                       +------------------------+
   |                                       | M anufacturer|         |
   |                                       | A uthorized  |Ownership|
   |                                       | S igning     |Tracker  |
   |                                       | A uthority   |         |
   |                                       +--------------+---------+
   |                                                      ^
   |                                                      |  BRSKI-
   V                                                      |   MASA
+-------+     ............................................|...
|       |     .                                           |  .
|       |     .  +------------+       +-----------+       |  .
|       |     .  |            |       |           |       |  .
|Pledge |     .  |   Circuit  |       | Domain    <-------+  .
|       |     .  |   Proxy    |       | Registrar |          .
|       <-------->............<-------> (PKI RA)  |          .
|       |        |        BRSKI-EST   |           |          .
|       |     .  |            |       +-----+-----+          .
|IDevID |     .  +------------+             | EST RFC7030    .
|       |     .           +-----------------+----------+     .
|       |     .           | Key Infrastructure         |     .
|       |     .           | (e.g. PKI Certificate      |     .
+-------+     .           |       Authority)           |     .
              .           +----------------------------+     .
              .                                              .
              ................................................
                            "Domain" components
]]></artwork>
          <postamble>Figure 1</postamble>
</figure>

      <t>We assume a multi-vendor network. In such an environment there could
      be a Vendor Service for each vendor that supports devices following this
      document's specification, or an integrator could provide a generic
      service authorized by multiple vendors. It is unlikely that an
      integrator could provide Ownership Tracking services for multiple
      vendors due to the required sales channel integrations necessary to
      track ownership.</t>

      <t>The domain is the managed network infrastructure with a Key Infrastructure the Pledge is
      joining. The a domain provides initial device connectivity
      sufficient for bootstrapping with a Circuit Proxy. The Domain
      Registrar authenticates the Pledge, makes authorization decisions, and distributes
      vouchers obtained from the Vendor Service. Optionally the Registrar
      also acts as a PKI Registration Authority.</t>

      <section title="Behavior of a Pledge">
        <t>The pledge goes through a series of steps which are outlined here
        at a high level.</t>

        <figure>
<artwork><![CDATA[
             +--------------+
             |   Factory    |
             |   default    |
             +------+-------+
                    |
             +------v-------+
             |  Discover    |
+------------>              |
|            +------+-------+
|                   |
|            +------v-------+
|            |  Identity    |
^------------+              |
| rejected   +------+-------+
|                   |
|            +------v-------+
|            | Request      |
|            | Join         |
|            +------+-------+
|                   |
|            +------v-------+
|            |  Imprint     |   Optional
^------------+              <--+Manual input (Appendix C)
| Bad Vendor +------+-------+
| response          |  send Voucher Status Telemetry
|            +------v-------+
|            |  Enroll      |
^------------+              |
| Enroll     +------+-------+
| Failure           |
|            +------v-------+
|            |  Enrolled    |
^------------+              |
 Factory     +--------------+
 reset

]]></artwork>

            <postamble>Figure 2</postamble>
        </figure>

        <t>State descriptions for the pledge are as follows:</t>

        <t><list style="numbers">
            <t>Discover a communication channel to a Registrar.</t>

            <t>Identify itself. This is done by presenting an X.509 IDevID
                credential to the discovered Registrar (via the Proxy) in a TLS
                handshake. (The Registrar credentials are only provisionally
                accepted at this time).</t>

            <t>Requests to Join the discovered Registrar. A unique nonce can be
                included ensuring that any responses can be associated with this
                particular bootstrapping attempt.</t>

            <t>Imprint on the Registrar. This requires verification of the
                vendor service provided voucher. A voucher contains sufficient
                information for the Pledge to complete authentication of a
                Registrar. (It enables the Pledge to finish
                authentication of the Registrar TLS server certificate).</t>

            <t>Enroll. By accepting the domain specific information from a
                Registrar, and by obtaining a domain certificate from a Registrar
                using a standard enrollment protocol, e.g. Enrollment over Secure
                Transport (EST) <xref target="RFC7030"></xref>.</t>

            <t>The Pledge is now a member of, and can be managed by, the
                domain and will only repeat the discovery aspects of bootstrapping
                if it is returned to factory default settings.</t>
        </list></t>
      </section>

      <section title="Secure Imprinting using Vouchers">
        <t>A voucher is a cryptographically protected statement to the Pledge
        device authorizing a zero-touch imprint on the Registrar
        domain. </t>

        <t>The format and cryptographic mechanism of vouchers is described in
        detail in <xref target="I-D.ietf-anima-voucher" />.</t>

        <t>Vouchers provide a flexible mechanism to secure imprinting: the
            Pledge device only imprints when a voucher can be validated. At the
            lowest security levels the MASA server can indiscriminately
            issue vouchers. At the highest security levels issuance of
            vouchers can be integrated with complex sales channel
            integrations that are beyond the scope of this document. This
            provides the flexibility for a number of use cases via a single
            common protocol mechanism on the Pledge and Registrar devices that
            are to be widely deployed in the field. The MASA vendor services have
            the flexibility to leverage either the currently defined claim
            mechanisms or to experiment with higher or lower security levels.</t>

        <t>Vouchers provide a signed but non-encrypted communication channel between
            the Pledge, the MASA, and the Registrar. The Registrar maintains
            control over the transport and policy decisions allowing the
            local security policy of the domain network to be enforced.</t>
      </section>

      <section anchor="IDevIDextension" title="Initial Device Identifier">
          <t>Pledge authentication and voucher request signing is via an X.509 certificate installed
             during the manufacturing process. This Initial Device Identifier
             provides a basis for authenticating the Pledge during subsequent
             protocol exchanges and informing the Registrar of the MASA
             URI. There is no requirement for a common root PKI hierarchy. Each
             device vendor can generate their own root certificate.</t>

              <t>The following previously defined fields are in the
                  X.509 IDevID certificate:</t>

              <t><list style="symbols">
              <t>The subject field's DN encoding MUST include the "serialNumber"
                  attribute with the device's unique serial number.</t>
              <t>The subject-alt field's encoding SHOULD include a non-critical
                  version of the RFC4108 defined HardwareModuleName.</t>
              </list></t>

              <t>In order to build the voucher "serial-number" field these IDevID
              fields need to be converted into a serial-number of "type string". The following
              methods is used depending on the first available IDevID certificate field (attempted in this order):</t>
              <t><list style="symbols">
              <t>An RFC4514 String Representation of the Distinguished Name "serialNumber" attribute.</t>
              <t>The HardwareModuleName hwSerialNum OCTET STRING base64 encoded.</t>
              <t>The RFC4514 String Representation of the Distinguished Name "common name" attribute.</t>
              </list></t>

              <t>The following newly defined field SHOULD be in the X.509 IDevID
              certificate: An X.509 non-critical certificate extension that
              contains a single Uniform Resource Identifier (URI) that points
              to an on-line Manufacturer Authorized Signing Authority. The URI is
              represented as described in Section 7.4 of [RFC5280].</t>

              <t>Any Internationalized Resource Identifiers (IRIs) MUST be mapped to
              URIs as specified in Section 3.1 of [RFC3987] before they are placed
              in the certificate extension. The URI provides the authority information.
              The BRSKI .well-known tree is described in
              <xref target="ProtocolDetails"></xref></t>

              <t>The new extension is identified as follows:</t>

              <figure>
                  <artwork><![CDATA[
<CODE BEGINS>

MASAURLExtnModule-2016 { iso(1) identified-organization(3) dod(6)
internet(1) security(5) mechanisms(5) pkix(7)
id-mod(0) id-mod-MASAURLExtn2016(TBD) }

DEFINITIONS IMPLICIT TAGS ::= BEGIN

-- EXPORTS ALL --

IMPORTS
EXTENSION
FROM PKIX-CommonTypes-2009
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-pkixCommon-02(57) }

id-pe
FROM PKIX1Explicit-2009
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-pkix1-explicit-02(51) } ;
MASACertExtensions EXTENSION ::= { ext-MASAURL, ... }
ext-MASAURL EXTENSION ::= { SYNTAX MASAURLSyntax
IDENTIFIED BY id-pe-masa-url }

id-pe-masa-url OBJECT IDENTIFIER ::= { id-pe TBD }

MASAURLSyntax ::= IA5String

END

<CODE ENDS>
                  ]]></artwork>
              </figure>
      <t></t>
      <t>The choice of id-pe is based on guidance found in Section 4.2.2 of
          [RFC5280], "These extensions may be used to direct applications to on-line
          information about the issuer or the subject". The MASA URL is precisely
          that: online information about the particular subject. </t>
      </section>

    <section anchor="flow" title="Protocol Flow">
        <t>A representative flow is shown in Figure 3:</t>

        <figure>
<artwork><![CDATA[
+--------+         +---------+    +------------+     +------------+
| Pledge |         | Circuit |    | Domain     |     | Vendor     |
|        |         | Proxy   |    | Registrar  |     | Service    |
|        |         |         |    |  (JRC)     |     | (MASA)     |
+--------+         +---------+    +------------+     +------------+
  |                     |                   |           Internet |
  |<-RFC4862 IPv6 addr  |                   |                    |
  |<-RFC3927 IPv4 addr  | Appendix A        |                    |
  |                     |                   |                    |
  |-------------------->|                   |                    |
  | optional: mDNS query| Appendix B        |                    |
  | RFC6763/RFC6762     |                   |                    |
  |                     |                   |                    |
  |<--------------------|                   |                    |
  | GRASP M_FLOOD       |                   |                    |
  |   periodic broadcast|                   |                    |
  |                     |                   |                    |
  |<------------------->C<----------------->|                    |
  |              TLS via the Circuit Proxy  |                    |
  |<--Registrar TLS server authentication---|                    |
[PROVISIONAL accept of server cert]         |                    |
  P---X.509 client authentication---------->|                    |
  P                     |                   |                    |
  P---Voucher Request (include nonce)------>|                    |
  P                     |                   |                    |
  P                     |       /--->       |                    |
  P                     |       |      [accept device?]          |
  P                     |       |      [contact Vendor]          |
  P                     |       |           |--Pledge ID-------->|
  P                     |       |           |--Domain ID-------->|
  P                     |       |           |--optional:nonce--->|
  P                     |       |           |     [extract DomainID]
  P                     |       |           |                    |
  P                     |    optional:      |     [update audit log]
  P                     |       |can        |                    |
  P                     |       |occur      |                    |
  P                     |       |in         |                    |
  P                     |       |advance    |                    |
  P                     |       |if         |                    |
  P                     |       |nonceless  |                    | 
  P                     |       |           |<- voucher ---------|
  P                     |       \---->      |                    |
  P                     |                   |                    |
  P<------voucher---------------------------|                    |
[verify voucher ]       |                   |                    |
[verify provisional cert|                   |                    |
  |                     |                   |                    |
  |---------------------------------------->|                    |
  |      [voucher status telemetry]         |<-device audit log--|
  |                     |       [verify audit log and voucher]   |
  |                     |                   |                    |
  |<--------------------------------------->|                    |
  | Continue with RFC7030 enrollment        |                    |
  | using now bidirectionally authenticated |                    |
  | TLS session.        |                   |                    |
  |                     |                   |                    |]]></artwork>
        <postamble>Figure 3</postamble>
        </figure>

        <section anchor="pledge-overview" title="Architectural component: Pledge">
          <t>
            The Pledge is the device which is attempting to join.
            Until the pledge completes the enrollment process, it does has
            network connectivity only to the Proxy.
          </t>
        </section>
        <section anchor="proxy-overview" title="Architectural component: Circuit Proxy">
          <t>
            The (Circuit) Proxy provides HTTPS connectivity between the
            pledge and the registrar. The proxy mechanism is
            described in <xref target="proxydetails" />, with an optional
            stateless mechanism described in <xref target="IPIPmechanism" />.
          </t>
        </section>
        <section anchor="registrar-overview" title="Architectural component: Domain Registrar">
          <t>
            The Domain Registrar (having the formal name Join Registrar/Coordinator (JRC)), operates as a CMC Registrar, terminating the EST and BRSKI connections. The Registrar is manually configured or distributed with a list of trust anchors necessary to authenticate any Pledge device expected on the network.
            The Registrar communicates with the Vendor supplied MASA to
            establish ownership.
          </t>
        </section>
        <section anchor="masa-overview" title="Architectural component: Vendor Service">
          <t>
            The Vendor Service provides two logically seperate functions:
            the Manufacturer Authorized Signing Authority (MASA), and an
            ownership tracking/auditing function.
          </t>
        </section>
      </section>

      <section anchor="timeunknown" title="Lack of realtime clock">
          <t>Many devices when bootstrapping do not have knowledge of the
              current time. Mechanisms like Network Time Protocols can not be
              secured until bootstrapping is complete. Therefore bootstrapping is
              defined in a method that does not require knowledge of the current
              time.</t>

          <t>Unfortunately there are moments during bootstrapping when
              certificates are verified, such as during the TLS handshake, where
              validity periods are confirmed. This paradoxical "catch-22" is
              resolved by the Pledge maintaining a concept of the current "window"
              of presumed time validity that is continually refined throughout the
              bootstrapping process as follows:</t>

          <t><list style="symbols">
              <t>Initially the Pledge does not know the current time.</t>

              <t>During Pledge authentiation by the Registrar a realtime clock
                  can be used by the Registrar. This bullet expands on a closely
                  related issue regarding Pledge lifetimes. RFC5280 indicates that
                  long lived Pledge certifiates "SHOULD be assigned the
                  GeneralizedTime value of 99991231235959Z" <xref target="RFC7030"/> so the
                  Registrar MUST support such lifetimes and SHOULD support
                  ignoring Pledge lifetimes if they did not follow the RFC5280
                  recommendations.</t>

              <t>The Pledge authenticates the voucher presented to it. During
                  this authentication the Pledge ignores certificate
                  lifetimes (by necessity because it does not have a realtime clock).</t>

             <t>If the voucher contains a nonce
            then the Pledge MUST confirm the nonce matches the original voucher request. This ensures the
            voucher is fresh. See <xref target="RequestVoucherFromRegistrar">/</xref>.</t>

              <t>Once the voucher is accepted the validity period of the
                  pinned-domain-cert in the voucher now serves as a valid time
                  window. Any subsequent certificate validity periods checked
                  during RFC5280 path validation MUST occur within this
                  window.</t>

              <t>When accepting an enrollment certificate the validity period
                  within the new certificate is assumed to be valid by the Pledge.
                  The Pledge is now willing to use this credential for client
                  authentication.</t>
          </list></t>
      </section>
      <section title="Cloud Registrar">
          <t>The Pledge MAY contact a well known URI of a cloud Registrar if a
              local Registrar can not be discovered or if the Pledge's target use
              cases do not include a local Registrar.</t>
          <t>If the Pledge uses a well known URI for contacting a cloud Registrar
              an Implicit Trust Anchor database (see <xref target="RFC7030"/>) MUST
              be used to authenticate service as described in RFC6125. This is
              consistent with the human user configuration of an EST server URI in
              <xref target="RFC7030"/> which also depends on RFC6125.</t>
      </section>
      <section title="Determining the MASA to contact" anchor="obtainmasaurl">
          <t>The registrar needs to be able to contact a MASA that is trusted by the Pledge in order to obtain vouchers. There are three mechanisms described:</t>

        <t>The device's Initial Device Identifier will normally contain the MASA URL as detailed in <xref target="IDevIDextension"></xref>. This is the RECOMMENDED
            mechanism.</t>              
        <t>If the Registrar is integrated with <xref target="I-D.ietf-opsawg-mud"></xref> and the Pledge IDevID contains the id-pe-mud-url then the Registrar MAY attempt to obtain the MASA URL from the MUD file. The MUD file extension
            for the MASA URL is defined in <xref target="mud-extension"></xref>.</t>
        <t>It can be operationally difficult to ensure the necessary X.509 extensions are in the Pledge's' IDevID due to the difficulty of aligning current Pledge manufacturing with software releases and development. As a final fallback the Registrar MAY be manually configured or distributed with a MASA URL for each vendor. Note that the Registrar can only select the configured MASA URL based on the trust anchor -- so vendors can only leverage this approach if they ensure a single MASA URL works for all Pledge's associated with each trust anchor.</t>

      </section>
    </section>

    <section title="Voucher Request artifact" anchor="voucher-request">
        <t>The voucher request is how an entity requests a voucher. The
            Pledge forms a voucher request and submits it to the Registrar. The
            Registrar in turn submits a voucher request to the MASA server. A voucher
            request is a voucher structure with an additional
            "prior-signed-voucher-request" "leaf to support forwarding the Pledge's
            initial voucher request.</t>

        <t>Unless otherwise signaled (outside the voucher artifact), the signing
            structure is as defined for vouchers, see <xref target="I-D.ietf-anima-voucher"/>.</t>

        <section title="Tree Diagram" anchor="voucher-request-tree-diagram">
            <t>The following tree diagram illustrates a high-level view of a
                voucher request document.  The notation used in this diagram is described
                in <xref target="I-D.ietf-anima-voucher" />.  Each node in the diagram is
                fully described by the YANG module in <xref target="voucher-request-yang-module"/>.
                Please review the YANG module for a detailed description of the
                voucher request format.</t>

<figure>
<artwork><![CDATA[
module: ietf-voucher-request
  groupings:
  voucher-request-grouping
      +---- voucher
         +---- created-on?                      yang:date-and-time
         +---- expires-on?                      yang:date-and-time
         +---- assertion                        enumeration
         +---- serial-number                    string
         +---- idevid-issuer?                   binary
         +---- pinned-domain-cert?              binary
         +---- domain-cert-revocation-checks?   boolean
         +---- nonce?                           binary
         +---- last-renewal-date?               yang:date-and-time
         +---- prior-signed-voucher-request?    binary
         +---- proximity-registrar-cert?        binary

]]></artwork>
</figure>

        </section> <!-- tree diagram -->

        <section title="Examples" anchor="voucher-request-examples">
            <t>This section provides voucher examples for illustration
                purposes.  That these examples conform to the encoding rules
                defined in <xref target="RFC7951"/>.</t>

            <t><list style="format Example (%d)" counter="examples"><t>The following example illustrates a Pledge generated voucher-request. The
            assertion leaf is indicated as 'proximity' and the Registrar's TLS server
            certificate is included in the 'pinned-domain-cert' leaf. See
            <xref target="RequestVoucherFromRegistrar"/>.</t></list></t>
<figure>
<artwork><![CDATA[
{
    "ietf-voucher-request:voucher": {
        "nonce": "62a2e7693d82fcda2624de58fb6722e5",
        "created-on": "2017-01-01T00:00:00.000Z",
        "assertion": "proximity",
        "proximity-registrar-cert": "base64encodedvalue=="
    }
}]]></artwork>
</figure>

            <t><list style="format Example (%d)" counter="examples"><t>The following example illustrates a Registrar generated voucher-request.
                The 'prior-signed-voucher-request' leaf is populated with the Pledge's
                voucher request (such as the prior example). See
                <xref target="RequestVoucherFromMASA"/>.</t></list></t>
<figure>
<artwork><![CDATA[
{
    "ietf-voucher-request:voucher": {
        "nonce": "62a2e7693d82fcda2624de58fb6722e5",
        "created-on": "2017-01-01T00:00:02.000Z",
        "assertion": "proximity",
        "idevid-issuer": "base64encodedvalue=="
        "serial-number": "JADA123456789"
        "prior-signed-voucher": "base64encodedvalue=="
    }
}]]></artwork>
</figure>

            <t><list style="format Example (%d)" counter="examples"><t>The following example illustrates a Registrar generated voucher-request.
                The 'prior-signed-voucher-request' leaf is not populated with the Pledge's
                voucher request nor is the nonce leaf. This form might be used by a
                Registrar requesting a voucher when the Pledge is offline or when
                the Registrar expects to be offline during deployment.  See
                <xref target="RequestVoucherFromMASA"/>.</t></list></t>
<figure>
<artwork><![CDATA[
{
    "ietf-voucher-request:voucher": {
        "created-on": "2017-01-01T00:00:02.000Z",
        "assertion": "TBD",
        "idevid-issuer": "base64encodedvalue=="
        "serial-number": "JADA123456789"
    }
}]]></artwork>
</figure>

            <t><list style="format Example (%d)" counter="examples"><t>The following example illustrates a Registrar generated voucher-request.
                The 'prior-signed-voucher-request' leaf is not populated with the Pledge's
                voucher request because the Pledge did not sign it's own request. This form
                might be used when more constrained Pledges are being deployed. The
                nonce is populated from the Pledge's request.   See
                <xref target="RequestVoucherFromMASA"/>.</t></list></t>
<figure>
<artwork><![CDATA[
{
    "ietf-voucher-request:voucher": {
        "nonce": "62a2e7693d82fcda2624de58fb6722e5",
        "created-on": "2017-01-01T00:00:02.000Z",
        "assertion": "proximity",
        "idevid-issuer": "base64encodedvalue=="
        "serial-number": "JADA123456789"
    }
}]]></artwork>
</figure>

        </section>  <!-- examples -->

        <section title="YANG Module" anchor="voucher-request-yang-module">

          <t>Following is a YANG <xref target="RFC7950"/> module formally
          extending the <xref target="I-D.ietf-anima-voucher" /> voucher into
          the voucher request.</t>

<figure>
<artwork><![CDATA[
<CODE BEGINS> file "ietf-voucher-request@2017-10-13.yang"
module ietf-voucher-request {
  yang-version 1.1;

  namespace
    "urn:ietf:params:xml:ns:yang:ietf-voucher-request";
  prefix "vch";

  import ietf-restconf {
    prefix rc;
    description
      "This import statement is only present to access
       the yang-data extension defined in RFC 8040.";
    reference "RFC 8040: RESTCONF Protocol";
  }

  import ietf-voucher {
    prefix v;
    description
      "FIXME";
    reference "RFC ????: Voucher Profile for Bootstrapping Protocols";
  }

  organization
   "IETF ANIMA Working Group";

  contact
   "WG Web:   <http://tools.ietf.org/wg/anima/>
    WG List:  <mailto:anima@ietf.org>
    Author:   Kent Watsen
              <mailto:kwatsen@juniper.net>
    Author:   Max Pritikin
              <mailto:pritikin@cisco.com>
    Author:   Michael Richardson
              <mailto:mcr+ietf@sandelman.ca>
    Author:   Toerless Eckert
              <mailto:tte+ietf@cs.fau.de>";

  description
   "This module... FIXME

    The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT',
    'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in
    the module text are to be interpreted as described in RFC 2119.

    Copyright (c) 2017 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
    (http://trustee.ietf.org/license-info).

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

  revision "2017-10-13" {
    description
     "Initial version";
    reference
     "RFC XXXX: Voucher Profile for Bootstrapping Protocols";
  }

  // Top-level statement
  rc:yang-data voucher-request-artifact {
    uses voucher-request-grouping;
  }

  // Grouping defined for future usage
  grouping voucher-request-grouping {
    description
      "Grouping to allow reuse/extensions in future work.";

    uses v:voucher-artifact-grouping {
      refine "voucher/created-on" {
        mandatory false;
      }
        
      refine "voucher/pinned-domain-cert" {
        mandatory false;
      }

      augment "voucher"  {
        description
          "Adds leaf nodes appropriate for requesting vouchers.";

        leaf prior-signed-voucher-request {
          type binary;
          description
            "If it is necessary to change a voucher, or re-sign and
             forward a voucher that was previously provided along a
             protocol path, then the previously signed voucher SHOULD be
             included in this field. 
     
             For example, a pledge might sign a proximity voucher, which
             an intermediate registrar then re-signs to make its own
             proximity assertion.  This is a simple mechanism for a
             chain of trusted parties to change a voucher, while
             maintaining the prior signature information.
     
             The pledge MUST ignore all prior voucher information when 
             accepting a voucher for imprinting. Other parties MAY
             examine the prior signed voucher information for the
             purposes of policy decisions. For example this information
             could be useful to a MASA to determine that both pledge and
             registrar agree on proximity assertions. The MASA SHOULD
             remove all prior-signed-voucher information when signing
             a voucher for imprinting so as to minimize the final 
             voucher size.";
        }

        leaf proximity-registrar-cert {
          type binary;
          description
            "An X.509 v3 certificate structure as specified by RFC 5280,
             Section 4 encoded using the ASN.1 distinguished encoding
             rules (DER), as specified in ITU-T X.690.

             The first certificate in the Registrar TLS server 
             certificate_list sequence  (see [RFC5246]) presented by 
             the Registrar to the Pledge. This MUST be populated in a 
             Pledge's voucher request if the proximity assertion is 
             populated.";
        }
      }
    }
  }

}

<CODE ENDS>
]]></artwork>
</figure>

</section>  <!-- yang module -->
    </section>   <!-- voucher request artifact -->
    <section anchor="proxydetails" title="Proxy details">
      <t>The role of the Proxy is to facilitate communications. The Proxy
      forwards packets between the Pledge and a Registrar that has been
      configured on the Proxy.
      </t>

      <t>
        The Proxy does not terminate the TLS handshake: it passes streams
        of bytes onward without examination.
      </t>
      <t>
        A proxy MAY assume TLS framing for auditing purposes,
        but MUST NOT assume any TLS version.
      </t>

      <t>
        A Proxy is always assumed even if it is directly integrated
        into a Registrar.
        (In a completely autonomic network, the Registrar MUST provide
        proxy functionality so that it can be discovered, and the network
        can grow concentrically around the Registrar)
      </t>

      <t>
        As a result of the Proxy Discovery process in section <xref target="brskigrasp" />,
        the port number exposed by the proxy
        does not need to be well known, or require an IANA allocation.
      </t>

      <t>
        If the Proxy joins an Autonomic Control Plane (<xref
        target="I-D.ietf-anima-autonomic-control-plane"></xref>) it
        SHOULD use Autonomic Control Plane secured GRASP (<xref
        target="I-D.ietf-anima-grasp"></xref>) to discovery the Registrar
        address and port.  As part of the discovery process, the proxy mechanism
        (Circuit Proxy vs IPIP encapsulation) is agreed to between the
        Registrar and Join Proxy.
      </t>

      <t>
        For the IPIP encapsulation methods (described in <xref target="IPIPmechanism" />), the port
        announced by the Proxy SHOULD be the same as on the registrar in order
        for the proxy to remain stateless.
      </t>

      <t>
        In order to permit the proxy functionality to be implemented on the
        maximum variety of devices the chosen mechanism SHOULD use the minimum
        amount of state on the proxy device. While many devices in the ANIMA
        target space will be rather large routers, the proxy function is
        likely to be implemented in the control plane CPU of such a device,
        with available capabilities for the proxy function similar to many
        class 2 IoT devices.
      </t>

      <t>
        The document <xref
        target="I-D.richardson-anima-state-for-joinrouter"></xref> provides a
        more extensive analysis and background of the alternative proxy methods.
      </t>
        <section anchor="discovery" title="Pledge discovery of Proxy">
            <t>The result of discovery is a logical communication with a
                Registrar, through a Proxy. The Proxy is transparent to the Pledge
                but is always assumed to exist.</t>

            <t>To discover the Proxy the Pledge performs the following
                actions:</t>

            <t><list style="numbers">
                <t>MUST: Obtains a local address using IPv6
                    methods as described in <xref target="RFC4862"></xref> IPv6
                    Stateless Address AutoConfiguration.
                    Use of <xref target="RFC4941" /> temporary addresses is
                    encouraged.  A new temporary address SHOULD be allocated
                    whenever the discovery process is forced to restart due
                    to failures.
                    Pledges will generally prefer use of IPv6 Link-Local
                    addresses, and discovery of Proxy will be by Link-Local
                    mechanisms.
                    IPv4 methods are described in <xref target="IPv4operations" /></t>

                <t>MUST: Listen for GRASP M_FLOOD
                    (<xref target="I-D.ietf-anima-grasp" />)
                    announcements of the objective: "AN_Proxy".
                    See section <xref target="brskigrasp" /> for the details of
                    the objective.  The Pledge may listen concurrently for
                    other sources of information, see <xref target="mdnsmethods" />.
                </t>
            </list>

            Once a proxy is
            discovered the Pledge communicates with a Registrar through the
            proxy using the bootstrapping protocol defined in <xref
                target="ProtocolDetails"></xref>. </t>

            <t>Each discovery method attempted SHOULD exponentially back-off
                attempts (to a maximum of one hour) to avoid overloading the network
                infrastructure with discovery. The back-off timer for each method
                MUST be independent of other methods.
            </t>
            <t>
                Methods SHOULD be run in
                parallel to avoid head of queue problems wherein an attacker
                running a fake proxy or registrar can operate protocol
                actions intentionally slowly.
            </t>
            <t>
              Once a connection to a
                Registrar is established (e.g. establishment of a TLS session key)
                there are expectations of more timely responses, see <xref
                    target="RequestVoucherFromRegistrar"></xref>.</t>

            <t>Once all discovered services are attempted the device SHOULD
                return to listening for GRASP M_FLOOD.
                It should periodically retry the vendor specific mechanisms.
                The Pledge MAY prioritize selection order as
                appropriate for the anticipated environment.</t>

         <section anchor="brskigrasp" title="Proxy Grasp announcements">
             <t>
               A proxy uses the GRASP M_FLOOD mechanism to announce itself.
               The pledge SHOULD listen for messages of these form.
               This announcement can be within the same message as the ACP
               announcement detailed in
                 <xref target="I-D.ietf-anima-autonomic-control-plane" />.
                 <figure>
                     <artwork><![CDATA[
 proxy-objective = ["AN_Proxy", [ O_IPv6_LOCATOR, ipv6-address,
 transport-proto, port-number ] ]

 ipv6-address       - the v6 LL of the proxy
 transport-proto    - 6, for TCP 17 for UDP
 port-number        - the TCP or UDP port number to find the proxy]]></artwork>
                     <postamble>Figure 5</postamble>
                 </figure>
             </t>
         </section>
        </section>
      <section anchor="coapconnection" title="CoAP connection to Registrar">
        <t>The use of CoAP to connect from Pledge to Registrar is out of scope for this document, and may be described in future work.
        </t>
      </section>

      <section title="HTTPS proxy connection to Registrar">
        <t>The proxy SHOULD also provide one of: an IPIP encapsulation of
        HTTP traffic to the registrar, or a TCP circuit
        proxy that connects the Pledge to a Registrar.
        </t>

        <t>When the Proxy provides a circuit proxy to a Registrar the
        Registrar MUST accept HTTPS connections.
        </t>
      </section>

      <section title="Proxy discovery of Registrar">
        <t> The Registrar SHOULD announce itself so that proxies can find it
        and determine what kind of connections can be terminated.
        </t>
        <t>
          When the Registrar joins an Autonomic Control Plane
                 (<xref target="I-D.ietf-anima-autonomic-control-plane"></xref>)
                 it MUST respond to GRASP (<xref target="I-D.ietf-anima-grasp"></xref>)
                 M_NEG_SYN message.
             </t>
             <t>
                 The registrar responds to discovery messages from the proxy
                 (or GRASP caches between them) as follows: (XXX changed from M_DISCOVERY)
                 <figure>
                     <artwork><![CDATA[
 objective         = ["AN_registrar", F_DISC, 255 ]
 discovery-message = [M_NEG_SYN, session-id, initiator, objective]]]></artwork>

                     <postamble>Figure 6: Registrar Discovery</postamble>
                 </figure>
             </t>

             <t>
                 The response from the registrar (or cache) will be a M_RESPONSE with the
                 following parameters:<figure>
                     <artwork><![CDATA[
 response-message = [M_RESPONSE, session-id, initiator, ttl,
 (+locator-option // divert-option), ?objective)]
 initiator = ACP address of Registrar
 locator1  = [O_IPv6_LOCATOR, fd45:1345::6789, 6,  443]
 locator2  = [O_IPv6_LOCATOR, fd45:1345::6789, 17, 5683]
 locator3  = [O_IPv6_LOCATOR, fe80::1234, 41, nil]]]></artwork>
                     <postamble>Figure 7: Registrar Response</postamble>
                 </figure>
             </t>
             <t>
                 The set of locators is to be interpreted as follows.
                 A protocol of 6 indicates that TCP proxying on the
                 indicated port is desired.  A protocol of 17 indicates that UDP
                 proxying on the indicated port is desired.  In each case, the traffic
                 SHOULD be proxied to the same port at the ULA address provided.
             </t>
             <t>
                 A protocol of 41 indicates that packets may be IPIP proxy'ed.
                 In the case of that IPIP proxying is used, then the provided
                 link-local address MUST be advertised on the local link using
                 proxy neighbour discovery.  The Join Proxy MAY limit forwarded
                 traffic to the protocol (6 and 17) and port numbers
                 indicated by locator1 and locator2.
                 The address to which the IPIP traffic should be sent is the
                 initiator address (an ACP address of the Registrar), not the
                 address given in the locator.
             </t>
             <t>
                 Registrars MUST accept TCP / UDP traffic on the ports given at
                 the ACP address of the Registrar.  If the Registrar supports IPIP
                 tunnelling, it MUST also accept traffic encapsulated with IPIP.
             </t>
             <t>
                 Registrars MUST accept HTTPS/EST traffic on the TCP ports
                 indicated.
                 Registrars MAY accept DTLS/CoAP/EST traffic on the UDP in
                 addition to TCP traffic.
             </t>
         </section>
    </section>

    <section anchor="ProtocolDetails" title="Protocol Details">
        <t>The Pledge MUST initiate BRSKI after boot if it is unconfigured.
        The Pledge MUST NOT automatically initiate BRSKI if it has been
        configured or is in the process of being configured.</t>

        <t>BRSKI is described as extensions to EST <xref target="RFC7030"/> to
        reduce the number of TLS connections and crypto operations required on
        the Pledge. The Registrar implements the BRSKI REST interface within
        the same .well-known URI tree as the existing EST URIs as described in
        EST <xref target="RFC7030"/> section 3.2.2. The communication channel between the Pledge and the Registrar is referred to as "BRSKI-EST" (see Figure 1).</t>
        
        <t>The communication channel between the Registrar and MASA is similarly described as extensions to EST within the same ./well-known tree. For clarity this channel is referred to as "BRSKI-MASA". (See Figure 1).</t>
            
        <t>MASA URI is "https:// authority "./well-known/est".</t>

        <t>BRSKI uses EST message formats for existing operations, uses JSON
        <xref target="RFC7159" /> for all new operations defined here, and
        voucher formats.
        </t>

        <t>While EST section 3.2 does not insist upon use of HTTP 1.1 persistent connections, BRSKI-EST connections SHOULD use persistent connections. The intention of this guidance is to ensure the provisional TLS authentication occurs only once and is properly managed.</t>

        <t>Summarized automation extensions for the BRSKI-EST flow are:</t>

        <t><list style="symbols">
            <t>The Pledge provisionally accepts the Registrar certificate during
            the TLS handshake as detailed in <xref target="brskiesttls"></xref>.</t>

            <t>If the Registrar responds with a redirection to other web origins the Pledge MUST follow
            only a single redirection. (EST supports redirection but does
            not allow redirections to other web origins without user input).</t>

            <t>The Registar MAY respond with an HTTP 202 ("the request has been
                accepted for processing, but the processing has not been completed") as
                described in EST <xref target="RFC7030"/> section 4.2.3 wherein the
                client "MUST wait at least the specified 'retry-after' time before
                repeating the same request". The Pledge is RECOMMENDED to provide local
                feed (blinked LED etc) during this wait cycle if mechanisms for this
                are available. To prevent an attacker Registrar from significantly
                delaying bootstrapping the Pledge MUST limit the 'retry-after' time to
                60 seconds. To avoid blocking on a single erroneous Registrar the Pledge
                MUST drop the connection after 5 seconds in which there has
                been no progress on the TCP connection.  It should proceed to other
                discovered Registrars if there are any.  If there were no
                other Registrars discovered, the pledge MAY continue to wait,
                as long as it is concurrently listening for new proxy
                announcements.
            </t>

            <t>
                Ideally the Pledge could keep track of the
                appropriate retry-after value for any number of outstanding Registrars
                but this would involve a large state table on the Pledge. Instead the
                pledge MAY ignore the exact retry-after value in favor of a single hard
                coded value that takes effect between discovery ([[ProxyDiscovery]])
                attempts. A Registrar that is unable
                to complete the transaction the first time due to timing reasons will
                have future chances.
            </t>

            <t>The Pledge requests and validates a voucher using the new REST calls
            described below.</t>

            <t>If necessary the Pledge calls the EST defined /cacerts method to obtain the
            domain owners' CA certificate.  The pinned-domain-certificate
            element from the voucher should validate this certificate, or be
            identical to it.</t>

            <t>The Pledge completes authentication of the server certificate as detailed in <xref target="CompletingAuthenticationBootstrapping"></xref>. This moves the BRSKI-EST TLS connection out of the provisional state. Optionally, the BRSKI-EST TLS connection can now be used for EST enrollment.</t>

        </list></t>

      <t>The extensions for a Registrar (equivalent to EST server) are:</t>

      <t><list style="symbols">
          <t>Client authentication is automated using Initial Device Identity
          (IDevID) as per the EST certificate based client authentication.
              The subject field's DN encoding MUST include the "serialNumber"
              attribute with the device's unique serial number. In the language of
              RFC6125 this provides for a SERIALNUM-ID category of identifier that
              can be included in a certificate and therefore that can also be used
              for matching purposes. The SERIALNUM-ID whitelist is collated according
              to vendor trust anchor since serial numbers are not globally
              unique.</t>

          <t>The Registrar requests and validates the Voucher from the
          vendor authorized MASA service.</t>

          <t>The Registrar forwards the Voucher to the Pledge when
          requested.</t>

          <t>The Registar performs log verifications in addition to local
          authorization checks before accepting optional Pledge device enrollment requests.</t>
        </list></t>

        <section anchor="brskiesttls" title="BRSKI-EST TLS establishment details">
            <t>The Pledge establishes the TLS connection with the Registrar through
                the circuit proxy (see <xref target="proxydetails"></xref>)
                but the TLS handshake is with the Registar. The BRSKI-EST Pledge 
                is the TLS client and the BRSKI-EST Registrar is the TLS server. 
                All security associations established are
                between the Pledge and the Registrar regardless of proxy
                operations.</t>
            <t>Establishment of the BRSKI-EST TLS connection is as
                specified in EST <xref target="RFC7030"/> section 4.1.1 "Bootstrap
                Distribution of CA Certificates" <xref target="RFC7030"/> wherein
                the client is authenticated with the IDevID certificate, and the
                EST server (the Registrar) is provisionally authenticated with a unverified
                server certificate.</t>
            <t>The Pledge maintains a security paranoia concerning the provisional state, and all data recieved, until a voucher is received and verified as specified in <xref target="CompletingAuthenticationBootstrapping"></xref></t>
        </section>
        <section anchor="RequestVoucherFromRegistrar"
               title="Pledge Requests Voucher from the Registrar">
        <t>When the Pledge bootstraps it makes a request for a Voucher from a
        Registrar.</t>

        <t>This is done with an HTTPS POST using the operation path value of
        "/requestvoucher".</t>

        <t>The request media types are:</t>
        <t><list style="hanging">
          <t hangText="application/pkcs7-mime; smime-type=voucher-request">The request is a
          "YANG-defined JSON document that has been signed using a PKCS#7 structure" as described in
          <xref target="voucher-request"/> using the JSON encoding described in <xref target="RFC7951"/>.
          The Pledge SHOULD sign the request using the <xref target="IDevIDextension"/> credential.
          </t>
          <t hangText="application/json">The request is the "YANG-defined JSON document"
          as described in <xref target="voucher-request"/> with exception that it is not within
          a PKCS#7 structure. It is protected only by the TLS client authentication.
          This reduces the cryptographic requirements on the Pledge.</t>
        </list></t>

        <t>For simplicity the term 'voucher request' is used to refer to either of these media types. Registrar
        impementations SHOULD anticipate future media types but of course will simply fail the request if those
        types are not yet known.</t>

        <t>The Pledge populates the voucher request fields as follows:</t>

        <t><list style="hanging">
            <t hangText="created-on:">Pledges that have a realtime clock are RECOMMENDED to populate this field. This provides additional information to the MASA.</t>
            <t hangText="nonce:">The voucher request MUST contain a cryptographically strong random or pseudo-random number nonce. Doing so ensures <xref target="timeunknown"/> functionality. The nonce MUST NOT be reused for bootstrapping attempts.</t>
            <t hangText="assertion:">The voucher request MAY contain an assertion of "proximity".</t>
            <t hangText="proximity-registrar-cert:">In a Pledge voucher request this is the first certificate in the TLS server 'certificate_list' sequence (see [RFC5246]) presented by the Registrar to the Pledge. This MUST be populated in a Pledge's voucher request if the "proximity" assertion is populated.</t>
        </list></t>
        <t>All other fields MAY be omitted in the voucher request.</t>

        <t>An example JSON payload of a voucher request from a Pledge is in
            <xref target="voucher-request-examples"/> Example 1.</t>

        <t>The Registrar validates the client identity as described in EST
        <xref target="RFC7030"/> section 3.3.2. If the request is signed the Registrar confirms the
        'proximity' asserion and associated 'proximity-registrar-cert' are correct. The registrar performs
        authorization as detailed in [[EDNOTE: UNRESOLVED. See Appendix D "Pledge Authorization"]]. If
        these validations fail the Registrar SHOULD respond with an appropriate HTTP error code.</t>

        <t>If authorization is successful the Registrar obtains a voucher from the MASA service (see
            <xref target="RequestVoucherFromMASA"/>) and returns that MASA signed voucher to the pledge
        as described in <xref target="VoucherResponse"/>.</t>

      </section>
    <section anchor="brskimasatls" title="BRSKI-MASA TLS establishment details">
        <t>The BRSKI-MASA TLS connection is a 'normal' TLS connection appropriate for HTTPS REST interfaces. The Registrar initiates the connection and uses the MASA URL obtained as described in <xref target="obtainmasaurl"></xref> for RFC6125 authentication of the MASA server.</t>
        <t>The primary method of Registrar "authentication" by the MASA is detailed in <xref target="RequestVoucherFromMASA"></xref>. As detailed in <xref target="securityconsiderations"></xref> the MASA might find it necessary to request additional Registrar authentication. Registrars MUST be prepared to support TLS client certificate authentication and HTTP Basic or Digest authentication as described in RFC7030 for EST clients. Implementors are advised that contacting the MASA is to establish a secured REST connection with a web service and that there are a number of authentication models being explored within the industry. Registrars are RECOMMENDED to fail gracefully and generate useful administrative notifications or logs in the advent of unexpected HTTP 401 (Unauthorized) responses from the MASA.</t>
    </section>
      <section anchor="RequestVoucherFromMASA" title="Registrar Requests Voucher from MASA">
        <t>When a Registrar receives a voucher request from a Pledge it in turn requests
            a voucher from the MASA service. For simplicity this is defined as an optional EST message
        between a Registrar and an EST server running on the MASA service
        although the Registrar is not required to make use of any other EST
        functionality when communicating with the MASA service. (The MASA
        service MUST properly reject any EST functionality requests it does
        not wish to service; a requirement that holds for any REST
        interface).</t>

        <t>This is done with an HTTP POST using the operation path value of
        "/requestvoucher".</t>

        <t>The request media type is:</t>
        <t><list style="hanging">
          <t hangText="application/pkcs7-mime; smime-type=voucher-request">The request is a
          "YANG-defined JSON document that has been signed using a PKCS#7 structure" as described
          in <xref target="I-D.ietf-anima-voucher"/> using the JSON encoding described in <xref target="RFC7951"/>.
          The Registrar MUST sign the request. The entire Registrar certificate chain,
          up to and including the Domain CA, MUST be included in the PKCS#7 structure.
          </t>
        </list></t>

        <t>For simplicity the term 'voucher request' is used.  MASA impementations SHOULD anticipate future media
            types but of course will simply fail the request if those types are not yet known.</t>

        <t>The Registrar populates the voucher request fields as follows:</t>

        <t><list style="hanging">
        <t hangText="created-on:">Registrars are RECOMMENDED to populate this field. This provides additional information to the MASA.</t>
        <t hangText="nonce:">The optional nonce value from the Pledge request if desired (see below).</t>
        <t hangText="serial-number:">The serial number of the Pledge the Registrar would like a voucher for.</t>
        <t hangText="idevid-issuer:">The idevid-issuer value from the pledge certificate
        is included to ensure a statistically unique identity. The Pledge's serial number is
        extracted from the X.509 IDevID. See <xref target="IDevIDextension"></xref>.</t>
        <t hangText="prior-signed-voucher:">If the Pledge provided a signed voucher request
        then it SHOULD be included in the voucher request built by the Registrar.
        (NOTE: this is the Pledge's complete voucher request, inclusive of the
        'assertion', 'proximity-registrar-cert', etc wrapped by the pledge's
        original PKCS#7 signature).</t>
        </list></t>

        <t>A Registrar MAY exclude the nonce from the voucher request
            it submits to the MASA. Doing so allows
        the Registrar to request a Voucher when the Pledge is offline, or
        when the Registrar is expected to be offline when the Pledge is
        being deployed. These use cases require the Registrar to learn the
        appropriate IDevID SerialNumber field from the physical device labeling
        or from the sales channel (out-of-scope of this
        document). If a nonce is not provided the MASA server MUST
        authenticate the Registrar as described in EST <xref target="RFC7030"/>
        section 3.3.2 to reduce the risk of DDoS attacks and to provide an
        authenticated identity as an input to sales channel integration and
        authorizations (also out-of-scope of this document).</t>

        <t>All other fields MAY be omitted in the voucher request.</t>

        <t>Example JSON payloads of voucher requests from a Registrar are in
            <xref target="voucher-request-examples"/> Example 2 through 4.</t>

        <t>The MASA verifies that the voucher request is internally consistent
        but does not authenticate the registrar certificate since the
        registrar is not know to the MASA server in advance. The MASA validation
        checks before issuing a voucher are as follows:</t>
        <t><list style="hanging">
            <t hangText="Renew for expired voucher:">As described in
                <xref target="I-D.ietf-anima-voucher"/> vouchers
                are normally short lived to avoid revocation issues. If the request
                is for a previous (expired) voucher using the same Registrar (as determined
                by the Registrar pinned-domain-cert) and the MASA has not been informed that the claim is
                invalid then the request for a renewed voucher SHOULD be automatically
                authorized.</t>
            <t hangText="Voucher signature consistency:">The MASA MUST verify that the voucher
                request is signed by a Registrar. This is confirmed by
                verifying that the id-kp-cmcRA extended key
                usage extension field (as detailed in EST RFC7030 section 3.6.1) exists in the certificate
                of the entity that signed the voucher request. This verification
                is only a consistency check that the unauthenticated domain CA intended this
                to be a Registrar. Performing this check provides value to domain PKI by assuring the
                domain administrator that the MASA service will only respect claims from
                authorized Registration Authorities of the domain. (The requirement for the Registrar to
                include the Domain CA certificate in the signature structure was stated above).</t>
            <t hangText="Registrar revocation consistency:">The MASA SHOULD check for revocation
                of the Registrar certificate. The maximum lifetime of the voucher issued
                SHOULD NOT exceed the lifetime of the Registrar's revocation validation (for
                example if the Registrar revocation status is indicated in a CRL that is
                valid for two weeks then that is an appropriate lifetime for the voucher).
                Because the Registar certificate authority is unknown to the MASA in
                advance this is only an extended consistency check and is not required.
                The maximum lifetime of the voucher issued
                SHOULD NOT exceed the lifetime of the Registrar's revocation validation (for
                example if the Registrar revocation status is indicated in a CRL that is
                valid for two weeks then that is an appropriate lifetime for the voucher).</t>
            <t hangText="Pledge proximity assertion:">
                The MASA server MAY verify that the Registrar signed voucher includes
                the 'prior-signed-voucher' field populated
                with a Pledge signed voucher that includes a 'proximity-registrar-cert'
                that is consistent with the certificate the Registrar used to
                sign the voucher request. The MASA
                server is aware of which Pledge's support signing of their voucher
                requests and can use this information to confirm proximity of
                the Pledge with the Registrar.</t>
        </list></t>

        <t>The Registrar certificate chain root certificate is extracted from the signature
        method and used to populate the "pinned-domain-cert" of the Voucher being issued. The
        domain ID (e.g. hash of the public key of the domain) is extracted from the root certificate
        and is used to update the audit log.</t>
      </section>

      <section anchor="VoucherResponse" title="Voucher Response">
        <t>The voucher response to requests from the Pledge and requests from
        a Registrar are in the same format. A Registrar either caches prior
        MASA responses or dynamically requests a new Voucher based on local
        policy.</t>

        <t>If the join operation is successful, the server response MUST
        contain an HTTP 200 response code. The server MUST answer with a
        suitable 4xx or 5xx HTTP [RFC2616] error code when a problem occurs.
        The response data from the MASA server MUST be a plaintext
        human-readable (ASCII, english) error message containing explanatory
        information describing why the request was rejected.</t>

        <t>A 403 (Forbidden) response is appropriate if the voucher request
        is not signed correctly, stale, or if the pledge has another
        outstanding voucher which can not be overridden.</t>
        <t>A 404 (Not Found) response is appropriate when the request is for a
        device which is not known to the MASA.</t>
        <t>A 406 (Not Acceptable) response is appropriate if a voucher of the
        desired type, or using the desired algorithms (as indicated by the
        Accept: headers, and algorithms used in the signature) can not be
        issued,  such as because the MASA knows the pledge can not process
        that type.</t>
        <t>A 415 (Unsupported Media Type) response is approriate for a
        request that has a voucher encoding that is not understood.</t>


        <t>The response media type is:</t>
        <t><list style="hanging">
            <t hangText="application/pkcs7-mime; smime-type=voucher">The response is a "YANG-defined JSON document that has been
                signed using a PKCS#7 structure" as described in <xref target="I-D.ietf-anima-voucher"/>
                using the JSON encoded described in <xref target="RFC7951"/>.
                The MASA MUST sign the request.</t>
        </list></t>

        <t>The syntactic details of vouchers are described in detail in <xref
            target="I-D.ietf-anima-voucher"/>. For example, the voucher consists
            of:</t>

        <figure>
          <artwork><![CDATA[
{
  "ietf-voucher:voucher": {
    "nonce": "62a2e7693d82fcda2624de58fb6722e5",
    "assertion": "logging"
    "pinned-domain-cert": "base64encodedvalue=="
    "serial-number": "JADA123456789"
  }
}
]]></artwork>
        </figure>

        <t>The Pledge verifies the signed voucher using the manufacturer
        installed trust anchor associated with the vendor's selected Manufacturer
        Authorized Signing Authority.</t>

        <t>The 'pinned-domain-cert' element of the voucher contains the domain
            CA's public key. The Pledge MUST use the 'pinned-domain-cert' trust
            anchor to immediately complete authentication of the provisional TLS
            connection.</t>
        <t>The Pledge MUST be prepared to parse and fail gracefully from
        a Voucher response that does not contain a 'pinned-domain-cert' field. The
        Pledge MUST be prepared to ignore additional fields it does not recognize.
        </t>

        <section anchor="CompletingAuthenticationBootstrapping"
                 title="Completing authentication of Provisional TLS connection">
          <t>If a Registrar's credentials can not be verified using the
          pinned-domain-cert trust anchor from the voucher then the TLS
          connection is immediately
          discarded and the Pledge abandons attempts to bootstrap with this
          discovered registrar. The pledge SHOULD send voucher status
          telemetry (described below) before closing the TLS connection.
          The pledge MUST attempt to enroll using any other proxies
          it has found.  It SHOULD return to the same proxy again after
          attempting with other proxies.  Attempts should be attempted in
          the exponential backoff described earlier.
          Attempts SHOULD be repeated as failure may be the result of a
          temporary inconsistently (an inconsistently rolled Registrar key,
          or some other mis-configuration).  The inconsistently could also
          be the result an active MITM attack on the EST connection.
          </t>
          <t> The Registrar MUST use a certificate that chains to the pinned-domain-cert
              as its TLS server certificate.
          </t>

          <t>The Pledge's PKIX path validation of a Registrar certificate's validity
              period information is as described in <xref target="timeunknown"></xref>.
          Once the PKIX path validation is successful the TLS connection is
          no longer provisional.</t>

          <t>The pinned-domain-cert is installed as an
          Explicit Trust Anchor for future operations. It can therefore
          can be used to authenticate any dynamically
          discovered EST server that contain the id-kp-cmcRA extended key
          usage extension as detailed in EST RFC7030 section 3.6.1; but to
          reduce system complexity the Pledge SHOULD avoid additional
          discovery operations. Instead the Pledge SHOULD communicate directly
          with the Registrar as the EST server. The ' pinned-domain-cert' is not a complete
          distribution of the EST section 4.1.3 CA Certificate Response which is
          an additional justification for the recommendation to proceed with EST
          key management operations. Once a full CA Certificate Response is
          obtained it is more authoritative for the domain than the limited
          'pinned-domain-cert' response.'</t>
        </section>
      </section>

      <section anchor="voucherstatus" title="Voucher Status Telemetry ">
        <t>The domain is expected to provide indications to the system
        administrators concerning device lifecycle status. To facilitate this
        it needs telemetry information concerning the device's
        status.</t>

        <t>To indicate Pledge status regarding the Voucher, the pledge
        MUST post a status message.</t>

        <t>The posted data media type: application/json</t>

        <t>The client HTTP POSTs the following to the server at the EST well
        known URI /voucher_status. The Status field indicates if the Voucher
        was acceptable. If it was not acceptable the Reason string indicates
        why. In the failure case this message is being sent to an
        unauthenticated, potentially malicious Registrar and therefore the
        Reason string SHOULD NOT provide information beneficial to an
        attacker. The operational benefit of this telemetry information is
        balanced against the operational costs of not recording that an
        Voucher was ignored by a client the registar expected to continue
        joining the domain.</t>

        <t><figure>
            <artwork><![CDATA[{
  "version":"1",
  "Status":FALSE /* TRUE=Success, FALSE=Fail"
  "Reason":"Informative human readable message"
  "reason-context": { additional JSON }
}]]></artwork>
          </figure>The server SHOULD respond with an HTTP 200 but MAY simply
        fail with an HTTP 404 error. The client ignores any response. Within
        the server logs the server SHOULD capture this telemetry
        information.</t>
        <t>
          The reason-context attribute is an arbitrary JSON object (literal
          value or hash of values) which provides additional information
          specific to this pledge.  The contents of this field are not
          subject to standardization."
        </t>
        <t>
          Additional standard responses MAY be added via Specification
          Required.
        </t>
      </section>

      <section anchor="authzLogRequest" title="MASA authorization log Request ">
         <t>
           After receiving the voucher status telemetry <xref target="voucherstatus" />,
           the Registrar SHOULD request the MASA authorization log from the MASA
           service using this EST extension. If a device had previously registered
           with another domain, a Registrar of that domain would show in the
           log.
         </t>

        <t>This is done with an HTTP GET using the operation path value of
        "/requestauditlog".</t>

        <t>The registrar MUST HTTP POSTs the same Voucher Request as when requesting a
        Voucher. It is posted to the /requestauditlog URI instead. The
        "idevid-issuer" and "serial-number" informs the MASA
        server which log is requested so the appropriate log can be prepared
        for the response. Using the same media type and message minimizes
        cryptographic and message operations although it results in additional
        network traffic. The relying MASA server implementation MAY leverage
        internal state to associate this request with the original, and by now
        already validated, voucher request so as to avoid an extra crypto
        validation.</t>

        <t>The request media type is:</t>
        <t><list style="hanging">
        <t hangText="application/pkcs7-mime; smime-type=voucher-request">The request is a "YANG-defined JSON document that has been signed using a PKCS#7 structure" as described in <xref target="voucher-request"/> using the JSON encoded described in <xref target="RFC7951"/>. The Registrar MUST sign the request. The entire Registrar certificate chain, up to and including the Domain CA, MUST be included in the PKCS#7 structure.</t>
        </list></t>

        <section title="MASA authorization log Response">
          <t>A log data file is returned consisting of all log entries. For
          example:</t>

          <t><figure>
            <artwork><![CDATA[{
  "version":"1",
  "events":[
    {
     "date":"<date/time of the entry>",
     "domainID":"<domainID as extracted from the domain CA certificate
                  within the CMS of the audit voucher request>",
     "nonce":"<any nonce if supplied (or the exact string 'NULL')>"
    },
    {
     "date":"<date/time of the entry>",
     "domainID":"<domainID as extracted from the domain CA certificate
                  within the CMS of the audit voucher request>",
     "nonce":"<any nonce if supplied (or the exact string 'NULL')>"
    }
  ]
}]]></artwork>
          </figure></t>

          <t>Distribution of a large log is less than ideal. This structure can
          be optimized as follows: All nonce-less entries for the same domainID
          MAY be condensed into the single most recent nonceless entry.</t>

          <t>A Registrar SHOULD use this log information to make an informed decision
          regarding the continued bootstrapping of the Pledge. For example if
          the log includes unexpected domainIDs this is indicative of
          problematic imprints by the Pledge. If the log includes nonce-less
          entries this is indicative of the permanent ability for the indicated
          domain to trigger a reset of the device and take over management of
          it. Equipment that is purchased pre-owned can be expected to have an
          extensive history. A Registrar MAY request logs at future times.
          A Registrar MAY be configured to ignore the
          history of the device but it is RECOMMENDED that this only be
          configured if hardware assisted NEA [RFC5209] is supported.</t>

          <t>Log entries containing the Domain's ID can be compared against
          local history logs in search of discrepancies.</t>

          <t>This document specifies a simple log format as provided by the
          MASA service to the registar. This format could be improved by
          distributed consensus technologies that integrate vouchers
          with a technologies such as block-chain or hash trees or the
          like. Doing so is out of the scope of this document but are
          anticipated improvements for future work.  As such, the
          Registrar client SHOULD anticipate new kinds of responses, and
          SHOULD provide operator controls to indicate how to process
          unknown responses.
          </t>
        </section>
      </section>

      <section title="EST Integration for PKI bootstrapping">
        <t>The Pledge SHOULD follow the BRSKI operations with EST enrollment operations
        including "CA Certificates Request", "CSR Attributes" and "Client Certificate Request"
        or "Server-Side Key Generation" etc. This is a relatively seamless integration
        since BRSKI REST calls provide an automated alternative to the manual bootstrapping method
        described in <xref target="RFC7030"></xref>. As noted above, use of HTTP 1.1 persistent
        connections simplifies the Pledge state machine.</t>

        <t>The Pledge is also RECOMMENDED to implement the following EST automation extensions. They
        supplement the RFC7030 EST to better support automated devices that do not
        have an end user.</t>

        <!-- dealing with: https://github.com/anima-wg/anima-bootstrap/issues/24 -->
        <t>
          Although EST allows clients to obtain multiple certificates by sending
          multiple CSR requests BRSKI mandates use of the CSR Attributes request
          and mandates that the Registrar validate the CSR against the expected
          attributes. This implies that client requests will "look the same" and
          therefore result in a single logical certificate being issued even if
          the client were to make multiple requests. Registrars MAY contain
          more complex logic but doing so is out-of-scope of this
          specification.
          BRSKI does not signal any enhancement or restriction to this
          capability. Pledges that require multiple certificates could establish
          direct EST connections to the Registrar.
        </t>

        <section title="EST Distribution of CA Certificates">
          <t>The Pledge MUST request the full EST Distribution of CA
          Certificates message. See RFC7030, section 4.1.</t>

          <t>This ensures that the Pledge has the complete set of current CA
          certificates beyond the pinned-domain-cert (see <xref
          target="CompletingAuthenticationBootstrapping"></xref> for a discussion of the
          limitations inherent in having a single certificate instead of a full
          CA Certificates response). Although these limitations are acceptable during initial bootstrapping they are not appropriate for ongoing PKIX end entity certificate validation.</t>
        </section>

        <section anchor="csrattributes" title="EST CSR Attributes">
          <t>Automated bootstrapping occurs without local administrative
          configuration of the Pledge. In some deployments its plausible that
          the Pledge generates a certificate request containing only identity
          information known to the Pledge (essentially the X.509 IDevID information)
          and ultimately receives a certificate containing domain specific
          identity information. Conceptually the CA has complete control over
          all fields issued in the end entity certificate. Realistically this
          is operationally difficult with the current status of PKI
          certificate authority deployments where the CSR is submitted to the
          CA via a number of non-standard protocols. Even with all
          standardized protocols used, it could operationally be problematic
          to expect that service specific certificate fields can be created
          by a CA that is likely operated by a group that has no insight
          into different network services/protocols used. For example, the
          CA could even be outsourced.</t>

          <t>To alleviate these operational difficulties, the Pledge MUST
          request the
          EST "CSR Attributes" from the EST server and the EST server needs
          to be able to reply with the attributes necessary for use of
          the certificate in its intended protocols/services. This approach
          allows for minimal CA integrations and instead
          the local infrastructure (EST server) informs the Pledge of the proper
          fields to include in the generated CSR. This approach is beneficial
          to automated boostrapping in the widest number of environments.</t>

          <t>If the hardwareModuleName in
          the X.509 IDevID is populated then it SHOULD by default be propagated to
          the LDevID along with the hwSerialNum. The EST server SHOULD support
          local policy concerning this functionality.</t>

          <t>In networks using the BRSKI enrolled certificate to authenticate
          the ACP (Autonomic Control Plane), the EST attributes MUST include
          the "ACP information" field. See <xref target="I-D.ietf-anima-autonomic-control-plane" /> for more details.</t>

          <t>The Registar MUST also confirm the resulting CSR is formatted as
          indicated before forwarding the request to a CA. If the Registar is
          communicating with the CA using a protocol like full CMC which
          provides mechanisms to override the CSR attributes, then these
          mechanisms MAY be used even if the client ignores CSR Attribute
          guidance.</t>
        </section>

        <section title="EST Client Certificate Request">
          <t>The Pledge MUST request a new client certificate. See RFC7030,
          section 4.2.</t>
        </section>

        <section title="Enrollment Status Telemetry">
          <t>For automated bootstrapping of devices the adminstrative elements
          providing bootstrapping also provide indications to the system
          administrators concerning device lifecycle status. This might
          include information concerning attempted bootstrapping messages seen
          by the client, MASA provides logs and status of credential
          enrollment. The EST protocol assumes an end user and therefore does
          not include a final success indication back to the server. This is
          insufficient for automated use cases.</t>

          <t>To indicate successful enrollment the client SHOULD re-negotiate
          the EST TLS session using the newly obtained credentials. This
          occurs by the client initiating a new TLS ClientHello message on the
          existing TLS connection. The client MAY simply close the old TLS
          session and start a new one. The server MUST support either
          model.</t>

          <t>In the case of a FAIL the Reason string indicates why the most
          recent enrollment failed. The SubjectKeyIdentifier field MUST be
          included if the enrollment attempt was for a keypair that is locally
          known to the client. If EST /serverkeygen was used and failed then
          the field is omitted from the status telemetry.</t>

          <t>In the case of a SUCCESS the Reason string is omitted. The
          SubjectKeyIdentifier is included so that the server can record
          the successful certificate distribution.</t>

          <t>Status media type: application/json</t>

          <t>The client HTTP POSTs the following to the server at the new EST
          well known URI /enrollstatus.</t>

          <t><figure>
              <artwork><![CDATA[{
  "version":"1",
  "Status":TRUE /* TRUE=Success, FALSE=Fail"
  "Reason":"Informative human readable message"
  "reason-context": "Additional information"
}]]></artwork>
            </figure></t>

          <t>The server SHOULD respond with an HTTP 200 but MAY simply fail
          with an HTTP 404 error.</t>

          <t>Within the server logs the server MUST capture if this message
          was received over an TLS session with a matching client certificate.
          This allows for clients that wish to minimize their crypto
          operations to simply POST this response without renegotiating the TLS
          session - at the cost of the server not being able to accurately
          verify that enrollment was truly successful.</t>
        </section>

        <section title="EST over CoAP">
          <t>This document describes extensions to EST for the purposes
              of bootstrapping of remote key infrastructures.
              Bootstrapping is relevant for CoAP enrollment
              discussions as well. The defintion of EST and BRSKI over CoAP is not
              discussed within this document beyond ensuring proxy support for
              CoAP operations. Instead it is anticipated that a definition of
              CoAP mappings will occur in subsequent documents such as
              <xref target="I-D.vanderstok-ace-coap-est"></xref> and that
              CoAP mappings for BRSKI will be discussed either there or
              in future work.</t>
        </section>
      </section>
    </section>


    <section anchor="reducedsecuritymodes"
             title="Reduced security operational modes">
      <t>A common requirement of bootstrapping is to support less secure
      operational modes for support specific use cases. The following sections
      detail specific ways that the Pledge, Registrar and MASA can be
      configured to run in a less secure mode for the indicated reasons.</t>

      <section title="Trust Model">
        <figure>
          <artwork><![CDATA[
+--------+         +---------+    +------------+     +------------+
| Pledge |         | Circuit |    | Domain     |     | Vendor     |
|        |         | Proxy   |    | Registrar  |     | Service    |
|        |         |         |    |            |     | (Internet  |
+--------+         +---------+    +------------+     +------------+
              ]]></artwork>

          <postamble>Figure 10</postamble>
        </figure>

        <t><list style="hanging">
            <t hangText="Pledge:">The Pledge could be compromised and
            providing an attack vector for malware. The entity is trusted to
            only imprint using secure methods described in this document.
            Additional endpoint assessment techniques are RECOMMENDED but are
            out-of-scope of this document.</t>

            <t hangText="Proxy:">Provides proxy functionalities but is not
            involved in security considerations.</t>

            <t hangText="Registrar:">When interacting with a MASA server a
            Registrar makes all decisions. When Ownership Vouchers are
            involved a Registrar is only a conduit and all security decisions
            are made on the vendor service.</t>

            <t hangText="Vendor Service, MASA:">This form of vendor service is
            trusted to accurately log all claim attempts and to provide
            authoritative log information to Registrars. The MASA does not
            know which devices are associated with which domains. These claims
            could be strengthened by using cryptographic log techniques to
            provide append only, cryptographic assured, publicly auditable
            logs. Current text provides only for a trusted vendor.</t>

            <t hangText="Vendor Service, Ownership Validation:">This form of
            vendor service is trusted to accurately know which device is owned
            by which domain.</t>
          </list></t>
      </section>

      <section title="Pledge security reductions">
        <t>The Pledge can choose to accept vouchers using less
            secure methods. These methods enable offline and emergency
            (touch based) deployment use cases:
            <list style="numbers">
        <t>The Pledge MUST accept nonceless vouchers. This allows for offline
        use cases. Logging and validity periods address the inherent
        security considerations of supporting these use cases.</t>
        <t>The Pledge MAY support "trust on first use" for physical interfaces
        such as a local console port or physical user interface but MUST NOT
        support "trust on first use" on network interfaces. This
        is because "trust on first use" permanently degrades the security for
        all use cases.</t>
        <t>The Pledge MAY have an operational mode where it skips Voucher
        validation one time. For example if a physical button is depressed
        during the bootstrapping operation. This can be useful if the vendor
        service is unavailable. This behavior SHOULD be available via local
        configuration or physical presence methods to ensure new entities can
        always be deployed even when autonomic methods fail. This allows for
        unsecured imprint.</t></list></t>

        <t>It is RECOMMENDED that "trust on first use" or skipping voucher validation
        only be available if hardware assisted Network Endpoint Assessment [RFC5209]
        is supported. This recommendation ensures that domain network monitoring
        can detect innappropriate use of offline or emergency
        deployment procedures.</t>
      </section>

      <section title="Registrar security reductions">
        <t>A Registrar can choose to accept devices using less secure methods.
        These methods are acceptable when low security models are needed, as
        the security decisions are being made by the local administrator, but
        they MUST NOT be the default behavior:<list style="numbers">
            <t>A registrar MAY choose to accept all devices, or all devices of
            a particular type, at the administrator's discretion. This could
            occur when informing all Registrars of unique identifiers of new
            entities might be operationally difficult.</t>

            <t>A registrar MAY choose to accept devices that claim a unique
            identity without the benefit of authenticating that claimed
            identity. This could occur when the Pledge does not include an
            X.509 IDevID factory installed credential. New Entities without an
            X.509 IDevID credential MAY form the <xref
            target="RequestVoucherFromRegistrar"></xref> request using the
            <xref target="RequestVoucherFromMASA"></xref> format to ensure the
            Pledge's serial number information is provided to the Registar
            (this includes the IDevID AuthorityKeyIdentifier value which would
            be statically configured on the Pledge). The Pledge MAY refuse to
            provide a TLS client certificate (as one is not available). The
            Pledge SHOULD support HTTP-based or certificate-less TLS
            authentication as described in EST RFC7030 section 3.3.2. A
            Registrar MUST NOT accept unauthenticated New Entities unless it
            has been configured to do so by an administrator that has verified
            that only expected new entities can communicate with a Registrar
            (presumably via a physically secured perimeter).</t>

            <t>A Registrar MAY request nonce-less Vouchers from the MASA
            service (by not including a nonce in the request). These
            Vouchers can then be transmitted to the Registrar and stored until
            they are needed during bootstrapping operations. This is for use
            cases where target network is protected by an air gap and
            therefore can not contact the MASA service during Pledge
            deployment.</t>

            <t>A registrar MAY ignore unrecognized nonce-less log
            entries. This could occur when used equipment is purchased with a
            valid history being deployed in air gap networks that required
            permanent Vouchers.</t>
          </list></t>
      </section>

      <section title="MASA security reductions">
        <t>Lower security modes chosen by the MASA service effect all device
        deployments unless bound to the specific device identities. In which
        case these modes can be provided as additional features for specific
        customers. The MASA service can choose to run in less secure modes
        by:</t>

        <t><list style="numbers">
            <t>Not enforcing that a nonce is in the Voucher. This
            results in distribution of Voucher that never expires and in
            effect makes the Domain an always trusted entity to the Pledge
            during any subsequent bootstrapping attempts. That this occurred
            is captured in the log information so that the Registrar
            can make appropriate security decisions when a Pledge joins the
            Domain. This is useful to support use cases where Registrars might
            not be online during actual device deployment. Because this
            results in long lived Voucher and does not require the proof
            that the device is online this is only accepted when the Registrar
            is authenticated by the MASA server and authorized to provide this
            functionality. The MASA server is RECOMMENDED to use this
            functionality only in concert with an enhanced level of ownership
            tracking (out-of-scope). If the Pledge device is known to have
            a real-time-clock that is set from the factory use of a voucher
            validity period is RECOMMENDED.</t>

            <t>Not verifying ownership before responding with an
            Voucher. This is expected to be a common operational model because
            doing so relieves the vendor providing MASA services from having
            to track ownership during shipping and supply chain and allows
            for a very low overhead MASA service. A Registrar uses the audit
            log information as a defense in depth strategy to ensure that this
            does not occur unexpectedly (for example when purchasing new
            equipment the Registrar would throw an error if any audit log
            information is reported). The MASA should verify the
            'prior-signed-voucher' information for Pledge's that support
            that functionality. This provides a proof-of-proximity
            check that reduces the need for ownership verification.</t>
          </list></t>
      </section>
    </section>

    <section title="IANA Considerations">
        <t>This document requests the following Parameter Values for the "smime-type" Parameters:</t>
        <t><list style="symbols">
            <t>voucher-request</t>
            <t>voucher</t>
        </list></t>

      <section title="PKIX Registry">
        <t>IANA is requested to register the following:</t>
        <t>This document requests a number for id-mod-MASAURLExtn2016(TBD)
        from the pkix(7) id-mod(0) Registry. [[EDNOTE: fix names]]
        </t>
        <t>This document requests a number from the id-pe registry
        for id-pe-masa-url. XXX
        </t>
      </section>
      <section title="MIME">
        <t><list style="hanging" hangIndent="6">
          <t hangText="Type name:"></t>
          <t hangText="Subtype name:"></t>
          <t hangText="Required parameters:"></t>
          <t hangText="Optional parameters:"></t>
          <t hangText="Encoding considerations:"></t>
          <t hangText="Security considerations:"></t>
          <t hangText="Interoperability considerations:"></t>
          <t hangText="Published specification:"></t>
          <t hangText="Applications that use this media type:"></t>
          <t hangText="Fragment identifier considerations:"></t>
          <t hangText="Additional information:"></t>
          <t hangText="Deprecated alias names for this type:"></t>
          <t hangText="     Magic number(s):"></t>
          <t hangText="     File extension(s):"></t>
          <t hangText="     Macintosh file type code(s):"></t>
          <t hangText="   Person and email address to contact for further information:"></t>
          <t hangText="Intended usage:">LIMITED USED</t>
          <t hangText="Restrictions on usage:"></t>
          <t hangText="Author:"></t>
          <t hangText="Change controller:"></t>
          <t hangText="Provisional registration? (standards tree only):"></t>
        </list>
        </t>
      </section>
      <section title="Voucher Status Telemetry">
        <t>IANA is requested to create a registry entitled: _Voucher Status
        Telemetry Attributes_.  New items can be added using the
        Specification Required.  The following items are to be in the
        initial registration, with this document as the reference:
        <list style="symbols">
          <t>version</t>
          <t>Status</t>
          <t>Reason</t>
          <t>reason-context</t>
        </list></t>
      </section>

    </section>
    <section anchor="securityconsiderations" title="Security Considerations">
        <t>There are uses cases where the MASA could be unavailable or
        uncooperative to the Registrar. They include planned and unplanned
        network partitions, changes to MASA policy, or other instances where
        MASA policy rejects a claim. These introduce an operational risk to the
        Registrar owner that MASA/vendor behavior might limit the ability to
        re-boostrap a Pledge device. For example this might be an issue during
        disaster recovery. This risk can be mitigated by Registrars that request and
        maintain long term copies of "nonceless" Vouchers. In that way
        they are guaranteed to be able to repeat bootstrapping for their
        devices.</t>

        <t>The issuance of nonceless vouchers themselves create a security
        concern. If the Registrar of a previous domain can intercept protocol
        communications then it can use a previously issued nonceless voucher to
        establish management control of a pledge device even after having sold
        it. This risk is mitigated by recording the issuance of such vouchers
        in the MASA audit log that is verified by the subsequent Registrar.
        This reduces the resale value of the equipment because future owners
        will detect the lowered security inherent in the existence of a
        nonceless voucher that would be trusted by their Pledge. This
        reflects a balance between partition resistant recovery and
        security of future bootstrapping. Registrars take the Pledge's audit
        history into account when applying policy to new devices.</t>

        <t>The MASA server is exposed to DoS attacks wherein attackers claim
        an unbounded number of devices. Ensuring a Registrar is
        representative of a valid vendor customer, even without validating
        ownership of specific Pledge devices, helps to mitigate this. Pledge
        signatures on the initial voucher request, as forwarded by the
        Registrar in the prior-signed-voucher field, significantly
        reduce this risk by ensuring the MASA can confirm proximity
        between the Pledge and the Registrar making the request. This
        mechanism is optional to allow for constrained devices.</t>

        <t>It is possible for an attacker to request a voucher from
        the MASA service directly after the real Registrar obtains an
        audit log. If the attacker could also force the bootstrapping
        protocol to reset there is a theoretical opportunity for the attacker to
        use their voucher to take control of the Pledge but then proceed to
        enroll with the target domain. Possible prevention mechanisms
        include:</t>

      <t><list style="symbols">
          <t>Per device rate limits on the MASA service ensure such timing
          attacks are difficult.</t>

          <t>The Registrar can repeat the request for audit log information
              at some time after bootstrapping is complete.</t>
        </list></t>

      <t>To facilitate logging and administrative oversight the Pledge reports
      on Voucher parsing status to the Registrar. In the case of a
      failure this information is informative to a potentially malicious
      Registar but this is RECOMMENDED anyway because of the operational
      benefits of an informed administrator in cases where the failure is
      indicative of a problem.</t>

      <t>To facilitate truely limited clients EST RFC7030 section 3.3.2
      requirements that the client MUST support a client authentication model
      have been reduced in <xref target="reducedsecuritymodes"></xref> to a
      statement that the Registrar "MAY" choose to accept devices
      that fail cryptographic authentication. This reflects
      current (poor) practices in shipping devices without a cryptographic
      identity that are NOT RECOMMENDED.</t>

        <t>During the provisional period of the connection all HTTP header and
        content data MUST treated as untrusted data. HTTP libraries are
        regularly exposed to non-secured HTTP traffic: mature libraries
        should not have any problems.
        </t>

      <t>Pledge's might chose to engage in protocol operations with
      multiple discovered Registrars in parallel. As noted above they
      will only do so with distinct nonce values, but the end result
      could be multple voucher's issued from the MASA if all registrars
      attempt to claim the device. This is not a failure and the Pledge
      choses whichever voucher to accept based on internal logic. The
      Registrar's verifying log information will see multiple entries
      and take this into account for their analytics purposes.</t>

      <section title="Freshness in Voucher Requests">
        <t>
          A concern has been raised that the voucher request produced by the
          Pledge should contain some content (a nonce) from the Registrar and/or MASA
          in order for those actors to verify that the voucher request is fresh.
        </t>
        <t>
          There are a number of operational problems with getting a nonce
          from the MASA to the pledge. It is somewhat easier to collect a
          random value from the Registrar, but as the Registrar is not yet
          vouched for, such a Registrar nonce has little value.
          There are privacy and logistical challenges to addressing these
          operational issues, so if
          such a thing were to be considered, it would have to provide some
          clear value.  This section examines the impacts of not having a
          fresh voucher request from the pledge.
        </t>
        <t>
          Because the Registrar authenticates the Pledge a full Man-in-the-Middle
          attack is not possible, despite the provisional TLS authentication
          by the Pledge (see <xref target="ProtocolDetails"></xref>).
          Instead we examine the case of a fake Registrar (Rm)
          that communicates with the Pledge in parallel or in close time proximity
          with the intended Registrar. (This scenario is intentionally supported as
          described in <xref target="discovery"></xref>).
        </t>
        <t>
          The fake Registrar (Rm) can obtain a voucher signed by the MASA
          either directly or through arbitrary intermediaries.
          Assuming that the MASA accepts the voucher request (either because
          Rm is collaborating with a legitimate Registrar according to supply chain
          information, or because the MASA is in audit-log only mode), then
          a voucher linking the pledge to the Registrar Rm is issued.
        </t>
        <t>
          Such a voucher, when passed back to the Pledge, would link the
          pledge to Registrar Rm, and would permit the Pledge to
          end the provisional state. It now trusts Rm and, if it has any
          security vulnerabilities leveragable by an Rm with full
          administrative control, can be assumed to be a
          threat against the intended Registrar.
        </t>
        <t>
          This flow is mitigated by the intended Registar verifying the audit
          logs available from the MASA as described in
          <xref target="authzLogRequest" ></xref>. Rm might chose to wait
          until after the intended Registrar completes the authorization
          process before submitting the now-stale voucher request. The Rm
          would need to remove the Pledge's nonce.
        </t>
        <t>
          In order to successfully use the resulting "stale voucher" Rm
          would have to attack the Pledge and return it to a bootstrapping
          enabled state. This would require wiping the Pledge of current
          configuration and triggering a re-bootstrapping of the Pledge.
          This is no more likely than simply taking control of the Pledge
          directly but if this is a consideration the target network is
          RECOMMENDED to take the following steps:
        </t>
        <t><list style="symbols">
          <t>Ongoing network monitoring for unexpected bootstrapping attempts by Pledges.</t>
          <t>Retreival and examination of MASA log information upon the occurance
              of any such unexpected events. Rm will be listed in the logs.</t>
        </list></t>
      </section>
    </section>

    <section title="Acknowledgements">
      <t>We would like to thank the various reviewers for their input, in
      particular
      Brian Carpenter,
      Toerless Eckert,
      Fuyu Eleven,
      Eliot Lear,
      Sergey Kasatkin,
      Markus Stenberg,
      and Peter van der Stok</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC2119;

      &RFC7030;

      &RFC5652;

      &RFC5246;

      &RFC5280;

      &RFC7159;

      &RFC7950;

      &RFC7951;

      <?rfc include="reference.RFC.3542" ?>

      <?rfc include="reference.RFC.5386" ?>

      <?rfc include="reference.RFC.5660" ?>

      <?rfc include="reference.RFC.7228" ?>

      <?rfc include="reference.RFC.6762" ?>

      <?rfc include="reference.RFC.6763" ?>

      <?rfc include="reference.RFC.3927" ?>

      <?rfc include="reference.RFC.4862" ?>
      <?rfc include="reference.RFC.4941" ?>

      <?rfc include="reference.RFC.3748" ?>

      <?rfc include="reference.I-D.ietf-anima-autonomic-control-plane" ?>
      <?rfc include="reference.I-D.ietf-anima-voucher" ?>
      <?rfc include="reference.I-D.vanderstok-ace-coap-est" ?>

      <reference anchor="IDevID"
                 target="http://standards.ieee.org/findstds/standard/802.1AR-2009.html">
        <front>
          <title>IEEE 802.1AR Secure Device Identifier</title>

          <author surname="IEEE Standard"></author>

          <date month="December" year="2009" />
        </front>
      </reference>
    </references>

    <references title="Informative References">
      &I-D.behringer-autonomic-network-framework;

      <?rfc include="reference.RFC.7435" ?>
      <?rfc include="reference.RFC.7217" ?>
      &RFC7575;

      <?rfc include="reference.RFC.2473" ?>
      <?rfc include="reference.I-D.ietf-anima-grasp" ?>

      <?rfc include="reference.I-D.richardson-anima-state-for-joinrouter" ?>

      <?rfc include="reference.I-D.ietf-opsawg-mud" ?>

      <?rfc include="reference.I-D.ietf-netconf-zerotouch" ?>

      <reference anchor="imprinting"
                 target="https://en.wikipedia.org/wiki/Imprinting_(psychology)">
        <front>
          <title>Wikipedia article: Imprinting</title>

          <author surname="Wikipedia"></author>

          <date month="July" year="2015" />
        </front>
      </reference>

      <reference anchor="Stajano99theresurrecting"
                 target="https://www.cl.cam.ac.uk/~fms27/papers/1999-StajanoAnd-duckling.pdf">
        <front>
          <title>The resurrecting duckling: security issues for ad-hoc
          wireless networks</title>

          <author fullname="Frank Stajano" initials="F." surname="Stajano"></author>

          <author fullname="Ross Anderson" initials="R." surname="Anderson"></author>

          <date year="1999" />
        </front>
      </reference>
    </references>

    <section anchor="IPv4operations" title="IPv4 operations">
      <section title="IPv4 Link Local addresses">
      <t>Instead of an IPv6 link-local address, an IPv4 address may be
      generated using <xref target="RFC3927" />  Dynamic Configuration of
      IPv4 Link-Local Addresses.
      </t>
      <t> In the case that an IPv4 Local-Local address is formed, then the
      bootstrap process would continue as in the IPv6 case by looking for
      a (circuit) proxy.
      </t>
      </section>

      <section title="Use of DHCPv4">
      <t>
        The Plege MAY obtain an IP address via
        DHCP [RFC2131]. The DHCP provided parameters for the Domain Name
        System can be used to perform DNS operations if all
        local discovery attempts fail.
      </t>
      </section>
    </section>

    <section anchor="mdnsmethods" title="mDNS / DNSSD proxy discovery options">
      <t>The Pledge MAY perform DNS-based Service Discovery <xref
      target="RFC6763"></xref> over Multicast DNS <xref
      target="RFC6762"></xref> searching for the service
      "_bootstrapks._tcp.local.". </t>

      <t>
        To prevent unaccceptable levels of
        network traffic the congestion avoidance mechanisms specified in
        <xref target="RFC6762"></xref> section 7 MUST be followed. The
        Pledge SHOULD listen for an unsolicited broadcast response as
        described in <xref target="RFC6762"></xref>. This allows devices
        to avoid announcing their presence via mDNS broadcasts and
        instead silently join a network by watching for periodic
        unsolicited broadcast responses.
      </t>

      <t>
        Performs DNS-based Service Discovery [RFC6763] over
        normal DNS operations. The service searched for is
        "_bootstrapks._tcp.example.com". In this case the domain
        "example.com" is discovered as described in <xref
        target="RFC6763"></xref> section 11.
        This method is only available if the host has received a useable
        IPv4 address via DHCPv4 as suggested in
        <xref target="IPv4operations" />.
      </t>

      <t>
        If no local bootstrapks service is located using the GRASP
        mechanisms, or the above mentioned DNS-based Service Discovery
        methods the Pledge MAY contact a well
        known vendor provided bootstrapping server by performing a DNS
        lookup using a well known URI such as
        "bootstrapks.vendor-example.com". The details of the URI are
        vendor specific. Vendors that leverage this method on the Pledge
        are responsible for providing the bootstrapks service.
      </t>

      <t>
        The current DNS services returned
          during each query is maintained until bootstrapping is completed. If
          bootstrapping fails and the Pledge returns to the Discovery state it
          picks up where it left off and continues attempting bootstrapping.
          For example if the first Multicast DNS _bootstrapks._tcp.local
          response doesn't work then the second and third responses are tried.
          If these fail the Pledge moves on to normal DNS-based Service
          Discovery.
      </t>
    </section>

    <section anchor="IPIPmechanism" title="IPIP Join Proxy mechanism">
      <t>
        The Circuit Proxy mechanism suffers from requiring a state on the
        Join Proxy for each connection that is relayed.  The Circuit Proxy
        can be considered a kind of Algorithm Gateway [FIND-good-REF].
      </t>
      <t>
        An alternative to proxying at the TCP layer is to selectively forward
        at the IP layer.  This moves all per-connection to the Join
        Registrar.  The IPIP tunnel statelessly forwards packets.  This
        section provides some explanation of some of the details of the
        Registrar discovery procotol which are not important to Circuit
        Proxy, and some implementation advice.
      </t>
      <t>
        The IPIP tunnel is described in <xref target="RFC2473" />.  Each such tunnel is
        considered a unidirectional construct, but two tunnels may be
        associated to form a bidirectional mechanism.
        An IPIP tunnel is setup as follows.
        The outer addresses are an ACP address of the Join Proxy,
        and the ACP address of the Join Registrar.  The inner addresses seen
        in the tunnel are the link-local addresses of the network on which
        the join activity is occuring.
      </t>
      <t>
        One way to look at this construct is to consider that the Registrar
        is extending attaching an interface to the network on which the Join
        Proxy is physically present.  The Registrar then interacts as if it
        were present on that network using link-local (fe80::) addresses.
        The Join node is unaware that the traffic is being proxied through a
        tunnel, and does not need any special routing.
      </t>
      <t>
        There are a number of considerations with this mechanism which
        require cause some minor amounts of complexity.  Note that due to the
        tunnels, the Registrar sees multiple connections to a fe80::/10
        network on not just physical interfaces, but on each of the virtual
        interfaces represending the tunnels.
      </t>
      <section title="Multiple Join networks on the Join Proxy side">
        <t>
          The Join Proxy will in the general case be a routing device with
          multiple interfaces.  Even a device as simple as a wifi access
          point may have wired, and multiple frequencies of wireless
          interfaces, potentially with multiple ESSIDs.
        </t>
        <t>
          Each of these interfaces on the Join Proxy may be seperate L3
          routing domains, and therefore will have a unique set of link-local
          addresses.  An IPIP packet being returned by the Registrar needs to
          be forwarded to the correct interface, so the Join Proxy needs an
          additional key to distinguish which network the packet should be
          returned to.
        </t>
        <t>
          The simplest way to get this additional key is to allocate an
          additional ACP address; one address for each network on which join
          traffic is occuring.  The Join Proxy SHOULD do a GRASP M_NEG_SYN
          for each interface which they wish to relay traffic, as this allows
          the Registrar to do any static tunnel configuration that may be
          required.
        </t>
      </section>
      <section title="Automatic configuration of tunnels on Registrar">
        <t>
          The Join Proxy is expected to do a GRASP negotiation with the proxy
          for each Join Interface that it needs to relay traffic from.  This
          is to permit Registrars to configure the appropriate virtual
          interfaces before join traffic arrives.
        </t>
        <t>
          A Registrar serving a large number of interfaces may not wish to
          allocate resources to every interface at all times, but can instead
          dynamically allocate interfaces.  It can do this by monitoring IPIP
          traffic that arrives on it's ACP interface, and when packets arrive
          from new Join Proxys, it can dynamically configure virtual interfaces.
        </t>
        <t>
          A more sophisticated Registrar willing to modify the
          behaviour of it's TCP and UDP stack could note the IPIP traffic
          origination in the socket control block and make information
          available to the TCP layer (for HTTPS connections), or to
          the application (for CoAP connections) via a proprietary extension
          to the socket API.
        </t>
      </section>
      <section title="Proxy Neighbor Discovery by Join Proxy">
        <t>
          The Join Proxy MUST answer neighbor discovery messages for the
          address given by the Registrar as being it's link-local
          address.  The Join Proxy must also advertise this address as the
          address to which to connect to when advertising it's existence.
        </t>
        <t>
          This proxy neighbor discovery means that the pledge will create TCP
          and UDP connections to the correct Registrar address.  This matters
          as the TCP and UDP pseudo-header checksum includes the destination
          address, and for the proxy to remain completely stateless, it must
          not be necessary for the checksum to be updated.
        </t>
      </section>

      <section title="Use of connected sockets; or IP_PKTINFO for CoAP on Registrar">
        <t>
          TCP connections on the registrar SHOULD properly capture the
          ifindex of the incoming connection into the socket structure.  This
          is normal IPv6 socket API processing.  The outgoing responses will
          go out on the same (virtual) interface by ifindex.
        </t>
        <t>
          When using UDP sockets with CoAP, the application will have to pay
          attention to the incoming ifindex on the socket.  Access to this
          information is available using the IP_PKTINFO auxiliary extension
          which is a standard part of the IPv6 sockets API.
        </t>
        <t>
          A registrar application could, after receipt of an initial CoAP
          message from the Pledge, create a connected UDP socket (including
          the ifindex information).  The kernel would then take care of
          accurate demultiplexing upon receive, and subsequent transmission
          to the correct interface.
        </t>
      </section>

      <section title="Use of socket extension rather than virtual interface">
        <t>
          Some operating systems on which a Registrar need be implemented may
          find need for a virtual interface per Join Proxy to be
          problematic. There are other mechanism which can make be done.
        </t>
        <t>
          If the IPIP decapsulator can mark the (SYN) packet inside the kernel
          with the address of the Join Proxy sending the traffic, then an
          interface per Join Proxy may not be needed.  The outgoing path need
          just pay attention to this extra information and add an appropriate
          IPIP header on outgoing.  A CoAP over UDP mechanism may need to
          expose this extra information to the application as the UDP sockets
          are often not connected, and the application will need to specify
          the outgoing path on each packet send.
        </t>
        <t>
          Such an additional socket mechanism has not been standardized.
          Terminating L2TP connections over IPsec transport mode suffers from
          the same challenges.
        </t>
      </section>
    </section>
    <section anchor="mud-extension" title="MUD Extension">
        <t>The following extension augments the MUD model to include a single node, as described in <xref target="I-D.ietf-opsawg-mud"></xref> section 3.6, 
            using the following sample module that has the following tree structure:</t>
        <figure>
<artwork><![CDATA[
module: ietf-mud-brski-masa
augment /ietf-mud:mud:
+--rw masa-server?   inet:uri
]]></artwork>
        </figure>
        <t>The model is defined as follows:</t>
        <figure>
<artwork><![CDATA[
<CODE BEGINS>
module ietf-mud-brski-masa {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-mud-brski-masa";
  prefix ietf-mud-brski-masa;
  import ietf-mud {
    prefix ietf-mud;
  }
  import ietf-inet-types {
    prefix inet;
  }

  organization
    "IETF ANIMA (Autonomic Networking Integrated Model and 
    Approach) Working Group";
    contact
    "WG Web: http://tools.ietf.org/wg/anima/
    WG List: anima@ietf.org
    ";
  description
    "BRSKI extension to a MUD file to indicate the
    MASA URL.";

  revision 2017-10-09 {
    description
    "Initial revision.";
    reference
    "RFC XXXX: Manufacturer Usage Description
    Specification";
  }

  augment "/ietf-mud:mud" {
    description
    "BRSKI extension to a MUD file to indicate the
    MASA URL.";
    leaf masa-server {
      type inet:uri;
      description
      "This value is the URI of the MASA server";
    }
  }
}
<CODE ENDS>]]></artwork>
        </figure>
    </section>
  </back>
</rfc>
<!--
    Local Variables:
    mode: xml
    End:
-->
