<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc2818 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2818.xml">
<!ENTITY rfc3688 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3688.xml">
<!ENTITY rfc5246 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY rfc6020 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
<!ENTITY rfc6335 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6335.xml">
<!ENTITY rfc6991 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6991.xml">
<!ENTITY rfc7589 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7589.xml">
]>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>
<?rfc-ext include-index="no" ?>
<!--<?rfc strict="no"?> -->

<rfc category="std"
     ipr="trust200902"
     docName="draft-ietf-netconf-tls-client-server-00" >
    <front>
        <title>TLS Client and Server Models</title>
        <author initials="K.W." surname="Watsen" fullname="Kent Watsen">
            <organization>Juniper Networks</organization>
            <address>
                <email>kwatsen@juniper.net</email>
            </address>
        </author>
        <date/>
        <area>Operations</area>
        <workgroup>NETCONF Working Group</workgroup>
        <abstract>
            <t>This document defines two YANG modules, one
            defines groupings for a generic TLS client and the other defines
            groupings for a generic TLS server.  It is intended that these
            groupings will be used by applications using the TLS protocol.</t>
        </abstract>
        <note title="Editorial Note (To be removed by RFC Editor)">
          <t>This draft contains many placeholder values that need to be replaced
          with finalized values at the time of publication.  This note summarizes
          all of the substitutions that are needed.  No other RFC Editor
          instructions are specified elsewhere in this document.</t>

          <t>This document contains references to other drafts in progress, both in
          the Normative References section, as well as in body text throughout.  
          Please update the following references to reflect their final RFC assignments:
            <list style="symbols">
              <t>draft-ietf-netconf-system-keychain</t>
            </list>
          </t>
          <t>Artwork in this document contains shorthand references to drafts in 
          progress.  Please apply the following replacements:
            <list  style="symbols">
              <t><spanx style="verb">XXXX</spanx> --&gt; the assigned RFC value for this draft</t>
              <t><spanx style="verb">YYYY</spanx> --&gt; the assigned RFC value for draft-ietf-netconf-system-keychain</t>
            </list>
          </t>
          <t>Artwork in this document contains placeholder values for the date of 
          publication of this draft.  Please apply the following replacement:
            <list  style="symbols">
              <t><spanx style="verb">2016-07-08</spanx> --&gt; the publication date of this draft</t>
            </list>
          </t>
          <t>The following two Appendix sections are to be removed prior to publication:
            <list  style="symbols">
              <t>Appendix A.  Change Log</t>
              <t>Appendix B.  Open Issues</t>
            </list>
          </t>
        </note>
    </front>
    <middle>

        <section title="Introduction">

            <t>This document defines two YANG <xref target="RFC6020"/> modules,
            one defines groupings for a generic TLS client and the other
            defines groupings for a generic TLS server (TLS is defined in
            <xref target="RFC5246"/>).  It is intended that these groupings
            will be used by applications using the TLS protocol.  For
            instance, these groupings could be used to help define the data
            model for an HTTPS <xref target="RFC2818"/> server or a
            NETCONF over TLS <xref target="RFC7589"/> based server.</t>

            <t>The two YANG modules in this document each define two groupings. One
            grouping defines everything other than what's needed for the TCP
            <xref target="RFC793"/> protocol layer.  The other grouping uses the
            first grouping while adding TCP layer specifics (e.g., addresses to
            connect to, ports to listen on, etc.).  This separation is done in
            order to enable applications the opportunity to define their own
            strategy for how the underlying TCP connection is established.  For
            instance, applications supporting NETCONF Call Home
            <xref target="draft-ietf-netconf-call-home"/> could use the first
            grouping for the TLS parts it provides, while adding data nodes for
            the reversed TCP layer.</t>

            <section title="Terminology">
              <t>The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL",
              "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
              and "OPTIONAL" in this document are to be interpreted as
              described in RFC 2119 <xref target="RFC2119"/>.</t>
            </section>

            <section title="Tree Diagrams" anchor="tree-diagrams">
            <t>A simplified graphical representation of the data models
            is used in this document.  The meaning of the symbols in
            these diagrams is as follows:
              <list style="symbols">
                <t>Brackets "[" and "]" enclose list keys.</t>
                <t>Braces "{" and "}" enclose feature names, and indicate
                that the named feature must be present for the subtree
                to be present.</t>
                <t>Abbreviations before data node names: "rw" means
                configuration (read-write) and "ro" state data 
                (read-only).</t>
                <t>Symbols after data node names: "?" means an optional
                node, "!" means a presence container, and "*" denotes a
                list and leaf-list.</t>
                <t>Parentheses enclose choice and case nodes, and case
                nodes are also marked with a colon (":").</t>
                <t>Ellipsis ("...") stands for contents of subtrees that
                are not shown.</t>
              </list>
            </t>
            </section>
        </section>

      <section title="The TLS Client Model" anchor="tls-client-model">

        <t>EDITOR NOTE: Please ignore this section, it is incomplete.</t>

        <t>The TLS client model presented in this section contains two
        YANG groupings, one for a client that initiates the underlying
        TCP connection and another for a client that has had the TCP
        connection opened for it already (e.g., call home).</t>

        <t>Both of these groupings reference data nodes defined by the
        System Keychain model <xref target="draft-ietf-netconf-system-keychain"/>.  For
        instance, a reference to the keychain model is made to indicate
        which trusted CA certificate a client should use to authenticate
        the server's certificate.</t>

        <section title="Tree Diagram">
          <t>The following tree diagram presents the data model for
          the two groupings defined in the ietf-tls-client module.</t>
          <t>
            <figure>
              <artwork><![CDATA[
module: ietf-tls-client
groupings:
  initiating-tls-client-grouping
     +---- some-TBD-tcp-client-stuff?   string
     +---- some-TBD-tls-client-stuff?   string

  non-initiating-tls-client-grouping
     +---- some-TBD-tls-client-stuff?   string

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

        <section title="Example Usage">
          <t>This section shows how it would appear if the
          initiating-tls-client-grouping were populated with some data.
          This example is consistent with the examples presented in
          Section 2.2 of <xref target="draft-ietf-netconf-system-keychain"/>.</t>
          <t>
            <figure>
              <artwork><![CDATA[
FIXME
]]></artwork>
            </figure>
          </t>
        </section>

        <section title="YANG Model" anchor="tls-client-yang-module">
          <t>This YANG module has a normative references to
          <xref target="RFC6991"/> and <xref target="draft-ietf-netconf-system-keychain"/>.</t>
          <t>
            <figure>
              <artwork><![CDATA[

<CODE BEGINS> file "ietf-tls-client@2016-07-08.yang"

// Editor's Note:
// This module is incomplete at this time.  Below is
// just a skeleton so there's something in the draft.
// Please ignore this module for now!

module ietf-tls-client {
  yang-version 1.1;

  namespace "urn:ietf:params:xml:ns:yang:ietf-tls-client";
  prefix "tlsc";
/*
  import ietf-inet-types {
    prefix inet;
    reference 
      "RFC 6991: Common YANG Data Types";
  }

  import ietf-system-keychain {
    prefix kc;
    reference
      "RFC YYYY: System Keychain Model";
  }
*/
  organization
   "IETF NETCONF (Network Configuration) Working Group";

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

    WG Chair: Mehmet Ersue
              <mailto:mehmet.ersue@nsn.com>

    WG Chair: Mahesh Jethanandani
              <mailto:mjethanandani@gmail.com>

    Editor:   Kent Watsen
              <mailto:kwatsen@juniper.net>";


  description
   "This module defines a reusable grouping for a TLS client that
    can be used as a basis for specific TLS client instances.

    Copyright (c) 2014 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 "2016-07-08" {
    description
     "Initial version";
    reference
     "RFC XXXX: TLS Client and Server Models";
  }

  grouping initiating-tls-client-grouping {
    description
      "A reusable grouping for a TLS client that initiates the
       underlying TCP transport connection.";
    leaf some-TBD-tcp-client-stuff {
      type string;
      description "";
    }     
    uses non-initiating-tls-client-grouping;
  }

 grouping non-initiating-tls-client-grouping {
    description
      "A reusable grouping for a TLS client that does not initiate
       the underlying TCP transport connection.";
    leaf some-TBD-tls-client-stuff {
      type string;
      description "";
    }   
  }         
  
}



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

      <section title="The TLS Server Model" anchor="tls-server-model">

        <t>The TLS server model presented in this section contains two
        YANG groupings, one for a server that opens a socket to accept
        TCP connections and another for a server that has had the TCP
        connection opened for it already (e.g., inetd).</t>

        <t>Both of these groupings reference data nodes defined by the
        System Keychain model <xref target="draft-ietf-netconf-system-keychain"/>.  
        For instance, a reference to the keychain model is made to indicate
        the certificate a server should present.</t>

        <section title="Tree Diagram">
          <t>The following tree diagram presents the data model for
          the two groupings defined in the ietf-tls-server module.</t>
          <t>
            <figure>
              <artwork><![CDATA[
module: ietf-tls-server
groupings:
  listening-tls-server-grouping
     +---- address?        inet:ip-address
     +---- port?           inet:port-number
     +---- certificates
     |  +---- certificate* [name]
     |     +---- name?   -> /kc:keychain/private-keys/private-key/certi
ficate-chains/certificate-chain/name
     +---- client-auth
        +---- trusted-ca-certs?       -> /kc:keychain/trusted-certifica
tes/name
        +---- trusted-client-certs?   -> /kc:keychain/trusted-certifica
tes/name

  non-listening-tls-server-grouping
     +---- certificates
     |  +---- certificate* [name]
     |     +---- name?   -> /kc:keychain/private-keys/private-key/certi
ficate-chains/certificate-chain/name
     +---- client-auth
        +---- trusted-ca-certs?       -> /kc:keychain/trusted-certifica
tes/name
        +---- trusted-client-certs?   -> /kc:keychain/trusted-certifica
tes/name

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

        <section title="Example Usage">
          <t>This section shows how it would appear if the
          listening-tls-server-grouping were populated with some data.
          This example is consistent with the examples presented in
          Section 2.2 of <xref target="draft-ietf-netconf-system-keychain"/>.</t>
          <t>
            <figure>
              <artwork><![CDATA[
<listening-tls-server
  xmlns="urn:ietf:params:xml:ns:yang:ietf-tls-server">
  <port>6513</port>
  <certificates>
    <certificate>
      <name>ex-key-sect571r1-cert</name>
    </certificate>
  </certificates>
  <client-auth>
    <trusted-ca-certs>
      deployment-specific-ca-certs
    </trusted-ca-certs>
    <trusted-client-certs>
      explicitly-trusted-client-certs
    </trusted-client-certs>
  </client-auth>
</listening-tls-server>
]]></artwork>
            </figure>
          </t>
        </section>

        <section title="YANG Model" anchor="tls-server-yang-module">
          <t>This YANG module has a normative references to <xref target="RFC6991"/>,
          and <xref target="draft-ietf-netconf-system-keychain"/>.</t>
          <t>
            <figure>
              <artwork><![CDATA[

<CODE BEGINS> file "ietf-tls-server@2016-07-08.yang"

module ietf-tls-server {
  yang-version 1.1;

  namespace "urn:ietf:params:xml:ns:yang:ietf-tls-server";
  prefix "tlss";

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

  import ietf-system-keychain {
    prefix kc;
    reference
      "RFC YYYY: System Keychain Model";
  }

  organization
   "IETF NETCONF (Network Configuration) Working Group";

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

    WG Chair: Mehmet Ersue
              <mailto:mehmet.ersue@nsn.com>

    WG Chair: Mahesh Jethanandani
              <mailto:mjethanandani@gmail.com>

    Editor:   Kent Watsen
              <mailto:kwatsen@juniper.net>";


  description
   "This module defines a reusable grouping for a TLS server that
    can be used as a basis for specific TLS server instances.

    Copyright (c) 2014 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 "2016-07-08" {
    description
     "Initial version";
    reference
     "RFC XXXX: TLS Client and Server Models";
  }


  // grouping
  grouping non-listening-tls-server-grouping {
    description
      "A reusable grouping for a TLS server that can be used as a
       basis for specific TLS server instances.";
    container certificates {
      description
        "The list of certificates the TLS server will present when
         establishing a TLS connection in its Certificate message,
         as defined in Section 7.4.2 in RRC 5246.";
      reference
        "RFC 5246:
           The Transport Layer Security (TLS) Protocol Version 1.2";
      list certificate {
        key name;
        min-elements 1;
        description
          "An unordered list of certificates the TLS server can pick 
           from when sending its Server Certificate message.";
        reference
          "RFC 5246: The TLS Protocol, Section 7.4.2";
        leaf name {
          type leafref {
            path "/kc:keychain/kc:private-keys/kc:private-key/"
                 + "kc:certificate-chains/kc:certificate-chain/"
                 + "kc:name";
          }
          description
            "The name of the certificate in the keychain.";
        }
      }
    }

    container client-auth {
      description
        "A reference to a list of trusted certificate authority (CA)
         certificates and a reference to a list of trusted client
         certificates.";
      leaf trusted-ca-certs {
        type leafref {
          path "/kc:keychain/kc:trusted-certificates/kc:name";
        }
        description
          "A reference to a list of certificate authority (CA) 
           certificates used by the TLS server to authenticate
           TLS client certificates.";
      }
  
      leaf trusted-client-certs {
        type leafref {
          path "/kc:keychain/kc:trusted-certificates/kc:name";
        }
        description
          "A reference to a list of client certificates used by 
           the TLS server to authenticate TLS client certificates.
           A clients certificate is authenticated if it is an
           exact match to a configured trusted client certificate.";
      }
    }
  }


  grouping listening-tls-server-grouping {
    description
      "A reusable grouping for a TLS server that can be used as a
       basis for specific TLS server instances.";
    leaf address {
      type inet:ip-address;
      description
       "The IP address of the interface to listen on.  The TLS
        server will listen on all interfaces if no value is
        specified. Please note that some addresses have special
        meanings (e.g., '0.0.0.0' and '::').";
    }
    leaf port {
      type inet:port-number;
      description
       "The local port number on this interface the TLS server
        listens on.  When this grouping is used, it is RECOMMENDED
        that refine statement is used to either set a default port
        value or to set mandatory true.";
    }
    uses non-listening-tls-server-grouping;
  }
}



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

      <section title="Security Considerations">

<!--
I removed all the NACM statements in the new modules

            <t>There are a number of data nodes defined in the 
            "ietf-netconf-server" and "ietf-restconf-server" YANG
            modules which are readable and/or writable that may 
            be considered sensitive or vulnerable in some 
            network environments.  Write and read operations to
            these data nodes can have a negative effect on network
            operations.  It is thus important to control write
            and read access to these data nodes.  Below are the 
            data nodes and their sensitivity/vulnerability.</t>

            <t>netconf-server/tls/client-auth/trusted-ca-certs:
            <list style="symbols">
              <t>This container contains certificates that a NETCONF server
              is to use as trust anchors for authenticating X.509-based
              client certificates.  Write access to this node is
              protected using an nacm:default-deny-write statement.</t>
            </list>
            </t>

            <t>netconf-server/tls/client-auth/trusted-client-certs:
            <list style="symbols">
              <t>This container contains certificates that a NETCONF server
              is to trust directly when authenticating X.509-based
              client certificates.  Write access to this node is
              protected using an nacm:default-deny-write statement.</t>
            </list>
            </t>

            <t>restconf-server/tls/client-auth/trusted-ca-certs:
            <list style="symbols">
              <t>This container contains certificates that a RESTCONF server
              is to use as trust anchors for authenticating X.509-based
              client certificates.  Write access to this node is
              protected using an nacm:default-deny-write statement.</t>
            </list>
            </t>

            <t>restconf-server/tls/client-auth/trusted-client-certs:
            <list style="symbols">
              <t>This container contains certificates that a RESTCONF server
              is to trust directly when authenticating X.509-based
              client certificates.  Write access to this node is
              protected using an nacm:default-deny-write statement.</t>
            </list>
            </t>
-->
      </section>

      <section title="IANA Considerations">
        <section title="The IETF XML Registry">
          <t>This document registers two URIs in the IETF XML 
          registry <xref target="RFC2119"/>.  Following the format in 
          <xref target="RFC3688"/>, the following registrations are
          requested:</t>
          <t>
            <figure>
                <artwork><![CDATA[
   URI: urn:ietf:params:xml:ns:yang:ietf-tls-client
   Registrant Contact: The NETCONF WG of the IETF.
   XML: N/A, the requested URI is an XML namespace.

   URI: urn:ietf:params:xml:ns:yang:ietf-tls-server
   Registrant Contact: The NETCONF WG of the IETF.
   XML: N/A, the requested URI is an XML namespace.
]]></artwork>
            </figure>
          </t>
        </section>

        <section title="The YANG Module Names Registry">
          <t>This document registers two YANG modules in the
          YANG Module Names registry <xref target="RFC6020"/>.
          Following the format in <xref target="RFC6020"/>, the
          the following registrations are requested:</t>
          <t>
            <figure>
                <artwork><![CDATA[
   name:         ietf-tls-client
   namespace:    urn:ietf:params:xml:ns:yang:ietf-tls-client
   prefix:       tlsc
   reference:    RFC XXXX

   name:         ietf-tls-server
   namespace:    urn:ietf:params:xml:ns:yang:ietf-tls-server
   prefix:       tlss
   reference:    RFC XXXX
]]></artwork>
            </figure>
          </t>
        </section>
      </section>

      <section title="Acknowledgements">
        <t>The authors would like to thank for following for
        lively discussions on list and in the halls (ordered
        by last name): Andy Bierman, Martin Bjorklund, Benoit Claise,
        Mehmet Ersue, David Lamparter, Alan Luchuk, Ladislav Lhotka,
        Radek Krejci, Tom Petch, Juergen Schoenwaelder, Phil Shafer,
        Sean Turner, and Bert Wijnen.</t>
     </section>

    </middle>

    <back>
      <references title="Normative References">
        &rfc2119;
        &rfc6020;
        &rfc6991;
        &rfc7589;

        <reference anchor='draft-ietf-netconf-system-keychain' target="https://datatracker.ietf.org/html/draft-ieft-netconf-system-keychain">
          <front>
            <title>System Keychain Model</title>
            <author initials='K.W.' surname='Watsen' fullname='Kent Watsen'>
              <organization>Juniper Networks</organization>
            </author>
            <date year='2016' />
          </front>
          <seriesInfo name='Internet-Draft' value='draft-ieft-netconf-system-keychain-00'/>
        </reference>
      </references>

      <references title="Informative References">
        <reference anchor="RFC793" target="https://www.ietf.org/rfc/rfc793.txt">
          <front>
            <title>TRANSMISSION CONTROL PROTOCOL</title>
            <author initials="J." surname="Postel" fullname="J. Postel">
              <organization/>
            </author>
            <date year="1981" month="September"/>
          </front>
          <seriesInfo name="STD" value="7"/>
        </reference>

        &rfc2818;
        &rfc3688;
        &rfc5246;

        <reference anchor='draft-ietf-netconf-call-home' target="https://datatracker.ietf.org/html/draft-ieft-netconf-call-home-17">
          <front>
            <title>
              NETCONF Call Home and RESTCONF Call Home
            </title>
            <author initials='K.W.' surname='Watsen' fullname='Kent Watsen'>
              <organization>Juniper Networks</organization>
            </author>
            <date year='2015'/>
          </front>
          <seriesInfo name='Internet-Draft' value='draft-ieft-netconf-call-home-17' />
        </reference>
      </references>

      <section title="Change Log">
        <section title="server-model-09 to 00">
          <t>
            <list style="symbols">
              <t>This draft was split out from draft-ietf-netconf-server-model-09.</t>
              <t>Noted that '0.0.0.0' and '::' might have special meanings.</t>
            </list>
          </t>
        </section>
      </section>

      <section title="Open Issues">
        <t>Please see: https://github.com/netconf-wg/tls-client-server/issues.</t>
      </section>
    </back>
</rfc>

