<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>

<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc iprnotified="no"?>
<?rfc strict="yes"?>

<rfc ipr="trust200902" category="std" number="7317" submissionType="IETF"
   consensus="yes">

<front>
<title abbrev="YANG System Management">A YANG Data Model for System Management</title>

<author initials="A" surname="Bierman" fullname='Andy Bierman' >
<organization>YumaWorks</organization>
<address>
<email>andy@yumaworks.com</email>
</address>
</author>

<author initials="M" surname="Bjorklund" fullname='Martin Bjorklund' >
<organization>Tail-f Systems</organization>
<address>
<email>mbj@tail-f.com</email>
</address>
</author>

<date month="July" year="2014"/>

<keyword>NETCONF</keyword>

<abstract>
        <t>
This document defines a YANG data model for the configuration and
identification of some common system properties within a device
containing a Network Configuration Protocol (NETCONF) server.
This document also includes data node definitions for system
identification, time-of-day management, user management, DNS
resolver configuration, and some protocol operations for system
management.
        </t>
</abstract>
</front>

<middle>
<section title="Introduction">
<t>
This document defines a YANG <xref target="RFC6020"/> data model for the
configuration and identification of some common properties within a
device containing a Network Configuration Protocol (NETCONF) server.
</t>
<t>
Devices that are managed by NETCONF and perhaps other mechanisms
have common properties that need to be configured and monitored
in a standard way.
</t>
<t>
The &quot;ietf&nbhy;system&quot; YANG module defined in this document
provides the following features:
</t>
<t>
<list style="symbols">
<t>
configuration and monitoring of system identification
</t>
<t>
configuration and monitoring of system time-of-day
</t>
<t>
configuration of user authentication
</t>
<t>
configuration of local users
</t>
<t>
configuration of the DNS resolver
</t>
<t>
system control operations (shutdown, restart, setting time)
</t>
</list>
</t>

<section title="Terminology">
<t>
The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;,
&quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD
NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;,
&quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be
interpreted as described in BCP&nbsp;14, <xref target="RFC2119"/>.
</t>
<t>
The following terms are defined in <xref target="RFC6241"/> and are not
redefined here:
</t>
<t>
<list style="symbols">
<t>
client
</t>
<t>
configuration data
</t>
<t>
server
</t>
<t>
state data
</t>
</list>
</t>

<t>The following terms are defined in <xref target="RFC6020"/> and are not
redefined here:
</t>
<t>
<list style="symbols">
<t>
augment
</t>
<t>
data model
</t>
</list>
</t>

</section>

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

<section title="Objectives">
<section title="System Identification">
<t>
There are many common properties used to identify devices,
operating systems, software versions, etc. that need to be
supported in the system data module. These objects are defined
as operational state data, and the information returned by the
server is intended to be specific to the device vendor.
</t>
<t>
Some user-configurable administrative strings are also
provided, such as the system location and description.
</t>
</section>
<section title="System Time Management">
<t>
Management of the date and time used by the system needs to be
supported. The use of one or more NTP servers to automatically set the
system date and time needs to be possible. Utilization of the Time Zone
Database <xref target="RFC6557"/> also needs to be supported. It
should be possible to configure the system to use NTP.
</t>
</section>

<section title="User Authentication">
<t>
The authentication mechanism needs to support password authentication over
RADIUS in order to support deployment scenarios with centralized
authentication servers.

 Additionally, for scenarios when no centralized authentication server
exists or for situations where the centralized authentication server cannot
be reached from the device, local users need to be supported.
</t>
<t>
Since the mandatory transport protocol for NETCONF is Secure Shell
(SSH) <xref target="RFC6242"/>, the authentication model needs to support
SSH&apos;s &quot;publickey&quot; and &quot;password&quot; authentication
methods <xref target="RFC4252"/>.
</t>
<t>
The model for authentication configuration should be flexible enough
to support authentication methods defined by other standards documents
or by vendors. It should be possible to configure the system
authentication properties.
</t>
</section>
<section title="DNS Resolver">
<t>
The configuration of the DNS resolver within the system containing the
NETCONF server is required in order to control how domain names are
resolved.
</t>
</section>
<section title="System Control">
<t>
A few operations are needed to support common tasks such as
restarting the device or setting the system date and time.
</t>
</section>
</section>

<section title="System Data Model">
<section title="System Identification">
<t>
The data model for system identification has the following
structure:
</t>
        <figure>
        <artwork><![CDATA[
   +--rw system
   |  +--rw contact?          string
   |  +--rw hostname?         inet:domain-name
   |  +--rw location?         string
   +--ro system-state
      +--ro platform
         +--ro os-name?       string
         +--ro os-release?    string
         +--ro os-version?    string
         +--ro machine?       string
        ]]></artwork>
        </figure>
