module ietf-ssh-server {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-ssh-server";
prefix sshs;
import iana-crypt-hash {
prefix ianach;
reference
"RFC 7317: A YANG Data Model for System Management";
}
import ietf-netconf-acm {
prefix nacm;
reference
"RFC 8341: Network Configuration Access Control Model";
}
import ietf-crypto-types {
prefix ct;
reference
"RFC AAAA: YANG Data Types and Groupings for Cryptography";
}
import ietf-truststore {
prefix ts;
reference
"RFC BBBB: A YANG Data Model for a Truststore";
}
import ietf-keystore {
prefix ks;
reference
"RFC CCCC: A YANG Data Model for a Keystore";
}
import ietf-ssh-common {
prefix sshcmn;
revision-date 2020-07-08; // stable grouping definitions
reference
"RFC EEEE: YANG Groupings for SSH Clients and SSH Servers";
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web:
WG List:
Author: Kent Watsen
Author: Gary Wu ";
description
"This module defines reusable groupings for SSH servers that
can be used as a basis for specific SSH server instances.
Copyright (c) 2020 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
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC EEEE
(https://www.rfc-editor.org/info/rfcEEEE); see the RFC
itself for full legal notices.;
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all
capitals, as shown here.";
revision 2020-07-08 {
description
"Initial version";
reference
"RFC EEEE: YANG Groupings for SSH Clients and SSH Servers";
}
// Features
feature ssh-server-transport-params-config {
description
"SSH transport layer parameters are configurable on an SSH
server.";
}
feature ssh-server-keepalives {
description
"Per socket SSH keepalive parameters are configurable for
SSH servers on the server implementing this feature.";
}
feature client-auth-config-supported {
description
"Indicates that the configuration for how to authenticate
clients can be configured herein, as opposed to in an
application specific location. That is, to support the
consuming data models that prefer to place client
authentication with client definitions, rather then
in a data model principally concerned with configuring
the transport.";
}
feature client-auth-publickey {
description
"Indicates that the 'publickey' authentication type
is supported.
The 'publickey' authentication type is required by
RFC 4252, but common implementations enable it to
be disabled.";
reference
"RFC 4252:
The Secure Shell (SSH) Authentication Protocol";
}
feature client-auth-password {
description
"Indicates that the 'password' authentication type
is supported.";
}
feature client-auth-hostbased {
description
"Indicates that the 'hostbased' authentication type
is supported.";
}
feature client-auth-none {
description
"Indicates that the 'none' authentication type is
supported.";
}
// Groupings
grouping ssh-server-grouping {
description
"A reusable grouping for configuring a SSH server without
any consideration for how underlying TCP sessions are
established.
Note that this grouping uses fairly typical descendent
node names such that a stack of 'uses' statements will
have name conflicts. It is intended that the consuming
data model will resolve the issue (e.g., by wrapping
the 'uses' statement in a container called
'ssh-server-parameters'). This model purposely does
not do this itself so as to provide maximum flexibility
to consuming models.";
container server-identity {
nacm:default-deny-write;
description
"The list of host keys the SSH server will present when
establishing a SSH connection.";
list host-key {
key "name";
min-elements 1;
ordered-by user;
description
"An ordered list of host keys the SSH server will use to
construct its ordered list of algorithms, when sending
its SSH_MSG_KEXINIT message, as defined in Section 7.1
of RFC 4253.";
reference
"RFC 4253: The Secure Shell (SSH) Transport Layer
Protocol";
leaf name {
type string;
description
"An arbitrary name for this host key";
}
choice host-key-type {
mandatory true;
description
"The type of host key being specified";
container public-key {
description
"A locally-defined or referenced asymmetric key pair
to be used for the SSH server's host key.";
reference
"RFC CCCC: A YANG Data Model for a Keystore";
uses ks:local-or-keystore-asymmetric-key-grouping {
refine "local-or-keystore/local/local-definition" {
must
'public-key-format = "ct:ssh-public-key-format"';
}
refine "local-or-keystore/keystore/"
+ "keystore-reference" {
must 'deref(.)/../ks:public-key-format'
+ ' = "ct:ssh-public-key-format"';
}
}
}
container certificate {
if-feature "sshcmn:ssh-x509-certs";
description
"A locally-defined or referenced end-entity
certificate to be used for the SSH server's
host key.";
reference
"RFC CCCC: A YANG Data Model for a Keystore";
uses
ks:local-or-keystore-end-entity-cert-with-key-grouping {
refine "local-or-keystore/local/local-definition" {
must
'public-key-format'
+ ' = "ct:subject-public-key-info-format"';
}
refine "local-or-keystore/keystore/keystore-reference"
+ "/asymmetric-key" {
must 'deref(.)/../ks:public-key-format'
+ ' = "ct:subject-public-key-info-format"';
}
}
}
}
}
} // container server-identity
container client-authentication {
nacm:default-deny-write;
description
"Specifies how the SSH server can authenticate SSH clients.";
container supported-authentication-methods {
description
"Indicates which authentication methods the server
supports.";
leaf publickey {
type empty;
description
"Indicates that the 'publickey' method is supported.
Note that RFC 6187 X.509v3 Certificates for SSH uses
the 'publickey' method name.";
reference
"RFC 4252: The Secure Shell (SSH) Authentication
Protocol.
RFC 6187: X.509v3 Certificates for Secure Shell
Authentication.";
}
leaf password {
if-feature client-auth-password;
type empty;
description
"Indicates that the 'password' method is supported.";
reference
"RFC 4252: The Secure Shell (SSH) Authentication
Protocol.";
}
leaf hostbased {
if-feature client-auth-hostbased;
type empty;
description
"Indicates that the 'hostbased' method is supported.";
reference
"RFC 4252: The Secure Shell (SSH) Authentication
Protocol.";
}
leaf none {
if-feature client-auth-none;
type empty;
description
"Indicates that the 'none' method is supported.";
reference
"RFC 4252: The Secure Shell (SSH) Authentication
Protocol.";
}
}
container users {
if-feature "client-auth-config-supported";
description
"A list of locally configured users.";
list user {
key name;
description
"The list of local users configured on this device.";
leaf name {
type string;
description
"The user name string identifying this entry.";
}
container public-keys {
if-feature client-auth-publickey;
presence
"Indicates that the server can authenticate this
user using any of the configured SSH public keys.";
description
"A set of SSH public keys may be used by the SSH
server to authenticate this user. A user is
authenticated if its public key is an exact
match to a configured public key.";
reference
"RFC BBBB: A YANG Data Model for a Truststore";
uses ts:local-or-truststore-public-keys-grouping {
refine "local-or-truststore/local/local-definition"
+ "/public-key" {
must 'public-key-format'
+ ' = "ct:ssh-public-key-format"';
}
refine "local-or-truststore/truststore/"
+ "truststore-reference" {
must 'deref(.)/../*/ts:public-key-format'
+ ' = "ct:ssh-public-key-format"';
}
}
}
leaf password {
if-feature client-auth-password;
type ianach:crypt-hash;
description
"The password for this user.";
}
container hostbased {
if-feature client-auth-hostbased;
presence
"Indicates that the server can authenticate this
user's 'host' using any of the configured SSH
host keys.";
description
"A set of SSH host keys may be used by the SSH
server to authenticate this user's host. A
user's host is authenticated if its host key
is an exact match to a configured host key.";
reference
"RFC 4253: The Secure Shell (SSH) Transport Layer
RFC BBBB: A YANG Data Model for a Truststore";
uses ts:local-or-truststore-public-keys-grouping {
refine "local-or-truststore/local/local-definition"
+ "/public-key" {
must 'public-key-format'
+ ' = "ct:ssh-public-key-format"';
}
refine "local-or-truststore/truststore"
+ "/truststore-reference" {
must 'deref(.)/../*/ts:public-key-format'
+ ' = "ct:ssh-public-key-format"';
}
}
}
leaf none {
if-feature client-auth-none;
type empty;
description
"Indicates that the 'none' method is supported.";
reference
"RFC 4252: The Secure Shell (SSH) Authentication
Protocol.";
}
}
}
container ca-certs {
if-feature "client-auth-config-supported";
if-feature "sshcmn:ssh-x509-certs";
presence
"Indicates that the SSH server can authenticate SSH
clients using configured certificate authority (CA)
certificates.";
description
"A set of certificate authority (CA) certificates used by
the SSH server to authenticate SSH client certificates.
A client certificate is authenticated if it has a valid
chain of trust to a configured CA certificate.";
reference
"RFC BBBB: A YANG Data Model for a Truststore";
uses ts:local-or-truststore-certs-grouping;
}
container ee-certs {
if-feature "client-auth-config-supported";
if-feature "sshcmn:ssh-x509-certs";
presence
"Indicates that the SSH server can authenticate SSH
clients using configured end-entity certificates.";
description
"A set of client certificates (i.e., end entity
certificates) used by the SSH server to authenticate
the certificates presented by SSH clients. A client
certificate is authenticated if it is an exact match
to a configured end-entity certificate.";
reference
"RFC BBBB: A YANG Data Model for a Truststore";
uses ts:local-or-truststore-certs-grouping;
}
} // container client-authentication
container transport-params {
nacm:default-deny-write;
if-feature "ssh-server-transport-params-config";
description
"Configurable parameters of the SSH transport layer.";
uses sshcmn:transport-params-grouping;
} // container transport-params
container keepalives {
nacm:default-deny-write;
if-feature "ssh-server-keepalives";
presence
"Indicates that the SSH server proactively tests the
aliveness of the remote SSH client.";
description
"Configures the keep-alive policy, to proactively test
the aliveness of the SSL client. An unresponsive SSL
client is dropped after approximately max-wait *
max-attempts seconds. Per Section 4 of RFC 4254,
the SSH server SHOULD send an SSH_MSG_GLOBAL_REQUEST
message with a purposely nonexistent 'request name'
value (e.g., keepalive@ietf.org) and the 'want reply'
value set to '1'.";
reference
"RFC 4254: The Secure Shell (SSH) Connection Protocol";
leaf max-wait {
type uint16 {
range "1..max";
}
units "seconds";
default "30";
description
"Sets the amount of time in seconds after which
if no data has been received from the SSL client,
a SSL-level message will be sent to test the
aliveness of the SSL client.";
}
leaf max-attempts {
type uint8;
default "3";
description
"Sets the maximum number of sequential keep-alive
messages that can fail to obtain a response from
the SSL client before assuming the SSL client is
no longer alive.";
}
}
} // grouping ssh-server-grouping
} // module ietf-ssh-server