module ietf-tls-client {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-tls-client";
prefix tlsc;
import ietf-tls-common {
prefix tlscmn;
revision-date 2020-03-08; // stable grouping definitions
reference
"RFC XXXX: YANG Groupings for TLS Clients and TLS Servers";
}
import ietf-crypto-types {
prefix ct;
reference
"RFC AAAA: Common YANG Data Types 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-netconf-acm {
prefix nacm;
reference
"RFC 8341: Network Configuration Access Control Model";
}
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 TLS clients that
can be used as a basis for specific TLS client instances.
Copyright (c) 2019 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 XXXX
(https://www.rfc-editor.org/info/rfcXXXX); 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-03-08 {
description
"Initial version";
reference
"RFC XXXX: YANG Groupings for TLS Clients and TLS Servers";
}
// Features
feature tls-client-hello-params-config {
description
"TLS hello message parameters are configurable on a TLS
client.";
}
feature tls-client-keepalives {
description
"Per socket TLS keepalive parameters are configurable for
TLS clients on the server implementing this feature.";
}
feature x509-certificate-auth {
description
"Indicates that the client supports authenticating servers
using X.509 certificates.";
}
feature raw-public-key-auth {
description
"Indicates that the client supports authenticating servers
using ray public keys.";
}
feature psk-auth {
description
"Indicates that the client supports authenticating servers
using PSKs (pre-shared or pairwise-symmetric keys).";
}
// Groupings
grouping tls-client-grouping {
description
"A reusable grouping for configuring a TLS client without
any consideration for how an underlying TCP session is
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
'tls-client-parameters'). This model purposely does
not do this itself so as to provide maximum flexibility
to consuming models.";
container client-identity {
nacm:default-deny-write;
description
"Identity credentials the TLS client MAY present when
establishing a connection to a TLS server. If not
configured, then client authentication is presumed to
occur a protocol layer above TLS. When configured,
and requested by the TLS server when establishing a
TLS session, these credentials are passed in the
Certificate message defined in Section 7.4.2 of
RFC 5246.";
reference
"RFC 5246:
The Transport Layer Security (TLS) Protocol Version 1.2
RFC ZZZZ:
YANG Data Model for a 'Keystore' Mechanism";
choice auth-type {
description
"A choice amongst available authentication types.";
case certificate {
if-feature x509-certificate-auth;
container certificate {
description
"Specifies the client identity using a certificate.";
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"';
}
}
}
}
case raw-public-key {
if-feature raw-public-key-auth;
container raw-private-key {
description
"Specifies the client identity using a raw
private key.";
uses ks:local-or-keystore-asymmetric-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" {
must 'deref(.)/../ks:public-key-format'
+ ' = "ct:subject-public-key-info-format"';
}
}
}
}
case psk {
if-feature psk-auth;
container psk {
description
"Specifies the client identity using a PSK (pre-shared
or pairwise-symmetric key). Note that, when the PSK is
configured as a Keystore reference, the key's 'name'
node MAY be used as the PSK's ID when used by the TLS
protocol.";
uses ks:local-or-keystore-symmetric-key-grouping {
augment "local-or-keystore/local/local-definition" {
if-feature "ks:local-definitions-supported";
description
"Adds an 'id' value when the PSK is used by TLS.";
leaf id {
type string; // is this the right type?
description
"The key id used in the TLS protocol for PSKs.";
}
}
}
}
}
}
} // container client-identity
container server-authentication {
nacm:default-deny-write;
must 'ca-certs or server-certs';
description
"Specifies how the TLS client can authenticate TLS servers.
Any combination of credentials is additive and unordered.
Note that no configuration is required for PSK (pre-shared
or pairwise-symmetric key) based authentication as the key
is necessarily the same as configured in the '../client-
identity' node.";
container ca-certs {
if-feature "x509-certificate-auth";
presence
"Indicates that the TLS client can authenticate TLS servers
using configured certificate authority certificates.";
description
"A set of certificate authority (CA) certificates used by
the TLS client to authenticate TLS server certificates.
A server certificate is authenticated if it has a valid
chain of trust to a configured CA certificate.";
reference
"RFC YYYY: YANG Data Model for a Truststore";
uses ts:local-or-truststore-certs-grouping;
// Note: TS certs don't have a key-format...no test needed
}
container server-certs {
// FIXME: plural too much? rename to ee-certs?
if-feature "x509-certificate-auth";
presence
"Indicates that the TLS client can authenticate TLS
servers using configured server certificates.";
description
"A set of server certificates (i.e., end entity
certificates) used by the TLS client to authenticate
certificates presented by TLS servers. A server
certificate is authenticated if it is an exact
match to a configured server certificate.";
reference
"RFC YYYY: YANG Data Model for a Truststore";
uses ts:local-or-truststore-certs-grouping;
// Note: TS certs don't have a key-format...no test needed
}
container raw-public-keys {
if-feature "raw-public-key-auth";
presence
"Indicates that the TLS client can authenticate TLS
servers using configured server certificates.";
description
"A set of raw public keys used by the TLS client to
authenticate raw public keys presented by the TLS
server. A raw public key is authenticated if it
is an exact match to a configured raw public key.";
reference
"RFC YYYY: 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:subject-public-key-info-format"';
}
refine "local-or-truststore/truststore"
+ "/truststore-reference" {
must 'deref(.)/../*/ts:public-key-format'
+ ' = "ct:subject-public-key-info-format"';
}
}
}
container psks {
if-feature "psk-auth";
presence
"Indicates that the TLS client can authenticate TLS servers
using a configure PSK (pre-shared or pairwise-symmetric
key).";
description
"No configuration is required since the PSK value is the
same as PSK value configured in the 'client-identity'
node.";
}
} // container server-authentication
container hello-params {
nacm:default-deny-write;
if-feature "tls-client-hello-params-config";
uses tlscmn:hello-params-grouping;
description
"Configurable parameters for the TLS hello message.";
} // container hello-params
container keepalives {
nacm:default-deny-write;
if-feature "tls-client-keepalives";
presence "Indicates that keepalives are enabled.";
description
"Configures the keep-alive policy, to proactively test
the aliveness of the TLS server. An unresponsive
TLS server is dropped after approximately max-wait
* max-attempts seconds.";
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 TLS server, a
TLS-level message will be sent to test the
aliveness of the TLS server.";
}
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 TLS server before assuming the TLS server is
no longer alive.";
}
}
} // grouping tls-client-grouping
} // module ietf-tls-client