</section>
<section title="System Time Management">
<t>
The data model for system time management has the following
structure:
</t>
        <figure>
        <artwork><![CDATA[
   +--rw system 
   |  +--rw clock
   |  |  +--rw (timezone)?
   |  |     +--:(timezone-name)
   |  |     |  +--rw timezone-name?     timezone-name
   |  |     +--:(timezone-utc-offset)
   |  |        +--rw timezone-utc-offset?   int16
   |  +--rw ntp!
   |     +--rw enabled?   boolean
   |     +--rw server* [name]
   |        +--rw name                string
   |        +--rw (transport)
   |        |  +--:(udp)
   |        |     +--rw udp
   |        |        +--rw address    inet:host
   |        |        +--rw port?      inet:port-number
   |        +--rw association-type?   enumeration
   |        +--rw iburst?             boolean
   |        +--rw prefer?             boolean
   +--ro system-state
      +--ro clock
         +--ro current-datetime?      yang:date-and-time
         +--ro boot-datetime?         yang:date-and-time
        ]]></artwork>
        </figure>
<t>
New &quot;case&quot; statements can be added in future revisions of
this data model, or through augmentation by some other data model.
</t>
</section>

<section title="DNS Resolver Model">
<t>
The data model for configuration of the DNS resolver has the following
structure:
</t>
        <figure>
        <artwork><![CDATA[
   +--rw system
      +--rw dns-resolver
         +--rw search*    inet:domain-name
         +--rw server* [name]
         |  +--rw name    string
         |  +--rw (transport)
         |     +--:(udp-and-tcp)
         |        +--udp-and-tcp
         |           +--rw address    inet:ip-address
         |           +--rw port?      inet:port-number
         +--rw options
            +--rw timeout?    uint8
            +--rw attempts?   uint8
        ]]></artwork>
        </figure>
<t>
New &quot;case&quot; statements can be added in future revisions of
this data model, or through augmentation by some other data model.
</t>
</section>
<section title="RADIUS Client Model">
<t>
The data model for configuration of the RADIUS client has the
following structure:
</t>
        <figure>
        <artwork><![CDATA[
   +--rw system
      +--rw radius
         +--rw server* [name]
         |  +--rw name                   string
         |  +--rw (transport)
         |  |  +--:(udp)
         |  |     +--rw udp
         |  |        +--rw address                inet:host
         |  |        +--rw authentication-port?   inet:port-number
         |  |        +--rw shared-secret          string
         |  +--rw authentication-type?   identityref
         +--rw options
            +--rw timeout?    uint8
            +--rw attempts?   uint8
        ]]></artwork>
        </figure>
<t>
New &quot;case&quot; statements can be added in future revisions of
this data model, or through augmentation by some other data model.
</t>
</section>
<section title="User Authentication Model">
<t>
This document defines three authentication methods for use with
NETCONF:
</t>
<t>
<list style="symbols">
<t>
publickey for local users over SSH
</t>
<t>
password for local users over any secure transport
</t>
<t>
password for RADIUS users over any secure transport
</t>
</list>
</t>
<t>
Additional methods can be defined by other standards documents or by
vendors.
</t>
<t>
This document defines two optional YANG features:
&quot;local&nbhy;users&quot; and &quot;radius&nbhy;authentication&quot;,
which the server advertises to indicate support for configuring local
users on the device and support for using RADIUS for authentication,
respectively.
</t>
<t>
The authentication parameters defined in this document are primarily
used to configure authentication of NETCONF users but MAY also be
used by other interfaces, e.g., a command line interface or a
web-based user interface.
</t>
<t>
The data model for user authentication has the following structure:
</t>
        <figure>
        <artwork><![CDATA[
   +--rw system
      +--rw authentication
         +--rw user-authentication-order*   identityref
         +--rw user* [name]
            +--rw name        string
            +--rw password?   ianach:crypt-hash
            +--rw authorized-key* [name]
               +--rw name         string
               +--rw algorithm    string
               +--rw key-data     binary
        ]]></artwork>
        </figure>
<section title="SSH Public Key Authentication">
<t>
If the NETCONF server advertises the &quot;local&nbhy;users&quot; feature,
configuration of local users and their SSH public keys is supported in
the /system/authentication/user list.
</t>
<t>
Public key authentication is requested by the SSH client. If the
&quot;local&nbhy;users&quot; feature is supported, then when a NETCONF client starts
an SSH session towards the server using the &quot;publickey&quot; authentication
&quot;method name&quot; <xref target="RFC4252"/>, the SSH server looks up the user name given
in the SSH authentication request in the /system/authentication/user
list and verifies the key as described in <xref target="RFC4253"/>.
</t>
</section>

<section title="Local User Password Authentication">
<t>
If the NETCONF server advertises the &quot;local&nbhy;users&quot; feature,
configuration of local users and their passwords is supported in the
/system/authentication/user list.
</t>
<t>
For NETCONF transport protocols that support password authentication,
the leaf-list &quot;user&nbhy;authentication&nbhy;order&quot; is used to
control whether or not local user password authentication should be used.
</t>
<t>
In SSH, password authentication is requested by the client. Other
NETCONF transport protocols MAY also support password authentication.
</t>
<t>
When local user password authentication is requested, the NETCONF
transport looks up the user name provided by the client in the
/system/authentication/user list and verifies the password.
</t>
</section>
<section title="RADIUS Password Authentication">
<t>
If the NETCONF server advertises the &quot;radius&nbhy;authentication&quot;
feature, the device supports user authentication using RADIUS.
</t>
<t>
For NETCONF transport protocols that support password authentication,
the leaf-list &quot;user&nbhy;authentication&nbhy;order&quot; is used to
control whether or not RADIUS password authentication should be used.
</t>
<t>
In SSH, password authentication is requested by the client. Other
NETCONF transport protocols MAY also support password authentication.
</t>
</section>
</section>

