NETCONF                                                  M. Jethanandani
Internet-Draft                                            Kloud Services
Intended status: Standards Track                               K. Watsen
Expires: May 20, August 6, 2021                                  Watsen Networks
                                                       November 16, 2020
                                                        February 2, 2021

         An HTTPS-based Transport for Configured Subscriptions
                   draft-ietf-netconf-https-notif-06
                   draft-ietf-netconf-https-notif-07

Abstract

   This document defines both a YANG data module protocol for configuring sending notifications over
   HTTPS based
   configured subscription, as well as extensions to the data model for configured
   subscriptions defined in RFC 8639.  The use of HTTPS
   maximizes transport-level interoperability, while allowing  It also presents an example
   module for
   encoding selection from text, e.g.  XML configuration without using the data model defined in RFC
   8639.

   This document requires that the publisher is a "server" (e.g., a
   NETCONF or JSON, to binary. RESTCONF server), but does not assume that the receiver is
   a server.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on May 20, August 6, 2021.

Copyright Notice

   Copyright (c) 2020 2021 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2   3
     1.1.  Applicability Statement . . . . . . . . . . . . . . . . .   3
     1.2.  Note to RFC Editor  . . . . . . . . . . . . . . . . . . .   3
     1.3.  Abbreviations . . . . . . . . . . . . . . . . . . . . . .   3   4
     1.4.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   4
       1.4.1.  Subscribed Notifications  . . . . . . . . . . . . . .   4
     1.5.  Receiver and
   2.  Overview of Publisher to Receiver Interaction . . . . . . . .   4
   3.  Discovering a Receiver's Capabilities . . .   4
       1.5.1.  Pipelining of messages . . . . . . . . .   5
     3.1.  Applicability . . . . . .   4
   2.  Learning Receiver Capabilities . . . . . . . . . . . . . . .   7
     2.1.  Introduction .   5
     3.2.  Request . . . . . . . . . . . . . . . . . . . . .   7
     2.2.  Example . . . .   5
     3.3.  Response  . . . . . . . . . . . . . . . . . . . . .   7
   3.  The "ietf-sub-notif-recv-list" Module . . .   6
     3.4.  Example . . . . . . . . .   8
     3.1.  Data Model Overview . . . . . . . . . . . . . . . .   6
   4.  Sending Event Notifications . . .   8
     3.2.  YANG Module . . . . . . . . . . . . . .   7
     4.1.  Request . . . . . . . . .   8
   4.  The "ietf-https-notif" Module . . . . . . . . . . . . . . . .  10
     4.1.  Data Model Overview   7
     4.2.  Response  . . . . . . . . . . . . . . . . . . . . . .  10
     4.2.  YANG module . .   8
     4.3.  Example . . . . . . . . . . . . . . . . . . . . . . .  11 . .   8
   5.  Security Considerations  The "ietf-subscribed-notif-receivers" Module  . . . . . . . .   9
     5.1.  Data Model Overview . . . . . . . . . . .  14
   6.  Receiving Event Notifications . . . . . . . .   9
     5.2.  YANG Module . . . . . . . . .  15
   7.  IANA Considerations . . . . . . . . . . . . . .   9
   6.  The "ietf-https-notif-transport" Module . . . . . . .  15
     7.1.  URI Registration . . . .  12
     6.1.  Data Model Overview . . . . . . . . . . . . . . . . . . .  15
     7.2.  12
     6.2.  YANG Module Name Registration module . . . . . . . . . . . . . .  15
     7.3.  Media Types . . . . . . . . .  13
   7.  Security Considerations . . . . . . . . . . . . . . .  16
       7.3.1.  Media Type "application/ietf-https-notif-cap+xml . .  16
       7.3.2.  Media Type "application/ietf-https-notif-cap+json . .  17
   8.  Examples  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  18
     8.1.  The "IETF XML" Registry . . . . . . . . . .  18
     8.1.  Subscribed Notification based Configuration . . . . . . .  18
     8.2.  Non Subscribed Notification based Configuration  The "YANG Module Names" Registry  . . . . . . . . . . . .  20  18
     8.3.  Bundled Message  The "Capabilities for HTTPS Notification Receivers"
           Registry  . . . . . . . . . . . . . . . . . . . . .  24
   9.  Contributors . . .  18
   9.  References  . . . . . . . . . . . . . . . . . . . . .  25
   10. Acknowledgements . . . .  19
     9.1.  Normative references  . . . . . . . . . . . . . . . . . .  25
   11. Normative  19
     9.2.  Informative references  . . . . . . . . . . . . . . . . .  21
   Appendix A.  Configuration Examples . . .  25
   Authors' Addresses . . . . . . . . . . . .  21
     A.1.  Using Subscribed Notifications (RFC 8639) . . . . . . . .  22
     A.2.  Not Using Subscribed Notifications  . . .  27

1.  Introduction

   Subscription to YANG Notifications [RFC8639] defines a YANG data
   module for configuring subscribed notifications.  It defines a
   "subscriptions" container that contains a list of receivers, but it
   defers the configuration and management . . . . . . . .  24
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  26
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  26

1.  Introduction

   This document defines a protocol for sending notifications over
   HTTPS.  Using HTTPS maximizes transport-level interoperability, while
   allowing for a variety of those receivers to encoding options.  This document defines
   support for JSON and XML; future efforts may define support for other
   documents.
   encodings (e.g., binary).

   This document also defines two YANG 1.1 [RFC7950] data
   modules, one for augmenting modules that extend
   the data model defined in Subscription to YANG Notifications
   [RFC8639] to add a transport type, and another for configuring and
   managing HTTPS based receivers for the notifications.

   The first module allows for different transports to be configured for
   the same receiver instance.  The second module describes how to
   enable
   [RFC8639], enabling the transmission configuration of YANG modeled notifications, in the
   configured encoding (i.e., XML, JSON) over HTTPS.  Notifications are
   delivered in HTTPS-based receivers.

   An example module illustrating the form configuration of a HTTPS POST.  The use of HTTPS maximizes
   transport-level interoperability, while publisher not
   using the encoding selection pivots
   between implementation simplicity (XML, JSON) and throughput (text
   versus binary). data model defined in RFC 8639 is also provided.

   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.

1.1.  Applicability Statement

   While the YANG modules have been defined as an augmentation of
   Subscription to YANG Notifications [RFC8639], the notification method
   defined in this document MAY be used outside of Subscription to YANG
   Notifications [RFC8639] by using some of the definitions from this
   module along with the grouping defined in Groupings for HTTP Clients
   and Servers [I-D.ietf-netconf-http-client-server].  For an example on
   how that can be done, see Section 8.2.

1.2.  Note to RFC Editor

   This document uses several placeholder values throughout the
   document.  Please replace them as follows and remove this section
   before publication.

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

   2020-11-16

   RFC YYYY, where YYYY is the number assigned to
   [I-D.ietf-netconf-http-client-server].

   2021-02-02 with the actual date of the publication of this document.

