A YANG Data Model for a KeystoreWatsen Networkskent+ietf@watsen.net
Operations
NETCONF Working GroupThis document defines 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.Editorial Note (To be removed by RFC Editor)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:
2021-05-18 --> the publication date of this draft
The following Appendix section is to be removed prior to publication:
. Change Log
IntroductionThis document defines a YANG 1.1 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 .
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
locally (within the defining data model) or be a reference to a key
in the keystore.
Special consideration has been given for systems that have cryptographic
hardware, such as a Trusted Platform Module (TPM). These systems 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 the public half is
conveyed in an identity certificate (e.g., an IDevID
certificate). Please see
to see how built-in keys are supported.This document intends to support existing practices; it does not
intend to define new behavior for systems to implement. To simplify
implementation, advanced key formats may be selectively implemented.Implementations may utilize zero or more operating system level
keystore utilities and/or hardware security modules (HSMs).Relation to other RFCsThis document presents one or more YANG modules
that are part of a collection of RFCs that work together to,
ultimately, enable the configuration of the clients and
servers of both the NETCONF and RESTCONF
protocols.The modules have been defined in a modular fashion to enable
their use by other efforts, some of which are known to be in
progress at the time of this writing, with many more expected
to be defined in time.The normative dependency relationship between the various RFCs in the collection
is presented in the below diagram. The labels in the diagram
represent the primary purpose provided by each RFC. Hyperlinks to
each RFC are provided below the diagram.
Label to RFC Mapping
Label in Diagram
Originating RFC
crypto-types
truststore
keystore
tcp-client-server
ssh-client-server
tls-client-server
http-client-server
netconf-client-server
restconf-client-server
Specification LanguageThe 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
when, and only when, they appear in all capitals, as shown here.TerminologyThe terms "client" and "server" are defined in and are not redefined here.The term "keystore" is defined in this draft as a mechanism that intends safeguard secrets placed
into it for protection.The nomenclature "<running>" and "<operational>" are defined in .The sentence fragments "augmented" and "augmented in" are used herein as the past tense verbified form of the "augment"
statement defined in .Adherence to the NMDAThis document is compliant with Network Management Datastore Architecture
(NMDA) . For instance, keys and associated
certificates installed during manufacturing (e.g., for an IDevID
certificate) are expected to appear in <operational>
(see ).The "ietf-keystore" ModuleThis section defines a YANG 1.1 module called
"ietf-keystore". A high-level overview of the module is provided in
. Examples illustrating the module's use
are provided in . The YANG module itself is
defined in .Data Model OverviewThis section provides an overview of the "ietf-keystore" module
in terms of its features, typedefs, groupings, and protocol-accessible
nodes.FeaturesThe following diagram lists all the "feature" statements
defined in the "ietf-keystore" module:TypedefsThe following diagram lists the "typedef" statements defined in
the "ietf-keystore" module:Comments:
All of the typedefs defined in the "ietf-keystore" module
extend the base "leafref" type defined in .
The leafrefs refer to symmetric and asymmetric keys in the
central keystore, when this module is implemented.
These typedefs are provided as an aid to downstream
modules that import the "ietf-keystore" module.
GroupingsThe "ietf-keystore" module defines the following "grouping" statements:
Each of these groupings are presented in the following subsections.The "encrypted-by-choice-grouping" GroupingThe following tree diagram illustrates the
"encrypted-by-choice-grouping" grouping:Comments:
This grouping defines a "choice" statement with options to reference
either a symmetric or an asymmetric key configured in the keystore.
This grouping is usable only when the keystore module is implemented.
Servers defining custom keystore locations MUST augment in alternate
"encrypted-by" references to the alternate locations.
The "asymmetric-key-certificate-ref-grouping" GroupingThe following tree diagram illustrates the
"asymmetric-key-certificate-ref-grouping" grouping:Comments:
This grouping defines a reference to a certificate in two parts: the
first being the name of the asymmetric key the certificate is associated
with, and the second being the name of the certificate itself.
This grouping is usable only when the keystore module is implemented.
Servers defining custom keystore locations MAY define an alternate grouping
for references to the alternate locations.
The "local-or-keystore-symmetric-key-grouping" GroupingThe following tree diagram illustrates the
"local-or-keystore-symmetric-key-grouping" grouping:Comments:
The "local-or-keystore-symmetric-key-grouping" grouping is provided
soley as convenience to downstream modules that wish to offer
an option for whether a symmetric key is defined locally
or as a reference to a symmetric key in the keystore.
A "choice" statement is used to expose the various options.
Each option is enabled by a "feature" statement. Additional
"case" statements MAY be augmented in if, e.g., there is a
need to reference a symmetric key in an alternate location.
For the "local-definition" option, the definition uses the
"symmetric-key-grouping" grouping discussed in .
For the "keystore" option, the "keystore-reference" is an
instance of the "symmetric-key-ref" discussed in .
The "local-or-keystore-asymmetric-key-grouping" GroupingThe following tree diagram illustrates the
"local-or-keystore-asymmetric-key-grouping" grouping:Comments:
The "local-or-keystore-asymmetric-key-grouping" grouping is provided
soley as convenience to downstream modules that wish to offer
an option for whether an asymmetric key is defined locally
or as a reference to an asymmetric key in the keystore.
A "choice" statement is used to expose the various options.
Each option is enabled by a "feature" statement. Additional
"case" statements MAY be augmented in if, e.g., there is a
need to reference an asymmetric key in an alternate location.
For the "local-definition" option, the definition uses the
"asymmetric-key-pair-grouping" grouping discussed in .
For the "keystore" option, the "keystore-reference" is an
instance of the "asymmetric-key-ref" typedef discussed in
.
The "local-or-keystore-asymmetric-key-with-certs-grouping" GroupingThe following tree diagram illustrates the
"local-or-keystore-asymmetric-key-with-certs-grouping" grouping:Comments:
The "local-or-keystore-asymmetric-key-with-certs-grouping" grouping is provided
soley as convenience to downstream modules that wish to offer
an option for whether an asymmetric key is defined locally
or as a reference to an asymmetric key in the keystore.
A "choice" statement is used to expose the various options.
Each option is enabled by a "feature" statement. Additional
"case" statements MAY be augmented in if, e.g., there is a
need to reference an asymmetric key in an alternate location.
For the "local-definition" option, the definition uses the
"asymmetric-key-pair-with-certs-grouping" grouping discussed in .
For the "keystore" option, the "keystore-reference" is an
instance of the "asymmetric-key-ref" typedef discussed in
.
The "local-or-keystore-end-entity-cert-with-key-grouping" GroupingThe following tree diagram illustrates the
"local-or-keystore-end-entity-cert-with-key-grouping" grouping:Comments:
The "local-or-keystore-end-entity-cert-with-key-grouping" grouping is provided
soley as convenience to downstream modules that wish to offer
an option for whether a symmetric key is defined locally
or as a reference to a symmetric key in the keystore.
A "choice" statement is used to expose the various options.
Each option is enabled by a "feature" statement. Additional
"case" statements MAY be augmented in if, e.g., there is a
need to reference a symmetric key in an alternate location.
For the "local-definition" option, the definition uses the
"asymmetric-key-pair-with-certs-grouping" grouping discussed in .
For the "keystore" option, the "keystore-reference" uses the
"asymmetric-key-certificate-ref-grouping" grouping discussed in
.
The "keystore-grouping" GroupingThe following tree diagram illustrates the
"keystore-grouping" grouping:Comments:
The "keystore-grouping" grouping defines a keystore instance
as being composed of symmetric and asymmetric keys. The structure
for the symmetric and asymmetric keys is essentially the same,
being a "list" inside a "container".
For asymmetric keys, each "asymmetric-key" uses the
"asymmetric-key-pair-with-certs-grouping" grouping discussed in
.
For symmetric keys, each "symmetric-key" uses the
"symmetric-key-grouping" grouping discussed in
.
Protocol-accessible NodesThe following tree diagram lists all the
protocol-accessible nodes defined in the "ietf-keystore" module, without
expanding the "grouping" statements:The following tree diagram 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:Comments:
Protocol-accessible nodes are those nodes that are accessible
when the module is "implemented", as described in .
The protocol-accessible nodes for the "ietf-keystore" module
are an instance of the "keystore-grouping" grouping discussed in
.
The reason for why "keystore-grouping" exists separate from
the protocol-accessible nodes definition is so as to enable
instances of the keystore to be instantiated in other
locations, as may be needed or desired by some modules.
Example UsageThe 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.A Keystore InstanceThe following example illustrates keys in <running>.
Please see for an example illustrating
built-in values in <operational>.cleartext-symmetric-keyct:octet-string-key-formatbase64encodedvalue==hidden-symmetric-keyencrypted-symmetric-keyct:one-symmetric-key-formathidden-asymmetric-key
ct:cms-enveloped-data-format
base64encodedvalue==ssh-rsa-key
ct:ssh-public-key-format
base64encodedvalue==
ct:rsa-private-key-format
base64encodedvalue==
ssh-rsa-key-with-cert
ct:subject-public-key-info-format
base64encodedvalue==
ct:rsa-private-key-format
base64encodedvalue==
ex-rsa-cert2base64encodedvalue==raw-private-key
ct:subject-public-key-info-format
base64encodedvalue==
ct:rsa-private-key-format
base64encodedvalue==
rsa-asymmetric-key
ct:subject-public-key-info-format
base64encodedvalue==
ct:rsa-private-key-format
base64encodedvalue==
ex-rsa-certbase64encodedvalue==ec-asymmetric-key
ct:subject-public-key-info-format
base64encodedvalue==
ct:ec-private-key-format
base64encodedvalue==
ex-ec-certbase64encodedvalue==hidden-asymmetric-key
ct:subject-public-key-info-format
base64encodedvalue==builtin-idevid-certbase64encodedvalue==my-ldevid-certbase64encodedvalue==encrypted-asymmetric-key
ct:subject-public-key-info-format
base64encodedvalue==
ct:one-asymmetric-key-format
encrypted-symmetric-key
ct:cms-encrypted-data-format
base64encodedvalue==
]]>A Certificate Expiration NotificationThe following example illustrates a "certificate-expiration"
notification for a certificate associated with a key configured
in the keystore.2018-05-25T00:01:00Zhidden-asymmetric-keymy-ldevid-cert2018-08-05T14:18:53-05:00
]]>The "Local or Keystore" GroupingsThis section illustrates the various "local-or-keystore" groupings
defined in the "ietf-keystore" module, specifically the
"local-or-keystore-symmetric-key-grouping"
(),
"local-or-keystore-asymmetric-key-grouping"
(),
"local-or-keystore-asymmetric-key-with-certs-grouping"
(), and
"local-or-keystore-end-entity-cert-with-key-grouping"
() groupings.These examples assume the existence of an example module called "ex-keystore-usage"
having the namespace "http://example.com/ns/example-keystore-usage".The ex-keystore-usage module is first presented using tree diagrams
, followed by an instance example illustrating
all the "local-or-keystore" groupings in use, followed by the YANG
module itself.The following tree diagram illustrates "ex-keystore-usage" without
expanding the "grouping" statements:The following tree diagram illustrates the "ex-keystore-usage"
module, with all "grouping" statements expanded, enabling the
usage's full structure to be seen:The following example provides two equivalent instances of
each grouping, the first being a reference to a keystore
and the second being locally-defined. The instance having
a reference to a keystore is consistent with the keystore
defined in . The two instances are
equivalent, as the locally-defined instance example contains
the same values defined by the keystore instance referenced
by its sibling example.example 1acleartext-symmetric-keyexample 1bct:octet-string-key-formatbase64encodedvalue==example 2arsa-asymmetric-keyexample 2b
ct:subject-public-key-info-format
base64encodedvalue==
ct:rsa-private-key-format
base64encodedvalue==
example 3arsa-asymmetric-keyexample 3b
ct:subject-public-key-info-format
base64encodedvalue==
ct:rsa-private-key-format
base64encodedvalue==
a locally-defined certbase64encodedvalue==example 4arsa-asymmetric-keyex-rsa-certexample 4b
ct:subject-public-key-info-format
base64encodedvalue==
ct:rsa-private-key-format
base64encodedvalue==
base64encodedvalue==
]]>Following is the "ex-keystore-usage" module's YANG definition:";
description
"This module illustrates notable groupings defined in
the 'ietf-keystore' module.";
revision 2021-05-18 {
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:local-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:local-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:local-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:local-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.";
}
}
}
]]>YANG ModuleThis YANG module has normative references to
and .<CODE BEGINS> file "ietf-keystore@2021-05-18.yang"
WG List:
Author: Kent Watsen ";
description
"This module defines a 'keystore' to centralize management
of security credentials.
Copyright (c) 2021 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 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 2021-05-18 {
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 keystore.";
}
feature local-definitions-supported {
description
"The 'local-definitions-supported' feature indicates that
the server supports locally-defined keys.";
}
/****************/
/* Typedefs */
/****************/
typedef 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 keystore, when this
module is implemented.";
}
typedef 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 keystore, when this
module is implemented.";
}
/*****************/
/* Groupings */
/*****************/
grouping encrypted-by-choice-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 keystore, when this module is implemented.";
choice encrypted-by-choice {
nacm:default-deny-write;
mandatory true;
description
"A choice amongst other symmetric or asymmetric keys.";
case symmetric-key-ref {
leaf symmetric-key-ref {
type ks:symmetric-key-ref;
description
"Identifies the symmetric key used to encrypt the
associated key.";
}
}
case asymmetric-key-ref {
leaf asymmetric-key-ref {
type ks:asymmetric-key-ref;
description
"Identifies the asymmetric key whose public key
encrypted the associated key.";
}
}
}
}
grouping asymmetric-key-certificate-ref-grouping {
description
"This grouping defines a reference to a specific certificate
associated with an asymmetric key stored in the keystore,
when this module is implemented.";
leaf asymmetric-key {
nacm:default-deny-write;
type ks: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.";
}
}
// local-or-keystore-* groupings
grouping local-or-keystore-symmetric-key-grouping {
description
"A grouping that expands to allow the symmetric key to be
either stored locally, i.e., within the using data model,
or a reference to a symmetric key stored in the keystore.
Servers that do not 'implement' this module, and hence
'central-keystore-supported' is not defined, SHOULD
augment in custom 'case' statements enabling references
to the alternate keystore locations.";
choice local-or-keystore {
nacm:default-deny-write;
mandatory true;
description
"A choice between an inlined definition and a definition
that exists in the keystore.";
case local {
if-feature "local-definitions-supported";
container local-definition {
description
"Container to hold the local key definition.";
uses ct:symmetric-key-grouping;
}
}
case keystore {
if-feature "central-keystore-supported";
leaf keystore-reference {
type ks:symmetric-key-ref;
description
"A reference to an symmetric key that exists in
the keystore, when this module is implemented.";
}
}
}
}
grouping local-or-keystore-asymmetric-key-grouping {
description
"A grouping that expands to allow the asymmetric key to be
either stored locally, i.e., within the using data model,
or a reference to an asymmetric key stored in the keystore.
Servers that do not 'implement' this module, and hence
'central-keystore-supported' is not defined, SHOULD
augment in custom 'case' statements enabling references
to the alternate keystore locations.";
choice local-or-keystore {
nacm:default-deny-write;
mandatory true;
description
"A choice between an inlined definition and a definition
that exists in the keystore.";
case local {
if-feature "local-definitions-supported";
container local-definition {
description
"Container to hold the local key definition.";
uses ct:asymmetric-key-pair-grouping;
}
}
case keystore {
if-feature "central-keystore-supported";
leaf keystore-reference {
type ks:asymmetric-key-ref;
description
"A reference to an asymmetric key that exists in
the keystore, when this module is implemented. The
intent is to reference just the asymmetric key
without any regard for any certificates that may
be associated with it.";
}
}
}
}
grouping local-or-keystore-asymmetric-key-with-certs-grouping {
description
"A grouping that expands to allow an asymmetric key and
its associated certificates to be either stored locally,
i.e., within the using data model, or a reference to an
asymmetric key (and its associated certificates) stored
in the keystore.
Servers that do not 'implement' this module, and hence
'central-keystore-supported' is not defined, SHOULD
augment in custom 'case' statements enabling references
to the alternate keystore locations.";
choice local-or-keystore {
nacm:default-deny-write;
mandatory true;
description
"A choice between an inlined definition and a definition
that exists in the keystore.";
case local {
if-feature "local-definitions-supported";
container local-definition {
description
"Container to hold the local key definition.";
uses ct:asymmetric-key-pair-with-certs-grouping;
}
}
case keystore {
if-feature "central-keystore-supported";
leaf keystore-reference {
type ks: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 local-or-keystore-end-entity-cert-with-key-grouping {
description
"A grouping that expands to allow an end-entity certificate
(and its associated asymmetric key pair) to be either stored
locally, i.e., within the using data model, or a reference
to a specific certificate in the keystore.
Servers that do not 'implement' this module, and hence
'central-keystore-supported' is not defined, SHOULD
augment in custom 'case' statements enabling references
to the alternate keystore locations.";
choice local-or-keystore {
nacm:default-deny-write;
mandatory true;
description
"A choice between an inlined definition and a definition
that exists in the keystore.";
case local {
if-feature "local-definitions-supported";
container local-definition {
description
"Container to hold the local key definition.";
uses ct:asymmetric-key-pair-with-cert-grouping;
}
}
case keystore {
if-feature "central-keystore-supported";
container keystore-reference {
uses asymmetric-key-certificate-ref-grouping;
description
"A reference to a specific certificate associated with
an asymmetric key stored in the keystore, when this
module is implemented.";
}
}
}
}
grouping keystore-grouping {
description
"Grouping definition enables use in other contexts. If ever
done, implementations MUST augment new 'case' statements
into the various local-or-keystore 'choice' statements to
supply leafrefs to the model-specific location(s).";
container asymmetric-keys {
nacm:default-deny-write;
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;
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 {
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-key/"
+ "encrypted-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-choice-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-choice-grouping;
}
}
}
}
]]><CODE ENDS>Support for Built-in KeysIn some implementations, a server may support built-in keys. 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.The primary characteristic of the built-in keys is that they are provided
by the system, as opposed to configuration. As such, they are present in
<operational>. The example below illustrates what the keystore in
<operational> might look like for a server in its factory default
state.Manufacturer-Generated Hidden Key
ct:subject-public-key-info-format
base64encodedvalue==Manufacturer-Generated IDevID Certbase64encodedvalue==
]]>In order for the built-in keys (and their associated built-in
certificates) to be referenced by configuration, the referenced keys
and associated certificates MUST first be copied into <running>.Built-in keys that are "hidden" MUST be copied into <running>
using the same key values, so that the server can bind them to the
built-in entries.Built-in keys that are "encrypted" MAY be copied into other parts
of the configuration so long as they are otherwise unmodified (e.g.,
the "encrypted-by" reference cannot be altered).Built-in keys that are "cleartext" MAY be copied into other parts
of the configuration but, by doing so, they lose their association
to the built-in entries and any assurances afforded by knowing they
are/were built-in.The built-in keys and built-in associated certificates are immutable
by configuration operations. With exception to additional/custom
certificates associated to a built-in key, servers MUST ignore
attempts to modify any aspect of built-in keys and/or built-in
associated certificates.The following example illustrates how a single built-in key definition
from the previous example has been propagated to <running>:Manufacturer-Generated Hidden Key
ct:subject-public-key-info-format
base64encodedvalue==Manufacturer-Generated IDevID Certbase64encodedvalue==Deployment-Specific LDevID Certbase64encodedvalue==
]]>After the above configuration is applied, <operational> should appear
as follows:Manufacturer-Generated Hidden Key
ct:subject-public-key-info-format
base64encodedvalue==Manufacturer-Generated IDevID Certbase64encodedvalue==Deployment-Specific LDevID Certbase64encodedvalue==
]]>Encrypting Keys in ConfigurationThis 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 the keys
being compromised when in transit.Key Encryption KeyThe 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 system. 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 MAY provide an API enabling the encryption of other
keys or, alternatively, let the administrators do so themselves
using the asymmetric key's public half.A server MUST possess (or be able to possess, in case the KEK has
been encrypted by another KEK) a KEK's cleartext value so that it
can decrypt the other keys in the configuration at runtime.Configuring Encrypted KeysEach time a new key is configured, it SHOULD be encrypted by
a KEK.In "ietf-crypto-types" ,
the format for encrypted values is described by identity statements
derived from the "symmetrically-encrypted-value-format" and
"symmetrically-encrypted-value-format" identity statements.Implementations SHOULD provide an API that simultaneously generates
and encrypts a key (symmetric or asymmetric) using a KEK. Thusly
newly generated key cleartext values may never known to the
administrators generating the keys.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-key" (for symmetric keys) or the
"encrypted-private-key" (for asymmetric keys) nodes. These two nodes
contain both the encrypted value as well as a reference to the KEK
that encrypted the key.Migrating Configuration to Another ServerWhen 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 many 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
(e.g., NACM's "default-deny-all"), 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 doesn't
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 )
asymmetric key. The private key, due to its long lifetime, is hidden
(i.e., "hidden-private-key" in ). The public key 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.It is RECOMMENDED that MKs are built-in and hidden but, if
this is not possible, access control mechanisms like NACM SHOULD
be used to limit access to the MK's secret data only to the most
trusted authorized clients (e.g., an organization's crypto officer).
In this case, it is RECOMMENDED that the MK is not built-in and hence
is, effectively, just like a KEK.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 the 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: | (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) | |
| +----------------+ | | +----------------+ |
| | | |
+----------------------+ +----------------------+
]]>Security ConsiderationsSecurity of Data at RestThe YANG module defined in this document defines a mechanism called a
"keystore" that, by its name, suggests that it will protect its
contents from unauthorized disclosure and modification.Security controls for the API (i.e., data in motion) are
discussed in , but controls for the
data at rest cannot be specified by the YANG module.In order to satisfy the expectations of a "keystore", it
is RECOMMENDED that implementations ensure that the keystore
contents are encrypted when persisted to non-volatile memory.Unconstrained Private Key UsageThis 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.The "ietf-keystore" YANG ModuleThe YANG module defined in this document is designed to be accessed via YANG
based management protocols, such as NETCONF and
RESTCONF . Both of these protocols have mandatory-to-implement
secure transport layers (e.g., SSH, TLS) with mutual authentication.The NETCONF access control model (NACM) provides the means
to restrict access for particular users to a pre-configured subset of all available
protocol operations and content.None of the readable data nodes defined in this YANG module are considered sensitive
or vulnerable in network environments. The NACM "default-deny-all" extension
has not been set for any data nodes defined in this module.All of 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.IANA ConsiderationsThe "IETF XML" RegistryThis document registers one URI in the "ns" subregistry of the
IETF XML Registry . Following the format
in , the following registration is
requested:The "YANG Module Names" RegistryThis document registers one YANG module in the
YANG Module Names registry .
Following the format in , the
following registration is requested:ReferencesNormative ReferencesKey words for use in RFCs to Indicate Requirement LevelsIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)YANG is a data modeling language used to model configuration and state data manipulated by the Network Configuration Protocol (NETCONF), NETCONF remote procedure calls, and NETCONF notifications. [STANDARDS-TRACK]The YANG 1.1 Data Modeling LanguageYANG is a data modeling language used to model configuration data, state data, Remote Procedure Calls, and notifications for network management protocols. This document describes the syntax and semantics of version 1.1 of the YANG language. YANG version 1.1 is a maintenance release of the YANG language, addressing ambiguities and defects in the original specification. There are a small number of backward incompatibilities from YANG version 1. This document also specifies the YANG mappings to the Network Configuration Protocol (NETCONF).Network Configuration Access Control ModelThe standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) or the RESTCONF protocol requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability. There is a need for standard mechanisms to restrict NETCONF or RESTCONF protocol access for particular users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content. This document defines such an access control model.This document obsoletes RFC 6536.Informative ReferencesThe IETF XML RegistryThis document describes an IANA maintained registry for IETF standards which use Extensible Markup Language (XML) related items such as Namespaces, Document Type Declarations (DTDs), Schemas, and Resource Description Framework (RDF) Schemas.Network Configuration Protocol (NETCONF)The Network Configuration Protocol (NETCONF) defined in this document provides mechanisms to install, manipulate, and delete the configuration of network devices. It uses an Extensible Markup Language (XML)-based data encoding for the configuration data as well as the protocol messages. The NETCONF protocol operations are realized as remote procedure calls (RPCs). This document obsoletes RFC 4741. [STANDARDS-TRACK]RESTCONF ProtocolThis document describes an HTTP-based protocol that provides a programmatic interface for accessing data defined in YANG, using the datastore concepts defined in the Network Configuration Protocol (NETCONF).Ambiguity of Uppercase vs Lowercase in RFC 2119 Key WordsRFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.YANG Tree DiagramsThis document captures the current syntax used in YANG module tree diagrams. The purpose of this document is to provide a single location for this definition. This syntax may be updated from time to time based on the evolution of the YANG language.Network Management Datastore Architecture (NMDA)Datastores are a fundamental concept binding the data models written in the YANG data modeling language to network management protocols such as the Network Configuration Protocol (NETCONF) and RESTCONF. This document defines an architectural framework for datastores based on the experience gained with the initial simpler model, addressing requirements that were not well supported in the initial model. This document updates RFC 7950.IEEE Standard for Local and metropolitan area networks - Secure Device IdentityIEEE SA-Standards BoardChange Log00 to 01
Replaced the 'certificate-chain' structures with PKCS#7 structures.
(Issue #1)
Added 'private-key' as a configurable data node, and removed the
'generate-private-key' and 'load-private-key' actions. (Issue #2)
Moved 'user-auth-credentials' to the ietf-ssh-client module.
(Issues #4 and #5)
01 to 02
Added back 'generate-private-key' action.
Removed 'RESTRICTED' enum from the 'private-key' leaf type.
Fixed up a few description statements.
02 to 03
Changed draft's title.
Added missing references.
Collapsed sections and levels.
Added RFC 8174 to Requirements Language Section.
Renamed 'trusted-certificates' to 'pinned-certificates'.
Changed 'public-key' from config false to config true.
Switched 'host-key' from OneAsymmetricKey to definition from RFC 4253.
03 to 04
Added typedefs around leafrefs to common keystore paths
Now tree diagrams reference ietf-netmod-yang-tree-diagrams
Removed Design Considerations section
Moved key and certificate definitions from data tree to groupings
04 to 05
Removed trust anchors (now in their own draft)
Added back global keystore structure
Added groupings enabling keys to either be locally defined or a reference to the keystore.
05 to 06
Added feature "local-keys-supported"
Added nacm:default-deny-all and nacm:default-deny-write
Renamed generate-asymmetric-key to generate-hidden-key
Added an install-hidden-key action
Moved actions inside fo the "asymmetric-key" container
Moved some groupings to draft-ietf-netconf-crypto-types
06 to 07
Removed a "require-instance false"
Clarified some description statements
Improved the keystore-usage examples
07 to 08
Added "local-definition" containers to avoid posibility of the
action/notification statements being under a "case" statement.
Updated copyright date, boilerplate template, affiliation,
folding algorithm, and reformatted the YANG module.
08 to 09
Added a 'description' statement to the 'must' in the
/keystore/asymmetric-key node explaining that the descendent
values may exist in <operational> only, and that
implementation MUST assert that the values are either
configured or that they exist in <operational>.
Copied above 'must' statement (and description) into
the local-or-keystore-asymmetric-key-grouping,
local-or-keystore-asymmetric-key-with-certs-grouping,
and local-or-keystore-end-entity-cert-with-key-grouping
statements.
09 to 10
Updated draft title to match new truststore draft title
Moved everything under a top-level 'grouping' to enable use in other contexts.
Renamed feature from 'local-keys-supported' to 'local-definitions-supported' (same name used in truststore)
Removed the either-all-or-none 'must' expressions for the key's 3-tuple values (since the values are now 'mandatory true' in crypto-types)
Example updated to reflect 'mandatory true' change in crypto-types draft
10 to 11
Replaced typedef asymmetric-key-certificate-ref with grouping asymmetric-key-certificate-ref-grouping.
Added feature feature 'key-generation'.
Cloned groupings symmetric-key-grouping, asymmetric-key-pair-grouping,
asymmetric-key-pair-with-cert-grouping, and asymmetric-key-pair-with-certs-grouping
from crypto-keys, augmenting into each new case statements for values that
have been encrypted by other keys in the keystore. Refactored keystore model
to use these groupings.
Added new 'symmetric-keys' lists, as a sibling to the existing 'asymmetric-keys' list.
Added RPCs (not actions) 'generate-symmetric-key' and 'generate-asymmetric-key' to
*return* a (potentially encrypted) key.
11 to 12
Updated to reflect crypto-type's draft using enumerations over identities.
Added examples for the 'generate-symmetric-key' and 'generate-asymmetric-key' RPCs.
Updated the Introduction section.
12 to 13
Updated examples to incorporate new "key-format" identities.
Made the two "generate-*-key" RPCs be "action" statements instead.
13 to 14
Updated YANG module and examples to incorporate the new iana-*-algorithm modules in the crypto-types draft..
14 to 15
Added new "Support for Built-in Keys" section.
Added 'must' expressions asserting that the 'key-format' leaf whenever an encrypted key is specified.
Added local-or-keystore-symmetric-key-grouping for PSK support.
15 to 16
Moved the generate key actions to ietf-crypt-types as RPCs, which are
augmented by ietf-keystore to support encrypted keys. Examples updated
accordingly.
Added a SSH certificate-based key (RFC 6187) and a raw private key to
the example instance document (partly so they could be referenced by
examples in the SSH and TLS client/server drafts.
16 to 17
Removed augments to the "generate-symmetric-key" and "generate-asymmetric-key" groupings.
Removed "generate-symmetric-key" and "generate-asymmetric-key" examples.
Removed the "algorithm" nodes from remaining examples.
Updated the "Support for Built-in Keys" section.
Added new section "Encrypting Keys in Configuration".
Added a "Note to Reviewers" note to first page.
17 to 18
Removed dangling/unnecessary ref to RFC 8342.
r/MUST/SHOULD/ wrt strength of keys being configured over transports.
Added an example for the "certificate-expiration" notification.
Clarified that OS MAY have a multiplicity of underlying keystores and/or HSMs.
Clarified expected behavior for "built-in" keys in <operational>
Clarified the "Migrating Configuration to Another Server" section.
Expanded "Data Model Overview section(s) [remove "wall" of tree diagrams].
Updated the Security Considerations section.
18 to 19
Updated examples to reflect new "cleartext-" prefix in the crypto-types draft.
19 to 20
Addressed SecDir comments from Magnus Nystroem and Sandra Murphy.
20 to 21
Added a "Unconstrained Private Key Usage" Security Consideration to address
concern raised by SecDir.
(Editorial) Removed the output of "grouping" statements in the tree diagrams
for the "ietf-keystore" and "ex-keystore-usage" modules.
Addressed comments raised by YANG Doctor.
21 to 22
Added prefixes to 'path' statements per trust-anchors/issues/1
Renamed feature "keystore-supported" to "central-keystore-supported".
Associated with above, generally moved text to refer to a "central" keystore.
Aligned modules with `pyang -f` formatting.
Fixed nits found by YANG Doctor reviews.
AcknowledgementsThe authors would like to thank for following for
lively discussions on list and in the halls (ordered
by first name):
Alan Luchuk,
Andy Bierman,
Benoit Claise,
Bert Wijnen,
Balazs Kovacs,
David Lamparter,
Eric Voit,
Ladislav Lhotka,
Liang Xia,
Juergen Schoenwaelder,
Mahesh Jethanandani,
Magnus Nystroem,
Martin Bjoerklund,
Mehmet Ersue,
Phil Shafer,
Radek Krejci,
Ramkumar Dhanapal,
Reshad Rahman,
Sandra Murphy,
Sean Turner,
and Tom Petch.