<section title="System Control">
<t>
The following operations are defined:
</t>
        <figure>
        <artwork><![CDATA[
   set-current-datetime
   system-restart
   system-shutdown
        ]]></artwork>
        </figure>
<t>
Two protocol operations are included to restart or shut down the
system. The &apos;system&nbhy;restart&apos; operation can be used to
restart the entire system (not just the NETCONF server).
The &apos;system&nbhy;shutdown&apos; operation can be used to power off
the entire system.
</t>
</section>
</section>

<section title="Relationship to the SNMPv2-MIB">
<t>
If a device implements the SNMPv2-MIB <xref target="RFC3418"/>, there
are two objects that MAY be mapped by the implementation. See the YANG module
definition in <xref target="module"/> for details. The following table lists
the YANG data nodes with corresponding objects in the SNMPv2-MIB.
</t>

<?rfc compact="yes"?>
<texttable title="YANG Interface Configuration Data Nodes and Related&nbsp;SNMPv2&nbhy;MIB&nbsp;Objects">
<ttcol align='left'>YANG data node</ttcol>
<ttcol align='left'>SNMPv2-MIB object</ttcol>
<c>contact</c>
<c>sysContact</c>
<c>location</c>
<c>sysLocation</c>
</texttable>
<?rfc compact="no"?>
</section>
<section title="IANA Crypt Hash YANG Module" anchor="iana-module">
<t>
This YANG module references <xref target="RFC1321"/>,
<xref target="IEEE-1003.1-2008"/>, and
<xref target="FIPS.180-4.2012"/>.
</t>

<t>&lt;CODE BEGINS> file "iana-crypt-hash@2014-04-04.yang"</t>
        <figure>
        <artwork><![CDATA[
module iana-crypt-hash {
  namespace "urn:ietf:params:xml:ns:yang:iana-crypt-hash";
  prefix ianach;

  organization "IANA";
  contact
    "        Internet Assigned Numbers Authority

     Postal: ICANN
             12025 Waterfront Drive, Suite 300
             Los Angeles, CA 90094-2536
             United States

     Tel:    +1 310 301 5800
     E-Mail: iana@iana.org>";
  description
    "This YANG module defines a type for storing passwords
     using a hash function and features to indicate which hash
     functions are supported by an implementation.

     The latest revision of this YANG module can be obtained from
     the IANA web site.

     Requests for new values should be made to IANA via
     email (iana@iana.org).

     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).

     The initial version of this YANG module is part of RFC 7317;
     see the RFC itself for full legal notices.";

  revision 2014-04-04 {
    description
      "Initial revision.";
    reference
      "RFC 7317: A YANG Data Model for System Management";
  }

  typedef crypt-hash {
    type string {
      pattern
        '$0$.*'
      + '|$1$[a-zA-Z0-9./]{1,8}$[a-zA-Z0-9./]{22}'
      + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}'
      + '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}';
    }
    description
      "The crypt-hash type is used to store passwords using
       a hash function.  The algorithms for applying the hash
       function and encoding the result are implemented in
       various UNIX systems as the function crypt(3).

       A value of this type matches one of the forms:

         $0$<clear text password>
         $<id>$<salt>$<password hash>
         $<id>$<parameter>$<salt>$<password hash>

       The '$0$' prefix signals that the value is clear text.  When
       such a value is received by the server, a hash value is
       calculated, and the string '$<id>$<salt>$' or
       $<id>$<parameter>$<salt>$ is prepended to the result.  This
       value is stored in the configuration data store.

       If a value starting with '$<id>$', where <id> is not '0', is
       received, the server knows that the value already represents a
       hashed value and stores it 'as is' in the data store.

       When a server needs to verify a password given by a user, it
       finds the stored password hash string for that user, extracts
       the salt, and calculates the hash with the salt and given
       password as input.  If the calculated hash value is the same
       as the stored value, the password given by the client is
       accepted.

       This type defines the following hash functions:

         id | hash function | feature
         ---+---------------+-------------------
          1 | MD5           | crypt-hash-md5
          5 | SHA-256       | crypt-hash-sha-256
          6 | SHA-512       | crypt-hash-sha-512

       The server indicates support for the different hash functions
       by advertising the corresponding feature.";
    reference
      "IEEE Std 1003.1-2008 - crypt() function
       RFC 1321: The MD5 Message-Digest Algorithm
       FIPS.180-4.2012: Secure Hash Standard (SHS)";
  }

  feature crypt-hash-md5 {
    description
      "Indicates that the device supports the MD5
       hash function in 'crypt-hash' values.";
    reference "RFC 1321: The MD5 Message-Digest Algorithm";
  }

  feature crypt-hash-sha-256 {
    description
      "Indicates that the device supports the SHA-256
       hash function in 'crypt-hash' values.";
    reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
  }

  feature crypt-hash-sha-512 {
    description
      "Indicates that the device supports the SHA-512
       hash function in 'crypt-hash' values.";
    reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
  }

}
        ]]></artwork>
        </figure>