1.3.  Abbreviations

            +---------+--------------------------------------+
            | Acronym | Expansion                            |
            +---------+--------------------------------------+
            | HTTP    | Hyper Text Transport Protocol        |
            |         |                                      |
            | HTTPS   | Hyper Text Transport Protocol Secure |
            |         |                                      |
            | TCP     | Transmission Control Protocol        |
            |         |                                      |
            | TLS     | Transport Layer Security             |
            +---------+--------------------------------------+

1.4.  Terminology

   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 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

1.4.1.  Subscribed Notifications

   The following terms are defined in Subscription to YANG Notifications
   [RFC8639].

   o  Subscribed Notifications

1.5.  Receiver and

2.  Overview of Publisher to Receiver Interaction

   The interaction between protocol consists of two HTTP-based target resources presented by
   the receiver and receiver:

   o  A target resource enabling the publisher can be of type
   "pipelining" to discover what optional
      capabilities a receiver supports.  Publishers SHOULD query this
      target when before sending any notifications or if ever an error
      occurs.

   o  A target resource enabling to publish to send multiple notifications as part of one or more
      notification to a "bundled-
   message", as defined in Notification Message Headers and Bundles
   [I-D.ietf-netconf-notification-messages]

1.5.1.  Pipelining of messages

   In the case of "pipelining", the flow of messages would look
   something like this. receiver.  This example shows the flow assuming that
   Subscribed Notifications is used and therefore a <subscription-
   started> notification is sent before document defines support for
      sending only one notification per message; a future effort MAY
      extend the first notification. protocol to send multiple notifications per message.

   The example would be the same for when Subscribed Notification protocol is not
   used by removing illustrated in the first POST message for <susbscription-started>. diagram below:

             -------------                      --------------
             | Publisher |                      | Receiver   |
             -------------                      --------------

       Establish TCP             ------>

       Establish TLS             ------>

        Send HTTPS POST GET message
       with <subscription-    ------>
       started> notification
        to discover receiver's
        capabilities

                                  <------    Send 200 (OK) for
                                 <------          <subscription-started> containing
                                             capabilities supported
                                             by the receiver

   +-- For Each Notification (MAY be pipelined) ---------------------+
   |                                                                 |
   |    Send HTTPS POST message
       with YANG defined   ------>
       notification #1

       Send HTTPS POST message                            |
   |    with YANG defined         ------>                                            |
   |    notification #2
                                                 Send 204 (No Content)                                                 |
   |                                                                 |
   |                              <------         for notification #1    Send 204 (No Content)
                                 <------   |
   +-----------------------------------------------------------------+

   Note that, for RFC 8639 configured subscriptions, the very first
   notification #2

       Send HTTPS must be the "subscription-started" notification.

   The POST message
       with YANG defined         ------->
       notification #3

                                                 Send 204 (No Content)
                                 <------ messages MAY be "pipelined" (not illustrated in the diagram
   above), whereby multiple notifications are sent without waiting for notification #3

   The content of
   the exchange would look something like this.

   Request:

       POST /some/path HTTP/1.1
       Host: my-receiver.my-domain.com
       Content-Type: application/yang-data+xml

       <notification
         xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
         <eventTime>2019-03-22T12:35:00Z</eventTime>
         <foo xmlns="https://example.com/my-foobar-module">
           ...
         </foo>
       </notification>

       <notification
         xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
         <eventTime>2019-03-22T12:35:00Z</eventTime>
         <bar xmlns="https://example.com/my-foobar-module">
           ...
         </bar>
       </notification>

       <notification
         xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
         <eventTime>2019-03-22T12:35:01Z</eventTime>
         <baz xmlns="https://example.com/my-foobar-module">
           ...
         </baz>
       </notification>

   Response:

         HTTP/1.1 204 No Content
         Date: Fri, 03 Mar 2019 12:35:00 GMT
         Server: my-receiver.my-domain.com

         HTTP/1.1 204 No Content
         Date: Fri, 03 Mar 2019 12:35:00 GMT
         Server: my-receiver.my-domain.com

         HTTP/1.1 204 No Content
         Date: Fri, 03 Mar 2019 12:35:01 GMT
         Server: my-receiver.my-domain.com

2.  Learning Receiver HTTP response for a previous request.

3.  Discovering a Receiver's Capabilities

2.1.  Introduction

3.1.  Applicability

   For publishers using Subscription to YANG Notifications [RFC8639],
   dynamic discovery of a receiver's supported encoding is necessary
   only when the "/subscriptions/subscription/encoding" leaf is not
   configured, per the "encoding" leaf's description statement in the
   "ietf-subscribed-notification" module.  FIXME: do they need to
   discover *any* capabilities?

3.2.  Request

   To learn the capabilities of the a receiver, the a publisher can issue a an
   HTTPS GET request with Accept-Type set to application/ietf-https-
   notif-cap+xml or application/ietf-https-notif-cap+json, with latter
   as the mandatory to implement, and "capabilities" resource under a known path
   on the receiver with "Accept" header set using the "application/xml"
   and/or "application/json" media-types, with latter as the mandatory
   to implement, and the default in case the type is not specified.  If the

3.3.  Response

   The receiver supports capabilities such as binary
   encoding of data, it can return that as responds with a capability "200 (OK)" message, having the "Content-
   Type" header set to either "application/xml" or "application/json"
   (which ever was selected), and containing in the response body a response.
   Please note that, when used in conjunction with Subscription to YANG
   Notifications [RFC8639], dynamic discovery list
   of the receiver's
   supported encoding is considered only when capabilities encoded in the
   "/subscriptions/subscription/encoding" leaf selected format.

   Even though a YANG module is not configured, per defined for this interaction, the "encoding" leaf's
   response body MUST conform to the following YANG-modeled format:

   container receiver-capabilities {
     description
       "A container for a list of capabilities supported by
        the receiver.";
     leaf-list receiver-capability {
       type string {
         pattern "urn:ietf:capability:https-notif-receiver:*";
       }
       description statement.

2.2.
         "A capability supported by the receiver.  A full list of
          capabilities is defined in the 'Capabilities for HTTPS
          Notification Receivers' registry (see RFC XXXX).";
     }
   }

3.4.  Example

   The publisher can send the following request to learn the receiver
   capabilities.  The Accept-Type  In this example, the "Accept" states its preferred order for
   Content-Type that it the receiver
   wants to receive starting with XML, and notifications in XML but, if not supported, to use
   JSON encoding.  Currently, there is only one
   capability of binary encoding defined.

   GET / /some/path/capabilities HTTP/1.1
   Host: example.com
