draft-ietf-netconf-keystore-04.txt   draft-ietf-netconf-keystore-05.txt 
NETCONF Working Group K. Watsen NETCONF Working Group K. Watsen
Internet-Draft Juniper Networks Internet-Draft Juniper Networks
Intended status: Standards Track October 30, 2017 Intended status: Standards Track June 4, 2018
Expires: May 3, 2018 Expires: December 6, 2018
YANG Data Model for a "Keystore" Mechanism YANG Data Model for a Centralized Keystore Mechanism
draft-ietf-netconf-keystore-04 draft-ietf-netconf-keystore-05
Abstract Abstract
This document defines a YANG module called a "keystore", containing This document defines a YANG 1.1 module called "ietf-keystore" that
pinned certificates and pinned SSH host-keys. The module also enables centralized configuration of asymmetric keys and their
defines a grouping for configuring public key pairs and a grouping associated certificates, and notification for when configured
for configuring certificates. The module also defines a notification certificates are about to expire.
that a system can use when one of its configured certificates is
about to expire.
Editorial Note (To be removed by RFC Editor) Editorial Note (To be removed by RFC Editor)
This draft contains many placeholder values that need to be replaced This draft contains many placeholder values that need to be replaced
with finalized values at the time of publication. This note with finalized values at the time of publication. This note
summarizes all of the substitutions that are needed. No other RFC summarizes all of the substitutions that are needed. No other RFC
Editor instructions are specified elsewhere in this document. Editor instructions are specified elsewhere in this document.
Artwork in this document contains shorthand references to drafts in Artwork in this document contains shorthand references to drafts in
progress. Please apply the following replacements: progress. Please apply the following replacements:
o "VVVV" --> the assigned RFC value for this draft o "VVVV" --> the assigned RFC value for this draft
Artwork in this document contains placeholder values for the date of Artwork in this document contains placeholder values for the date of
publication of this draft. Please apply the following replacement: publication of this draft. Please apply the following replacement:
o "2017-10-30" --> the publication date of this draft o "2018-06-04" --> the publication date of this draft
The following Appendix section is to be removed prior to publication: The following Appendix section is to be removed prior to publication:
o Appendix A. Change Log o Appendix A. Change Log
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 3, 2018. This Internet-Draft will expire on December 6, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3
2. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . . . 4 3. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 4
3. Example Usage . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4
4. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 6
5. Security Considerations . . . . . . . . . . . . . . . . . . . 21 3.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 12
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 4. Security Considerations . . . . . . . . . . . . . . . . . . . 21
6.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 22 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23
6.2. The YANG Module Names Registry . . . . . . . . . . . . . 22 5.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 23
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 23 5.2. The YANG Module Names Registry . . . . . . . . . . . . . 23
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.1. Normative References . . . . . . . . . . . . . . . . . . 23 6.1. Normative References . . . . . . . . . . . . . . . . . . 23
8.2. Informative References . . . . . . . . . . . . . . . . . 24 6.2. Informative References . . . . . . . . . . . . . . . . . 24
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 26 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 26
A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 26 A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 26
A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 26 A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 26
A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 26 A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 26
A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 26 A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 26
A.5. 04 to 05 . . . . . . . . . . . . . . . . . . . . . . . . 27
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 27
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 27 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 27
1. Introduction 1. Introduction
This document defines a YANG [RFC7950] module for a system-level This document defines a YANG 1.1 [RFC7950] module called "ietf-
mechanism, herein called a "keystore". The keystore provides a keystore" that enables centralized configuration of asymmetric keys
centralized location for security sensitive data, as described below. and their associated certificates, and notification for when
configured certificates are about to expire.
This module has the following characteristics:
o A 'grouping' for a public/private key pair, and an 'action' for
requesting the system to generate a new private key.
o A 'grouping' for a list of certificates that might be associated This module also defines Six groupings designed for maximum reuse.
with a public/private key pair, and an 'action' the requesting a These groupings include one for the public half of an asymmetric key,
system to generate a certificate signing request. one for both the public and private halves of an asymmetric key, one
for both halves of an asymmetric key and a list of associated
certificates, one for an asymmetric key that may be configured
locally or via a reference to an asymmetric key in the keystore, one
for a trust anchor certificate and, lastly, one for an end entity
certificate.
o An unordered list of pinned certificate sets, where each pinned Special consideration has been given for systems that have
certificate set contains an unordered list of pinned certificates. cryptographic hardware, such as a Trusted Protection Module (TPM).
This structure enables a server to use specific sets of pinned These systems are unique in that the cryptographic hardware
certificates on a case-by-case basis. For instance, one set of completely hides the private keys and must perform all private key
pinned certificates might be used by an HTTPS-client when operations. To support such hardware, the "private-key" can be the
connecting to particular HTTPS servers, while another set of special value "hardware-protected" and the actions "generate-private-
pinned certificates might be used by a server when authenticating key" and "generate-certificate-signing-request" can be used to direct
client connections (e.g., certificate-based client these operations to the hardware .
authentication).
o An unordered list of pinned SSH host key sets, where each pinned This document in compliant with Network Management Datastore
SSH host key set contains an unordered list of pinned SSH host Architecture (NMDA) [RFC8342]. For instance, to support keys and
keys. This structure enables a server to use specific sets of associated certificates installed during manufacturing (e.g., for a
pinned SSH host-keys on a case-by-case basis. For instance, SSH IDevID [Std-802.1AR-2009] certificate), it is expected that such data
clients can be configured to use different sets of pinned SSH host may appear only in <operational>.
keys when connecting to different SSH servers.
o A notification to indicate when a certificate is about to expire. While only asymmetric keys are currently supported, the module has
been designed to enable other key types to be introduced in the
future.
Special consideration has been given for systems that have Trusted The module does not support protecting the contents of the keystore
Protection Modules (TPMs). These systems are unique in that the TPM (e.g., via encryption), though it could be extended to do so in the
must be directed to generate new keys (it is not possible to load a future.
key into a TPM) and it is not possible to backup/restore the TPM's
private keys as configuration.
It is not required that a system has an operating system level It is not required that a system has an operating system level
keystore utility to implement this module. keystore utility to implement this module.
1.1. Requirements Language 2. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
2. Tree Diagram 3. The Keystore Model
The following tree diagram [I-D.ietf-netmod-yang-tree-diagrams] 3.1. Tree Diagram
provides an overview of the data model for the "ietf-keystore"
module. This section provides a tree diagrams [RFC8340] for the "ietf-
keystore" module that presents both the protocol-accessible
"keystore" as well the all the groupings intended for external usage.
module: ietf-keystore module: ietf-keystore
+--rw keystore +--rw keystore
+--rw pinned-certificates* [name] +--rw asymmetric-keys
| +--rw name string +--rw asymmetric-key* [name]
| +--rw description? string | +--rw name string
| +--rw pinned-certificate* [name] | +--rw algorithm
| +--rw name string | | ct:key-algorithm-ref
| +--rw data binary | +--rw public-key binary
+--rw pinned-host-keys* [name] | +--rw private-key union
+--rw name string | +--rw certificates
+--rw description? string | | +--rw certificate* [name]
+--rw pinned-host-key* [name] | | +--rw name string
+--rw name string | | +--rw cert
+--rw data binary | | | ct:end-entity-cert-cms
| | +---n certificate-expiration
| | +-- expiration-date? yang:date-and-time
| +---x generate-certificate-signing-request
| +---w input
| | +---w subject binary
| | +---w attributes? binary
| +--ro output
| +--ro certificate-signing-request binary
+---x generate-asymmetric-key
+---w input
+---w name string
+---w algorithm ct:key-algorithm-ref
notifications: grouping end-entity-cert-grouping
+-- cert ct:end-entity-cert-cms
+---n certificate-expiration +---n certificate-expiration
+--ro certificate instance-identifier +-- expiration-date? yang:date-and-time
+--ro expiration-date yang:date-and-time grouping local-or-keystore-end-entity-certificate-grouping
+-- (local-or-keystore)
grouping certificate-grouping +--:(local)
+---- certificates | +-- algorithm ct:key-algorithm-ref
| +---- certificate* [name] | +-- public-key binary
| +---- name? string | +-- private-key union
| +---- value? binary | +-- cert ct:end-entity-cert-cms
| +---n certificate-expiration
| +-- expiration-date? yang:date-and-time
+--:(keystore) {keystore-implemented}?
+-- reference
ks:asymmetric-key-certificate-ref
grouping local-or-keystore-asymmetric-key-with-certs-grouping
+-- (local-or-keystore)
+--:(local)
| +-- algorithm
| | ct:key-algorithm-ref
| +-- public-key binary
| +-- private-key union
| +-- certificates
| | +-- certificate* [name]
| | +-- name? string
| | +-- cert ct:end-entity-cert-cms
| | +---n certificate-expiration
| | +-- expiration-date? yang:date-and-time
| +---x generate-certificate-signing-request
| +---w input
| | +---w subject binary
| | +---w attributes? binary
| +--ro output
| +--ro certificate-signing-request binary
+--:(keystore) {keystore-implemented}?
+-- reference
ks:asymmetric-key-ref
grouping trust-anchor-cert-grouping
+-- cert ct:trust-anchor-cert-cms
grouping asymmetric-key-pair-grouping
+-- algorithm ct:key-algorithm-ref
+-- public-key binary
+-- private-key union
grouping public-key-grouping
+-- algorithm ct:key-algorithm-ref
+-- public-key binary
grouping asymmetric-key-pair-with-certs-grouping
+-- algorithm ct:key-algorithm-ref
+-- public-key binary
+-- private-key union
+-- certificates
| +-- certificate* [name]
| +-- name? string
| +-- cert ct:end-entity-cert-cms
| +---n certificate-expiration
| +-- expiration-date? yang:date-and-time
+---x generate-certificate-signing-request +---x generate-certificate-signing-request
+---w input +---w input
| +---w subject binary | +---w subject binary
| +---w attributes? binary | +---w attributes? binary
+--ro output +--ro output
+--ro certificate-signing-request binary +--ro certificate-signing-request binary
grouping private-key-grouping grouping local-or-keystore-asymmetric-key-grouping
+---- algorithm? identityref +-- (local-or-keystore)
+---- private-key? union +--:(local)
+---- public-key? binary | +-- algorithm ct:key-algorithm-ref
+---x generate-private-key | +-- public-key binary
+---w input | +-- private-key union
+---w algorithm identityref +--:(keystore) {keystore-implemented}?
+-- reference ks:asymmetric-key-ref
3. Example Usage 3.2. Example Usage
The following example illustrates what a configured keystore might The following example illustrates what a fully configured keystore
look like. might look like in <operational>, as described by Section 5.3 in
[RFC8342]. This datastore view illustrates data set by the
manufacturing process alongside conventional configuration. This
keystore instance has three keys, two having one associated
certificate and one having two associated certificates.
<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"> <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<asymmetric-keys>
<!-- Manufacturer's trust root CA certs --> <asymmetric-key or:origin="or:intended">
<pinned-certificates> <name>ex-rsa-key</name>
<name>manufacturers-root-ca-certs</name> <algorithm>ct:rsa1024</algorithm>
<description> <private-key>base64encodedvalue==</private-key>
Certificates built into the device for authenticating <public-key>base64encodedvalue==</public-key>
manufacturer-signed objects, such as TLS server certificates, <certificates>
vouchers, etc.. Note, though listed here, these are not <certificate>
configurable; any attempt to do so will be denied. <name>ex-rsa-cert</name>
</description> <cert>base64encodedvalue==</cert>
<pinned-certificate> </certificate>
<name>Manufacturer Root CA cert 1</name> </certificates>
<data>base64encodedvalue==</data> </asymmetric-key>
</pinned-certificate>
<pinned-certificate>
<name>Manufacturer Root CA cert 2</name>
<data>base64encodedvalue==</data>
</pinned-certificate>
</pinned-certificates>
<!-- pinned netconf/restconf client certificates --> <asymmetric-key or:origin="or:intended">
<pinned-certificates> <name>tls-ec-key</name>
<name>explicitly-trusted-client-certs</name> <algorithm>ct:secp256r1</algorithm>
<description> <private-key>base64encodedvalue==</private-key>
Specific client authentication certificates for explicitly <public-key>base64encodedvalue==</public-key>
trusted clients. These are needed for client certificates <certificates>
that are not signed by a pinned CA. <certificate>
</description> <name>tls-ec-cert</name>
<pinned-certificate> <cert>base64encodedvalue==</cert>
<name>George Jetson</name> </certificate>
<data>base64encodedvalue==</data> </certificates>
</pinned-certificate> </asymmetric-key>
</pinned-certificates>
<!-- pinned netconf/restconf server certificates --> <asymmetric-key or:origin="or:system">
<pinned-certificates> <name>tpm-protected-key</name>
<name>explicitly-trusted-server-certs</name> <algorithm>ct:rsa2048</algorithm>
<description> <private-key>hardware-protected</private-key>
Specific server authentication certificates for explicitly <public-key>base64encodedvalue==</public-key>
trusted servers. These are needed for server certificates <certificates>
that are not signed by a pinned CA. <certificate>
</description> <name>builtin-idevid-cert</name>
<pinned-certificate> <cert>base64encodedvalue==</cert>
<name>Fred Flintstone</name> </certificate>
<data>base64encodedvalue==</data> <certificate or:origin="or:intended">
</pinned-certificate> <name>my-ldevid-cert</name>
</pinned-certificates> <cert>base64encodedvalue==</cert>
</certificate>
</certificates>
</asymmetric-key>
<!-- trust anchors (CA certs) for authenticating clients --> </asymmetric-keys>
<pinned-certificates> </keystore>
<name>deployment-specific-ca-certs</name>
<description>
Trust anchors (i.e. CA certs) that are used to authenticate
client connections. Clients are authenticated if their
certificate has a chain of trust to one of these configured
CA certificates.
</description>
<pinned-certificate>
<name>ca.example.com</name>
<data>base64encodedvalue==</data>
</pinned-certificate>
</pinned-certificates>
<!-- trust anchors for random HTTPS servers on Internet --> The following example illustrates the "generate-private-key" action
<pinned-certificates> in use with the NETCONF protocol.
<name>common-ca-certs</name>
<description>
Trusted certificates to authenticate common HTTPS servers.
These certificates are similar to those that might be
shipped with a web browser.
</description>
<pinned-certificate>
<name>ex-certificate-authority</name>
<data>base64encodedvalue==</data>
</pinned-certificate>
</pinned-certificates>
<!-- pinned SSH host keys --> REQUEST
<pinned-host-keys> -------
<name>explicitly-trusted-ssh-host-keys</name> <rpc message-id="101"
<description> xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
Trusted SSH host keys used to authenticate SSH servers. <action xmlns="urn:ietf:params:xml:ns:yang:1">
These host keys would be analogous to those stored in <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">
a known_hosts file in OpenSSH. <asymmetric-keys>
</description> <generate-asymmetric-key>
<pinned-host-key> <name>ex-key-sect571r1</name>
<name>corp-fw1</name> <algorithm
<data>base64encodedvalue==</data> xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
</pinned-host-key> ct:secp521r1
</pinned-host-keys> </algorithm>
</generate-asymmetric-key>
</asymmetric-keys>
</keystore>
</action>
</rpc>
</keystore> RESPONSE
--------
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<ok/>
</rpc-reply>
The following example illustrates the "generate-certificate-signing-
request" action in use with the NETCONF protocol.
REQUEST
-------
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<action xmlns="urn:ietf:params:xml:ns:yang:1">
<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">
<asymmetric-keys>
<asymmetric-key>
<name>ex-key-sect571r1</name>
<generate-certificate-signing-request>
<subject>base64encodedvalue==</subject>
<attributes>base64encodedvalue==</attributes>
</generate-certificate-signing-request>
</asymmetric-key>
</asymmetric-keys>
</keystore>
</action>
</rpc>
RESPONSE
--------
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<certificate-signing-request
xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">
base64encodedvalue==
</certificate-signing-request>
</rpc-reply>
The following example illustrates the "certificate-expiration" The following example illustrates the "certificate-expiration"
notification in use with the NETCONF protocol. notification in use with the NETCONF protocol.
[ note: '\' line wrapping for formatting only]
<notification <notification
xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2016-07-08T00:01:00Z</eventTime> <eventTime>2018-05-25T00:01:00Z</eventTime>
<certificate-expiration <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">
xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"> <asymmetric-keys>
<certificate xmlns:ks="urn:ietf:params:xml:ns:yang:ietf-keystore\ <asymmetric-key>
"> <name>tpm-protected-key</name>
/ks:keystore/ks:keys/ks:key[ks:name='ex-rsa-key']/ks:certifica\ <certificates>
tes/ks:certificate[ks:name='ex-rsa-cert'] <certificate>
</certificate> <name>my-ldevid-cert</name>
<expiration-date>2016-08-08T14:18:53-05:00</expiration-date> <certificate-expiration>
</certificate-expiration> <expiration-date>
2018-08-05T14:18:53-05:00
</expiration-date>
</certificate-expiration>
</certificate>
</certificates>
</asymmetric-key>
</asymmetric-keys>
</keystore>
</notification> </notification>
The following example module has been constructed to illustrate the The following example module has been constructed to illustrate the
groupings defined in the "ietf-keystore" module. "local-or-keystore-asymmetric-key-grouping" grouping defined in the
"ietf-keystore" module.
module ex-keystore-usage { module ex-keystore-usage {
yang-version 1.1; yang-version 1.1;
namespace "http://example.com/ns/example-keystore-usage"; namespace "http://example.com/ns/example-keystore-usage";
prefix "eku"; prefix "eku";
import ietf-keystore { import ietf-keystore {
prefix ks; prefix ks;
reference reference
"RFC VVVV: YANG Data Model for a 'Keystore' Mechanism"; "RFC VVVV: YANG Data Model for a 'Keystore' Mechanism";
} }
organization organization
"IETF NETCONF (Network Configuration) Working Group"; "Example Corporation";
contact contact
"WG Web: <http://tools.ietf.org/wg/netconf/> "Author: YANG Designer <mailto:yang.designer@example.com>";
WG List: <mailto:netconf@ietf.org>
Author: Kent Watsen <mailto:kwatsen@juniper.net>";
description description
"This module uses the groupings defines the keystore draft "This module illustrates the grouping defined in the keystore
for illustration."; draft called 'local-or-keystore-asymmetric-key-grouping'.";
revision "YYYY-MM-DD" { revision "YYYY-MM-DD" {
description description
"Initial version"; "Initial version";
reference
"RFC XXXX: YANG Data Model for a 'Keystore' Mechanism";
} }
container key { container keys {
uses ks:private-key-grouping;
uses ks:certificate-grouping;
description description
"A container of certificates, and an action to generate "A container of keys.";
a certificate signing request."; list key {
key name;
leaf name {
type string;
description
"An arbitrary name for this key.";
}
uses ks:local-or-keystore-asymmetric-key-grouping;
description
"A key which may be configured locally or be a reference to
a key in the keystore.";
}
} }
} }
The following example illustrates what two configured keys, one local
and the other remote, might look like. This example consistent with
other examples above (i.e., the referenced key is in an example
above).
The following example illustrates what a configured key might look <keys xmlns="http://example.com/ns/example-keystore-usage">
like. This example uses the "ex-keystore-usage" module above. <key>
<name>locally-defined key</name>
[ note: '\' line wrapping for formatting only] <algorithm
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<key xmlns="http://example.com/ns/example-keystore-usage"> ct:secp521r1
<algorithm xmlns:ks="urn:ietf:params:xml:ns:yang:ietf-keystore">ks:\ </algorithm>
secp521r1</algorithm> <private-key>base64encodedvalue==</private-key>
<private-key>base64encodedvalue==</private-key> <public-key>base64encodedvalue==</public-key>
<public-key>base64encodedvalue==</public-key> </key>
<certificates> <key>
<certificate> <name>keystore-defined key</name>
<name>domain certificate</name> <reference>ex-rsa-key</reference>
<value>base64encodedvalue==</value> </key>
</certificate> </keys>
</certificates>
</key>
The following example illustrates the "generate-certificate-signing-
request" action in use with the NETCONF protocol. This example uses
the "ex-keystore-usage" module above.
REQUEST
-------
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<action xmlns="urn:ietf:params:xml:ns:yang:1">
<key xmlns="http://example.com/ns/example-keystore-usage">
<generate-certificate-signing-request>
<subject>base64encodedvalue==</subject>
<attributes>base64encodedvalue==</attributes>
</generate-certificate-signing-request>
</key>
</action>
</rpc>
RESPONSE
--------
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<certificate-signing-request
xmlns="http://example.com/ns/example-keystore-usage">
base64encodedvalue==
</certificate-signing-request>
</rpc-reply>
The following example illustrates the "generate-private-key" action
in use with the NETCONF protocol. This example uses the "ex-
keystore-usage" module above.
REQUEST
-------
[ note: '\' line wrapping for formatting only]
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0\
">
<action xmlns="urn:ietf:params:xml:ns:yang:1">
<key xmlns="http://example.com/ns/example-keystore-usage">
<generate-private-key>
<algorithm xmlns:ks="urn:ietf:params:xml:ns:yang:ietf-keysto\
re">ks:secp521r1</algorithm>
</generate-private-key>
</key>
</action>
</rpc>
RESPONSE
--------
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<ok/>
</rpc-reply>
4. YANG Module
This YANG module imports modules defined in [RFC6536] and [RFC6991].
This module uses data types defined in [RFC2315], [RFC2986],
[RFC3447], [RFC4253], [RFC5280], [RFC5915], and [ITU.X690.1994].
This module uses algorithms defined in [RFC3447] and [RFC5480].
<CODE BEGINS> file "ietf-keystore@2017-10-30.yang"
module ietf-keystore {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-keystore";
prefix "ks";
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-netconf-acm {
prefix nacm;
reference
"RFC 6536: Network Configuration Protocol (NETCONF) Access
Control Model";
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>
Author: Kent Watsen
<mailto:kwatsen@juniper.net>";
description 3.3. YANG Module
"This module defines a keystore to centralize management
of security credentials.
Copyright (c) 2017 IETF Trust and the persons identified This YANG module imports modules defined in [RFC6536], [RFC6991], and
as authors of the code. All rights reserved. [I-D.ietf-netconf-crypto-types]. This module uses data types defined
in [RFC2986], [RFC3447], [RFC5652], [RFC5915], [RFC6125], and
[ITU.X690.2015].
Redistribution and use in source and binary forms, with <CODE BEGINS> file "ietf-keystore@2018-06-04.yang"
or without modification, is permitted pursuant to, and module ietf-keystore {
subject to the license terms contained in, the Simplified yang-version 1.1;
BSD License set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC VVVV; see namespace "urn:ietf:params:xml:ns:yang:ietf-keystore";
the RFC itself for full legal notices."; prefix "ks";
revision "2017-10-30" { import ietf-yang-types {
description prefix yang;
"Initial version"; reference
reference "RFC 6991: Common YANG Data Types";
"RFC VVVV: YANG Data Model for a 'Keystore' Mechanism"; }
}
// Identities import ietf-crypto-types {
prefix ct;
reference
"RFC CCCC: Common YANG Data Types for Cryptography";
}
identity key-algorithm { organization
description "IETF NETCONF (Network Configuration) Working Group";
"Base identity from which all key-algorithms are derived.";
}
identity rsa1024 { contact
base key-algorithm; "WG Web: <http://datatracker.ietf.org/wg/netconf/>
description WG List: <mailto:netconf@ietf.org>
"The RSA algorithm using a 1024-bit key.";
reference Author: Kent Watsen
"RFC3447: Public-Key Cryptography Standards (PKCS) #1: <mailto:kwatsen@juniper.net>";
RSA Cryptography Specifications Version 2.1.";
}
identity rsa2048 { description
base key-algorithm; "This module defines a keystore to centralize management
description of security credentials.
"The RSA algorithm using a 2048-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa3072 { Copyright (c) 2018 IETF Trust and the persons identified
base key-algorithm; as authors of the code. All rights reserved.
description
"The RSA algorithm using a 3072-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa4096 { Redistribution and use in source and binary forms, with
base key-algorithm; or without modification, is permitted pursuant to, and
description subject to the license terms contained in, the Simplified
"The RSA algorithm using a 4096-bit key."; BSD License set forth in Section 4.c of the IETF Trust's
reference Legal Provisions Relating to IETF Documents
"RFC3447: Public-Key Cryptography Standards (PKCS) #1: (http://trustee.ietf.org/license-info).
RSA Cryptography Specifications Version 2.1.";
}
identity rsa7680 { This version of this YANG module is part of RFC VVVV; see
base key-algorithm; the RFC itself for full legal notices.";
description
"The RSA algorithm using a 7680-bit key.";
reference
"RFC3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.";
}
identity rsa15360 { revision "2018-06-04" {
base key-algorithm; description
description "Initial version";
"The RSA algorithm using a 15360-bit key."; reference
reference "RFC VVVV: YANG Data Model for a 'Keystore' Mechanism";
"RFC3447: Public-Key Cryptography Standards (PKCS) #1: }
RSA Cryptography Specifications Version 2.1.";
} // Features
identity secp192r1 { feature keystore-implemented {
base key-algorithm; description
description "The 'keystore-implemented' feature indicates that the server
"The secp192r1 algorithm."; implements the keystore, and therefore groupings defined in
reference this module that reference the keystore are usable.";
"RFC5480: }
Elliptic Curve Cryptography Subject Public Key Information.";
}
identity secp256r1 { // Typedefs
base key-algorithm;
description
"The secp256r1 algorithm.";
reference
"RFC5480:
Elliptic Curve Cryptography Subject Public Key Information.";
}
identity secp384r1 { typedef asymmetric-key-ref {
base key-algorithm; type leafref {
description path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key"
"The secp384r1 algorithm."; + "/ks:name";
reference require-instance false;
"RFC5480: }
Elliptic Curve Cryptography Subject Public Key Information."; description
} "This typedef enables modules to easily define a reference
to an asymmetric key stored in the keystore. The require
instance attribute is false to enable the referencing of
asymmetric keys that exist only in <operational>.";
reference
"RFC 8342: Network Management Datastore Architecture (NMDA)";
}
identity secp521r1 { typedef asymmetric-key-certificate-ref {
base key-algorithm; type leafref {
description path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key"
"The secp521r1 algorithm."; + "/ks:certificates/ks:certificate/ks:name";
reference require-instance false;
"RFC5480: }
Elliptic Curve Cryptography Subject Public Key Information."; description
} "This typedef enables modules to easily define a reference
to a specific certificate associated with an asymmetric key
stored in the keystore. The require instance attribute is
false to enable the referencing of certificates that exist
only in <operational>.";
reference
"RFC 8342: Network Management Datastore Architecture (NMDA)";
}
// typedefs // Groupings
//
// These groupings are factored out more than needed for
// reusability purposes.
typedef pinned-certificates { grouping public-key-grouping {
type leafref { description
path "/ks:keystore/ks:pinned-certificates/ks:name"; "A public key.";
} leaf algorithm {
description type ct:key-algorithm-ref;
"This typedef enables importing modules to easily define a mandatory true;
reference to pinned-certificates. Use of this type also description
impacts the YANG tree diagram output."; "Identifies the key's algorithm. More specifically,
reference this leaf specifies how the 'public-key' binary leaf
"I-D.ietf-netmod-yang-tree-diagrams: YANG Tree Diagrams"; is encoded.";
} reference
"RFC CCCC: Common YANG Data Types for Cryptography";
}
leaf public-key {
type binary;
mandatory true;
description
"A binary that contains the value of the public key. The
interpretation of the content is defined by the key
algorithm. For example, a DSA key is an integer, an RSA
key is represented as RSAPublicKey as defined in
RFC 3447, and an Elliptic Curve Cryptography (ECC) key
is represented using the 'publicKey' described in
RFC 5915.";
reference
"RFC 3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.
RFC 5915: Elliptic Curve Private Key Structure.";
}
}
typedef pinned-host-keys { grouping asymmetric-key-pair-grouping {
type leafref { description
path "/ks:keystore/ks:pinned-host-keys/ks:name"; "A private/public key pair.";
} uses public-key-grouping;
description leaf private-key {
"This typedef enables importing modules to easily define a type union {
reference to pinned-host-keys. Use of this type also type binary;
impacts the YANG tree diagram output."; type enumeration {
reference enum "hardware-protected" {
"I-D.ietf-netmod-yang-tree-diagrams: YANG Tree Diagrams"; description
} "The private key is inaccessible due to being
protected by a cryptographic hardware module
(e.g., a TPM).";
}
}
}
mandatory true;
description
"A binary that contains the value of the private key. The
interpretation of the content is defined by the key
algorithm. For example, a DSA key is an integer, an RSA
key is represented as RSAPrivateKey as defined in
RFC 3447, and an Elliptic Curve Cryptography (ECC) key
is represented as ECPrivateKey as defined in RFC 5915.";
reference
"RFC 3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.
RFC 5915: Elliptic Curve Private Key Structure.";
}
}
grouping trust-anchor-cert-grouping {
description
"A certificate, and a notification for when it might expire.";
leaf cert {
type ct:trust-anchor-cert-cms;
mandatory true;
description
"The binary certificate data for this certificate.";
reference
"RFC YYYY: Common YANG Data Types for Cryptography";
}
}
// groupings grouping end-entity-cert-grouping {
description
"A certificate, and a notification for when it might expire.";
leaf cert {
type ct:end-entity-cert-cms;
mandatory true;
description
"The binary certificate data for this certificate.";
reference
"RFC YYYY: Common YANG Data Types for Cryptography";
}
notification certificate-expiration {
description
"A notification indicating that the configured certificate
is either about to expire or has already expired. When to
send notifications is an implementation specific decision,
but it is RECOMMENDED that a notification be sent once a
month for 3 months, then once a week for four weeks, and
then once a day thereafter until the issue is resolved.";
leaf expiration-date {
type yang:date-and-time;
//mandatory true;
description
"Identifies the expiration date on the certificate.";
}
}
}
grouping private-key-grouping { grouping asymmetric-key-pair-with-certs-grouping {
description description
"A private/public key pair, and an action to request the "A private/public key pair and associated certificates.";
system to generate a private key."; uses asymmetric-key-pair-grouping;
leaf algorithm { container certificates {
type identityref { description
base "key-algorithm"; "Certificates associated with this asymmetric key.
}
description
"Identifies the key's algorithm. More specifically, this
leaf specifies how the 'private-key' and 'public-key'
binary leafs are encoded.";
}
leaf private-key {
nacm:default-deny-all;
type union {
type binary;
type enumeration {
enum "hardware-protected" {
description
"The private key is inaccessible due to being
protected by a cryptographic hardware module
(e.g., a TPM).";
}
}
}
must "../algorithm";
description
"A binary that contains the value of the private key. The
interpretation of the content is defined by the key
algorithm. For example, a DSA key is an integer, an RSA
key is represented as RSAPrivateKey as defined in
[RFC3447], and an Elliptic Curve Cryptography (ECC) key
is represented as ECPrivateKey as defined in [RFC5915]";
reference
"RFC 3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.
RFC 5915: Elliptic Curve Private Key Structure.";
}
leaf public-key {
type binary;
must "../algorithm";
must "../private-key";
description
"A binary that contains the value of the public key. The
interpretation of the content is defined by the key
algorithm. For example, a DSA key is an integer, an RSA
key is represented as RSAPublicKey as defined in
[RFC3447], and an Elliptic Curve Cryptography (ECC) key
is represented using the 'publicKey' described in
[RFC5915]";
reference
"RFC 3447: Public-Key Cryptography Standards (PKCS) #1:
RSA Cryptography Specifications Version 2.1.
RFC 5915: Elliptic Curve Private Key Structure.";
}
action generate-private-key {
description
"Requests the device to generate a private key using the
specified key algorithm. This action is primarily to
support cryptographic processors that must generate
the private key themselves. The resulting key is
considered operational state and hence only present
in the <operational>.";
input {
leaf algorithm {
type identityref {
base "key-algorithm";
}
mandatory true;
description
"The algorithm to be used when generating the key.";
}
}
} // end generate-private-key
}
grouping certificate-grouping {
description
"A container of certificates, and an action to generate
a certificate signing request.";
container certificates {
description
"Certificates associated with this key. More than one
certificate supports, for instance, a TPM-protected
key that has both IDevID and LDevID certificates
associated.";
list certificate {
key name;
description
"A certificate for this private key.";
leaf name {
type string;
description
"An arbitrary name for the certificate.";
}
leaf value {
type binary;
description
"A PKCS #7 SignedData structure, as specified by
Section 9.1 in RFC 2315, containing just certificates
(no content, signatures, or CRLs), encoded using ASN.1
distinguished encoding rules (DER), as specified in
ITU-T X.690.
This structure contains the certificate itself as well More than one certificate supports, for instance,
as any intermediate certificates leading up to a trust a TPM-protected asymmetric key that has both IDevID
anchor certificate. The trust anchor certificate MAY and LDevID certificates associated.";
be included as well."; list certificate {
reference key name;
"RFC 2315: description
PKCS #7: Cryptographic Message Syntax Version 1.5. "A certificate for this asymmetric key.";
ITU-T X.690: leaf name {
Information technology - ASN.1 encoding rules: type string;
Specification of Basic Encoding Rules (BER), description
Canonical Encoding Rules (CER) and Distinguished "An arbitrary name for the certificate.";
Encoding Rules (DER)."; }
} uses end-entity-cert-grouping;
} } // end certifcate
} } // end certificates
action generate-certificate-signing-request { action generate-certificate-signing-request {
description description
"Generates a certificate signing request structure for "Generates a certificate signing request structure for
the associated private key using the passed subject and the associated asymmetric key using the passed subject
attribute values. The specified assertions need to be and attribute values. The specified assertions need
appropriate for the certificate's use. For example, to be appropriate for the certificate's use. For
an entity certificate for a TLS server SHOULD have example, an entity certificate for a TLS server
values that enable clients to satisfy RFC 6125 SHOULD have values that enable clients to satisfy
processing."; RFC 6125 processing.";
input { input {
leaf subject { leaf subject {
type binary; type binary;
mandatory true; mandatory true;
description description
"The 'subject' field from the CertificationRequestInfo "The 'subject' field per the CertificationRequestInfo
structure as specified by RFC 2986, Section 4.1 encoded structure as specified by RFC 2986, Section 4.1
using the ASN.1 distinguished encoding rules (DER), as encoded using the ASN.1 distinguished encoding
specified in ITU-T X.690."; rules (DER), as specified in ITU-T X.690.";
reference reference
"RFC 2986: "RFC 2986:
PKCS #10: Certification Request Syntax Specification PKCS #10: Certification Request Syntaxi
Version 1.7. Specification Version 1.7.
ITU-T X.690: ITU-T X.690:
Information technology - ASN.1 encoding rules: Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER), Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER)."; Encoding Rules (DER).";
} }
leaf attributes { leaf attributes {
type binary; type binary;
description description
"The 'attributes' field from the CertificationRequestInfo "The 'attributes' field from the structure
structure as specified by RFC 2986, Section 4.1 encoded CertificationRequestInfo as specified by RFC 2986,
using the ASN.1 distinguished encoding rules (DER), as Section 4.1 encoded using the ASN.1 distinguished
specified in ITU-T X.690."; encoding rules (DER), as specified in ITU-T X.690.";
reference reference
"RFC 2986: "RFC 2986:
PKCS #10: Certification Request Syntax Specification PKCS #10: Certification Request Syntax
Version 1.7. Specification Version 1.7.
ITU-T X.690: ITU-T X.690:
Information technology - ASN.1 encoding rules: Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER), Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER)."; Encoding Rules (DER).";
} }
} }
output { output {
leaf certificate-signing-request { leaf certificate-signing-request {
type binary; type binary;
mandatory true; mandatory true;
description description
"A CertificationRequest structure as specified by RFC "A CertificationRequest structure as specified by
2986, Section 4.1 encoded using the ASN.1 distinguished RFC 2986, Section 4.2 encoded using the ASN.1
encoding rules (DER), as specified in ITU-T X.690."; distinguished encoding rules (DER), as specified
reference in ITU-T X.690.";
"RFC 2986: reference
PKCS #10: Certification Request Syntax Specification "RFC 2986:
Version 1.7. PKCS #10: Certification Request Syntax
ITU-T X.690: Specification Version 1.7.
ITU-T X.690:
Information technology - ASN.1 encoding rules: Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER), Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER)."; Encoding Rules (DER).";
} }
} } // end output
} } // end generate-certificate-signing-request
} }
// protocol accessible nodes grouping local-or-keystore-asymmetric-key-grouping {
description
"A grouping that expands to allow the key to be either stored
locally within the using data model, or be a reference to an
asymmetric key stored in the keystore.";
choice local-or-keystore {
mandatory true;
case local {
uses asymmetric-key-pair-grouping;
}
case keystore {
if-feature "keystore-implemented";
leaf reference {
type ks:asymmetric-key-ref;
mandatory true;
description
"A reference to a value that exists in the keystore.";
}
}
description
"A choice between an inlined definition and a definition
that exists in the keystore.";
}
}
container keystore { grouping local-or-keystore-asymmetric-key-with-certs-grouping {
nacm:default-deny-write; description
description "A grouping that expands to allow the key to be either stored
"The keystore contains X.509 certificates and SSH host keys."; locally within the using data model, or be a reference to an
asymmetric key stored in the keystore.";
choice local-or-keystore {
mandatory true;
case local {
uses asymmetric-key-pair-with-certs-grouping;
}
case keystore {
if-feature "keystore-implemented";
leaf reference {
type ks:asymmetric-key-ref;
mandatory true;
description
"A reference to a value that exists in the keystore.";
}
}
description
"A choice between an inlined definition and a definition
that exists in the keystore.";
}
}
list pinned-certificates { grouping local-or-keystore-end-entity-certificate-grouping {
key name; description
description "A grouping that expands to allow the end-entity certificate
"A list of pinned certificates. These certificates can be (and the associated private key) to be either stored locally
used by a server to authenticate clients, or by clients to within the using data model, or be a reference to a specific
authenticate servers. Each list of pinned certificates certificate in the keystore.";
SHOULD be specific to a purpose, as the list as a whole choice local-or-keystore {
may be referenced by other modules. For instance, a mandatory true;
NETCONF server's configuration might use a specific list case local {
of pinned certificates for when authenticating NETCONF uses ks:asymmetric-key-pair-grouping;
client connections."; uses ks:end-entity-cert-grouping;
leaf name { }
type string; case keystore {
description if-feature "keystore-implemented";
"An arbitrary name for this list of pinned certificates."; leaf reference {
} type ks:asymmetric-key-certificate-ref;
leaf description { mandatory true;
type string; description
description "A reference to a value that exists in the keystore.";
"An arbitrary description for this list of pinned }
certificates."; }
} description
list pinned-certificate { "A choice between an inlined definition and a definition
key name; that exists in the keystore.";
description }
"A pinned certificate."; }
leaf name {
type string;
description
"An arbitrary name for this pinned certificate. The
name must be unique across all lists of pinned
certificates (not just this list) so that leafrefs
from another module can resolve to unique values.";
}
leaf data {
type binary;
mandatory true;
description
"An X.509 v3 certificate structure as specified by RFC
5280, Section 4 encoded using the ASN.1 distinguished
encoding rules (DER), as specified in ITU-T X.690.";
reference
"RFC 5280:
Internet X.509 Public Key Infrastructure Certificate
and Certificate Revocation List (CRL) Profile.
ITU-T X.690:
Information technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER),
Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).";
}
}
}
list pinned-host-keys { // protocol accessible nodes
key name;
description
"A list of pinned host keys. These pinned host-keys can
be used by clients to authenticate SSH servers. Each
list of pinned host keys SHOULD be specific to a purpose,
so the list as a whole may be referenced by other modules.
For instance, a NETCONF client's configuration might
point to a specific list of pinned host keys for when
authenticating specific SSH servers.";
leaf name {
type string;
description
"An arbitrary name for this list of pinned SSH host keys.";
}
leaf description {
type string;
description
"An arbitrary description for this list of pinned SSH host
keys.";
}
list pinned-host-key {
key name;
description
"A pinned host key.";
leaf name {
type string;
description
"An arbitrary name for this pinned host-key. Must be
unique across all lists of pinned host-keys (not just
this list) so that a leafref to it from another module
can resolve to unique values.";
}
leaf data {
type binary;
mandatory true;
description
"The binary public key data for this SSH key, as
specified by RFC 4253, Section 6.6, i.e.:
string certificate or public key format container keystore {
identifier description
byte[n] key/certificate data."; "The keystore contains a list of keys.";
reference
"RFC 4253: The Secure Shell (SSH) Transport Layer
Protocol";
}
}
}
}
notification certificate-expiration { container asymmetric-keys {
description description
"A notification indicating that a configured certificate is "A list of asymmetric keys.";
either about to expire or has already expired. When to send list asymmetric-key {
notifications is an implementation specific decision, but key name;
it is RECOMMENDED that a notification be sent once a month description
for 3 months, then once a week for four weeks, and then once "An asymmetric key.";
a day thereafter."; leaf name {
leaf certificate { type string;
type instance-identifier; description
mandatory true; "An arbitrary name for the asymmetric key.";
description }
"Identifies which certificate is expiring or is expired."; uses asymmetric-key-pair-with-certs-grouping;
} } // end asymmetric-key
leaf expiration-date {
type yang:date-and-time;
mandatory true;
description
"Identifies the expiration date on the certificate.";
}
}
} action generate-asymmetric-key {
<CODE ENDS> description
"Requests the device to generate an asymmetric key using
the specified asymmetric key algorithm. This action is
primarily to support cryptographic processors that must
generate the asymmetric key themselves. The resulting
asymmetric key is considered operational state and hence
present only in <operational>.";
5. Security Considerations input {
leaf name {
type string;
mandatory true;
description
"The name the asymmetric key should have when listed
in /keystore/asymmetric-keys/asymmetric-key, in
<operational>.";
}
leaf algorithm {
type ct:key-algorithm-ref;
mandatory true;
description
"The algorithm to be used when generating the
asymmetric key.";
reference
"RFC CCCC: Common YANG Data Types for Cryptography";
}
}
} // end generate-asymmetric-key
} // end asymmetric-keys
} // end keystore
}
<CODE ENDS>
4. Security Considerations
The YANG module defined in this document is designed to be accessed The YANG module defined in this document is designed to be accessed
via YANG based management protocols, such as NETCONF [RFC6241] and via YANG based management protocols, such as NETCONF [RFC6241] and
RESTCONF [RFC8040]. Both of these protocols have mandatory-to- RESTCONF [RFC8040]. Both of these protocols have mandatory-to-
implement secure transport layers (e.g., SSH, TLS) with mutual implement secure transport layers (e.g., SSH, TLS) with mutual
authentication. authentication.
The NETCONF access control model (NACM) [RFC6536] provides the means The NETCONF access control model (NACM) [RFC6536] provides the means
to restrict access for particular users to a pre-configured subset of to restrict access for particular users to a pre-configured subset of
all available protocol operations and content. all available protocol operations and content.
skipping to change at page 21, line 37 skipping to change at page 22, line 8
writable/creatable/deletable (i.e., config true, which is the writable/creatable/deletable (i.e., config true, which is the
default). These data nodes may be considered sensitive or vulnerable default). These data nodes may be considered sensitive or vulnerable
in some network environments. Write operations (e.g., edit-config) in some network environments. Write operations (e.g., edit-config)
to these data nodes without proper protection can have a negative to these data nodes without proper protection can have a negative
effect on network operations. These are the subtrees and data nodes effect on network operations. These are the subtrees and data nodes
and their sensitivity/vulnerability: and their sensitivity/vulnerability:
/: The entire data tree defined by this module is sensitive to /: The entire data tree defined by this module is sensitive to
write operations. For instance, the addition or removal of write operations. For instance, the addition or removal of
keys, certificates, trusted anchors, etc., can dramatically keys, certificates, trusted anchors, etc., can dramatically
alter the implemented security policy. This being the case, alter the implemented security policy. However, no NACM
the top-level node in this module is marked with the NACM value annotations are applied as the data SHOULD be editable by users
'default-deny-write'. other than a designated 'recovery session'.
/keystore/keys/key/private-key: When writing this node, /keystore/asymmetric-keys/asymmetric-key/private-key: When
implementations MUST ensure that the strength of the key being writing this node, implementations MUST ensure that the
configured is not greater than the strength of the underlying strength of the key being configured is not greater than the
secure transport connection over which it is communicated. strength of the underlying secure transport connection over
Implementations SHOULD fail the write-request if ever the which it is communicated. Implementations SHOULD fail the
strength of the private key is greater then the strength of the write-request if ever the strength of the private key is
underlying transport, and alert the client that the strength of greater then the strength of the underlying transport, and
the key may have been compromised. Additionally, when deleting alert the client that the strength of the key may have been
this node, implementations SHOULD automatically (without compromised. Additionally, when deleting this node,
explicit request) zeroize these keys in the most secure manner implementations SHOULD automatically (without explicit request)
available, so as to prevent the remnants of their persisted zeroize these keys in the most secure manner available, so as
storage locations from being analyzed in any meaningful way. to prevent the remnants of their persisted storage locations
from being analyzed in any meaningful way.
Some of the readable data nodes in this YANG module may be considered Some of the readable data nodes in this YANG module may be considered
sensitive or vulnerable in some network environments. It is thus sensitive or vulnerable in some network environments. It is thus
important to control read access (e.g., via get, get-config, or important to control read access (e.g., via get, get-config, or
notification) to these data nodes. These are the subtrees and data notification) to these data nodes. These are the subtrees and data
nodes and their sensitivity/vulnerability: nodes and their sensitivity/vulnerability:
/keystore/keys/key/private-key: This node is additionally /keystore/asymmetric-keys/asymmetric-key/private-key: This node
sensitive to read operations such that, in normal use cases, it is additionally sensitive to read operations such that, in
should never be returned to a client. The best reason for normal use cases, it should never be returned to a client. The
returning this node is to support backup/restore type best reason for returning this node is to support backup/
workflows. This being the case, this node is marked with the restore type workflows. However, no NACM annotations are
NACM value 'default-deny-all'. applied as the data SHOULD be editable by users other than a
designated 'recovery session'.
Some of the operations in this YANG module may be considered Some of the operations in this YANG module may be considered
sensitive or vulnerable in some network environments. It is thus sensitive or vulnerable in some network environments. It is thus
important to control access to these operations. These are the important to control access to these operations. These are the
operations and their sensitivity/vulnerability: operations and their sensitivity/vulnerability:
generate-certificate-signing-request: For this action, it is generate-certificate-signing-request: For this action, it is
RECOMMENDED that implementations assert channel binding RECOMMENDED that implementations assert channel binding
[RFC5056], so as to ensure that the application layer that sent [RFC5056], so as to ensure that the application layer that sent
the request is the same as the device authenticated when the the request is the same as the device authenticated when the
secure transport layer was established. secure transport layer was established.
6. IANA Considerations This document uses PKCS #10 [RFC2986] for the "generate-certificate-
signing-request" action. The use of Certificate Request Message
Format (CRMF) [RFC4211] was considered, but is was unclear if there
was market demand for it. If it is desired to support CRMF in the
future, placing a "choice" statement in both the input and output
statements, along with an "if-feature" statement on the CRMF option,
would enable a backwards compatible solution.
6.1. The IETF XML Registry 5. IANA Considerations
5.1. The IETF XML Registry
This document registers one URI in the IETF XML registry [RFC3688]. This document registers one URI in the IETF XML registry [RFC3688].
Following the format in [RFC3688], the following registration is Following the format in [RFC3688], the following registration is
requested: requested:
URI: urn:ietf:params:xml:ns:yang:ietf-keystore URI: urn:ietf:params:xml:ns:yang:ietf-keystore
Registrant Contact: The NETCONF WG of the IETF. Registrant Contact: The NETCONF WG of the IETF.
XML: N/A, the requested URI is an XML namespace. XML: N/A, the requested URI is an XML namespace.
6.2. The YANG Module Names Registry 5.2. The YANG Module Names Registry
This document registers one YANG module in the YANG Module Names This document registers one YANG module in the YANG Module Names
registry [RFC6020]. Following the format in [RFC6020], the the registry [RFC6020]. Following the format in [RFC6020], the the
following registration is requested: following registration is requested:
name: ietf-keystore name: ietf-keystore
namespace: urn:ietf:params:xml:ns:yang:ietf-keystore namespace: urn:ietf:params:xml:ns:yang:ietf-keystore
prefix: ks prefix: ks
reference: RFC VVVV reference: RFC VVVV
7. Acknowledgements 6. References
The authors would like to thank for following for lively discussions
on list and in the halls (ordered by last name): Andy Bierman, Martin
Bjorklund, Benoit Claise, Mehmet Ersue, Balazs Kovacs, David
Lamparter, Alan Luchuk, Ladislav Lhotka, Radek Krejci, Tom Petch,
Juergen Schoenwaelder; Phil Shafer, Sean Turner, and Bert Wijnen.
8. References 6.1. Normative References
8.1. Normative References [I-D.ietf-netconf-crypto-types]
Watsen, K., "Common YANG Data Types for Cryptography",
draft-ietf-netconf-crypto-types-00 (work in progress),
June 2018.
[ITU.X690.1994] [ITU.X690.2015]
International Telecommunications Union, "Information International Telecommunication Union, "Information
Technology - ASN.1 encoding rules: Specification of Basic Technology - ASN.1 encoding rules: Specification of Basic
Encoding Rules (BER), Canonical Encoding Rules (CER) and Encoding Rules (BER), Canonical Encoding Rules (CER) and
Distinguished Encoding Rules (DER)", ITU-T Recommendation Distinguished Encoding Rules (DER)", ITU-T Recommendation
X.690, 1994. X.690, ISO/IEC 8825-1, August 2015,
<https://www.itu.int/rec/T-REC-X.690/>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC2315] Kaliski, B., "PKCS #7: Cryptographic Message Syntax
Version 1.5", RFC 2315, DOI 10.17487/RFC2315, March 1998,
<https://www.rfc-editor.org/info/rfc2315>.
[RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification [RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification
Request Syntax Specification Version 1.7", RFC 2986, Request Syntax Specification Version 1.7", RFC 2986,
DOI 10.17487/RFC2986, November 2000, DOI 10.17487/RFC2986, November 2000,
<https://www.rfc-editor.org/info/rfc2986>. <https://www.rfc-editor.org/info/rfc2986>.
[RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
Standards (PKCS) #1: RSA Cryptography Specifications Standards (PKCS) #1: RSA Cryptography Specifications
Version 2.1", RFC 3447, DOI 10.17487/RFC3447, February Version 2.1", RFC 3447, DOI 10.17487/RFC3447, February
2003, <https://www.rfc-editor.org/info/rfc3447>. 2003, <https://www.rfc-editor.org/info/rfc3447>.
[RFC4253] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70,
Transport Layer Protocol", RFC 4253, DOI 10.17487/RFC4253, RFC 5652, DOI 10.17487/RFC5652, September 2009,
January 2006, <https://www.rfc-editor.org/info/rfc4253>. <https://www.rfc-editor.org/info/rfc5652>.
[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
Housley, R., and W. Polk, "Internet X.509 Public Key
Infrastructure Certificate and Certificate Revocation List
(CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
<https://www.rfc-editor.org/info/rfc5280>.
[RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk,
"Elliptic Curve Cryptography Subject Public Key
Information", RFC 5480, DOI 10.17487/RFC5480, March 2009,
<https://www.rfc-editor.org/info/rfc5480>.
[RFC5915] Turner, S. and D. Brown, "Elliptic Curve Private Key [RFC5915] Turner, S. and D. Brown, "Elliptic Curve Private Key
Structure", RFC 5915, DOI 10.17487/RFC5915, June 2010, Structure", RFC 5915, DOI 10.17487/RFC5915, June 2010,
<https://www.rfc-editor.org/info/rfc5915>. <https://www.rfc-editor.org/info/rfc5915>.
[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for
the Network Configuration Protocol (NETCONF)", RFC 6020, the Network Configuration Protocol (NETCONF)", RFC 6020,
DOI 10.17487/RFC6020, October 2010, DOI 10.17487/RFC6020, October 2010,
<https://www.rfc-editor.org/info/rfc6020>. <https://www.rfc-editor.org/info/rfc6020>.
skipping to change at page 24, line 38 skipping to change at page 24, line 46
<https://www.rfc-editor.org/info/rfc6536>. <https://www.rfc-editor.org/info/rfc6536>.
[RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types",
RFC 6991, DOI 10.17487/RFC6991, July 2013, RFC 6991, DOI 10.17487/RFC6991, July 2013,
<https://www.rfc-editor.org/info/rfc6991>. <https://www.rfc-editor.org/info/rfc6991>.
[RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
RFC 7950, DOI 10.17487/RFC7950, August 2016, RFC 7950, DOI 10.17487/RFC7950, August 2016,
<https://www.rfc-editor.org/info/rfc7950>. <https://www.rfc-editor.org/info/rfc7950>.
8.2. Informative References 6.2. Informative References
[I-D.ietf-netmod-yang-tree-diagrams]
Bjorklund, M. and L. Berger, "YANG Tree Diagrams", draft-
ietf-netmod-yang-tree-diagrams-02 (work in progress),
October 2017.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
DOI 10.17487/RFC3688, January 2004, DOI 10.17487/RFC3688, January 2004,
<https://www.rfc-editor.org/info/rfc3688>. <https://www.rfc-editor.org/info/rfc3688>.
[RFC4211] Schaad, J., "Internet X.509 Public Key Infrastructure [RFC4211] Schaad, J., "Internet X.509 Public Key Infrastructure
Certificate Request Message Format (CRMF)", RFC 4211, Certificate Request Message Format (CRMF)", RFC 4211,
DOI 10.17487/RFC4211, September 2005, DOI 10.17487/RFC4211, September 2005,
<https://www.rfc-editor.org/info/rfc4211>. <https://www.rfc-editor.org/info/rfc4211>.
[RFC5056] Williams, N., "On the Use of Channel Bindings to Secure [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure
Channels", RFC 5056, DOI 10.17487/RFC5056, November 2007, Channels", RFC 5056, DOI 10.17487/RFC5056, November 2007,
<https://www.rfc-editor.org/info/rfc5056>. <https://www.rfc-editor.org/info/rfc5056>.
[RFC5914] Housley, R., Ashmore, S., and C. Wallace, "Trust Anchor [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and
Format", RFC 5914, DOI 10.17487/RFC5914, June 2010, Verification of Domain-Based Application Service Identity
<https://www.rfc-editor.org/info/rfc5914>. within Internet Public Key Infrastructure Using X.509
(PKIX) Certificates in the Context of Transport Layer
Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March
2011, <https://www.rfc-editor.org/info/rfc6125>.
[RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
and A. Bierman, Ed., "Network Configuration Protocol and A. Bierman, Ed., "Network Configuration Protocol
(NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
<https://www.rfc-editor.org/info/rfc6241>. <https://www.rfc-editor.org/info/rfc6241>.
[RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
<https://www.rfc-editor.org/info/rfc8040>. <https://www.rfc-editor.org/info/rfc8040>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
<https://www.rfc-editor.org/info/rfc8340>.
[RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
and R. Wilton, "Network Management Datastore Architecture
(NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
<https://www.rfc-editor.org/info/rfc8342>.
[Std-802.1AR-2009] [Std-802.1AR-2009]
IEEE SA-Standards Board, "IEEE Standard for Local and IEEE SA-Standards Board, "IEEE Standard for Local and
metropolitan area networks - Secure Device Identity", metropolitan area networks - Secure Device Identity",
December 2009, <http://standards.ieee.org/findstds/ December 2009, <http://standards.ieee.org/findstds/
standard/802.1AR-2009.html>. standard/802.1AR-2009.html>.
Appendix A. Change Log Appendix A. Change Log
A.1. 00 to 01 A.1. 00 to 01
skipping to change at page 27, line 5 skipping to change at page 27, line 5
A.4. 03 to 04 A.4. 03 to 04
o Added typedefs around leafrefs to common keystore paths o Added typedefs around leafrefs to common keystore paths
o Now tree diagrams reference ietf-netmod-yang-tree-diagrams o Now tree diagrams reference ietf-netmod-yang-tree-diagrams
o Removed Design Considerations section o Removed Design Considerations section
o Moved key and certificate definitions from data tree to groupings o Moved key and certificate definitions from data tree to groupings
A.5. 04 to 05
o FIXME
o FIXME
o FIXME
Acknowledgements
The authors would like to thank for following for lively discussions
on list and in the halls (ordered by last name): Andy Bierman, Martin
Bjorklund, Benoit Claise, Mehmet Ersue, Balazs Kovacs, David
Lamparter, Alan Luchuk, Ladislav Lhotka, Mahesh Jethanandani, Radek
Krejci, Reshad Rahman, Tom Petch, Juergen Schoenwaelder, Phil Shafer,
Sean Turner, Eric Voit, Bert Wijnen, and Liang Xia.
Author's Address Author's Address
Kent Watsen Kent Watsen
Juniper Networks Juniper Networks
EMail: kwatsen@juniper.net EMail: kwatsen@juniper.net
 End of changes. 95 change blocks. 
808 lines changed or deleted 793 lines changed or added

This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/