module ietf-keystore {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-keystore";
prefix "ks";
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-netconf-acm {
prefix nacm;
reference
"RFC 6536: Network Configuration Protocol (NETCONF) Access
Control Model";
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web:
WG List:
Author: Kent Watsen
";
description
"This module defines a keystore to centralize management
of security credentials.
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 VVVV; see
the RFC itself for full legal notices.";
revision "2017-03-13" {
description
"Initial version";
reference
"RFC VVVV: NETCONF Server and RESTCONF Server Configuration
Models";
}
// Identities
identity key-algorithm {
description
"Base identity from which all key-algorithms are derived.";
}
identity rsa1024 {
base key-algorithm;
description
"The RSA algorithm using a 1024-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa2048 {
base key-algorithm;
description
"The RSA algorithm using a 2048-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa3072 {
base key-algorithm;
description
"The RSA algorithm using a 3072-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa4096 {
base key-algorithm;
description
"The RSA algorithm using a 4096-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa7680 {
base key-algorithm;
description
"The RSA algorithm using a 7680-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa15360 {
base key-algorithm;
description
"The RSA algorithm using a 15360-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity secp192r1 {
base key-algorithm;
description
"The secp192r1 algorithm.";
reference
"RFC5480:
Elliptic Curve Cryptography Subject Public Key Information.";
}
identity secp256r1 {
base key-algorithm;
description
"The secp256r1 algorithm.";
reference
"RFC5480:
Elliptic Curve Cryptography Subject Public Key Information.";
}
identity secp384r1 {
base key-algorithm;
description
"The secp384r1 algorithm.";
reference
"RFC5480:
Elliptic Curve Cryptography Subject Public Key Information.";
}
identity secp521r1 {
base key-algorithm;
description
"The secp521r1 algorithm.";
reference
"RFC5480:
Elliptic Curve Cryptography Subject Public Key Information.";
}
// data model
container keystore {
nacm:default-deny-write;
description
"The keystore contains both active material (e.g., private keys
and passwords) and passive material (e.g., trust anchors).
The active material can be used to support either a server (e.g.,
a TLS/SSH server's private) or a client (a private key used for
TLS/SSH client-certificate based authentication, or a password
used for SSH/HTTP-client authentication).
The passive material can be used to support either a server
(e.g., client certificates to trust) or clients (e.g., server
certificates to trust).";
container keys {
description
"A list of keys maintained by the keystore.";
list key {
key name;
description
"A key maintained by the keystore.";
leaf name {
type string;
description
"An arbitrary name for the key.";
}
leaf algorithm-identifier {
type identityref {
base "key-algorithm";
}
mandatory true;
description
"Identifies which algorithm is to be used with the key.
This value determines how the 'private-key' and 'public-
key' fields are interpreted.";
// no params, such as in RFC 5912? (no are set for algs
// we care about, but what about the future?
}
leaf private-key {
nacm:default-deny-all;
type union {
type binary;
type enumeration {
enum "RESTRICTED" {
description
"The private key is restricted due to access-control.";
}
enum "INACCESSIBLE" {
description
"The private key is inaccessible due to being protected
by the cryptographic hardware modules (e.g., a TPM).";
}
}
}
mandatory true;
description
"A binary string that contains the value of the private
key. The interpretation of the content is defined in the
registration of the key algorithm. For example, a DSA key
is an INTEGER, an RSA key is represented as RSAPrivateKey
as defined in [RFC3447], and an Elliptic Curve Cryptography
(ECC) key is represented as ECPrivateKey as defined in
[RFC5915]"; // text lifted from RFC5958
}
// no key usage (ref: RFC 5912, pg 101 -- too X.509 specific?)
leaf public-key {
type binary;
config false;
mandatory true;
description
"A binary string that contains the value of the public
key. The interpretation of the content is defined in the
registration of the key algorithm. For example, a DSA key
is an INTEGER, an RSA key is represented as RSAPublicKey
as defined in [RFC3447], and an Elliptic Curve Cryptography
(ECC) key is represented using the 'publicKey' described in
[RFC5915]";
}
container certificates {
description
"Certificates associated with this private key. More
than one certificate per key is enabled to support,
for instance, a TPM-protected key that has associated
both IDevID and LDevID certificates.";
list certificate {
key name;
description
"A certificate for this private key.";
leaf name {
type string;
description
"An arbitrary name for the certificate. The name
must be a unique across all keys, not just within
this key.";
}
leaf value {
type binary;
description
"An unsigned PKCS #7 SignedData structure, as specified
by Section 9.1 in RFC 2315, containing just certificates
(no content, signatures, or CRLs), encoded using ASN.1
distinguished encoding rules (DER), as specified in
ITU-T X.690.
This structure contains, in order, the certificate
itself and all intermediate certificates leading up
to a trust anchor certificate. The certificate MAY
optionally include the trust anchor certificate.";
reference
"RFC 2315:
PKCS #7: Cryptographic Message Syntax Version 1.5.
ITU-T X.690:
Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).";
}
}
}
action generate-certificate-signing-request {
description
"Generates a certificate signing request structure for
the associated private key using the passed subject and
attribute values. Please review both the Security
Considerations and Design Considerations sections in
RFC VVVV for more information regarding this action
statement.";
input {
leaf subject {
type binary;
mandatory true;
description
"The 'subject' field from the CertificationRequestInfo
structure as specified by RFC 2986, Section 4.1 encoded
using the ASN.1 distinguished encoding rules (DER), as
specified in ITU-T X.690.";
reference
"RFC 2986:
PKCS #10: Certification Request Syntax Specification
Version 1.7.
ITU-T X.690:
Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).";
}
leaf attributes {
type binary;
description
"The 'attributes' field from the CertificationRequestInfo
structure as specified by RFC 2986, Section 4.1 encoded
using the ASN.1 distinguished encoding rules (DER), as
specified in ITU-T X.690.";
reference
"RFC 2986:
PKCS #10: Certification Request Syntax Specification
Version 1.7.
ITU-T X.690:
Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).";
}
}
output {
leaf certificate-signing-request {
type binary;
mandatory true;
description
"A CertificationRequest structure as specified by RFC
2986, Section 4.1 encoded using the ASN.1 distinguished
encoding rules (DER), as specified in ITU-T X.690.";
reference
"RFC 2986:
PKCS #10: Certification Request Syntax Specification
Version 1.7.
ITU-T X.690:
Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).";
}
}
}
}
}
list trusted-certificates {
key name;
description
"A list of trusted certificates. These certificates
can be used by a server to authenticate clients, or by
clients to authenticate servers. The certificates may
be endpoint specific or for certificate authorities,
to authenticate many clients at once. Each list of
certificates SHOULD be specific to a purpose, as the
list as a whole may be referenced by other modules.
For instance, a NETCONF server model might point to
a list of certificates to use when authenticating
client certificates.";
leaf name {
type string;
description
"An arbitrary name for this list of trusted certificates.";
}
leaf description {
type string;
description
"An arbitrary description for this list of trusted
certificates.";
}
list trusted-certificate {
key name;
description
"A trusted certificate for a specific use. Note, this
'certificate' is a list in order to encode any
associated intermediate certificates.";
leaf name {
type string;
description
"An arbitrary name for this trusted certificate. Must
be unique across all lists of trusted certificates
(not just this list) so that a leafref to it from
another module can resolve to unique values.";
}
leaf certificate { // rename to 'data'?
type binary;
description
"An X.509 v3 certificate structure as specified by RFC
5280, Section 4 encoded using the ASN.1 distinguished
encoding rules (DER), as specified in ITU-T X.690.";
reference
"RFC 5280:
Internet X.509 Public Key Infrastructure Certificate
and Certificate Revocation List (CRL) Profile.
ITU-T X.690:
Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).";
}
}
}
list trusted-host-keys {
key name;
description
"A list of trusted host-keys. These host-keys can be used
by clients to authenticate SSH servers. The host-keys are
endpoint specific. Each list of host-keys SHOULD be
specific to a purpose, as the list as a whole may be
referenced by other modules. For instance, a NETCONF
client model might point to a list of host-keys to use
when authenticating servers host-keys.";
leaf name {
type string;
description
"An arbitrary name for this list of trusted SSH host keys.";
}
leaf description {
type string;
description
"An arbitrary description for this list of trusted SSH host
keys.";
}
list trusted-host-key {
key name;
description
"A trusted host key.";
leaf name {
type string;
description
"An arbitrary name for this trusted host-key. Must be
unique across all lists of trusted host-keys (not just
this list) so that a leafref to it from another module
can resolve to unique values.
Note that, for when the SSH client is able to listen
for call-home connections as well, there is no reference
identifier (e.g., hostname, IP address, etc.) that it
can use to uniquely identify the server with. The
call-home draft recommends SSH servers use X.509v3
certificates (RFC6187) when calling home.";
}
leaf host-key { // rename to 'data'?
type binary;
mandatory true;
description // is this the correct type?
"An OneAsymmetricKey 'publicKey' structure as specified
by RFC 5958, Section 2 encoded using the ASN.1
distinguished encoding rules (DER), as specified
in ITU-T X.690.";
reference
"RFC 5958:
Asymmetric Key Packages
ITU-T X.690:
Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).";
}
}
}
}
notification certificate-expiration {
description
"A notification indicating that a configured certificate is
either about to expire or has already expired. When to send
notifications is an implementation specific decision, but
it is RECOMMENDED that a notification be sent once a month
for 3 months, then once a week for four weeks, and then once
a day thereafter.";
leaf certificate {
type instance-identifier;
mandatory true;
description
"Identifies which certificate is expiring or is expired.";
}
leaf expiration-date {
type yang:date-and-time;
mandatory true;
description
"Identifies the expiration date on the certificate.";
}
}
}