Accept-Type: application/ietf-https-notif-cap+xml, application/ietf-https-notif-cap+json

   In case
   Accept: application/xml, application/json

   If the receiver supports is able to reply using "application/xml", and
   assuming it is able to receive JSON and XML encoded notifications,
   the first Accept-Type, its response
   should might look like this:

   HTTP/1.1 200 OK
   Date: Wed, 26 Feb 2020 20:33:30 GMT
   Server: example-server
   Cache-Control: no-cache
   Content-Type: application/ietf-https-notif-cap+xml application/xml
   Content-Length: nnn

   <receiver-capabilities>
     <receiver-capability>
       <urn:ietf:params:https-config:capability:binary-encoding:1.0>
     <receiver-capability>\
       urn:ietf:capability:https-notif-receiver:encoding:json\
     </receiver-capability>
     <receiver-capability>\
       urn:ietf:capability:https-notif-receiver:encoding:xml\
     </receiver-capability>
   </receiver-capabilities>

3.

   If the receiver is unable to reply using "application/xml", the
   response might look like this:

   HTTP/1.1 200 OK
   Date: Wed, 26 Feb 2020 20:33:30 GMT
   Server: example-server
   Cache-Control: no-cache
   Content-Type: application/json
   Content-Length: nnn

   {
      receiver-capabilities {
        "receiver-capability": [
          "urn:ietf:capability:https-notif-receiver:encoding:json",
          "urn:ietf:capability:https-notif-receiver:encoding:xml"
        ]
      }
   }

4.  Sending Event Notifications

4.1.  Request

   The "ietf-sub-notif-recv-list" Module

3.1.  Data Model Overview

   This YANG module augments ietf-subscribed-notifications module publisher sends an HTTPS POST request to
   define the "relay-
   notifications" resource under a choice of transport types that other modules such as known path on the
   ietf-https-notif module can use receiver with the
   "Content-Type" header set to define either "application/json" or
   "application/xml" and a transport specific
   receiver.

   module: ietf-sub-notif-recv-list
     augment /sn:subscriptions:
       +--rw receiver-instances
          +--rw receiver-instance* [name]
             +--rw request body containing the notification
   encoded using the specified format.

   XML-encoded notifications are encoded using the format defined by
   NETCONF Event Notifications [RFC5277] for XML.

   JSON-encoded notifications are encoded the same as specified in
   Section 6.4 in RESTCONF [RFC8040] with the following deviations:

   o  The notifications do not contain the "data:" prefix used by SSE.

   o  Instead of saying that, for JSON-encoding purposes, the module
      name for the "notification" element is "ietf-restconf, the module
      name will instead by "ietf-https-notif".

4.2.  Response

   The response should be "204 (No Content)".

4.3.  Example

   An XML-encoded notification might be sent as follows:

  POST /some/path/relay-notification HTTP/1.1
  Host: example.com
  Content-Type: application/xml

  <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
    <eventTime>2019-03-22T12:35:00Z</eventTime>
    <event xmlns="https://example.com/example-mod">
      <event-class>fault</fault>
      <reporting-entity>
        <card>Ethernet0</card>
      </reporting-entity>
      <severity>major</severity>
    </event>
  </notification>

   A JSON-encoded notification might be sent as follows:

   POST /some/path/relay-notification HTTP/1.1
   Host: example.com
   Content-Type: application/json

   {
     "ietf-https-notif:notification": {
       "eventTime": "2013-12-21T00:01:00Z",
       "example-mod:event" : {
         "event-class" : "fault",
         "reporting-entity" : { "card" : "Ethernet0" },
         "severity" : "major"
       }
     }
   }
   And, in either case, the response might be as follows:

   HTTP/1.1 204 No Content
   Date: Wed, 26 Feb 2020 20:33:30 GMT
   Server: example-server

5.  The "ietf-subscribed-notif-receivers" Module

5.1.  Data Model Overview

   This YANG module augments the "ietf-subscribed-notifications" module
   to define a choice of transport types that other modules such as the
   "ietf-https-notif-transport" module can use to define a transport
   specific receiver.

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

  module: ietf-subscribed-notif-receivers

    augment /sn:subscriptions:
      +--rw receiver-instances
         +--rw receiver-instance* [name]
            +--rw name    string
            +--rw (transport-type)
    augment /sn:subscriptions/sn:subscription/sn:receivers/sn:receiver: /sn:subscriptions/sn:subscription/sn:receivers/sn:receiver:\

      +--rw receiver-instance-ref?   leafref

3.2.