<t>&lt;CODE ENDS></t>
</section>

<section title="System YANG Module" anchor="module">
<t>
This YANG module imports YANG extensions from
<xref target="RFC6536"/> and imports YANG types
from <xref target="RFC6991"/>. It also
references <xref target="RFC1035"/>, <xref target="RFC2865"/>,
<xref target="RFC3418"/>, <xref target="RFC5607"/>,
<xref target="RFC5966"/>, and <xref target="RFC6557"/>.
</t>

<t>&lt;CODE BEGINS> file "ietf-system@2014-05-14.yang"</t>

        <figure>
        <artwork><![CDATA[
module ietf-system {
  namespace "urn:ietf:params:xml:ns:yang:ietf-system";
  prefix "sys";

  import ietf-yang-types {
    prefix yang;
  }

  import ietf-inet-types {
    prefix inet;
  }

  import ietf-netconf-acm {
    prefix nacm;
  }

  import iana-crypt-hash {
    prefix ianach;
  }

  organization
    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

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

     WG Chair: Thomas Nadeau
               <mailto:tnadeau@lucidvision.com>

     WG Chair: Juergen Schoenwaelder
               <mailto:j.schoenwaelder@jacobs-university.de>

     Editor:   Andy Bierman
               <mailto:andy@yumaworks.com>

     Editor:   Martin Bjorklund
               <mailto:mbj@tail-f.com>";

  description
    "This module contains a collection of YANG definitions for the
     configuration and identification of some common system
     properties within a device containing a NETCONF server.  This
     includes data node definitions for system identification,
     time-of-day management, user management, DNS resolver
     configuration, and some protocol operations for system
     management.

     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 7317; see
     the RFC itself for full legal notices.";

  revision 2014-05-14 {
    description
      "Initial revision.";
    reference
      "RFC 7317: A YANG Data Model for System Management";
  }

 /*
  * Typedefs
  */

  typedef timezone-name {
    type string;
    description
      "A time zone name as used by the Time Zone Database,
       sometimes referred to as the 'Olson Database'.

       The exact set of valid values is an implementation-specific
       matter.  Client discovery of the exact set of time zone names
       for a particular server is out of scope.";
    reference
      "RFC 6557: Procedures for Maintaining the Time Zone Database";
   }

  /*
   * Features
   */

  feature radius {
    description
      "Indicates that the device can be configured as a RADIUS
       client.";
    reference
      "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
  }

  feature authentication {
    description
      "Indicates that the device supports configuration of
       user authentication.";
  }

  feature local-users {
    if-feature authentication;
    description
      "Indicates that the device supports configuration of
       local user authentication.";
  }

  feature radius-authentication {
    if-feature radius;
    if-feature authentication;
    description
      "Indicates that the device supports configuration of user
       authentication over RADIUS.";
    reference
      "RFC 2865: Remote Authentication Dial In User Service (RADIUS)
       RFC 5607: Remote Authentication Dial-In User Service (RADIUS)
                 Authorization for Network Access Server (NAS)
                 Management";
  }

  feature ntp {
    description
      "Indicates that the device can be configured to use one or
       more NTP servers to set the system date and time.";
  }

  feature ntp-udp-port {
    if-feature ntp;
    description
      "Indicates that the device supports the configuration of
       the UDP port for NTP servers.

       This is a 'feature', since many implementations do not support
       any port other than the default port.";
  }

  feature timezone-name {
    description
      "Indicates that the local time zone on the device
       can be configured to use the TZ database
       to set the time zone and manage daylight saving time.";
    reference
      "RFC 6557: Procedures for Maintaining the Time Zone Database";
  }

  feature dns-udp-tcp-port {
    description
      "Indicates that the device supports the configuration of
       the UDP and TCP port for DNS servers.

       This is a 'feature', since many implementations do not support
       any port other than the default port.";
  }

  /*
   * Identities
   */

  identity authentication-method {
    description
      "Base identity for user authentication methods.";
  }

  identity radius {
    base authentication-method;
    description
      "Indicates user authentication using RADIUS.";
    reference
      "RFC 2865: Remote Authentication Dial In User Service (RADIUS)
       RFC 5607: Remote Authentication Dial-In User Service (RADIUS)
                 Authorization for Network Access Server (NAS)
                 Management";
  }

  identity local-users {
    base authentication-method;
    description
      "Indicates password-based authentication of locally
       configured users.";
  }

  identity radius-authentication-type {
    description
      "Base identity for RADIUS authentication types.";
  }

  identity radius-pap {
    base radius-authentication-type;
    description
      "The device requests Password Authentication Protocol (PAP)
       authentication from the RADIUS server.";
    reference
      "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
  }

  identity radius-chap {
    base radius-authentication-type;
    description
      "The device requests Challenge Handshake Authentication
       Protocol (CHAP) authentication from the RADIUS server.";
    reference
      "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
  }

  /*
   * Configuration data nodes
   */

  container system {
    description
      "System group configuration.";

    leaf contact {
      type string;
      description
        "The administrator contact information for the system.

         A server implementation MAY map this leaf to the sysContact
         MIB object.  Such an implementation needs to use some
         mechanism to handle the differences in size and characters
         allowed between this leaf and sysContact.  The definition of
         such a mechanism is outside the scope of this document.";
      reference
        "RFC 3418: Management Information Base (MIB) for the
                   Simple Network Management Protocol (SNMP)
                   SNMPv2-MIB.sysContact";
    }
    leaf hostname {
      type inet:domain-name;
     description
       "The name of the host.  This name can be a single domain
        label or the fully qualified domain name of the host.";
    }
    leaf location {
      type string;
      description
        "The system location.

         A server implementation MAY map this leaf to the sysLocation
         MIB object.  Such an implementation needs to use some
         mechanism to handle the differences in size and characters
         allowed between this leaf and sysLocation.  The definition
         of such a mechanism is outside the scope of this document.";
      reference
        "RFC 3418: Management Information Base (MIB) for the
                   Simple Network Management Protocol (SNMP)
                   SNMPv2-MIB.sysLocation";
    }

    container clock {
      description
        "Configuration of the system date and time properties.";

      choice timezone {
        description
          "The system time zone information.";

        case timezone-name {
          if-feature timezone-name;
          leaf timezone-name {
            type timezone-name;
            description
              "The TZ database name to use for the system, such
               as 'Europe/Stockholm'.";
          }
        }
        case timezone-utc-offset {
          leaf timezone-utc-offset {
            type int16 {
              range "-1500 .. 1500";
            }
            units "minutes";
            description
              "The number of minutes to add to UTC time to
               identify the time zone for this system.  For example,
               'UTC - 8:00 hours' would be represented as '-480'.
               Note that automatic daylight saving time adjustment
               is not provided if this object is used.";
          }
        }
      }
    }

    container ntp {
      if-feature ntp;
      presence
        "Enables the NTP client unless the 'enabled' leaf
         (which defaults to 'true') is set to 'false'";
      description
        "Configuration of the NTP client.";

      leaf enabled {
        type boolean;
        default true;
        description
          "Indicates that the system should attempt to
           synchronize the system clock with an NTP server
           from the 'ntp/server' list.";
      }
      list server {
        key name;
        description
          "List of NTP servers to use for system clock
           synchronization.  If '/system/ntp/enabled'
           is 'true', then the system will attempt to
           contact and utilize the specified NTP servers.";

        leaf name {
          type string;
          description
            "An arbitrary name for the NTP server.";
        }
        choice transport {
          mandatory true;
          description
            "The transport-protocol-specific parameters for this
             server.";

          case udp {
            container udp {
              description
                "Contains UDP-specific configuration parameters
                 for NTP.";
              leaf address {
                type inet:host;
                mandatory true;
                description
                  "The address of the NTP server.";
              }
              leaf port {
                if-feature ntp-udp-port;
                type inet:port-number;
                default 123;
                description
                  "The port number of the NTP server.";
              }
            }
          }
        }
        leaf association-type {
          type enumeration {
            enum server {
              description
                "Use client association mode.  This device
                 will not provide synchronization to the
                 configured NTP server.";
            }
            enum peer {
              description
                "Use symmetric active association mode.
                 This device may provide synchronization
                 to the configured NTP server.";
            }
            enum pool {
              description
                "Use client association mode with one or
                 more of the NTP servers found by DNS
                 resolution of the domain name given by
                 the 'address' leaf.  This device will not
                 provide synchronization to the servers.";
            }
          }
          default server;
          description
            "The desired association type for this NTP server.";
        }
        leaf iburst {
          type boolean;
          default false;
          description
            "Indicates whether this server should enable burst
             synchronization or not.";
        }
        leaf prefer {
          type boolean;
          default false;
          description
            "Indicates whether this server should be preferred
             or not.";
        }
      }
    }

    container dns-resolver {
      description
        "Configuration of the DNS resolver.";

      leaf-list search {
        type inet:domain-name;
        ordered-by user;
        description
          "An ordered list of domains to search when resolving
           a host name.";
      }
      list server {
        key name;
        ordered-by user;
        description
          "List of the DNS servers that the resolver should query.

           When the resolver is invoked by a calling application, it
           sends the query to the first name server in this list.  If
           no response has been received within 'timeout' seconds,
           the resolver continues with the next server in the list.
           If no response is received from any server, the resolver
           continues with the first server again.  When the resolver
           has traversed the list 'attempts' times without receiving
           any response, it gives up and returns an error to the
           calling application.

           Implementations MAY limit the number of entries in this
           list.";

        leaf name {
          type string;
          description
            "An arbitrary name for the DNS server.";
        }
        choice transport {
          mandatory true;
          description
            "The transport-protocol-specific parameters for this
             server.";

          case udp-and-tcp {
            container udp-and-tcp {
              description
                "Contains UDP- and TCP-specific configuration
                 parameters for DNS.";
              reference
                "RFC 1035: Domain Names - Implementation and
                           Specification
                 RFC 5966: DNS Transport over TCP - Implementation
                           Requirements";

              leaf address {
                type inet:ip-address;
                mandatory true;
                description
                  "The address of the DNS server.";
              }
              leaf port {
                if-feature dns-udp-tcp-port;
                type inet:port-number;
                default 53;
                description
                  "The UDP and TCP port number of the DNS server.";
              }
            }
          }
        }
      }
      container options {
        description
          "Resolver options.  The set of available options has been
           limited to those that are generally available across
           different resolver implementations and generally useful.";
        leaf timeout {
          type uint8 {
            range "1..max";
          }
          units "seconds";
          default "5";
          description
            "The amount of time the resolver will wait for a
             response from each remote name server before
             retrying the query via a different name server.";
        }
        leaf attempts {
          type uint8 {
            range "1..max";
          }
          default "2";
          description
            "The number of times the resolver will send a query to
             all of its name servers before giving up and returning
             an error to the calling application.";
        }
      }
    }

    container radius {
      if-feature radius;

      description
        "Configuration of the RADIUS client.";

      list server {
        key name;
        ordered-by user;
        description
          "List of RADIUS servers used by the device.

           When the RADIUS client is invoked by a calling
           application, it sends the query to the first server in
           this list.  If no response has been received within
           'timeout' seconds, the client continues with the next
           server in the list.  If no response is received from any
           server, the client continues with the first server again.
           When the client has traversed the list 'attempts' times
           without receiving any response, it gives up and returns an
           error to the calling application.";

        leaf name {
          type string;
          description
            "An arbitrary name for the RADIUS server.";
        }
        choice transport {
          mandatory true;
          description
            "The transport-protocol-specific parameters for this
             server.";

          case udp {
            container udp {
              description
                "Contains UDP-specific configuration parameters
                 for RADIUS.";
              leaf address {
                type inet:host;
                mandatory true;
                description
                  "The address of the RADIUS server.";
              }
              leaf authentication-port {
                type inet:port-number;
                default "1812";
                description
                  "The port number of the RADIUS server.";
              }
              leaf shared-secret {
                type string;
                mandatory true;
                nacm:default-deny-all;
                description
                  "The shared secret, which is known to both the
                   RADIUS client and server.";
                reference
                  "RFC 2865: Remote Authentication Dial In User
                             Service (RADIUS)";
              }
            }
          }
        }
        leaf authentication-type {
          type identityref {
            base radius-authentication-type;
          }
          default radius-pap;
          description
            "The authentication type requested from the RADIUS
             server.";
        }
      }
      container options {
        description
          "RADIUS client options.";

        leaf timeout {
          type uint8 {
            range "1..max";
          }
          units "seconds";
          default "5";
          description
            "The number of seconds the device will wait for a
             response from each RADIUS server before trying with a
             different server.";
        }
        leaf attempts {
          type uint8 {
            range "1..max";
          }
          default "2";
          description
            "The number of times the device will send a query to
             all of its RADIUS servers before giving up.";
        }
      }
    }

    container authentication {
      nacm:default-deny-write;
      if-feature authentication;

       description
         "The authentication configuration subtree.";

       leaf-list user-authentication-order {
         type identityref {
           base authentication-method;
         }
         must '(. != "sys:radius" or ../../radius/server)' {
           error-message
             "When 'radius' is used, a RADIUS server"
           + " must be configured.";
           description
             "When 'radius' is used as an authentication method,
              a RADIUS server must be configured.";
         }
         ordered-by user;

         description
           "When the device authenticates a user with a password,
            it tries the authentication methods in this leaf-list in
            order.  If authentication with one method fails, the next
            method is used.  If no method succeeds, the user is
            denied access.

            An empty user-authentication-order leaf-list still allows
            authentication of users using mechanisms that do not
            involve a password.

            If the 'radius-authentication' feature is advertised by
            the NETCONF server, the 'radius' identity can be added to
            this list.

            If the 'local-users' feature is advertised by the
            NETCONF server, the 'local-users' identity can be
            added to this list.";
       }

       list user {
         if-feature local-users;
         key name;
         description
           "The list of local users configured on this device.";

         leaf name {
           type string;
           description
            "The user name string identifying this entry.";
         }
         leaf password {
           type ianach:crypt-hash;
           description
             "The password for this entry.";
         }
         list authorized-key {
           key name;
           description
             "A list of public SSH keys for this user.  These keys
              are allowed for SSH authentication, as described in
              RFC 4253.";
           reference
             "RFC 4253: The Secure Shell (SSH) Transport Layer
                        Protocol";

           leaf name {
             type string;
             description
               "An arbitrary name for the SSH key.";
           }
           leaf algorithm {
             type string;
             mandatory true;
             description
               "The public key algorithm name for this SSH key.

                Valid values are the values in the IANA 'Secure Shell
                (SSH) Protocol Parameters' registry, Public Key
                Algorithm Names.";
             reference
               "IANA 'Secure Shell (SSH) Protocol Parameters'
                registry, Public Key Algorithm Names";
           }
           leaf key-data {
             type binary;
             mandatory true;
             description
               "The binary public key data for this SSH key, as
                specified by RFC 4253, Section 6.6, i.e.:

                  string    certificate or public key format
                            identifier
                  byte[n]   key/certificate data.";
             reference
               "RFC 4253: The Secure Shell (SSH) Transport Layer
                          Protocol";
           }
         }
       }
     }
  }

  /*
   * Operational state data nodes
   */

  container system-state {
    config false;
    description
      "System group operational state.";

    container platform {
      description
        "Contains vendor-specific information for
         identifying the system platform and operating system.";
      reference
        "IEEE Std 1003.1-2008 - sys/utsname.h";

      leaf os-name {
        type string;
        description
          "The name of the operating system in use -
           for example, 'Linux'.";
        reference
          "IEEE Std 1003.1-2008 - utsname.sysname";
      }
      leaf os-release {
        type string;
        description
          "The current release level of the operating
           system in use.  This string MAY indicate
           the OS source code revision.";
        reference
          "IEEE Std 1003.1-2008 - utsname.release";
      }
      leaf os-version {
        type string;
        description
          "The current version level of the operating
           system in use.  This string MAY indicate
           the specific OS build date and target variant
           information.";
        reference
          "IEEE Std 1003.1-2008 - utsname.version";
      }
      leaf machine {
        type string;
        description
          "A vendor-specific identifier string representing
           the hardware in use.";
        reference
          "IEEE Std 1003.1-2008 - utsname.machine";
      }
    }

    container clock {
      description
        "Monitoring of the system date and time properties.";

      leaf current-datetime {
        type yang:date-and-time;
        description
          "The current system date and time.";
      }
      leaf boot-datetime {
        type yang:date-and-time;
        description
          "The system date and time when the system last restarted.";
      }
    }
  }

  rpc set-current-datetime {
    nacm:default-deny-all;
    description
      "Set the /system-state/clock/current-datetime leaf
       to the specified value.

       If the system is using NTP (i.e., /system/ntp/enabled
       is set to 'true'), then this operation will fail with
       error-tag 'operation-failed' and error-app-tag value of
       'ntp-active'.";
    input {
      leaf current-datetime {
        type yang:date-and-time;
        mandatory true;
        description
          "The current system date and time.";
      }
    }
  }

  rpc system-restart {
    nacm:default-deny-all;
    description
      "Request that the entire system be restarted immediately.
       A server SHOULD send an rpc reply to the client before
       restarting the system.";
  }

  rpc system-shutdown {
    nacm:default-deny-all;
    description
      "Request that the entire system be shut down immediately.
       A server SHOULD send an rpc reply to the client before
       shutting down the system.";
  }

}

        ]]></artwork>
        </figure>
