Internet-Draft | A YANG Data Model for a Keystore and Key | March 2024 |
Watsen | Expires 17 September 2024 | [Page] |
This document presents a YANG module called "ietf-keystore" that enables centralized configuration of both symmetric and asymmetric keys. The secret value for both key types may be encrypted or hidden. Asymmetric keys may be associated with certificates. Notifications are sent when certificates are about to expire.¶
This draft contains placeholder values that need to be replaced with finalized values at the time of publication. This note summarizes all of the substitutions that are needed. No other RFC Editor instructions are specified elsewhere in this document.¶
Artwork in this document contains shorthand references to drafts in progress. Please apply the following replacements:¶
AAAA
--> the assigned RFC value for draft-ietf-netconf-crypto-types¶
CCCC
--> the assigned RFC value for this draft¶
Artwork in this document contains placeholder values for the date of publication of this draft. Please apply the following replacement:¶
2024-03-16
--> the publication date of this draft¶
The "Relation to other RFCs" section Section 1.1 contains the text "one or more YANG modules" and, later, "modules". This text is sourced from a file in a context where it is unknown how many modules a draft defines. The text is not wrong as is, but it may be improved by stating more directly how many modules are defined.¶
The "Relation to other RFCs" section Section 1.1 contains a self-reference to this draft, along with a corresponding reference in the Appendix. Please replace the self-reference in this section with "This RFC" (or similar) and remove the self-reference in the "Normative/Informative References" section, whichever it is in.¶
Tree-diagrams in this draft may use the '\' line-folding mode defined in RFC 8792. However, nicer-to-the-eye is when the '\\' line-folding mode is used. The AD suggested suggested putting a request here for the RFC Editor to help convert "ugly" '\' folded examples to use the '\\' folding mode. "Help convert" may be interpreted as, identify what looks ugly and ask the authors to make the adjustment.¶
The following Appendix section is to be removed prior to publication:¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 17 September 2024.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
This document presents a YANG 1.1 [RFC7950] module called "ietf-keystore" that enables centralized configuration of both symmetric and asymmetric keys. The secret value for both key types may be encrypted or hidden (see [I-D.ietf-netconf-crypto-types]). Asymmetric keys may be associated with certificates. Notifications are sent when certificates are about to expire.¶
The "ietf-keystore" module defines many "grouping" statements intended for use by other modules that may import it. For instance, there are groupings that define enabling a key to be either configured inline (within the defining data model) or as a reference to a key in the central keystore.¶
Special consideration has been given for servers that have cryptographic hardware, such as a Trusted Platform Module (TPM). These servers are unique in that the cryptographic hardware hides the secret key values. Additionally, such hardware is commonly initialized when manufactured to protect a "built-in" asymmetric key for which its public half is conveyed in an identity certificate (e.g., an IDevID [Std-802.1AR-2018] certificate). Please see Section 3 to see how built-in keys are supported.¶
This document is intended to reflect existing practices that many server implementations support at the time of writing. To simplify implementation, advanced key formats may be selectively implemented.¶
Implementations may utilize operating-system level keystore utilities (e.g., "Keychain Access" on MacOS) and/or cryptographic hardware (e.g., TPMs).¶
This document presents one or more YANG modules [RFC7950] that are part of a collection of RFCs that work together to, ultimately, support the configuration of both the clients and servers of both the NETCONF [RFC6241] and RESTCONF [RFC8040] protocols.¶
The dependency relationship between the primary YANG groupings defined in the various RFCs is presented in the below diagram. In some cases, a draft may define secondary groupings that introduce dependencies not illustrated in the diagram. The labels in the diagram are a shorthand name for the defining RFC. The citation reference for shorthand name is provided below the diagram.¶
Please note that the arrows in the diagram point from referencer to referenced. For example, the "crypto-types" RFC does not have any dependencies, whilst the "keystore" RFC depends on the "crypto-types" RFC.¶
crypto-types ^ ^ / \ / \ truststore keystore ^ ^ ^ ^ | +---------+ | | | | | | | +------------+ | tcp-client-server | / | | ^ ^ ssh-client-server | | | | ^ tls-client-server | | | ^ ^ http-client-server | | | | | ^ | | | +-----+ +---------+ | | | | | | | | +-----------|--------|--------------+ | | | | | | | | +-----------+ | | | | | | | | | | | | | | | | | netconf-client-server restconf-client-server¶
Label in Diagram | Originating RFC |
---|---|
crypto-types | [I-D.ietf-netconf-crypto-types] |
truststore | [I-D.ietf-netconf-trust-anchors] |
keystore | [I-D.ietf-netconf-keystore] |
tcp-client-server | [I-D.ietf-netconf-tcp-client-server] |
ssh-client-server | [I-D.ietf-netconf-ssh-client-server] |
tls-client-server | [I-D.ietf-netconf-tls-client-server] |
http-client-server | [I-D.ietf-netconf-http-client-server] |
netconf-client-server | [I-D.ietf-netconf-netconf-client-server] |
restconf-client-server | [I-D.ietf-netconf-restconf-client-server] |
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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
The terms "client" and "server" are defined in [RFC6241] and are not redefined here.¶
The term "keystore" is defined in this document as a mechanism that intends to safeguard secrets.¶
The nomenclature "<running>" and "<operational>" are defined in [RFC8342].¶
The sentence fragments "augmented" and "augmented in" are used herein as the past tense verbified form of the "augment" statement defined in Section 7.17 of [RFC7950].¶
The term "key" may be used to mean one of three things in this document: 1) the YANG-defined "asymmetric-key" or "symmetric-key" node defined in this document, 2) the raw key data possessed by the aforementioned key nodes, and 3) the "key" of a YANG "list" statement. This document attempts to always qualify types '2' and '3' using, "raw key value" and "YANG list key" where needed. In all other cases, an unqualified "key" refers to a YANG-defined "asymmetric-key" or "symmetric-key" node.¶
This document is compliant with Network Management Datastore Architecture (NMDA) [RFC8342]. For instance, keys and associated certificates installed during manufacturing (e.g., for an IDevID certificate) are expected to appear in <operational> (see Section 3).¶
Various examples in this document use "BASE64VALUE=" as a placeholder value for binary data that has been base64 encoded (per Section 9.8 of [RFC7950]). This placeholder value is used because real base64 encoded structures are often many lines long and hence distracting to the example being presented.¶
This document uses the adjective "central" to the word "keystore" to refer to the top-level instance of the "keystore-grouping", when the "central-keystore-supported" feature is enabled. Please be aware that consuming YANG modules MAY instantiate the "keystore-grouping" in other locations. All such other instances are not the "central" instance.¶
This section defines a YANG 1.1 [RFC7950] module called "ietf-keystore". A high-level overview of the module is provided in Section 2.1. Examples illustrating the module's use are provided in Section 2.2. The YANG module itself is defined in Section 2.3.¶
This section provides an overview of the "ietf-keystore" module in terms of its features, typedefs, groupings, and protocol-accessible nodes.¶
The following diagram lists all the "feature" statements defined in the "ietf-keystore" module:¶
Features: +-- central-keystore-supported +-- inline-definitions-supported +-- asymmetric-keys +-- symmetric-keys¶
The diagram above uses syntax that is similar to but not defined in [RFC8340].¶
The following diagram lists the "typedef" statements defined in the "ietf-keystore" module:¶
Typedefs: leafref +-- central-symmetric-key-ref +-- central-asymmetric-key-ref¶
The diagram above uses syntax that is similar to but not defined in [RFC8340].¶
Comments:¶
The "ietf-keystore" module defines the following "grouping" statements:¶
Each of these groupings are presented in the following subsections.¶
The following tree diagram [RFC8340] illustrates the "encrypted-by-grouping" grouping:¶
grouping encrypted-by-grouping: +-- (encrypted-by) +--:(central-symmetric-key-ref) | {central-keystore-supported,symmetric-keys}? | +-- symmetric-key-ref? ks:central-symmetric-key-ref +--:(central-asymmetric-key-ref) {central-keystore-supported,asymmetric-keys}? +-- asymmetric-key-ref? ks:central-asymmetric-key-ref¶
Comments:¶
The following tree diagram [RFC8340] illustrates the "central-asymmetric-key-certificate-ref-grouping" grouping:¶
grouping central-asymmetric-key-certificate-ref-grouping: +-- asymmetric-key? ks:central-asymmetric-key-ref | {central-keystore-supported,asymmetric-keys}? +-- certificate? leafref¶
Comments:¶
The following tree diagram [RFC8340] illustrates the "inline-or-keystore-symmetric-key-grouping" grouping:¶
grouping inline-or-keystore-symmetric-key-grouping: +-- (inline-or-keystore) +--:(inline) {inline-definitions-supported}? | +-- inline-definition | +---u ct:symmetric-key-grouping +--:(central-keystore) {central-keystore-supported,symmetric-keys}? +-- central-keystore-reference? ks:central-symmetric-key-ref¶
Comments:¶
The following tree diagram [RFC8340] illustrates the "inline-or-keystore-asymmetric-key-grouping" grouping:¶
grouping inline-or-keystore-asymmetric-key-grouping: +-- (inline-or-keystore) +--:(inline) {inline-definitions-supported}? | +-- inline-definition | +---u ct:asymmetric-key-pair-grouping +--:(central-keystore) {central-keystore-supported,asymmetric-keys}? +-- central-keystore-reference? ks:central-asymmetric-key-ref¶
Comments:¶
The following tree diagram [RFC8340] illustrates the "inline-or-keystore-asymmetric-key-with-certs-grouping" grouping:¶
grouping inline-or-keystore-asymmetric-key-with-certs-grouping: +-- (inline-or-keystore) +--:(inline) {inline-definitions-supported}? | +-- inline-definition | +---u ct:asymmetric-key-pair-with-certs-grouping +--:(central-keystore) {central-keystore-supported,asymmetric-keys}? +-- central-keystore-reference? ks:central-asymmetric-key-ref¶
Comments:¶
The following tree diagram [RFC8340] illustrates the "inline-or-keystore-end-entity-cert-with-key-grouping" grouping:¶
grouping inline-or-keystore-end-entity-cert-with-key-grouping: +-- (inline-or-keystore) +--:(inline) {inline-definitions-supported}? | +-- inline-definition | +---u ct:asymmetric-key-pair-with-cert-grouping +--:(central-keystore) {central-keystore-supported,asymmetric-keys}? +-- central-keystore-reference +---u central-asymmetric-key-certificate-ref-grouping¶
Comments:¶
The following tree diagram [RFC8340] illustrates the "keystore-grouping" grouping:¶
grouping keystore-grouping: +-- asymmetric-keys {asymmetric-keys}? | +-- asymmetric-key* [name] | +-- name? string | +---u ct:asymmetric-key-pair-with-certs-grouping +-- symmetric-keys {symmetric-keys}? +-- symmetric-key* [name] +-- name? string +---u ct:symmetric-key-grouping¶
Comments:¶
The following tree diagram [RFC8340] lists all the protocol-accessible nodes defined in the "ietf-keystore" module, without expanding the "grouping" statements:¶
module: ietf-keystore +--rw keystore {central-keystore-supported}? +---u keystore-grouping¶
The following tree diagram [RFC8340] lists all the protocol-accessible nodes defined in the "ietf-keystore" module, with all "grouping" statements expanded, enabling the keystore's full structure to be seen:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ module: ietf-keystore +--rw keystore {central-keystore-supported}? +--rw asymmetric-keys {asymmetric-keys}? | +--rw asymmetric-key* [name] | +--rw name string | +--rw public-key-format? identityref | +--rw public-key? binary | +--rw private-key-format? identityref | +--rw (private-key-type) | | +--:(cleartext-private-key) {cleartext-private-keys}? | | | +--rw cleartext-private-key? binary | | +--:(hidden-private-key) {hidden-private-keys}? | | | +--rw hidden-private-key? empty | | +--:(encrypted-private-key) {encrypted-private-keys}? | | +--rw encrypted-private-key | | +--rw encrypted-by | | | +--rw (encrypted-by) | | | +--:(central-symmetric-key-ref) | | | | {central-keystore-supported,symme\ tric-keys}? | | | | +--rw symmetric-key-ref? | | | | ks:central-symmetric-key-ref | | | +--:(central-asymmetric-key-ref) | | | {central-keystore-supported,asymm\ etric-keys}? | | | +--rw asymmetric-key-ref? | | | ks:central-asymmetric-key-ref | | +--rw encrypted-value-format identityref | | +--rw encrypted-value binary | +--rw certificates | | +--rw certificate* [name] | | +--rw name string | | +--rw cert-data end-entity-cert-cms | | +---n certificate-expiration | | {certificate-expiration-notification}? | | +-- expiration-date yang:date-and-time | +---x generate-csr {csr-generation}? | +---w input | | +---w csr-format identityref | | +---w csr-info csr-info | +--ro output | +--ro (csr-type) | +--:(p10-csr) | +--ro p10-csr? p10-csr +--rw symmetric-keys {symmetric-keys}? +--rw symmetric-key* [name] +--rw name string +--rw key-format? identityref +--rw (key-type) +--:(cleartext-symmetric-key) | +--rw cleartext-symmetric-key? binary | {cleartext-symmetric-keys}? +--:(hidden-symmetric-key) {hidden-symmetric-keys}? | +--rw hidden-symmetric-key? empty +--:(encrypted-symmetric-key) {encrypted-symmetric-keys}? +--rw encrypted-symmetric-key +--rw encrypted-by | +--rw (encrypted-by) | +--:(central-symmetric-key-ref) | | {central-keystore-supported,symme\ tric-keys}? | | +--rw symmetric-key-ref? | | ks:central-symmetric-key-ref | +--:(central-asymmetric-key-ref) | {central-keystore-supported,asymm\ etric-keys}? | +--rw asymmetric-key-ref? | ks:central-asymmetric-key-ref +--rw encrypted-value-format identityref +--rw encrypted-value binary¶
Comments:¶
The examples in this section are encoded using XML, such as might be the case when using the NETCONF protocol. Other encodings MAY be used, such as JSON when using the RESTCONF protocol.¶
The following example illustrates keys in <running>. Please see Section 3 for an example illustrating built-in values in <operational>.¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore" xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"> <symmetric-keys> <symmetric-key> <name>cleartext-symmetric-key</name> <key-format>ct:octet-string-key-format</key-format> <cleartext-symmetric-key>BASE64VALUE=</cleartext-symmetric-\ key> </symmetric-key> <symmetric-key> <name>hidden-symmetric-key</name> <hidden-symmetric-key/> </symmetric-key> <symmetric-key> <name>encrypted-symmetric-key</name> <key-format>ct:one-symmetric-key-format</key-format> <encrypted-symmetric-key> <encrypted-by> <asymmetric-key-ref>hidden-asymmetric-key</asymmetric-k\ ey-ref> </encrypted-by> <encrypted-value-format>ct:cms-enveloped-data-format</enc\ rypted-value-format> <encrypted-value>BASE64VALUE=</encrypted-value> </encrypted-symmetric-key> </symmetric-key> </symmetric-keys> <asymmetric-keys> <asymmetric-key> <name>ssh-rsa-key</name> <private-key-format>ct:rsa-private-key-format</private-key-\ format> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> </asymmetric-key> <asymmetric-key> <name>ssh-rsa-key-with-cert</name> <private-key-format>ct:rsa-private-key-format</private-key-\ format> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> <certificates> <certificate> <name>ex-rsa-cert2</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </asymmetric-key> <asymmetric-key> <name>raw-private-key</name> <private-key-format>ct:rsa-private-key-format</private-key-\ format> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> </asymmetric-key> <asymmetric-key> <name>rsa-asymmetric-key</name> <private-key-format>ct:rsa-private-key-format</private-key-\ format> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> <certificates> <certificate> <name>ex-rsa-cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </asymmetric-key> <asymmetric-key> <name>ec-asymmetric-key</name> <private-key-format>ct:ec-private-key-format</private-key-f\ ormat> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> <certificates> <certificate> <name>ex-ec-cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </asymmetric-key> <asymmetric-key> <name>hidden-asymmetric-key</name> <public-key-format>ct:subject-public-key-info-format</publi\ c-key-format> <public-key>BASE64VALUE=</public-key> <hidden-private-key/> <certificates> <certificate> <name>builtin-idevid-cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> <certificate> <name>my-ldevid-cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </asymmetric-key> <asymmetric-key> <name>encrypted-asymmetric-key</name> <private-key-format>ct:one-asymmetric-key-format</private-k\ ey-format> <encrypted-private-key> <encrypted-by> <symmetric-key-ref>encrypted-symmetric-key</symmetric-k\ ey-ref> </encrypted-by> <encrypted-value-format>ct:cms-encrypted-data-format</enc\ rypted-value-format> <encrypted-value>BASE64VALUE=</encrypted-value> </encrypted-private-key> </asymmetric-key> </asymmetric-keys> </keystore>¶
The following example illustrates a "certificate-expiration" notification for a certificate associated with an asymmetric key configured in the keystore.¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2018-05-25T00:01:00Z</eventTime> <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"> <asymmetric-keys> <asymmetric-key> <name>hidden-asymmetric-key</name> <certificates> <certificate> <name>my-ldevid-cert</name> <certificate-expiration> <expiration-date>2018-08-05T14:18:53-05:00</expiration\ -date> </certificate-expiration> </certificate> </certificates> </asymmetric-key> </asymmetric-keys> </keystore> </notification>¶
This section illustrates the various "inline-or-keystore" groupings defined in the "ietf-keystore" module, specifically the "inline-or-keystore-symmetric-key-grouping" (Section 2.1.3.3), "inline-or-keystore-asymmetric-key-grouping" (Section 2.1.3.4), "inline-or-keystore-asymmetric-key-with-certs-grouping" (Section 2.1.3.5), and "inline-or-keystore-end-entity-cert-with-key-grouping" (Section 2.1.3.6) groupings.¶
These examples assume the existence of an example module called "ex-keystore-usage" having the namespace "https://example.com/ns/example-keystore-usage".¶
The ex-keystore-usage module is first presented using tree diagrams [RFC8340], followed by an instance example illustrating all the "inline-or-keystore" groupings in use, followed by the YANG module itself.¶
The following tree diagram illustrates "ex-keystore-usage" without expanding the "grouping" statements:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ module: ex-keystore-usage +--rw keystore-usage +--rw symmetric-key* [name] | +--rw name string | +---u ks:inline-or-keystore-symmetric-key-grouping +--rw asymmetric-key* [name] | +--rw name string | +---u ks:inline-or-keystore-asymmetric-key-grouping +--rw asymmetric-key-with-certs* [name] | +--rw name | | string | +---u ks:inline-or-keystore-asymmetric-key-with-certs-groupi\ ng +--rw end-entity-cert-with-key* [name] +--rw name | string +---u ks:inline-or-keystore-end-entity-cert-with-key-grouping¶
The following tree diagram illustrates the "ex-keystore-usage" module, with all "grouping" statements expanded, enabling the usage's full structure to be seen:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ module: ex-keystore-usage +--rw keystore-usage +--rw symmetric-key* [name] | +--rw name string | +--rw (inline-or-keystore) | +--:(inline) {inline-definitions-supported}? | | +--rw inline-definition | | +--rw key-format? identityref | | +--rw (key-type) | | +--:(cleartext-symmetric-key) | | | +--rw cleartext-symmetric-key? binary | | | {cleartext-symmetric-keys}? | | +--:(hidden-symmetric-key) | | | {hidden-symmetric-keys}? | | | +--rw hidden-symmetric-key? empty | | +--:(encrypted-symmetric-key) | | {encrypted-symmetric-keys}? | | +--rw encrypted-symmetric-key | | +--rw encrypted-by | | +--rw encrypted-value-format identityref | | +--rw encrypted-value binary | +--:(central-keystore) | {central-keystore-supported,symmetric-keys}? | +--rw central-keystore-reference? | ks:central-symmetric-key-ref +--rw asymmetric-key* [name] | +--rw name string | +--rw (inline-or-keystore) | +--:(inline) {inline-definitions-supported}? | | +--rw inline-definition | | +--rw public-key-format? identityref | | +--rw public-key? binary | | +--rw private-key-format? identityref | | +--rw (private-key-type) | | +--:(cleartext-private-key) | | | {cleartext-private-keys}? | | | +--rw cleartext-private-key? binary | | +--:(hidden-private-key) {hidden-private-keys}? | | | +--rw hidden-private-key? empty | | +--:(encrypted-private-key) | | {encrypted-private-keys}? | | +--rw encrypted-private-key | | +--rw encrypted-by | | +--rw encrypted-value-format identityref | | +--rw encrypted-value binary | +--:(central-keystore) | {central-keystore-supported,asymmetric-keys}? | +--rw central-keystore-reference? | ks:central-asymmetric-key-ref +--rw asymmetric-key-with-certs* [name] | +--rw name string | +--rw (inline-or-keystore) | +--:(inline) {inline-definitions-supported}? | | +--rw inline-definition | | +--rw public-key-format? identityref | | +--rw public-key? binary | | +--rw private-key-format? identityref | | +--rw (private-key-type) | | | +--:(cleartext-private-key) | | | | {cleartext-private-keys}? | | | | +--rw cleartext-private-key? binary | | | +--:(hidden-private-key) {hidden-private-keys}? | | | | +--rw hidden-private-key? empty | | | +--:(encrypted-private-key) | | | {encrypted-private-keys}? | | | +--rw encrypted-private-key | | | +--rw encrypted-by | | | +--rw encrypted-value-format identityref | | | +--rw encrypted-value binary | | +--rw certificates | | | +--rw certificate* [name] | | | +--rw name string | | | +--rw cert-data | | | | end-entity-cert-cms | | | +---n certificate-expiration | | | {certificate-expiration-notification}? | | | +-- expiration-date yang:date-and-time | | +---x generate-csr {csr-generation}? | | +---w input | | | +---w csr-format identityref | | | +---w csr-info csr-info | | +--ro output | | +--ro (csr-type) | | +--:(p10-csr) | | +--ro p10-csr? p10-csr | +--:(central-keystore) | {central-keystore-supported,asymmetric-keys}? | +--rw central-keystore-reference? | ks:central-asymmetric-key-ref +--rw end-entity-cert-with-key* [name] +--rw name string +--rw (inline-or-keystore) +--:(inline) {inline-definitions-supported}? | +--rw inline-definition | +--rw public-key-format? identityref | +--rw public-key? binary | +--rw private-key-format? identityref | +--rw (private-key-type) | | +--:(cleartext-private-key) | | | {cleartext-private-keys}? | | | +--rw cleartext-private-key? binary | | +--:(hidden-private-key) {hidden-private-keys}? | | | +--rw hidden-private-key? empty | | +--:(encrypted-private-key) | | {encrypted-private-keys}? | | +--rw encrypted-private-key | | +--rw encrypted-by | | +--rw encrypted-value-format identityref | | +--rw encrypted-value binary | +--rw cert-data? | | end-entity-cert-cms | +---n certificate-expiration | | {certificate-expiration-notification}? | | +-- expiration-date yang:date-and-time | +---x generate-csr {csr-generation}? | +---w input | | +---w csr-format identityref | | +---w csr-info csr-info | +--ro output | +--ro (csr-type) | +--:(p10-csr) | +--ro p10-csr? p10-csr +--:(central-keystore) {central-keystore-supported,asymmetric-keys}? +--rw central-keystore-reference +--rw asymmetric-key? | ks:central-asymmetric-key-ref | {central-keystore-supported,asymmetric-keys\ }? +--rw certificate? leafref¶
The following example provides two equivalent instances of each grouping, the first being a reference to a keystore and the second being inlined. The instance having a reference to a keystore is consistent with the keystore defined in Section 2.2.1. The two instances are equivalent, as the inlined instance example contains the same values defined by the keystore instance referenced by its sibling example.¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ <keystore-usage xmlns="https://example.com/ns/example-keystore-usage" xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"> <!-- The following two equivalent examples illustrate the --> <!-- "inline-or-keystore-symmetric-key-grouping" grouping: --> <symmetric-key> <name>example 1a</name> <central-keystore-reference>cleartext-symmetric-key</central-key\ store-reference> </symmetric-key> <symmetric-key> <name>example 1b</name> <inline-definition> <key-format>ct:octet-string-key-format</key-format> <cleartext-symmetric-key>BASE64VALUE=</cleartext-symmetric-key> </inline-definition> </symmetric-key> <!-- The following two equivalent examples illustrate the --> <!-- "inline-or-keystore-asymmetric-key-grouping" grouping: --> <asymmetric-key> <name>example 2a</name> <central-keystore-reference>rsa-asymmetric-key</central-keystore\ -reference> </asymmetric-key> <asymmetric-key> <name>example 2b</name> <inline-definition> <public-key-format>ct:subject-public-key-info-format</public-k\ ey-format> <public-key>BASE64VALUE=</public-key> <private-key-format>ct:rsa-private-key-format</private-key-for\ mat> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> </inline-definition> </asymmetric-key> <!-- the following two equivalent examples illustrate --> <!-- "inline-or-keystore-asymmetric-key-with-certs-grouping": --> <asymmetric-key-with-certs> <name>example 3a</name> <central-keystore-reference>rsa-asymmetric-key</central-keystore\ -reference> </asymmetric-key-with-certs> <asymmetric-key-with-certs> <name>example 3b</name> <inline-definition> <public-key-format>ct:subject-public-key-info-format</public-k\ ey-format> <public-key>BASE64VALUE=</public-key> <private-key-format>ct:rsa-private-key-format</private-key-for\ mat> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> <certificates> <certificate> <name>a locally-defined cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </inline-definition> </asymmetric-key-with-certs> <!-- The following two equivalent examples illustrate --> <!-- "inline-or-keystore-end-entity-cert-with-key-grouping": --> <end-entity-cert-with-key> <name>example 4a</name> <central-keystore-reference> <asymmetric-key>rsa-asymmetric-key</asymmetric-key> <certificate>ex-rsa-cert</certificate> </central-keystore-reference> </end-entity-cert-with-key> <end-entity-cert-with-key> <name>example 4b</name> <inline-definition> <public-key-format>ct:subject-public-key-info-format</public-k\ ey-format> <public-key>BASE64VALUE=</public-key> <private-key-format>ct:rsa-private-key-format</private-key-for\ mat> <cleartext-private-key>BASE64VALUE=</cleartext-private-key> <cert-data>BASE64VALUE=</cert-data> </inline-definition> </end-entity-cert-with-key> </keystore-usage>¶
Following is the "ex-keystore-usage" module's YANG definition:¶
module ex-keystore-usage { yang-version 1.1; namespace "https://example.com/ns/example-keystore-usage"; prefix ex-keystore-usage; import ietf-keystore { prefix ks; reference "RFC CCCC: A YANG Data Model for a Keystore"; } organization "Example Corporation"; contact "Author: YANG Designer <mailto:yang.designer@example.com>"; description "This example module illustrates notable groupings defined in the 'ietf-keystore' module."; revision 2024-03-16 { description "Initial version"; reference "RFC CCCC: A YANG Data Model for a Keystore"; } container keystore-usage { description "An illustration of the various keystore groupings."; list symmetric-key { key "name"; leaf name { type string; description "An arbitrary name for this key."; } uses ks:inline-or-keystore-symmetric-key-grouping; description "An symmetric key that may be configured locally or be a reference to a symmetric key in the keystore."; } list asymmetric-key { key "name"; leaf name { type string; description "An arbitrary name for this key."; } uses ks:inline-or-keystore-asymmetric-key-grouping; description "An asymmetric key, with no certs, that may be configured locally or be a reference to an asymmetric key in the keystore. The intent is to reference just the asymmetric key, not any certificates that may also be associated with the asymmetric key."; } list asymmetric-key-with-certs { key "name"; leaf name { type string; description "An arbitrary name for this key."; } uses ks:inline-or-keystore-asymmetric-key-with-certs-grouping; description "An asymmetric key and its associated certs, that may be configured locally or be a reference to an asymmetric key (and its associated certs) in the keystore."; } list end-entity-cert-with-key { key "name"; leaf name { type string; description "An arbitrary name for this key."; } uses ks:inline-or-keystore-end-entity-cert-with-key-grouping; description "An end-entity certificate and its associated asymmetric key, that may be configured locally or be a reference to another certificate (and its associated asymmetric key) in the keystore."; } } }¶
This YANG module has normative references to [RFC8341] and [I-D.ietf-netconf-crypto-types].¶
<CODE BEGINS> file "ietf-keystore@2024-03-16.yang"¶
module ietf-keystore { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-keystore"; prefix ks; 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"; } organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: https://datatracker.ietf.org/wg/netconf WG List: NETCONF WG list <mailto:netconf@ietf.org> Author: Kent Watsen <mailto:kent+ietf@watsen.net>"; description "This module defines a 'keystore' to centralize management of security credentials. Copyright (c) 2024 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 Revised 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 CCCC (https://www.rfc-editor.org/info/rfcCCCC); 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 2024-03-16 { description "Initial version"; reference "RFC CCCC: A YANG Data Model for a Keystore"; } /****************/ /* Features */ /****************/ feature central-keystore-supported { description "The 'central-keystore-supported' feature indicates that the server supports the central keystore (i.e., fully implements the 'ietf-keystore' module)."; } feature inline-definitions-supported { description "The 'inline-definitions-supported' feature indicates that the server supports locally-defined keys."; } feature asymmetric-keys { description "The 'asymmetric-keys' feature indicates that the server implements the /keystore/asymmetric-keys subtree."; } feature symmetric-keys { description "The 'symmetric-keys' feature indicates that the server implements the /keystore/symmetric-keys subtree."; } /****************/ /* Typedefs */ /****************/ typedef central-symmetric-key-ref { type leafref { path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key" + "/ks:name"; } description "This typedef enables modules to easily define a reference to a symmetric key stored in the central keystore."; } typedef central-asymmetric-key-ref { type leafref { path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key" + "/ks:name"; } description "This typedef enables modules to easily define a reference to an asymmetric key stored in the central keystore."; } /*****************/ /* Groupings */ /*****************/ grouping encrypted-by-grouping { description "A grouping that defines a 'choice' statement that can be augmented into the 'encrypted-by' node, present in the 'symmetric-key-grouping' and 'asymmetric-key-pair-grouping' groupings defined in RFC AAAA, enabling references to keys in the central keystore."; choice encrypted-by { nacm:default-deny-write; mandatory true; description "A choice amongst other symmetric or asymmetric keys."; case central-symmetric-key-ref { if-feature "central-keystore-supported"; if-feature "symmetric-keys"; leaf symmetric-key-ref { type ks:central-symmetric-key-ref; description "Identifies the symmetric key used to encrypt the associated key."; } } case central-asymmetric-key-ref { if-feature "central-keystore-supported"; if-feature "asymmetric-keys"; leaf asymmetric-key-ref { type ks:central-asymmetric-key-ref; description "Identifies the asymmetric key whose public key encrypted the associated key."; } } } } // *-ref groupings grouping central-asymmetric-key-certificate-ref-grouping { description "Grouping for the reference to a certificate associated with an asymmetric key stored in the central keystore."; leaf asymmetric-key { nacm:default-deny-write; if-feature "central-keystore-supported"; if-feature "asymmetric-keys"; type ks:central-asymmetric-key-ref; must '../certificate'; description "A reference to an asymmetric key in the keystore."; } leaf certificate { nacm:default-deny-write; type leafref { path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key" + "[ks:name = current()/../asymmetric-key]/" + "ks:certificates/ks:certificate/ks:name"; } must '../asymmetric-key'; description "A reference to a specific certificate of the asymmetric key in the keystore."; } } // inline-or-keystore-* groupings grouping inline-or-keystore-symmetric-key-grouping { description "A grouping for the configuration of a symmetric key. The symmetric key may be defined inline or as a reference to a symmetric key stored in the central keystore. Servers that wish to define alternate keystore locations SHOULD augment in custom 'case' statements enabling references to those alternate keystore locations."; choice inline-or-keystore { nacm:default-deny-write; mandatory true; description "A choice between an inlined definition and a definition that exists in the keystore."; case inline { if-feature "inline-definitions-supported"; container inline-definition { description "Container to hold the local key definition."; uses ct:symmetric-key-grouping; } } case central-keystore { if-feature "central-keystore-supported"; if-feature "symmetric-keys"; leaf central-keystore-reference { type ks:central-symmetric-key-ref; description "A reference to an symmetric key that exists in the central keystore."; } } } } grouping inline-or-keystore-asymmetric-key-grouping { description "A grouping for the configuration of an asymmetric key. The asymmetric key may be defined inline or as a reference to an asymmetric key stored in the central keystore. Servers that wish to define alternate keystore locations SHOULD augment in custom 'case' statements enabling references to those alternate keystore locations."; choice inline-or-keystore { nacm:default-deny-write; mandatory true; description "A choice between an inlined definition and a definition that exists in the keystore."; case inline { if-feature "inline-definitions-supported"; container inline-definition { description "Container to hold the local key definition."; uses ct:asymmetric-key-pair-grouping; } } case central-keystore { if-feature "central-keystore-supported"; if-feature "asymmetric-keys"; leaf central-keystore-reference { type ks:central-asymmetric-key-ref; description "A reference to an asymmetric key that exists in the central keystore. The intent is to reference just the asymmetric key without any regard for any certificates that may be associated with it."; } } } } grouping inline-or-keystore-asymmetric-key-with-certs-grouping { description "A grouping for the configuration of an asymmetric key and its associated certificates. The asymmetric key and its associated certificates may be defined inline or as a reference to an asymmetric key (and its associated certificates) in the central keystore. Servers that wish to define alternate keystore locations SHOULD augment in custom 'case' statements enabling references to those alternate keystore locations."; choice inline-or-keystore { nacm:default-deny-write; mandatory true; description "A choice between an inlined definition and a definition that exists in the keystore."; case inline { if-feature "inline-definitions-supported"; container inline-definition { description "Container to hold the local key definition."; uses ct:asymmetric-key-pair-with-certs-grouping; } } case central-keystore { if-feature "central-keystore-supported"; if-feature "asymmetric-keys"; leaf central-keystore-reference { type ks:central-asymmetric-key-ref; description "A reference to an asymmetric-key (and all of its associated certificates) in the keystore, when this module is implemented."; } } } } grouping inline-or-keystore-end-entity-cert-with-key-grouping { description "A grouping for the configuration of an asymmetric key and its associated end-entity certificate. The asymmetric key and its associated end-entity certificate may be defined inline or as a reference to an asymmetric key (and its associated end-entity certificate) in the central keystore. Servers that wish to define alternate keystore locations SHOULD augment in custom 'case' statements enabling references to those alternate keystore locations."; choice inline-or-keystore { nacm:default-deny-write; mandatory true; description "A choice between an inlined definition and a definition that exists in the keystore."; case inline { if-feature "inline-definitions-supported"; container inline-definition { description "Container to hold the local key definition."; uses ct:asymmetric-key-pair-with-cert-grouping; } } case central-keystore { if-feature "central-keystore-supported"; if-feature "asymmetric-keys"; container central-keystore-reference { uses central-asymmetric-key-certificate-ref-grouping; description "A reference to a specific certificate associated with an asymmetric key stored in the central keystore."; } } } } // the keystore grouping grouping keystore-grouping { description "Grouping definition enables use in other contexts. If ever done, implementations MUST augment new 'case' statements into the various inline-or-keystore 'choice' statements to supply leafrefs to the model-specific location(s)."; container asymmetric-keys { nacm:default-deny-write; if-feature "asymmetric-keys"; description "A list of asymmetric keys."; list asymmetric-key { key "name"; description "An asymmetric key."; leaf name { type string; description "An arbitrary name for the asymmetric key."; } uses ct:asymmetric-key-pair-with-certs-grouping; } } container symmetric-keys { nacm:default-deny-write; if-feature "symmetric-keys"; description "A list of symmetric keys."; list symmetric-key { key "name"; description "A symmetric key."; leaf name { type string; description "An arbitrary name for the symmetric key."; } uses ct:symmetric-key-grouping; } } } /*********************************/ /* Protocol accessible nodes */ /*********************************/ container keystore { if-feature central-keystore-supported; description "A central keystore containing a list of symmetric keys and a list of asymmetric keys."; nacm:default-deny-write; uses keystore-grouping { augment "symmetric-keys/symmetric-key/key-type/encrypted-" + "symmetric-key/encrypted-symmetric-key/encrypted-by" { description "Augments in a choice statement enabling the encrypting key to be any other symmetric or asymmetric key in the central keystore."; uses encrypted-by-grouping; } augment "asymmetric-keys/asymmetric-key/private-key-type/" + "encrypted-private-key/encrypted-private-key/" + "encrypted-by" { description "Augments in a choice statement enabling the encrypting key to be any other symmetric or asymmetric key in the central keystore."; uses encrypted-by-grouping; } } } }¶
<CODE ENDS>¶
In some implementations, a server may support keys built into the server. Built-in keys MAY be set during the manufacturing process or be dynamically generated the first time the server is booted or a particular service (e.g., SSH) is enabled.¶
Built-in keys are "hidden" keys expected to be set by a vendor-specific process. Any ability for operators to set and/or modify built-in keys is outside the scope of this document.¶
The primary characteristic of the built-in keys is that they are provided by the server, as opposed to configuration. As such, they are present in <operational> (Section 5.3 of [RFC8342]), and <system> [I-D.ietf-netmod-system-config], if implemented.¶
The example below illustrates what the keystore in <operational> might look like for a server in its factory default state. Note that the built-in keys have the "or:origin" annotation value "or:system".¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore" xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types" xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin" or:origin="or:intended"> <asymmetric-keys> <asymmetric-key or:origin="or:system"> <name>Manufacturer-Generated Hidden Key</name> <public-key-format>ct:subject-public-key-info-format</public-k\ ey-format> <public-key>BASE64VALUE=</public-key> <hidden-private-key/> <certificates> <certificate> <name>Manufacturer-Generated IDevID Cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </asymmetric-key> </asymmetric-keys> </keystore>¶
The following example illustrates how a single built-in key definition from the previous example has been propagated to <running>:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore" xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"> <asymmetric-keys> <asymmetric-key> <name>Manufacturer-Generated Hidden Key</name> <public-key-format>ct:subject-public-key-info-format</public-k\ ey-format> <public-key>BASE64VALUE=</public-key> <hidden-private-key/> <certificates> <certificate> <name>Manufacturer-Generated IDevID Cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> <certificate> <name>Deployment-Specific LDevID Cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </asymmetric-key> </asymmetric-keys> </keystore>¶
After the above configuration is applied, <operational> should appear as follows:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================ <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore" xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types" xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin" or:origin="or:intended"> <asymmetric-keys> <asymmetric-key or:origin="or:system"> <name>Manufacturer-Generated Hidden Key</name> <public-key-format>ct:subject-public-key-info-format</public-k\ ey-format> <public-key>BASE64VALUE=</public-key> <hidden-private-key/> <certificates> <certificate> <name>Manufacturer-Generated IDevID Cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> <certificate or:origin="or:intended"> <name>Deployment-Specific LDevID Cert</name> <cert-data>BASE64VALUE=</cert-data> </certificate> </certificates> </asymmetric-key> </asymmetric-keys> </keystore>¶
This section describes an approach that enables both the symmetric and asymmetric keys on a server to be encrypted, such that traditional backup/restore procedures can be used without concern for raw key data being compromised when in transit.¶
The approach presented in this section is not normative. This section answers how a configuration containing secrets that are encrypted by a built-in key (Section 3) can be backup'ed from one server and restored on a different server, when each server has unique master keys. The API defined by the "ietf-keystore" YANG module presented in this document is sufficient to support the workflow described in this section.¶
The ability to encrypt configured keys is predicated on the existence of a "key encryption key" (KEK). There may be any number of KEKs in a server. A KEK, by its namesake, is a key that is used to encrypt other keys. A KEK MAY be either a symmetric key or an asymmetric key.¶
If a KEK is a symmetric key, then the server MUST provide an API for administrators to encrypt other keys without needing to know the symmetric key's value. If the KEK is an asymmetric key, then the server SHOULD provide an API enabling the encryption of other keys or, alternatively, assume the administrators can do so themselves using the asymmetric key's public half.¶
A server MUST possess access to the KEK, or an API using the KEK, so that it can decrypt the other keys in the configuration at runtime.¶
Each time a new key is configured, it SHOULD be encrypted by a KEK.¶
In "ietf-crypto-types" [I-D.ietf-netconf-crypto-types], the format for encrypted values is described by identity statements derived from the "symmetrically-encrypted-value-format" and "asymmetrically-encrypted-value-format" identity statements.¶
Implementations of servers implementing the "ietf-keystore" module SHOULD provide an API that simultaneously generates a key and encrypts the generated key using a KEK. Thus the cleartext value of the newly generated key may never be known to the administrators generating the keys. Such API is defined in the "ietf-ssh-common" and the "ietf-tls-common" YANG modules defined in [I-D.ietf-netconf-ssh-client-server], and [I-D.ietf-netconf-tls-client-server], respectively.¶
In case the server implementation does not provide such an API, then the generating and encrypting steps MAY be performed outside the server, e.g., by an administrator with special access control rights (e.g., an organization's crypto officer).¶
In either case, the encrypted key can be configured into the keystore using either the "encrypted-symmetric-key" (for symmetric keys) or the "encrypted-private-key" (for asymmetric keys) nodes. These two nodes contain both the encrypted raw key value as well as a reference to the KEK that encrypted the key.¶
When a KEK is used to encrypt other keys, migrating the configuration to another server is only possible if the second server has the same KEK. How the second server comes to have the same KEK is discussed in this section.¶
In some deployments, mechanisms outside the scope of this document may be used to migrate a KEK from one server to another. That said, beware that the ability to do so typically entails having access to the first server but, in some scenarios, the first server may no longer be operational.¶
In other deployments, an organization's crypto officer, possessing a KEK's cleartext value, configures the same KEK on the second server, presumably as a hidden key or a key protected by access-control, so that the cleartext value is not disclosed to regular administrators. However, this approach creates high-coupling to and dependency on the crypto officers that does not scale in production environments.¶
In order to decouple the crypto officers from the regular administrators, a special KEK, called the "master key" (MK), may be used.¶
A MK is commonly a globally-unique built-in (see Section 3) asymmetric key. The private raw key value, due to its long lifetime, is hidden (i.e., "hidden-private-key" in Section 2.1.4.5. of [I-D.ietf-netconf-crypto-types]). The raw public key value is often contained in an identity certificate (e.g., IDevID). How to configure a MK during the manufacturing process is outside the scope of this document.¶
Assuming the server has a MK, the MK can be used to encrypt a "shared KEK", which is then used to encrypt the keys configured by regular administrators.¶
With this extra level of indirection, it is possible for a crypto officer to encrypt the same KEK for a multiplicity of servers offline using the public key contained in their identity certificates. The crypto officer can then safely handoff the encrypted KEKs to regular administrators responsible for server installations, including migrations.¶
In order to migrate the configuration from a first server, an administrator would need to make just a single modification to the configuration before loading it onto a second server, which is to replace the encrypted KEK keystore entry from the first server with the encrypted KEK for the second server. Upon doing this, the configuration (containing many encrypted keys) can be loaded into the second server while enabling the second server to decrypt all the encrypted keys in the configuration.¶
The following diagram illustrates this idea:¶
+-------------+ +-------------+ | shared KEK | | shared KEK | |(unencrypted)|-------------------------------> | (encrypted) | +-------------+ encrypts offline using +-------------+ ^ each server's MK | | | | | | possesses \o | +-------------- |\ | / \ shares with | crypto +--------------------+ officer | | | +----------------------+ | +----------------------+ | server-1 | | | server-2 | | configuration | | | configuration | | | | | | | | | | | | +----------------+ | | | +----------------+ | | | MK-1 | | | | | MK-2 | | | | (hidden) | | | | | (hidden) | | | +----------------+ | | | +----------------+ | | ^ | | | ^ | | | | | | | | | | | | | | | | | encrypted | | | | encrypted | | | by | | | | by | | | | | | | | | | | | | | | | +----------------+ | | | +----------------+ | | | shared KEK | | | | | shared KEK | | | | (encrypted) | | v | | (encrypted) | | | +----------------+ | | +----------------+ | | ^ | regular | ^ | | | | admin | | | | | | | | | | | encrypted | \o | | encrypted | | | by | |\ | | by | | | | / \ | | | | | | | | | | +----------------+ |----------------->| +----------------+ | | | all other keys | | migrate | | all other keys | | | | (encrypted) | | configuration | | (encrypted) | | | +----------------+ | | +----------------+ | | | | | +----------------------+ +----------------------+¶
The YANG module defined in this document defines a mechanism called a "keystore" that intends to protect its contents from unauthorized disclosure and modification.¶
In order to satisfy the expectations of a "keystore", it is RECOMMENDED that server implementations ensure that the keystore contents are encrypted when persisted to non-volatile memory, and ensure that the keystore contents that have been decrypted in volatile memory are zeroized when not in use.¶
The keystore contents may be encrypted either by encrypting the contents individually (e.g., using the "encrypted" value formats) or, in case cleartext values are used (which is NOT RECOMMENDED per Section 3.5 of [I-D.ietf-netconf-crypto-types]), then, e.g., disk-level encryption may be used.¶
If the keystore contents are not encrypted when persisted, then server implementations MUST ensure the persisted storage is inaccessible.¶
This module enables the configuration of private keys without constraints on their usage, e.g., what operations the key is allowed to be used for (e.g., signature, decryption, both).¶
This module also does not constrain the usage of the associated public keys, other than in the context of a configured certificate (e.g., an identity certificate), in which case the key usage is constrained by the certificate.¶
This section follows the template defined in Section 3.7.1 of [RFC8407].¶
The YANG module defined in this document is designed to be accessed via YANG based management protocols, such as NETCONF [RFC6241] and RESTCONF [RFC8040]. Both of these protocols have mandatory-to-implement secure transport layers (e.g., SSH, TLS) with mutual authentication.¶
The Network Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular users to a pre-configured subset of all available protocol operations and content.¶
Please be aware that this YANG module uses groupings from other YANG modules that define nodes that may be considered sensitive or vulnerable in network environments. Please review the Security Considerations for dependent YANG modules for information as to which nodes may be considered sensitive or vulnerable in network environments.¶
Some of the readable data nodes defined in this 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-config, or notification) to these data nodes. The following subtrees and data nodes have particular sensitivity/vulnerability:¶
The "cleartext-symmetric-key" node:¶
The "cleartext-private-key" node:¶
All the writable data nodes defined by this module, both in the "grouping" statements as well as the protocol-accessible "keystore" instance, may be considered sensitive or vulnerable in some network environments. For instance, any modification to a key or reference to a key may dramatically alter the implemented security policy. For this reason, the NACM extension "default-deny-write" has been set for all data nodes defined in this module.¶
This module does not define any "rpc" or "action" statements, and thus the security considerations for such is not provided here.¶
Built-in key types SHOULD be either hidden and/or encrypted (not cleartext). If this is not possible, access control mechanisms like NACM SHOULD be used to limit access to the key's secret data to only the most trusted authorized clients (e.g., belonging to an organization’s crypto officer).¶
This document registers one URI in the "ns" subregistry of the IETF XML Registry [RFC3688]. Following the format in [RFC3688], the following registration is requested:¶
URI: urn:ietf:params:xml:ns:yang:ietf-keystore Registrant Contact: The IESG XML: N/A, the requested URI is an XML namespace.¶
This document registers one YANG module in the YANG Module Names registry [RFC6020]. Following the format in [RFC6020], the following registration is requested:¶
name: ietf-keystore namespace: urn:ietf:params:xml:ns:yang:ietf-keystore prefix: ks reference: RFC CCCC¶
The authors would like to thank the following for lively discussions on list and in the halls (ordered by first name): Alan Luchuk, Andy Bierman, Benoit Claise, Bert Wijnen, Balázs Kovács, David Lamparter, Eric Voit, Éric Vyncke, Francesca Palombini, Ladislav Lhotka, Liang Xia, Jürgen Schönwälder, Mahesh Jethanandani, Magnus Nyström, Martin Björklund, Mehmet Ersue, Murray Kucherawy, Paul Wouters, Phil Shafer, Qin Wu, Radek Krejci, Ramkumar Dhanapal, Reese Enghardt, Reshad Rahman, Rob Wilton, Roman Danyliw, Sandra Murphy, Sean Turner, Tom Petch, Warren Kumari, and Zaheduzzaman Sarker.¶