5.2.  YANG Module

   The YANG module imports Subscription to YANG Notifications [RFC8639].

   <CODE BEGINS> file "ietf-sub-notif-recv-list@2020-11-16.yang" "ietf-subscribed-notif-receivers@2021-02-02.yang"
   [note: '\' line wrapping for formatting only]

   module ietf-sub-notif-recv-list ietf-subscribed-notif-receivers {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-sub-notif-recv-list";
       "urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers";
     prefix "snrl"; "snr";

     import ietf-subscribed-notifications {
       prefix sn;
       reference
      "I-D.ietf-netconf-subscribed-notifications";
         "RFC 8639: Subscription to YANG Notifications";
     }

     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
       "This YANG module for augmenting Subscribed Notifications to add
     a transport type.

     Copyright (c) 2018 IETF Trust and the persons identified as is implemented by Publishers implementing
        the document authors.  All rights reserved.
     Redistribution and use 'ietf-subscribed-notifications' module defined in source and binary forms, with or
     without modification, RFC 8639.

        While this module is permitted pursuant to, and defined in RFC XXXX, which primarily
        defines an HTTPS-based transport for notifications, this module
        is not HTTP-specific.  It is a generic extension that can be
        used by any 'notif' transport.

        This module defines two 'augment' statements.  One statement
        augments a 'container' statement called 'receiver-instances'
        into the top-level 'subscriptions' container.  The other
        statement, called 'receiver-instance-ref', augemnts a 'leaf'
        statement into each 'receiver' that references one of the
        afore mentioned receiver instances.  This indirection enables
        multiple configured subscriptions to send notifications to
        the same receiver instance.

        Copyright (c) 2021 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.

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

     revision "2020-11-16" "2021-02-02" {
       description
         "Initial Version.";

       reference
         "RFC XXXX, YANG Data Module for HTTPS Notifications.";
     }

     augment "/sn:subscriptions" {
       container receiver-instances {
         description
           "A container for all instances of receivers.";

         list receiver-instance {
           key "name";

           leaf name {
             type string;
             description
               "An arbitrary but unique name for this receiver
                instance.";
           }

           choice transport-type {
             mandatory true;
             description
               "Choice of different types of transports used to
                send
             notifications."; notifications.  The 'case' statements must
                be augmented in by other modules.";
           }
           description
             "A list of all receiver instances.";
         }
       }
       description
         "Augment the subscriptions container to define the
          transport type.";
     }

     augment
       "/sn:subscriptions/sn:subscription/sn:receivers/sn:receiver" {
       leaf receiver-instance-ref {
         type leafref {
           path "/sn:subscriptions/snrl:receiver-instances/" "/sn:subscriptions/snr:receiver-instances/" +
             "snrl:receiver-instance/snrl:name";
                "snr:receiver-instance/snr:name";
         }
         description
           "Reference to a receiver instance.";
       }
       description
         "Augment the subscriptions container to define an optional
          reference to a receiver instance.";

     }

   }
   <CODE ENDS>

4.

6.  The "ietf-https-notif" "ietf-https-notif-transport" Module

4.1.

6.1.  Data Model Overview

   This 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 ietf-sub-
   notif-recv-list "ietf-
   subscribed-notif-receivers" module to define a transport specific
   receiver.

   As mentioned earlier, it uses a POST method to deliver the
   notification.  The attribute 'path' "http-receiver/tls/http-client-parameters/path"
   leaf defines the path for the resource on the receiver, as defined by 'path-absolute'
   "path-absolute" in URI Generic Syntax [RFC3986].  The user-id used by
   Network Configuration Access Control Model [RFC8341], is that of the
   receiver and is derived from the certificate presented by the
   receiver as part of 'receiver-identity'. "receiver-identity".

   An abridged tree diagram representing the module is shown below.

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

   module: ietf-https-notif ietf-https-notif-transport

     augment /sn:subscriptions/snrl:receiver-instances
               /snrl:receiver-instance/snrl:transport-type: /sn:subscriptions/snr:receiver-instances
               /snr:receiver-instance/snr:transport-type:
       +--:(https)
          +--rw https-receiver
             +--rw (transport)
             |  +--:(tcp) {tcp-supported,not httpc:tcp-supported}?
             |  |  +--rw tcp
             |  |     +--rw tcp-client-parameters
             |  |     |  +--rw remote-address    inet:host
             |  |     |  +--rw remote-port?      inet:port-number
             |  |     |  +--rw local-address?    inet:ip-address
             |  |     |  |       {local-binding-supported}?
             |  |     |  +--rw local-port?       inet:port-number
             |  |     |  |       {local-binding-supported}?
             |  |     |  +--rw proxy-server! {proxy-connect}?
             |  |     |  |     ...
             |  |     |  +--rw keepalives! {keepalives-supported}?
             |  |     |        ...

             |  |     +--rw http-client-parameters
             |  |        +--rw client-identity!
             |  |        |     ...
             |  |        +--rw proxy-connect! {proxy-connect}?
             |  |              ...
             |  +--:(tls) {tls-supported}?
             |     +--rw tls
             |        +--rw tcp-client-parameters
             |        |  +--rw remote-address    inet:host
             |        |  +--rw remote-port?      inet:port-number
             |        |  +--rw local-address?    inet:ip-address
             |        |  |       {local-binding-supported}?
             |        |  +--rw local-port?       inet:port-number
             |        |  |       {local-binding-supported}?
             |        |  +--rw proxy-server! {proxy-connect}?
             |        |  |     ...
             |        |  +--rw keepalives! {keepalives-supported}?
             |        |        ...
             |        +--rw tls-client-parameters
             |        |  +--rw client-identity!
             |        |  |     ...
             |        |  +--rw server-authentication
             |        |  |     ...
             |        |  +--rw hello-params
             |        |  |       {tls-client-hello-params-config}?
             |        |  |     ...
             |        |  +--rw keepalives {tls-client-keepalives}?
             |        |        ...
             |        +--rw http-client-parameters
             |           +--rw client-identity!
             |           |     ...
             |           +--rw proxy-connect! {proxy-connect}?
             |           |     ...
             |           +--rw path               string
             +--rw receiver-identity {receiver-identity}?
                +--rw cert-maps
                      ...

4.2.
                   +--rw cert-to-name* [id]
                      +--rw id             uint32
                      +--rw fingerprint    x509c2n:tls-fingerprint
                      +--rw map-type       identityref
                      +--rw name           string

6.2.  YANG module

   The YANG module imports Common YANG Data Types [RFC6991], A A YANG Data Model for SNMP Configuration
   [RFC7407], JSON Encoding of Data Modeled
   with YANG [RFC7951], and Subscription to YANG Notifications
   [RFC8639]. [RFC8639], and YANG
   Groupings for HTTP Clients and HTTP Servers
   [I-D.ietf-netconf-http-client-server].

   The YANG module is shown below.

  <CODE BEGINS> file "ietf-https-notif@2020-11-16.yang" "ietf-https-notif-transport@2021-02-02.yang"
  [note: '\' line wrapping for formatting only]

  module ietf-https-notif ietf-https-notif-transport {
    yang-version 1.1;
    namespace "urn:ietf:params:xml:ns:yang:ietf-https-notif"; "urn:ietf:params:xml:ns:yang:ietf-https-notif-transport";\

    prefix "hn"; "hnt";

    import ietf-subscribed-notifications ietf-x509-cert-to-name {
      prefix sn; x509c2n;
      reference
         "I-D.ietf-netconf-subscribed-notifications";
        "RFC 7407: YANG Data Model for SNMP Configuration.";
    }

    import ietf-http-client ietf-subscribed-notifications {
      prefix httpc; sn;
      reference
         "I-D.ietf-netconf-http-client-server";
        "RFC 8639: Subscription to YANG Notifications";
    }

    import ietf-sub-notif-recv-list ietf-subscribed-notif-receivers {
      prefix snrl; snr;
      reference
        "RFC XXXX, YANG Data Module XXXX: An HTTPS-based Transport for HTTPS Notifications.";
                   Configured Subscriptions";
    }

    import ietf-x509-cert-to-name ietf-http-client {
      prefix x509c2n; httpc;
      reference
        "RFC 7407: YYYY: YANG Data Model Groupings for SNMP Configuration."; HTTP Clients and HTTP Servers";
    }

    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
      "This YANG module for configuring HTTPS base configuration. is implemented by Publishers that implement
       the 'ietf-subscribed-notifications' module defined in RFC 8639.

       This module augments a 'case' statement called 'https' into
       the 'choice' statement called 'transport-type' defined
       by the 'ietf-https-notif-transport' module defined in RFC XXXX. \

       Copyright (c) 2018 2021 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.

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

    revision "2020-11-16" "2021-02-02" {
      description
        "Initial Version.";
      reference
        "RFC XXXX, YANG Data Module for HTTPS Notifications.";
    }

    feature receiver-identity {
      description
        "Indicates if the server supports filtering notifications
         based on the receiver's identity derived from its TLS
         certificate.";
    }

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

     augment "/sn:subscriptions/snrl:receiver-instances/" +
             "snrl:receiver-instance/snrl:transport-type" {
       case https {
         container https-receiver

    grouping https-receiver-grouping {
      description
             "HTTPS receiver for notification";
        "A grouping that may be used by other modules wishing to
         configure HTTPS-based notifications without using RFC 8639.";
      uses httpc:http-client-stack-grouping {
        refine "transport/tcp" {
          // create the logical impossibility of enabling "tcp" the
          // "tcp" transport (i.e., "HTTP" without the 'S').
          if-feature "not httpc:tcp-supported";
        }
        augment "transport/tls/tls/http-client-parameters" {
          leaf path {
            type string;
            mandatory true;
            description
                   "Relative URI
              "URI prefix to the target resource."; resources.  Under this
               path the receiver must support both the 'capabilities'
               and 'relay-notification' resource targets, as described
               in RFC XXXX.";
          }
          description
            "Augmentation to add a receiver-specific path to for the target resource.";
             'capabilities' and 'relay-notification' resources.";
        }
      }
      container receiver-identity {
        if-feature receiver-identity;
        description
               "Specifies mechanism for identifying
          "Maps the receiver.
                The publisher MUST NOT include any content in receiver's TLS certificate to a
                notification local identity
           enabling access control to be applied to filter out
           notifications that the user is receiver may not be authorized
           to view.";
        container cert-maps {
          uses x509c2n:cert-to-name;
          description
            "The cert-maps container is used by a TLS-based HTTP
             server to map the HTTPS client's presented X.509
             certificate to a 'local' username. If no matching and
             valid cert-to-name list entry is found, the publisher
             MUST close the connection, and MUST NOT not send any
             notifications over it.";
          reference
            "RFC 7407: A YANG Data Model for SNMP Configuration.";
        }
      }
    }

    augment "/sn:subscriptions/snr:receiver-instances/" +
            "snr:receiver-instance/snr:transport-type" {
      case https {
        container https-receiver {
          description
            "The HTTPS receiver to send notifications to.";
          uses https-receiver-grouping;
        }
      }
      description
        "Augment the transport-type choice to define this include the 'https'
         transport.";
    }
  }
  <CODE ENDS>

5.

7.  Security Considerations

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

   The YANG module in this document makes use of grouping that are
   defined in YANG Groupings for HTTP Clients and HTTP Servers
   [I-D.ietf-netconf-http-client-server], and A YANG Data Model for SNMP
   Configuration [RFC7407].  Please see the Security Considerations
   section of those documents for considerations related to sensitivity
   and vulnerability of the data nodes defined in them.

   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:

   o  The 'path' "path" node in ietf-https-notif "ietf-subscribed-notif-receivers" module can be
      modified by a
      malcious malicious user to point to an invalid URI.

   Some of the readable data nodes in 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.  The model does not define any
   readable subtrees and data nodes.

   Some of the RPC operations in YANG module may be considered sensitive
   or vulnerable in some network environments.  It is thus important to
   control access to these operations.  The model does not define any
   RPC operations.

6.  Receiving Event Notifications

   Encoding notifications for

8.  IANA Considerations

8.1.  The "IETF XML" Registry

   This document registers two URIs in the HTTPS notifications is "ns" subregistry of the same as "IETF
   XML" registry [RFC3688].  Following the
   encoding notifications as defined format in RESTCONF [RFC8040] Section 6.4,
   with [RFC3688], the
   following changes.  Instead of saying that for JSON-encoding
   purposes, the module name for "notification" element will be "ietf-
   restconf, it will say that for JSON-encoding purposes, the module
   name for "notification" element will be "ietf-https-notif".

   With those changes, the SSE event notification encoded JSON example
   that would be sent over registrations are requested:

   URI: urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers
   Registrant Contact: The IESG
   XML: N/A, the HTTPS notif transport would appear as
   follows:

         data: {
         data:   "ietf-https-notif:notification" : {
         data:     "eventTime" : "2013-12-21T00:01:00Z",
         data:     "example-mod:event" : {
         data:       "event-class" : "fault",
         data:       "reporting-entity" : { "card" : "Ethernet0" },
         data:       "severity" : "major"
         data:     }
         data:   }
         data: }

7.  IANA Considerations

   This document registers two URI, two YANG module and two Media Types.

7.1. requested URI Registration

   in the IETF XML registry [RFC3688].  Following the format in RFC
   3688, the following registration is requested to be made:

   URI: urn:ietf:params:xml:ns:yang:ietf-http-notif an XML namespace.

   URI: urn:ietf:params:xml:ns:yang:ietf-sub-notif-recv-list urn:ietf:params:xml:ns:yang:ietf-https-notif-transport
   Registrant Contact: The IESG. IESG
   XML: N/A, the requested URI is an XML namespace.

7.2.  YANG

8.2.  The "YANG Module Name Registration Names" Registry

   This document registers one two YANG module modules in the YANG "YANG Module Names Names"
   registry YANG [RFC6020].  Following the format in [RFC6020], the following
   registrations are requested:

name: ietf-https-notif         ietf-subscribed-notif-receivers
namespace: urn:ietf:params:xml:ns:yang:ietf-https-notif    urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers
prefix: hn       snr
reference:    RFC XXXX

name: ietf-sub-recv-list         ietf-https-notif-transport
namespace: urn:ietf:params:xml:ns:yang:ietf-sub-notif-recv-list    urn:ietf:params:xml:ns:yang:ietf-https-notif-transport
prefix: snrl       hnt
reference:    RFC XXXX

7.3.  Media Types

7.3.1.  Media Type "application/ietf-https-notif-cap+xml

Type name: application

Subtype name: ietf-https-notif-cap+xml

Required parameters: None

Optional parameters: None

Encoding considerations:
    8-bit Each conceptual YANG data node is encoded according to the XML
    Encoding Rules and Canonical Format

8.3.  The "Capabilities for HTTPS Notification Receivers" Registry

   Following the specific YANG data node
    type guidelines defined in YANG 1.1 [RFC7950].

Security considerations:
    Security considerations related to [RFC5226], this document defines
   a new registry called "Capabilities for HTTPS Notification
   Receivers".  This registry defines capabilities that can be supported
   by HTTPS-based notification receivers.

   The following note shall be at the generation and consumption of
    RESTCONF messages are discussed in Section NN top of RFC XXXX.

    Additional security considerations are specific to the semantics registry:

   This registry defines capabilities that can be
   supported by HTTPS-based notification receivers.

   The fields for each registry are:

   o  URN

      *  The name of
    particular YANG data models. Each YANG module is expected the URN (required).

      *  The URN must conform to specify
    security considerations for the YANG data defined in that module.

Interoperability considerations: N/A

Published specification: syntax described by [RFC8141].

      *  The URN must begin with the string "urn:ietf:capability:https-
         notif-receiver".

   o  Reference

      *  The RFC XXXX

Applications that use this media type:
    Instance document data parsers used within a protocol or automation
    tool that utilize YANG-defined data structures.

Fragment identifier considerations:
    Fragment identifiers for this type are not defined. All YANG data
    nodes are accessible as resources using the path in defined the request URI.

Additional information:

    Deprecated alias names for this type: N/A
    Magic number(s): N/A
    File extension(s): None
    Macintosh file type code(s): "TEXT"

Person & email address to contact for further information:
    See Author's Address section of RFC XXXX.

Intended usage: COMMON

Restrictions on usage: N/A

Author: See Author's Address section of URN.

      *  The RFC XXXX

Change controller:
    Internet Engineering Task Force (mailto:iesg@ietf.org)

Provisional registration? (standards tree only): no

7.3.2.  Media Type "application/ietf-https-notif-cap+json

Type name: application

Subtype name: ietf-https-notif-cap+json

Required parameters: None

Optional parameters: None

Encoding considerations:
    8-bit Each conceptual YANG data node is encoded according to the XML
    Encoding Rules and Canonical Format for the specific YANG data node
    type defined must be in JSON Encoding of Data Modeled with YANG [RFC7951].

Security considerations:
    Security considerations related to the generation and consumption of
    RESTCONF messages are discussed in Section NN form "RFC <Number>: <Title>.

   o  Description

      *  An arbitrary description of RFC XXXX.

    Additional security considerations are specific to the semantics of
    particular YANG data models. Each YANG module algorithm (optional).

      *  The description should be no more than a few sentences.

      *  The description is expected to specify
    security considerations for the YANG data defined be in that module.

Interoperability considerations: N/A

Published specification: RFC XXXX

Applications that use this media type:
    Instance document data parsers used within a protocol or automation
    tool that utilize YANG-defined data structures.

Fragment identifier considerations:
    Fragment identifiers for this type are not defined. All YANG data
    nodes are accessible English, but may contain UTF-8
         characters as resources using the path may be needed in some cases.

   The update policy is either "RFC Required".  Updates do not otherwise
   require an expert review by a Designated Expert.

   Following is the request URI.

Additional information:

    Deprecated alias names initial assignment for this type: N/A
    Magic number(s): N/A
    File extension(s): None
    Macintosh file type code(s): "TEXT"

Person & email address to contact for further information:
    See Author's Address section of registry:

  Record:
     Name:        urn:ietf:capability:https-notif-receiver:encoding:json
     Reference:   RFC XXXX.

Intended usage: COMMON

Restrictions on usage: N/A

Author: See Author's Address section of XXXX
     Description: Identifies support for JSON-encoded notifications.

  Record:
     Name:        urn:ietf:capability:https-notif-receiver:encoding:xml
     Reference:   RFC XXXX

Change controller:
    Internet Engineering Task Force (mailto:iesg@ietf.org)

Provisional registration? (standards tree only): no

8.  Examples

   This section shows some examples
     Description: Identifies support for XML-encoded notifications.

9.  References

9.1.  Normative references

   [I-D.ietf-netconf-http-client-server]
              Watsen, K., "YANG Groupings for HTTP Clients and HTTP
              Servers", draft-ietf-netconf-http-client-server-05 (work
              in how the module can be used.

8.1.  Subscribed Notification based Configuration

   This example shows how a HTTPS client can be configured to send
   notifications to a receiver at address 192.0.2.1, port 443, a 'path',
   with server certificates, progress), August 2020.

   [I-D.ietf-netconf-notification-messages]
              Voit, E., Jenkins, T., Birkholz, H., Bierman, A., and the corresponding trust store that is
   used to authenticate a connection.

[note: '\' line wrapping A.
              Clemm, "Notification Message Headers and Bundles", draft-
              ietf-netconf-notification-messages-08 (work in progress),
              November 2019.

   [RFC2119]  Bradner, S., "Key words for formatting only]

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <subscriptions
      xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notificatio\
ns">
    <receiver-instances
        xmlns="urn:ietf:params:xml:ns:yang:ietf-sub-notif-recv-list">
      <receiver-instance>
        <name>foo</name>
        <https-receiver
            xmlns="urn:ietf:params:xml:ns:yang:ietf-https-notif"
            xmlns:x509c2n="urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-na\
me">
          <tls>
            <tcp-client-parameters>
              <remote-address>my-receiver.my-domain.com</remote-address>
              <remote-port>443</remote-port>
            </tcp-client-parameters>
            <tls-client-parameters>
              <server-authentication>
                <ca-certs>
                  <local-definition>
                    <certificate>
                      <name>Server Cert Issuer #1</name>
                      <cert-data>base64encodedvalue==</cert-data>
                    </certificate>
                  </local-definition>
                </ca-certs>
              </server-authentication>
            </tls-client-parameters>
            <http-client-parameters>
              <client-identity>
                <basic>
                  <user-id>my-name</user-id>
                  <password>my-password</password>
                </basic>
              </client-identity>
              <path>/some/path</path>
            </http-client-parameters>
          </tls>
          <receiver-identity>
            <cert-maps>
              <cert-to-name>
                <id>1</id>
                <fingerprint>11:0A:05:11:00</fingerprint>
                <map-type>x509c2n:san-any</map-type>
              </cert-to-name>
            </cert-maps>
          </receiver-identity>
        </https-receiver>
      </receiver-instance>
    </receiver-instances>
    <subscription>
      <id>6666</id>
      <transport xmlns:hn="urn:ietf:params:xml:ns:yang:ietf-https-no\
tif">
        hn:https
      </transport>
      <stream-subtree-filter>foo</stream-subtree-filter>
      <stream>some-stream</stream>
      <receivers>
        <receiver>
          <name>my-receiver</name>
          <receiver-instance-ref
              xmlns="urn:ietf:params:xml:ns:yang:ietf-sub-notif-recv-list">\
foo</receiver-instance-ref>
        </receiver>
      </receivers>
    </subscription>
  </subscriptions>

  <truststore xmlns="urn:ietf:params:xml:ns:yang:ietf-truststore">
    <certificate-bags>
      <certificate-bag>
        <name>explicitly-trusted-server-ca-certs</name>
        <description>
          Trust anchors (i.e. CA certs) that are used to authenticat\
e
          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-data>base64encodedvalue==</cert-data>
        </certificate>
        <certificate>
          <name>Fred Flintstone</name>
          <cert-data>base64encodedvalue==</cert-data>
        </certificate>
      </certificate-bag>
    </certificate-bags>
  </truststore>
</config>

8.2.  Non Subscribed Notification based Configuration

   In the case that it is desired to use HTTPS notif outside of
   Subscribed Notifications, there would have to be a module in RFCs to define
   the configuration for where Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

   [RFC3986]  Berners-Lee, T., Fielding, R., and how to send L. Masinter, "Uniform
              Resource Identifier (URI): Generic Syntax", STD 66,
              RFC 3986, DOI 10.17487/RFC3986, January 2005,
              <https://www.rfc-editor.org/info/rfc3986>.

   [RFC5277]  Chisholm, S. and H. Trevino, "NETCONF Event
              Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008,
              <https://www.rfc-editor.org/info/rfc5277>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the notification, such as Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the following:

   [note: '\' line wrapping NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC7407]  Bjorklund, M. and J. Schoenwaelder, "A YANG Data Model for formatting only]
   module example-custom-module {
     yang-version 1.1;
     namespace "http://example.com/example-custom-module";
     prefix "custom";

     import ietf-http-client {
       prefix httpc;
       reference
         "I-D.ietf-netconf-http-client-server";
     }

     organization
       "Example, Inc.";

     contact
       "Support at example.com";

     description
       "Example of module not using Subscribed Notifications module.";

     revision "2020-11-16" {
       description
         "Initial Version.";
       reference
         "RFC XXXX,
              SNMP Configuration", RFC 7407, DOI 10.17487/RFC7407,
              December 2014, <https://www.rfc-editor.org/info/rfc7407>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Module for HTTPS Notifications.";
     }

     container example-module {
       description
         "Example Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8174]  Leiba, B., "Ambiguity of using HTTPS notif without having Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

   [RFC8639]  Voit, E., Clemm, A., Gonzalez Prieto, A., Nilsen-Nygaard,
              E., and A. Tripathy, "Subscription to
          implement Subscribed Notifications.";

       container https-receivers {
         description
           "A container of all HTTPS notif receivers.";

         list https-receiver {
           key "name";

           leaf name {
             type string;
             description
               "A unique name YANG Notifications",
              RFC 8639, DOI 10.17487/RFC8639, September 2019,
              <https://www.rfc-editor.org/info/rfc8639>.

9.2.  Informative references

   [RFC5226]  Narten, T. and H. Alvestrand, "Guidelines for Writing an
              IANA Considerations Section in RFCs", RFC 5226,
              DOI 10.17487/RFC5226, May 2008,
              <https://www.rfc-editor.org/info/rfc5226>.

   [RFC8141]  Saint-Andre, P. and J. Klensin, "Uniform Resource Names
              (URNs)", RFC 8141, DOI 10.17487/RFC8141, April 2017,
              <https://www.rfc-editor.org/info/rfc8141>.

Appendix A.  Configuration Examples

   This non-normative section shows two examples for how the https notif receiver.";
           }

           uses httpc:http-client-stack-grouping {
             refine "transport/tcp" {
               // create the logical impossibility of enabling "tcp"
               // transport
               if-feature "not httpc:tcp-supported";
             }
             augment "transport/tls/tls/http-client-parameters" {
               leaf path {
                 type string;
                 description
                   "Relative URI to the target resource.";
               }
               description
                 "Augmentation "ietf-
   https-notif-transport" module can be used to add configure a path to the target resource.";
             }
           }
           description
             "Just include the grouping from ietf-http-client publisher to
   send notifications to
              realize the 'HTTPS stack'.";
         }
       }
     }
   }

   This example shows how a receiver.

   In both examples, the Publisher, acting as an HTTPS client can be client, is
   configured to send notifications to a receiver at address 192.0.2.1,
   port 443, a 'path', and configures the "path" leaf value to "/some/path", with
   server certificates, and the corresponding trust store that is used
   to authenticate a connection.

A.1.  Using Subscribed Notifications (RFC 8639)

   This example shows how an RFC 8639 [RFC8639] based publisher can be
   configured to send notifications to a receiver.

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

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <example-module
        xmlns="http://example.com/example-custom-module">
      <https-receivers>
        <https-receiver>
          <name>foo</name>
  <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-n\
otifications">
    <receiver-instances xmlns="urn:ietf:params:xml:ns:yang:ietf-subsc\
ribed-notif-receivers">
      <receiver-instance>
        <name>global-receiver-def</name>
        <https-receiver xmlns="urn:ietf:params:xml:ns:yang:ietf-https\
-notif-transport"
          xmlns:x509c2n="urn:ietf:params:xml:ns:yang:ietf-x509-cert-t\
o-name">
          <tls>
            <tcp-client-parameters>
              <remote-address>my-receiver.my-domain.com</remote-address>
              <remote-address>receiver.example.com</remote-address>
              <remote-port>443</remote-port>
            </tcp-client-parameters>
            <tls-client-parameters>
              <server-authentication>
                <ca-certs>
                  <local-definition>
                    <certificate>
                      <name>Server Cert Issuer #1</name>
                      <cert-data>base64encodedvalue==</cert-data>
                    </certificate>
                  </local-definition>
                </ca-certs>
              </server-authentication>
            </tls-client-parameters>
            <http-client-parameters>
              <client-identity>
                <basic>
                  <user-id>my-name</user-id>
                  <password>my-password</password>
                  <cleartext-password>my-password</cleartext-password\
>
                </basic>
              </client-identity>
              <path>/some/path</path>
            </http-client-parameters>
          </tls>
          <receiver-identity>
            <cert-maps>
              <cert-to-name>
                <id>1</id>
                <fingerprint>11:0A:05:11:00</fingerprint>
                <map-type>x509c2n:san-any</map-type>
              </cert-to-name>
            </cert-maps>
          </receiver-identity>
        </https-receiver>
      </https-receivers>
    </example-module>
      </receiver-instance>
    </receiver-instances>
    <subscription>
      <id>6666</id>
      <transport xmlns:ph="urn:ietf:params:xml:ns:yang:ietf-https-not\
if-transport">ph:https</transport>
      <stream-subtree-filter>some-subtree-filter</stream-subtree-filt\
er>
      <stream>some-stream</stream>
      <receivers>
        <receiver>
          <name>subscription-specific-receiver-def</name>
          <receiver-instance-ref xmlns="urn:ietf:params:xml:ns:yang:i\
etf-subscribed-notif-receivers">global-receiver-def</receiver-instance-ref>
        </receiver>
      </receivers>
    </subscription>
  </subscriptions>
  <truststore xmlns="urn:ietf:params:xml:ns:yang:ietf-truststore">
    <certificate-bags>
      <certificate-bag>
        <name>explicitly-trusted-server-ca-certs</name>
        <description>
          Trust anchors (i.e. CA certs) that are used to authenticat\
  e
            server connections.  Servers
          authenticate connections to receivers.  Receivers
          are authenticated if their certificate has a chain
          of trust to one of these CA certificates.
          certificates.
        </description>
        <certificate>
          <name>ca.example.com</name>
          <cert-data>base64encodedvalue==</cert-data>
        </certificate>
        <certificate>
          <name>Fred Flintstone</name>
          <cert-data>base64encodedvalue==</cert-data>
        </certificate>
      </certificate-bag>
    </certificate-bags>

  </truststore>
</config>

8.3.  Bundled Message

A.2.  Not Using Subscribed Notifications

   In the case of "bundled-message" as defined in Notification Message
   Headers and Bundles [I-D.ietf-netconf-notification-messages],
   something that this module supports, the flow of messages would look
   something like this.

       -------------                               --------------
       | Publisher |                               | Receiver   |
       -------------                               --------------
       Establish TCP             ------>
       Establish TLS             ------>
       Send HTTPS POST message
       with YANG defined         ------>
       notification #1
       Send HTTPS POST message
       with YANG defined         ------>
       notification #2
                                                   Send 204 (No Content)
                                 <------           for notification #1

                                                   Send 204 (No Content)
                                 <------           for notification #2
       Send HTTPS POST message
       with YANG defined         ------->
       notification #3
                                                   Send 204 (No Content)
                                 <------           for notification #3

   The content of the exchange would look something like this.

   Request:
       POST /some/path HTTP/1.1
       Host: my-receiver.my-domain.com
       Content-Type: application/yang-data+xml
       <notification
         xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
         <eventTime>2019-03-22T12:35:00Z</eventTime>
         <foo xmlns="https://example.com/my-foobar-module">
           ...
         </foo>
       </notification>
       <notification
         xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
         <eventTime>2019-03-22T12:35:00Z</eventTime>
         <bar xmlns="https://example.com/my-foobar-module">
           ...
         </bar>
       </notification>
       <notification
         xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
         <eventTime>2019-03-22T12:35:01Z</eventTime>
         <baz xmlns="https://example.com/my-foobar-module">
           ...
         </baz>
       </notification>
   Response:
         HTTP/1.1 204 No Content
         Date: Fri, 03 Mar 2019 12:35:00 GMT
         Server: my-receiver.my-domain.com
         HTTP/1.1 204 No Content
         Date: Fri, 03 Mar 2019 12:35:00 GMT
         Server: my-receiver.my-domain.com
         HTTP/1.1 204 No Content
         Date: Fri, 03 Mar 2019 12:35:01 GMT
         Server: my-receiver.my-domain.com

9.  Contributors

10.  Acknowledgements

11.  Normative references

   [I-D.ietf-netconf-http-client-server]
              Watsen, K., "YANG Groupings for HTTP Clients and HTTP
              Servers", draft-ietf-netconf-http-client-server-05 (work
              in progress), August 2020.

   [I-D.ietf-netconf-notification-messages]
              Voit, E., Jenkins, T., Birkholz, H., Bierman, A., and A.
              Clemm, "Notification Message Headers and Bundles", draft-
              ietf-netconf-notification-messages-08 (work in progress),
              November 2019.

   [RFC2119]  Bradner, S., "Key words for it is desired to use in RFCs HTTPS-based notifications
   outside of Subscribed Notifications, an application-specific module
   would to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

   [RFC3986]  Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
              Resource Identifier (URI): Generic Syntax", STD 66,
              RFC 3986, DOI 10.17487/RFC3986, January 2005,
              <https://www.rfc-editor.org/info/rfc3986>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language need define the configuration for sending the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using notification.

   Following is an example module.  Note that the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC6991]  Schoenwaelder, J., Ed., "Common module is "uses" the
   "https-receiver-grouping" grouping from the "ietf-https-notif-
   transport" module.

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

   module example-custom-module {
     yang-version 1.1;
     namespace "http://example.com/example-custom-module";
     prefix "custom";

     import ietf-https-notif-transport {
       prefix "hnt";
       reference
         "RFC XXXX:
           An HTTPS-based Transport for Configured Subscriptions";
     }

     organization
       "Example, Inc.";

     contact
       "Support at example.com";

     description
       "Example of module not using Subscribed Notifications module.";

     revision "2021-02-02" {
       description
         "Initial Version.";
       reference
         "RFC XXXX, YANG Data Types",
              RFC 6991, DOI 10.17487/RFC6991, July 2013,
              <https://www.rfc-editor.org/info/rfc6991>.

   [RFC7407]  Bjorklund, M. and J. Schoenwaelder, Module for HTTPS Notifications.";
     }

     container example-module {
       description
         "Example of using HTTPS notif without having to
          implement Subscribed Notifications.";

       container https-receivers {
         description
           "A YANG Data Model container of all HTTPS notif receivers.";
         list https-receiver {
          key "name";
           description
             "A list of HTTPS nofif receivers.";
          leaf name {
            type string;
            description
              "A unique name for
              SNMP Configuration", RFC 7407, DOI 10.17487/RFC7407,
              December 2014, <https://www.rfc-editor.org/info/rfc7407>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC7951]  Lhotka, L., "JSON Encoding the https notif receiver.";
          }
           uses hnt:https-receiver-grouping;
         }
       }
     }
   }

   Following is what the corresponding configuration looks like:

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

   <?xml version="1.0" encoding="UTF-8"?>
   <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <example-module xmlns="http://example.com/example-custom-module">
       <https-receivers>
         <https-receiver>
           <name>foo</name>
           <tls>
             <tcp-client-parameters>
               <remote-address>receiver.example.com</remote-address>
               <remote-port>443</remote-port>
             </tcp-client-parameters>
             <tls-client-parameters>
               <server-authentication>
                 <ca-certs>
                   <local-definition>
                     <certificate>
                       <name>Server Cert Issuer #1</name>
                       <cert-data>base64encodedvalue==</cert-data>
                     </certificate>
                   </local-definition>
                 </ca-certs>
               </server-authentication>
             </tls-client-parameters>
             <http-client-parameters>
               <client-identity>
                 <basic>
                   <user-id>my-name</user-id>
                   <cleartext-password>my-password</cleartext-password>
                 </basic>
               </client-identity>
               <path>/some/path</path>
             </http-client-parameters>
           </tls>
         </https-receiver>
       </https-receivers>
     </example-module>
     <truststore xmlns="urn:ietf:params:xml:ns:yang:ietf-truststore">
       <certificate-bags>
         <certificate-bag>
           <name>explicitly-trusted-server-ca-certs</name>
           <description>
             Trust anchors (i.e. CA certs) that are used to
             authenticate connections to receivers.  Receivers
             are authenticated if their certificate has a chain
             of Data Modeled with YANG",
              RFC 7951, DOI 10.17487/RFC7951, August 2016,
              <https://www.rfc-editor.org/info/rfc7951>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8174]  Leiba, B., "Ambiguity trust to one of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8341]  Bierman, A. these CA certificates.
           </description>
           <certificate>
             <name>ca.example.com</name>
             <cert-data>base64encodedvalue==</cert-data>
           </certificate>
           <certificate>
             <name>Fred Flintstone</name>
             <cert-data>base64encodedvalue==</cert-data>
           </certificate>
         </certificate-bag>
       </certificate-bags>
     </truststore>
   </config>

Acknowledgements

   The authors would like to thank for following for lively discussions
   on list and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

   [RFC8639] in the halls (ordered by first name): Eric Voit, E., Clemm, A., Gonzalez Prieto, A., Nilsen-Nygaard,
              E., Henning
   Rogge, Martin Bjorklund, Reshad Rahman, and A. Tripathy, "Subscription to YANG Notifications",
              RFC 8639, DOI 10.17487/RFC8639, September 2019,
              <https://www.rfc-editor.org/info/rfc8639>. Rob Wilton.

Authors' Addresses

   Mahesh Jethanandani
   Kloud Services

   Email: mjethanandani@gmail.com
   Kent Watsen
   Watsen Networks
   USA

   Email: kent+ietf@watsen.net