<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc category="std" docName="draft-ietf-netconf-https-notif-00"
     ipr="trust200902">
  <?rfc toc="yes"?>

  <front>
    <title abbrev="HTTP Configured Subscription">An HTTPS-based Transport for
    Configured Subscriptions</title>

    <author fullname="Mahesh Jethanandani" initials="M.J."
            surname="Jethanandani">
      <organization>VMware</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>mjethanandani@gmail.com</email>

        <uri/>
      </address>
    </author>

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

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <country>USA</country>
        </postal>

        <email>kent+ietf@watsen.net</email>
      </address>
    </author>

    <date day="17" month="September" year="2019"/>

    <area>Routing</area>

    <workgroup>NETCONF</workgroup>

    <keyword>http</keyword>

    <keyword>yang</keyword>

    <keyword>notification</keyword>

    <abstract>
      <t>This document defines a YANG data module for configuring HTTPS based
      configured subscription, as defined
      I-D.ietf-netconf-subscribed-notifications. The use of HTTPS maximizes
      transport-level interoperability, while allowing for encoding selection
      from text, e.g. XML or JSON, to binary.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t><xref target="I-D.ietf-netconf-subscribed-notifications">Subscribed
      Notifications</xref> defines a YANG data module for configuring
      subscribed notifications. It even defines a subscriptions container that
      contains a list of receivers. But it defers the configuration and
      management of those receivers to other documents. This document defines
      a <xref target="RFC7950">YANG</xref> data module for configuring and
      managing HTTPS based receivers for the notifications. Such a configured
      receiver can be a third party collector, collecting events on behalf of
      receivers that want to co-relate events from different publishers.
      Configured subscriptions enable a server, acting as a publisher of
      notifications, to proactively push notifications to external receivers
      without the receivers needing to first connect to the server, as is the
      case with dynamic subscriptions.</t>

      <t>This document describes how to enable the transmission of YANG
      modeled notifications, in the configured encoding (i.e., XML, JSON) over
      HTTPS. The use of HTTPS maximizes transport-level interoperability,
      while the encoding selection pivots between implementation simplicity
      (XML, JSON) and throughput (text versus binary).</t>

      <section title="Note to RFC Editor">
        <t>This document uses several placeholder values throughout the
        document. Please replace them as follows and remove this section
        before publication.</t>

        <t>RFC XXXX, where XXXX is the number assigned to this document at the
        time of publication.</t>

        <t>2019-09-17 with the actual date of the publication of this
        document.</t>
      </section>

      <section title="Abbreviations">
        <texttable>
          <ttcol>Acronym</ttcol>

          <ttcol>Expansion</ttcol>

          <c>HTTP</c>

          <c>Hyper Text Transport Protocol</c>

          <c>TCP</c>

          <c>Transmission Control Protocol</c>

          <c>TLS</c>

          <c>Transport Layer Security</c>
        </texttable>
      </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 BCP
        14 <xref target="RFC2119">RFC2119</xref> <xref
        target="RFC8174">RFC8174</xref> when, and only when, they appear in
        all capitals, as shown here.</t>

        <section title="Subscribed Notifications">
          <t>The following terms are defined in <xref
          target="I-D.ietf-netconf-subscribed-notifications">Subscribed
          Notifications</xref>.</t>

          <t><list style="symbols">
              <t>Subscribed Notifications</t>
            </list></t>
        </section>
      </section>
    </section>

    <section anchor="overview" title="YANG module">
      <section anchor="overview.protocol" title="Overview">
        <t>The YANG module is a definition of a set of receivers that are
        interested in the notifications published by the publisher. The module
        contains the TCP, TLS and HTTPS parameters that are needed to
        communicate with the receiver. The module augments the <xref
        target="I-D.ietf-netconf-subscribed-notifications">Subscribed
        Notifications</xref> receiver container to create a reference to a
        receiver defined by the YANG module.</t>

        <t>An abridged tree diagram representing the module is shown
        below.</t>

        <figure>
          <artwork><![CDATA[
module: ietf-https-notif
  +--rw receivers
     +--rw receiver* [name]
        +--rw name           string
        +--rw tcp-params
        |  +--rw remote-address    inet:host
        |  +--rw remote-port?      inet:port-number
        |  +--rw local-address?    inet:ip-address
        |  +--rw local-port?       inet:port-number
        |  +--rw keepalives!
        |        ...
        +--rw tls-params
        |  +--rw client-identity
        |  |     ...
        |  +--rw server-authentication
        |  |     ...
        |  +--rw hello-params {tls-client-hello-params-config}?
        |  |     ...
        |  +--rw keepalives! {tls-client-keepalives}?
        |        ...
        +--rw http-params
           +--rw protocol-version?   enumeration
           +--rw client-identity
           |     ...
           +--rw proxy-server! {proxy-connect}?
                 ...

  augment /sn:subscriptions/sn:subscription/sn:receivers/sn:receiver:
    +--rw receiver-ref?   -> /receivers/receiver/name

]]></artwork>
        </figure>
      </section>

      <section title="YANG module">
        <t>The YANG module is shown below.</t>

        <figure>
          <artwork><![CDATA[
<CODE BEGINS> file "ietf-https-notif@2019-09-17.yang"
module ietf-https-notif {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-https-notif";
  prefix "hsn";

  import ietf-subscribed-notifications {
    prefix sn;
    reference
      "I-D.ietf-netconf-subscribed-notifications";
  }

  import ietf-tcp-client {
    prefix tcpc;
  }

  import ietf-tls-client {
    prefix tlsc;
  }
  
  import ietf-http-client {
    prefix httpc;
  }
  
  organization
    "IETF NETCONF Working Group";

  contact
    "WG Web:   <http://tools.ietf.org/wg/netconf>
     WG List:  <netconf@ietf.org>

     Authors: Mahesh Jethanandani (mjethanandani at gmail dot com)
              Kent Watsen (kent plus ietf at watsen dot net)";
  description
    "YANG module for configuring HTTPS base configuration.

     Copyright (c) 2018 IETF Trust and the persons identified as
     the document authors.  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 "2019-09-17" {
    description
      "Initial Version.";
    reference
      "RFC XXXX, YANG Data Module for HTTPS Notifications.";
  }

  identity https {
    base sn:transport;
    description
      "HTTPS transport for notifications.";
  }

  container receivers {
    list receiver {
      key "name";

      leaf name {
	type string;
	description
	  "A name that uniquely identifies this receiver.";
      }

      container tcp-params {
	uses tcpc:tcp-client-grouping;
	description
	  "TCP client parameters.";
      }

      container tls-params {
	uses tlsc:tls-client-grouping;
	description
	  "TLS client parameters.";
      }

      container http-params {
	uses httpc:http-client-grouping;
	description
	  "HTTP client parameters.";
      }
      description
	"All receivers interested in this notification.";
    }
    description
      "HTTPS based notifications.";
  }
  
  augment "/sn:subscriptions/sn:subscription/sn:receivers/sn:receiver" {
    leaf receiver-ref {
      type leafref {
	path "/receivers/receiver/name";
      }
      description
	"Reference to a receiver.";
    }
    description
      "Augment the subscriptions container to define the receiver.";
  }
}
<CODE ENDS>

]]></artwork>
        </figure>
      </section>
    </section>

    <section title="Security Considerations">
      <t>The YANG module specified in this document defines a schema for data
      that is designed to be accessed via network management protocols such as
      <xref target="RFC6241">NETCONF</xref> or <xref
      target="RFC8040">RESTCONF</xref>. The lowest NETCONF layer is the secure
      transport layer, and the mandatory-to-implement secure transport is
      <xref target="RFC6242">Secure Shell (SSH)</xref>. The lowest RESTCONF
      layer is HTTPS, and the mandatory-to-implement secure transport is <xref
      target="RFC8446">TLS</xref>. The <xref target="RFC8341">NETCONF Access
      Control Model (NACM) </xref> provides the means to restrict access for
      particular NETCONF or RESTCONF users to a preconfigured subset of all
      available NETCONF or RESTCONF protocol operations and content.</t>

      <t>There are a number of data nodes defined in this YANG module that are
      writable/creatable/deletable (i.e., config true, which is the default).
      These data nodes may be considered sensitive or vulnerable in some
      network environments. Write operations (e.g., edit-config) to these data
      nodes without proper protection can have a negative effect on network
      operations. These are the subtrees and data nodes and their
      sensitivity/vulnerability:</t>

      <t>Some of the readable data nodes in this YANG module may be considered
      sensitive or vulnerable in some network environments. It is thus
      important to control read access (e.g., via get, get-config, or
      notification) to these data nodes. These are the subtrees and data nodes
      and their sensitivity/vulnerability:</t>

      <t>Some of the RPC operations in this YANG module may be considered
      sensitive or vulnerable in some network environments. It is thus
      important to control access to these operations. These are the
      operations and their sensitivity/vulnerability:</t>
    </section>

    <section title="IANA Considerations">
      <t>This document registers one URI and one YANG module.</t>

      <section title="URI Registration">
        <t>in the <xref target="RFC3688">IETF XML registry</xref> [RFC3688].
        Following the format in RFC 3688, the following registration is
        requested to be made: <figure>
            <artwork><![CDATA[URI: urn:ietf:params:xml:ns:yang:ietf-http-notif
]]></artwork>
          </figure></t>

        <t>Registrant Contact: The IESG. XML: N/A, the requested URI is an XML
        namespace.</t>
      </section>

      <section title="YANG Module Name Registration">
        <t>This document registers three YANG module in the YANG Module Names
        registry <xref target="RFC6020">YANG</xref>.</t>

        <t><figure>
            <artwork><![CDATA[name: ietf-https-notif
namespace: urn:ietf:params:xml:ns:yang:ietf-https-notif
prefix: hn
reference: RFC XXXX
]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="Examples">
      <t>This section tries to show some examples in how the model can be
      used.</t>

      <section title="HTTPS Configured Subscription">
        <t>This example shows how a HTTPS client can be configured to send
        notifications to a receiver at address 192.0.2.1, port 443 with server
        certificates, and the corresponding trust store that is used to
        authenticate a connection.</t>

        <t><figure>
            <artwork><![CDATA[
[note: '\' line wrapping for formatting only]

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <receivers
      xmlns="urn:ietf:params:xml:ns:yang:ietf-https-notif">
      <receiver>
	<name>foo</name>
	<tcp-params>
	  <remote-address>192.0.2.1</remote-address>
	  <remote-port>443</remote-port>
	  <local-address>192.0.3.1</local-address>
	  <local-port>63001</local-port>
	</tcp-params>
	<tls-params>
	  <server-authentication>
            <ca-certs>explicitly-trusted-server-ca-certs</ca-certs>
            <server-certs>explicitly-trusted-server-certs</server-ce\
rts>
	  </server-authentication>
	</tls-params>
      </receiver>
  </receivers>
  
  <subscriptions
      xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notificatio\
ns">
    <subscription>
      <id>6666</id>
      <stream-subtree-filter>foo</stream-subtree-filter>
      <stream>some-stream</stream>
	<receivers>
	  <receiver>
	    <name>my-receiver</name>
	    <receiver-ref
		xmlns="urn:ietf:params:xml:ns:yang:ietf-https-notif">foo</receiver\
-ref>
	  </receiver>
	</receivers>
      </subscription>
  </subscriptions>
  
  <truststore xmlns="urn:ietf:params:xml:ns:yang:ietf-truststore">
    <certificates>
       <name>explicitly-trusted-server-certs</name>
       <description>
         Specific server authentication certificates for explicitly
         trusted servers.  These are needed for server certificates
         that are not signed by a pinned CA.
       </description>
       <certificate>
         <name>Fred Flintstone</name>
         <cert>base64encodedvalue==</cert>
       </certificate>
     </certificates>
     <certificates>
       <name>explicitly-trusted-server-ca-certs</name>
       <description>
         Trust anchors (i.e. CA certs) that are used to authenticate\

         server connections.  Servers are authenticated if their
         certificate has a chain of trust to one of these CA
         certificates.
       </description>
       <certificate>
         <name>ca.example.com</name>
         <cert>base64encodedvalue==</cert>
       </certificate>
     </certificates>
  </truststore>
</config>

]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="Contributors">
      <t/>
    </section>

    <section title="Acknowledgements">
      <t/>
    </section>
  </middle>

  <back>
    <references title="Normative references">
      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.3688'?>

      <?rfc include='reference.RFC.6020'?>

      <?rfc include='reference.RFC.6241'?>

      <?rfc include='reference.RFC.6242'?>

      <?rfc include='reference.RFC.7950'?>

      <?rfc include='reference.RFC.8040'?>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.8341'?>

      <?rfc include='reference.RFC.8446'?>

      <?rfc include='reference.I-D.ietf-netconf-subscribed-notifications'?>
    </references>
  </back>
</rfc>