<t>&lt;CODE ENDS></t>
</section>
<section title="IANA Considerations" anchor="iana">
<t>
IANA has created an IANA-maintained YANG module called
&quot;iana&nbhy;crypt&nbhy;hash&quot;, based on the contents
of <xref target="iana-module"/>, which will allow for new hash
algorithms to be added to the type &quot;crypt&nbhy;hash&quot;.
The registration procedure will be Expert Review, as defined by
<xref target="RFC5226"/>.
</t>
<t>
This document registers two URIs in the "IETF XML Registry"
<xref target="RFC3688"/>. Following the format in RFC 3688, the following
registrations have been made.
</t>
        <figure>
        <artwork><![CDATA[
   URI: urn:ietf:params:xml:ns:yang:iana-crypt-hash
   Registrant Contact: The IESG.
   XML: N/A; the requested URI is an XML namespace.

   URI: urn:ietf:params:xml:ns:yang:ietf-system
   Registrant Contact: The IESG.
   XML: N/A; the requested URI is an XML namespace.
        ]]></artwork>
        </figure>
<t>
This document registers two YANG modules in the "YANG Module Names"
registry <xref target="RFC6020"/>.
</t>
        <figure>
        <artwork><![CDATA[
   name: iana-crypt-hash
   namespace: urn:ietf:params:xml:ns:yang:iana-crypt-hash
   prefix: ianach
   reference: RFC 7317

   name: ietf-system
   namespace: urn:ietf:params:xml:ns:yang:ietf-system
   prefix: sys
   reference: RFC 7317
        ]]></artwork>
        </figure>
