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-timezones {
prefix ianatz;
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web:
WG List:
WG Chair: David Kessens
WG Chair: Juergen Schoenwaelder
Editor: Andy Bierman
Editor: Martin Bjorklund
";
description
"This module contains a collection of YANG definitions for the
configuration and identification of the management system of a
device.
Copyright (c) 2012 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.";
// RFC Ed.: replace XXXX with actual RFC number and remove this
// note.
// RFC Ed.: remove this note
// Note: extracted from draft-ietf-netmod-system-mgmt-04.txt
// RFC Ed.: update the date below with the date of RFC publication
// and remove this note.
revision "2012-12-26" {
description
"Initial revision.";
reference
"RFC XXXX: A YANG Data Model for System Management";
}
/*
* Typedefs
*/
typedef crypt-hash {
type string {
pattern "$0$.*|$(1|5|6)$[a-zA-Z0-9./]{2,16}$.*";
}
description
"The crypt-hash type is used to store passwords using
a hash function. This type is implemented in various UNIX
systems as the function crypt(3).
When a clear text value is set to a leaf of this type, the
server calculates a password hash, and stores the result
in the datastore. Thus, the password is never stored in
clear text.
When a leaf of this type is read, the stored password hash is
returned.
A value of this type matches one of the forms:
$0$
$$$
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 '$$$' is prepended to the
result, where is a random 2-16 characters long salt
used to generate the digest. This value is stored in the
configuration data store.
If a value starting with '$$$' 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
correct.
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
Wikipedia: http://en.wikipedia.org/wiki/Crypt_(Unix)
RFC 1321: The MD5 Message-Digest Algorithm
FIPS.180-3.2008: Secure Hash Standard";
}
/*
* 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 can be configured
to do authentication of users.";
}
feature local-users {
if-feature authentication;
description
"Indicates that the device supports
local user authentication.";
}
feature radius-authentication {
if-feature radius;
if-feature authentication;
description
"Indicates that the device supports 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 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-3.2008: Secure Hash Standard";
}
feature crypt-hash-sha-512 {
description
"Indicates that the device supports the SHA-512
hash function in 'crypt-hash' values";
reference "FIPS.180-3.2008: Secure Hash Standard";
}
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 timezone-location {
description
"Indicates that the local timezone on the device
can be configured to use the TZ database
to set the timezone and manage daylight savings time.";
reference
"TZ Database http://www.twinsun.com/tz/tz-link.htm
Maintaining the Timezone Database
RFC 6557 (BCP 175)";
}
/*
* 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 PAP authentication from the RADIUS
server.";
reference
"RFC 2865: Remote Authentication Dial In User Service";
}
identity radius-chap {
base radius-authentication-type;
description
"The device requests CHAP authentication from the RADIUS
server.";
reference
"RFC 2865: Remote Authentication Dial In User Service";
}
/*
* Top-level container
*/
container system {
description
"System group configuration.";
leaf contact {
type string {
length "0..255";
}
description
"The administrator contact information for the system.";
reference
"RFC 3418 - Management Information Base (MIB) for the
Simple Network Management Protocol (SNMP)
SNMPv2-MIB.sysContact";
}
leaf name {
type string {
length "0..255";
}
description
"The administratively assigned system name.";
reference
"RFC 3418 - Management Information Base (MIB) for the
Simple Network Management Protocol (SNMP)
SNMPv2-MIB.sysName";
}
leaf location {
type string {
length "0..255";
}
description
"The system location";
reference
"RFC 3418 - Management Information Base (MIB) for the
Simple Network Management Protocol (SNMP)
SNMPv2-MIB.sysLocation";
}
container platform {
config false;
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";
}
leaf nodename {
type string;
description
"The host name of this system.";
reference
"IEEE Std 1003.1-2008 - utsname.nodename";
}
}
container clock {
description
"Configuration and monitoring of the system
date and time properties.";
leaf current-datetime {
type yang:date-and-time;
config false;
description
"The current system date and time.";
}
leaf boot-datetime {
type yang:date-and-time;
config false;
description
"The system date and time when the NETCONF
server last restarted.";
}
choice timezone {
description
"The system timezone information.";
leaf timezone-location {
if-feature timezone-location;
type ianatz:iana-timezone;
description
"The TZ database location identifier string
to use for the system, such as 'Europe/Stockholm'.";
}
leaf timezone-utc-offset {
type int16 {
range "-1500 .. 1500";
}
units "minutes";
description
"The number of minutes to add to UTC time to
identify the timezone for this system.
For example, 'UTC - 8:00 hours' would be
represented as '-480'. Note that automatic
daylight savings time adjustment is not provided,
if this object is used.";
}
}
}
container ntp {
if-feature ntp;
description
"Configuration of the NTP client.";
leaf use-ntp {
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 ntp-server {
key address;
description
"List of NTP servers to use for
system clock synchronization. If 'use-ntp'
is 'true', then the system will attempt to
contact and utilize the specified NTP servers.";
leaf association-type {
type enumeration {
enum server {
description
"Use server association mode. This device
is not expected to synchronize with the
configured NTP server.";
}
enum peer {
description
"Use peer association mode. This device
may be expected to synchronize with the
configured NTP server.";
}
enum pool {
description
"Use pool association mode. This device
is not expected to synchronize with the
configured NTP server.";
}
}
default server;
description
"The desired association type for this NTP server.";
}
leaf address {
type inet:host;
description
"The IP address or domain name of the NTP server.";
}
leaf enabled {
type boolean;
default true;
description
"Indicates whether this server is enabled for use or
not.";
}
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 {
description
"Configuration of the DNS resolver.";
leaf-list search {
type inet:host;
ordered-by user;
description
"An ordered list of domains to search when resolving
a host name.";
}
leaf-list server {
type inet:ip-address;
ordered-by user;
description
"Addresses of the name servers that the resolver should
query.
Implementations MAY limit the number of entries in this
leaf list.";
}
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 a 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
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 address;
ordered-by user;
description
"List of RADIUS servers used by the device.";
leaf address {
type inet:host;
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;
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";
}
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 a 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
the 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" and ../../radius/server) or'
+ '(. != "sys:radius")' {
error-message
"When 'radius' is used, 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.
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 crypt-hash;
description
"The password for this entry.";
}
list ssh-key {
key name;
description
"A list of public SSH keys for this user.";
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;
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;
description
"The binary key data for this ssh key.";
}
}
}
}
}
rpc set-current-datetime {
nacm:default-deny-all;
description
"Set the /system/clock/current-datetime leaf
to the specified value.
If the system is using NTP (e.g., /system/ntp/use-ntp
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.";
}
}