</section>

<section title="Security Considerations">
<t>
The YANG modules defined in this memo are designed to be accessed
via the NETCONF protocol <xref target="RFC6241"/>. The lowest NETCONF layer is
the secure transport layer and the mandatory to implement secure
transport is SSH <xref target="RFC6242"/>. The NETCONF access control model <xref target="RFC6536"/> provides the means to restrict access for particular NETCONF users to a pre-configured subset of all available NETCONF protocol operations and content. 
</t>
<t>
There are a number of data nodes defined in the &quot;ietf&nbhy;system&quot;
YANG module which are writable/creatable/deletable (i.e., config true,
which is the default). These data nodes may be considered sensitive or
vulnerable in some network environments. Write operations (e.g., edit-config) to these
data nodes without proper protection can have a negative effect on network operations.  These are the subtrees and data nodes and their
sensitivity/vulnerability:
</t>
<t>
<list style="symbols">
<t>
/system/clock/timezone: This choice contains the objects used to
control the time zone used by the device.
</t>
<t>
/system/ntp: This container contains the objects used to
control the Network Time Protocol servers used by the device.
</t>
<t>
/system/dns-resolver: This container contains the objects used to
control the Domain Name System servers used by the device.
</t>
<t>
/system/radius: This container contains the objects used to
control the Remote Authentication Dial-In User Service
servers used by the device.
</t>
<t>
/system/authentication/user-authentication-order: This leaf
controls how user login attempts are authenticated by the device.
</t>
<t>
/system/authentication/user: This list contains the
local users enabled on the system.
</t>
</list>
</t>
<t>
Some of the readable data nodes in the &quot;ietf&nbhy;system&quot;
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&nbhy;config or notification) to these data nodes. These are
the subtrees and data nodes and their sensitivity/vulnerability:
</t>
<t>
<list style="symbols">
<t>
/system/platform: This container has objects that may help
identify the specific NETCONF server and/or operating system
implementation used on the device.
</t>
<t>
/system/authentication/user: This list has objects that
may help identify the specific user names and password information
in use on the device.
</t>
</list>
</t>
<t>
Some of the RPC operations in the
&quot;ietf&nbhy;system&quot; YANG module may be considered sensitive or vulnerable in
some network environments. It is thus important to control access to
these operations. These are the operations and their
sensitivity/vulnerability:
</t>
<t>
<list style="symbols">
<t>
set-current-datetime: Changes the current date and time on the device.
</t>
<t>
system-restart: Reboots the device.
</t>
<t>
system-shutdown: Shuts down the device.
</t>
</list>
</t>
<t>
Since this document describes the use of RADIUS for purposes of
authentication, it is vulnerable to all of the threats that are
present in other RADIUS applications. For a discussion of such
threats, see <xref target="RFC2865"/> and <xref target="RFC3162"/>,
and Section 4 of <xref target="RFC3579"/>.
</t>
<t>
This document provides configuration parameters for
SSH&apos;s &quot;publickey&quot; and &quot;password&quot;
authentication mechanisms. Section 9.4 of <xref target="RFC4251"/>
and Section 11 of <xref target="RFC4252"/> discuss security considerations
for these mechanisms.
</t>
<t>
The &quot;iana&nbhy;crypt&nbhy;hash&quot; YANG module defines a type &quot;crypt&nbhy;hash&quot; that can
be used to store MD5 hashes. <xref target="RFC6151"/> discusses security
considerations for MD5. The usage of MD5 is NOT RECOMMENDED.
</t>
</section>

</middle>

<back>
<references title="Normative References">

<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.4251"?>
<?rfc include="reference.RFC.4252"?>
<?rfc include="reference.RFC.4253"?>
<?rfc include="reference.RFC.5226"?>
<?rfc include="reference.RFC.6151"?>

<reference anchor='RFC6241'>
<front>
<title>Network Configuration Protocol (NETCONF)</title>
<author initials='R.' surname='Enns' fullname='R. Enns' role="editor">
<organization /></author>
<author initials='M.' surname='Bjorklund' fullname='M. Bjorklund' role="editor">
<organization /></author>
<author initials='J.' surname='Schoenwaelder' fullname='J. Schoenwaelder' role="editor">
<organization /></author>
<author initials='A.' surname='Bierman' fullname='A. Bierman' role="editor">
<organization /></author>
<date year='2011' month='June' />
</front>
<seriesInfo name='RFC' value='6241' />
</reference>

<?rfc include="reference.RFC.6242"?>
<?rfc include="reference.RFC.6536"?>
<?rfc include="reference.RFC.6020"?>
<?rfc include="reference.RFC.1321"?>
<?rfc include="reference.RFC.2865"?>
<?rfc include="reference.RFC.3162"?>
<?rfc include="reference.RFC.3418"?>
<?rfc include="reference.RFC.5607"?>
<?rfc include="reference.RFC.1035"?>
<?rfc include="reference.RFC.5966"?>

<reference anchor="FIPS.180-4.2012" target="http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf">
<front>
<title>Secure Hash Standard (SHS)</title>
<author>
<organization>National Institute of Standards and Technology</organization>
</author>
<date month="March" year="2012"/>
</front>
<seriesInfo name="FIPS" value="PUB 180-4"/>
</reference>

<reference anchor="IEEE-1003.1-2008">
<front>
<title>POSIX.1-2008</title>
<author>
<organization>Institute of Electrical and Electronics Engineers</organization>
</author>
<date month="March" year="2008"/>
</front>
<seriesInfo name="IEEE" value="Standard 1003.1"/>
</reference>

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

</references>

<references title="Informative References">

<?rfc include="reference.RFC.3579"?>
<?rfc include="reference.RFC.3688"?>
<?rfc include="reference.RFC.6557"?>

</references>
</back>
</rfc>
