< draft-ietf-netconf-keystore-10.txt   draft-ietf-netconf-keystore-11.txt >
NETCONF Working Group K. Watsen NETCONF Working Group K. Watsen
Internet-Draft Watsen Networks Internet-Draft Watsen Networks
Intended status: Standards Track June 7, 2019 Intended status: Standards Track June 17, 2019
Expires: December 9, 2019 Expires: December 19, 2019
A YANG Data Model for a Keystore A YANG Data Model for a Keystore
draft-ietf-netconf-keystore-10 draft-ietf-netconf-keystore-11
Abstract Abstract
This document defines a YANG 1.1 module called "ietf-keystore" that This document defines a YANG 1.1 module called "ietf-keystore" that
enables centralized configuration of asymmetric keys and their enables centralized configuration of asymmetric keys and their
associated certificates, and notification for when configured associated certificates, and notification for when configured
certificates are about to expire. certificates are about to expire.
Editorial Note (To be removed by RFC Editor) Editorial Note (To be removed by RFC Editor)
skipping to change at page 1, line 33 skipping to change at page 1, line 33
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 "2019-06-07" --> the publication date of this draft o "2019-06-17" --> 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 December 9, 2019. This Internet-Draft will expire on December 19, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 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
skipping to change at page 2, line 33 skipping to change at page 2, line 33
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
2. Requirements Language . . . . . . . . . . . . . . . . . . . . 4 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 4
3. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 4 3. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 4
3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4 3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4
3.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 6 3.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 11
3.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 11 3.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 16
4. Security Considerations . . . . . . . . . . . . . . . . . . . 16 4. Security Considerations . . . . . . . . . . . . . . . . . . . 26
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27
5.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 17 5.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 27
5.2. The YANG Module Names Registry . . . . . . . . . . . . . 17 5.2. The YANG Module Names Registry . . . . . . . . . . . . . 28
6. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.1. Normative References . . . . . . . . . . . . . . . . . . 17 6.1. Normative References . . . . . . . . . . . . . . . . . . 28
6.2. Informative References . . . . . . . . . . . . . . . . . 18 6.2. Informative References . . . . . . . . . . . . . . . . . 29
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 19 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 30
A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 19 A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 30
A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 19 A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 30
A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 19 A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 30
A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 19 A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 30
A.5. 04 to 05 . . . . . . . . . . . . . . . . . . . . . . . . 20 A.5. 04 to 05 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.6. 05 to 06 . . . . . . . . . . . . . . . . . . . . . . . . 20 A.6. 05 to 06 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.7. 06 to 07 . . . . . . . . . . . . . . . . . . . . . . . . 20 A.7. 06 to 07 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.8. 07 to 08 . . . . . . . . . . . . . . . . . . . . . . . . 20 A.8. 07 to 08 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.9. 08 to 09 . . . . . . . . . . . . . . . . . . . . . . . . 20 A.9. 08 to 09 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.10. 09 to 10 . . . . . . . . . . . . . . . . . . . . . . . . 21 A.10. 09 to 10 . . . . . . . . . . . . . . . . . . . . . . . . 32
A.11. 10 to 11 . . . . . . . . . . . . . . . . . . . . . . . . 32
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 21 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 32
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 21 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 33
1. Introduction 1. Introduction
This document defines a YANG 1.1 [RFC7950] module called "ietf- This document defines a YANG 1.1 [RFC7950] module called "ietf-
keystore" that enables centralized configuration of asymmetric keys keystore" that enables centralized configuration of asymmetric keys
and their associated certificates, and notification for when and their associated certificates, and notification for when
configured certificates are about to expire. configured certificates are about to expire.
This module also defines Six groupings designed for maximum reuse. This module also defines Six groupings designed for maximum reuse.
These groupings include one for the public half of an asymmetric key, These groupings include one for the public half of an asymmetric key,
skipping to change at page 4, line 24 skipping to change at page 4, line 24
3.1. Tree Diagram 3.1. Tree Diagram
This section provides a tree diagrams [RFC8340] for the "ietf- This section provides a tree diagrams [RFC8340] for the "ietf-
keystore" module that presents both the protocol-accessible keystore" module that presents both the protocol-accessible
"keystore" as well the all the groupings intended for external usage. "keystore" as well the all the groupings intended for external usage.
module: ietf-keystore module: ietf-keystore
+--rw keystore +--rw keystore
+--rw asymmetric-keys +--rw asymmetric-keys
+--rw asymmetric-key* [name] | +--rw asymmetric-key* [name]
+--rw name string | +--rw name string
+--rw algorithm | +--rw algorithm
| asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-ref
+--rw public-key binary | +--rw public-key binary
+--rw private-key union | +--rw (private-key-type)
+--rw certificates | | +--:(private-key)
| +--rw certificate* [name] | | | +--rw private-key? binary
| +--rw name string | | +--:(hidden-private-key)
| +--rw cert? end-entity-cert-cms | | | +--rw hidden-private-key? empty
| +---n certificate-expiration | | +--:(encrypted-private-key)
| +-- expiration-date yang:date-and-time | | +--rw encrypted-private-key
+---x generate-certificate-signing-request | | +--rw (key-type)
+---w input | | | +--:(symmetric-key)
| +---w subject binary | | | | +--rw symmetric-key? leafref
| +---w attributes? binary | | | +--:(asymmetric-key)
+--ro output | | | +--rw asymmetric-key? leafref
+--ro certificate-signing-request binary | | +--rw value? binary
| +--rw certificates
| | +--rw certificate* [name]
| | +--rw name string
| | +--rw cert? 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
+--rw symmetric-keys
+--rw symmetric-key* [name]
+--rw name string
+--rw algorithm identityref
+--rw (key-type)
+--:(key)
| +--rw key? binary
+--:(hidden-key)
| +--rw hidden-key? empty
+--:(encrypted-key)
+--rw encrypted-key
+--rw (key-type)
| +--:(symmetric-key)
| | +--rw symmetric-key? leafref
| +--:(asymmetric-key)
| +--rw asymmetric-key? leafref
+--rw value? binary
rpcs:
+---x generate-symmetric-key
| +---w input
| | +---w algorithm identityref
| | +---w encrypt-with!
| | +---w (key-type)
| | +--:(symmetric-key)
| | | +---w symmetric-key? leafref
| | +--:(asymmetric-key)
| | +---w asymmetric-key? leafref
| +--ro output
| +--ro algorithm identityref
| +--ro (key-type)
| +--:(key)
| | +--ro key? binary
| +--:(hidden-key)
| | +--ro hidden-key? empty
| +--:(encrypted-key)
| +--ro encrypted-key
| +--ro (key-type)
| | +--:(symmetric-key)
| | | +--ro symmetric-key? leafref
| | +--:(asymmetric-key)
| | +--ro asymmetric-key? leafref
| +--ro value? binary
+---x generate-asymmetric-key
+---w input
| +---w algorithm identityref
| +---w encrypt-with!
| +---w (key-type)
| +--:(symmetric-key)
| | +---w symmetric-key? leafref
| +--:(asymmetric-key)
| +---w asymmetric-key? leafref
+--ro output
+--ro algorithm
| asymmetric-key-algorithm-ref
+--ro public-key binary
+--ro (private-key-type)
+--:(private-key)
| +--ro private-key? binary
+--:(hidden-private-key)
| +--ro hidden-private-key? empty
+--:(encrypted-private-key)
+--ro encrypted-private-key
+--ro (key-type)
| +--:(symmetric-key)
| | +--ro symmetric-key? leafref
| +--:(asymmetric-key)
| +--ro asymmetric-key? leafref
+--ro value? binary
grouping encrypted-value-grouping
+-- (key-type)
| +--:(symmetric-key)
| | +-- symmetric-key?
| | -> /keystore/symmetric-keys/symmetric-key/name
| +--:(asymmetric-key)
| +-- asymmetric-key?
| -> /keystore/asymmetric-keys/asymmetric-key/name
+-- value? binary
grouping symmetric-key-grouping
+-- algorithm identityref
+-- (key-type)
+--:(key)
| +-- key? binary
+--:(hidden-key)
| +-- hidden-key? empty
+--:(encrypted-key)
+-- encrypted-key
+-- (key-type)
| +--:(symmetric-key)
| | +-- symmetric-key? leafref
| +--:(asymmetric-key)
| +-- asymmetric-key? leafref
+-- value? binary
grouping asymmetric-key-pair-grouping
+-- algorithm asymmetric-key-algorithm-ref
+-- public-key binary
+-- (private-key-type)
+--:(private-key)
| +-- private-key? binary
+--:(hidden-private-key)
| +-- hidden-private-key? empty
+--:(encrypted-private-key)
+-- encrypted-private-key
+-- (key-type)
| +--:(symmetric-key)
| | +-- symmetric-key? leafref
| +--:(asymmetric-key)
| +-- asymmetric-key? leafref
+-- value? binary
grouping asymmetric-key-pair-with-cert-grouping
+-- algorithm
| asymmetric-key-algorithm-ref
+-- public-key binary
+-- (private-key-type)
| +--:(private-key)
| | +-- private-key? binary
| +--:(hidden-private-key)
| | +-- hidden-private-key? empty
| +--:(encrypted-private-key)
| +-- encrypted-private-key
| +-- (key-type)
| | +--:(symmetric-key)
| | | +-- symmetric-key? leafref
| | +--:(asymmetric-key)
| | +-- asymmetric-key? leafref
| +-- value? binary
+-- cert? 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
grouping asymmetric-key-pair-with-certs-grouping
+-- algorithm
| asymmetric-key-algorithm-ref
+-- public-key binary
+-- (private-key-type)
| +--:(private-key)
| | +-- private-key? binary
| +--:(hidden-private-key)
| | +-- hidden-private-key? empty
| +--:(encrypted-private-key)
| +-- encrypted-private-key
| +-- (key-type)
| | +--:(symmetric-key)
| | | +-- symmetric-key? leafref
| | +--:(asymmetric-key)
| | +-- asymmetric-key? leafref
| +-- value? binary
+-- certificates
| +-- certificate* [name]
| +-- name? string
| +-- cert? 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
grouping asymmetric-key-certificate-ref-grouping
+-- asymmetric-key? ks:asymmetric-key-ref
+-- certificate? leafref
grouping local-or-keystore-asymmetric-key-grouping grouping local-or-keystore-asymmetric-key-grouping
+-- (local-or-keystore) +-- (local-or-keystore)
+--:(local) {local-definitions-supported}? +--:(local) {local-definitions-supported}?
| +-- local-definition | +-- local-definition
| +-- algorithm asymmetric-key-algorithm-ref | +-- algorithm
| +-- public-key binary | | asymmetric-key-algorithm-ref
| +-- private-key union | +-- public-key binary
| +-- (private-key-type)
| +--:(private-key)
| | +-- private-key? binary
| +--:(hidden-private-key)
| | +-- hidden-private-key? empty
| +--:(encrypted-private-key)
| +-- encrypted-private-key
| +-- (key-type)
| | +--:(symmetric-key)
| | | +-- symmetric-key? leafref
| | +--:(asymmetric-key)
| | +-- asymmetric-key? leafref
| +-- value? binary
+--:(keystore) {keystore-supported}? +--:(keystore) {keystore-supported}?
+-- keystore-reference? ks:asymmetric-key-ref +-- keystore-reference? ks:asymmetric-key-ref
grouping local-or-keystore-asymmetric-key-with-certs-grouping grouping local-or-keystore-asymmetric-key-with-certs-grouping
+-- (local-or-keystore) +-- (local-or-keystore)
+--:(local) {local-definitions-supported}? +--:(local) {local-definitions-supported}?
| +-- local-definition | +-- local-definition
| +-- algorithm | +-- algorithm
| | asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-ref
| +-- public-key binary | +-- public-key binary
| +-- private-key union | +-- (private-key-type)
| | +--:(private-key)
| | | +-- private-key? binary
| | +--:(hidden-private-key)
| | | +-- hidden-private-key? empty
| | +--:(encrypted-private-key)
| | +-- encrypted-private-key
| | +-- (key-type)
| | | +--:(symmetric-key)
| | | | +-- symmetric-key? leafref
| | | +--:(asymmetric-key)
| | | +-- asymmetric-key? leafref
| | +-- value? binary
| +-- certificates | +-- certificates
| | +-- certificate* [name] | | +-- certificate* [name]
| | +-- name? string | | +-- name? string
| | +-- cert? end-entity-cert-cms | | +-- cert? end-entity-cert-cms
| | +---n certificate-expiration | | +---n certificate-expiration
| | +-- expiration-date yang:date-and-time | | +-- 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
skipping to change at page 5, line 32 skipping to change at page 9, line 44
| +--ro certificate-signing-request binary | +--ro certificate-signing-request binary
+--:(keystore) {keystore-supported}? +--:(keystore) {keystore-supported}?
+-- keystore-reference? ks:asymmetric-key-ref +-- keystore-reference? ks:asymmetric-key-ref
grouping local-or-keystore-end-entity-cert-with-key-grouping grouping local-or-keystore-end-entity-cert-with-key-grouping
+-- (local-or-keystore) +-- (local-or-keystore)
+--:(local) {local-definitions-supported}? +--:(local) {local-definitions-supported}?
| +-- local-definition | +-- local-definition
| +-- algorithm | +-- algorithm
| | asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-ref
| +-- public-key binary | +-- public-key binary
| +-- private-key union | +-- (private-key-type)
| | +--:(private-key)
| | | +-- private-key? binary
| | +--:(hidden-private-key)
| | | +-- hidden-private-key? empty
| | +--:(encrypted-private-key)
| | +-- encrypted-private-key
| | +-- (key-type)
| | | +--:(symmetric-key)
| | | | +-- symmetric-key? leafref
| | | +--:(asymmetric-key)
| | | +-- asymmetric-key? leafref
| | +-- value? binary
| +-- cert? | +-- cert?
| | end-entity-cert-cms | | end-entity-cert-cms
| +---n certificate-expiration | +---n certificate-expiration
| | +-- expiration-date yang:date-and-time | | +-- 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
+--:(keystore) {keystore-supported}? +--:(keystore) {keystore-supported}?
+-- keystore-reference? ks:asymmetric-key-certificate-ref +-- keystore-reference
+-- asymmetric-key? ks:asymmetric-key-ref
+-- certificate? leafref
grouping keystore-grouping grouping keystore-grouping
+-- asymmetric-keys +-- asymmetric-keys
+-- asymmetric-key* [name] | +-- asymmetric-key* [name]
+-- name? string | +-- name? string
+-- algorithm | +-- algorithm
| asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-ref
+-- public-key binary | +-- public-key binary
+-- private-key union | +-- (private-key-type)
+-- certificates | | +--:(private-key)
| +-- certificate* [name] | | | +-- private-key? binary
| +-- name? string | | +--:(hidden-private-key)
| +-- cert? end-entity-cert-cms | | | +-- hidden-private-key? empty
| +---n certificate-expiration | | +--:(encrypted-private-key)
| +-- expiration-date yang:date-and-time | | +-- encrypted-private-key
+---x generate-certificate-signing-request | | +-- (key-type)
+---w input | | | +--:(symmetric-key)
| +---w subject binary | | | | +-- symmetric-key? leafref
| +---w attributes? binary | | | +--:(asymmetric-key)
+--ro output | | | +-- asymmetric-key? leafref
+--ro certificate-signing-request binary | | +-- value? binary
| +-- certificates
| | +-- certificate* [name]
| | +-- name? string
| | +-- cert? 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
+-- symmetric-keys
+-- symmetric-key* [name]
+-- name? string
+-- algorithm identityref
+-- (key-type)
+--:(key)
| +-- key? binary
+--:(hidden-key)
| +-- hidden-key? empty
+--:(encrypted-key)
+-- encrypted-key
+-- (key-type)
| +--:(symmetric-key)
| | +-- symmetric-key? leafref
| +--:(asymmetric-key)
| +-- asymmetric-key? leafref
+-- value? binary
3.2. Example Usage 3.2. Example Usage
The following example illustrates what a fully configured keystore The following example illustrates what a fully configured keystore
might look like in <operational>, as described by Section 5.3 in might look like in <operational>, as described by Section 5.3 in
[RFC8342]. This datastore view illustrates data set by the [RFC8342]. This datastore view illustrates data set by the
manufacturing process alongside conventional configuration. This manufacturing process alongside conventional configuration. This
keystore instance has four keys, two having one associated keystore instance has four keys, two having one associated
certificate, one having two associated certificates, and one empty certificate, one having two associated certificates, and one empty
key. key.
skipping to change at page 7, line 17 skipping to change at page 12, line 25
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</asymmetric-key> </asymmetric-key>
<!-- all except 'my-ldevid-cert' copied from <operational> --> <!-- all except 'my-ldevid-cert' copied from <operational> -->
<asymmetric-key> <asymmetric-key>
<name>tpm-protected-key</name> <name>tpm-protected-key</name>
<algorithm>ct:rsa2048</algorithm> <algorithm>ct:rsa2048</algorithm>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key>permanently-hidden</private-key> <hidden-private-key/>
<certificates> <certificates>
<certificate> <certificate>
<name>builtin-idevid-cert</name> <name>builtin-idevid-cert</name>
</certificate> </certificate>
<certificate> <certificate>
<name>my-ldevid-cert</name> <name>my-ldevid-cert</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</asymmetric-key> </asymmetric-key>
skipping to change at page 10, line 45 skipping to change at page 16, line 4
</algorithm> </algorithm>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</local-definition> </local-definition>
</end-entity-cert-with-key> </end-entity-cert-with-key>
<end-entity-cert-with-key> <end-entity-cert-with-key>
<name>a keystore-defined certificate (and its associated key)</n\ <name>a keystore-defined certificate (and its associated key)</n\
ame> ame>
<keystore-reference>ex-rsa-cert</keystore-reference> <keystore-reference>
<asymmetric-key>ex-rsa-key</asymmetric-key>
<certificate>ex-rsa-cert</certificate>
</keystore-reference>
</end-entity-cert-with-key> </end-entity-cert-with-key>
</keystore-usage> </keystore-usage>
3.3. YANG Module 3.3. YANG Module
This YANG module has normative references to [RFC8341] and This YANG module has normative references to [RFC8341] and
[I-D.ietf-netconf-crypto-types], and an informative reference to [I-D.ietf-netconf-crypto-types], and an informative reference to
[RFC8342]. [RFC8342].
<CODE BEGINS> file "ietf-keystore@2019-06-07.yang" <CODE BEGINS> file "ietf-keystore@2019-06-17.yang"
module ietf-keystore { module ietf-keystore {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-keystore"; namespace "urn:ietf:params:xml:ns:yang:ietf-keystore";
prefix ks; prefix ks;
import ietf-crypto-types { import ietf-crypto-types {
prefix ct; prefix ct;
reference reference
"RFC CCCC: Common YANG Data Types for Cryptography"; "RFC CCCC: Common YANG Data Types for Cryptography";
} }
skipping to change at page 12, line 13 skipping to change at page 17, line 21
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
itself for full legal notices.; itself for full legal notices.;
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119) are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all (RFC 8174) when, and only when, they appear in all
capitals, as shown here."; capitals, as shown here.";
revision 2019-06-07 { revision 2019-06-17 {
description description
"Initial version"; "Initial version";
reference reference
"RFC VVVV: A YANG Data Model for a Keystore"; "RFC VVVV: A YANG Data Model for a Keystore";
} }
/****************/ /****************/
/* Features */ /* Features */
/****************/ /****************/
skipping to change at page 12, line 36 skipping to change at page 17, line 44
"The 'keystore-supported' feature indicates that the server "The 'keystore-supported' feature indicates that the server
supports the keystore."; supports the keystore.";
} }
feature local-definitions-supported { feature local-definitions-supported {
description description
"The 'local-definitions-supported' feature indicates that the "The 'local-definitions-supported' feature indicates that the
server supports locally-defined keys."; server supports locally-defined keys.";
} }
feature key-generation {
description
"Indicates that the server supports the actions related to
the life cycling keys in <operational>. To be used by
configuration, keys in <operational> must be copied to
<running>.";
}
/****************/ /****************/
/* Typedefs */ /* Typedefs */
/****************/ /****************/
typedef asymmetric-key-ref { typedef asymmetric-key-ref {
type leafref { type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key" path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key"
+ "/ks:name"; + "/ks:name";
} }
description description
"This typedef enables modules to easily define a reference "This typedef enables modules to easily define a reference
to an asymmetric key stored in the keystore."; to an asymmetric key stored in the keystore.";
} }
typedef asymmetric-key-certificate-ref { /*****************/
type leafref { /* Groupings */
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key" /*****************/
+ "/ks:certificates/ks:certificate/ks:name";
grouping encrypted-value-grouping {
description
"A reusable grouping for a value that has been encrypted by
a symmeteric or asymmetric key in the keystore.";
choice key-type {
mandatory true;
description
"A choice between a reference to a symmtric or asymmetric
key in the keystore.";
leaf symmetric-key {
type leafref {
path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key/"
+ "ks:name";
}
description
"Identifies a symmetric key used to encrypt this key.";
}
leaf asymmetric-key {
type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key/"
+ "ks:name";
}
description
"Identifies an asymmetric key used to encrypt this key.";
}
}
leaf value {
type binary;
description
"The private key, encrypted using the specified symmetric
or asymmetric key.";
}
}
grouping symmetric-key-grouping {
description
"This grouping is identical to the one in ietf-crypt-types
except that it adds a couple case statements enabling the
key value to be encrypted by a symmetric or an asymmetric
key known to the keystore.";
uses ct:symmetric-key-grouping {
augment "key-type" {
description
"Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module.";
container encrypted-key {
description
"A container for the encrypted symmetric key value.";
uses encrypted-value-grouping;
}
}
} }
}
grouping asymmetric-key-pair-grouping {
description description
"This typedef enables modules to easily define a reference "This grouping is identical to the one in ietf-crypt-types
to a specific certificate associated with an asymmetric key except that it adds a couple case statements enabling the
stored in the keystore."; key value to be encrypted by a symmetric or an asymmetric
key known to the keystore.";
uses ct:asymmetric-key-pair-grouping {
augment "private-key-type" {
description
"Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module.";
container encrypted-private-key {
description
"A container for the encrypted asymmetric private
key value.";
uses encrypted-value-grouping;
}
}
}
} }
/*****************/ grouping asymmetric-key-pair-with-cert-grouping {
/* Groupings */ description
/*****************/ "This grouping is identical to the one in ietf-crypt-types
except that it adds a couple case statements enabling the
key value to be encrypted by a symmetric or an asymmetric
key known to the keystore.";
uses ct:asymmetric-key-pair-with-cert-grouping {
augment "private-key-type" {
description
"Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module.";
container encrypted-private-key {
description
"A container for the encrypted asymmetric private
key value.";
uses encrypted-value-grouping;
}
}
}
}
grouping asymmetric-key-pair-with-certs-grouping {
description
"This grouping is identical to the one in ietf-crypt-types
except that it adds a couple case statements enabling the
key value to be encrypted by a symmetric or an asymmetric
key known to the keystore.";
uses ct:asymmetric-key-pair-with-certs-grouping {
augment "private-key-type" {
description
"Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module.";
container encrypted-private-key {
description
"A container for the encrypted asymmetric private
key value.";
uses encrypted-value-grouping;
}
}
}
}
grouping asymmetric-key-certificate-ref-grouping {
leaf asymmetric-key {
type ks:asymmetric-key-ref;
must '../certificate';
description
"A reference to an asymmetric key in the keystore.";
}
leaf certificate {
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.";
}
description
"This grouping defines a reference to a specific certificate
associated with an asymmetric key stored in the keystore.";
}
grouping local-or-keystore-asymmetric-key-grouping { grouping local-or-keystore-asymmetric-key-grouping {
description description
"A grouping that expands to allow the asymmetric key to be "A grouping that expands to allow the asymmetric key to be
either stored locally, within the using data model, or be either stored locally, within the using data model, or be
a reference to an asymmetric key stored in the keystore."; a reference to an asymmetric key stored in the keystore.";
choice local-or-keystore { choice local-or-keystore {
mandatory true; mandatory true;
case local { case local {
if-feature "local-definitions-supported"; if-feature "local-definitions-supported";
container local-definition { container local-definition {
description description
"Container to hold the local key definition."; "Container to hold the local key definition.";
uses ct:asymmetric-key-pair-grouping; uses asymmetric-key-pair-grouping;
} }
} }
case keystore { case keystore {
if-feature "keystore-supported"; if-feature "keystore-supported";
leaf keystore-reference { leaf keystore-reference {
type ks:asymmetric-key-ref; type ks:asymmetric-key-ref;
description description
"A reference to an asymmetric key that exists in "A reference to an asymmetric key that exists in
the keystore. The intent is to reference just the the keystore. The intent is to reference just the
asymmetric key, not any certificates that may also asymmetric key, not any certificates that may also
skipping to change at page 14, line 14 skipping to change at page 22, line 16
associated certificates to be either stored locally, within associated certificates to be either stored locally, within
the using data model, or be a reference to an asymmetric key the using data model, or be a reference to an asymmetric key
(and its associated certificates) stored in the keystore."; (and its associated certificates) stored in the keystore.";
choice local-or-keystore { choice local-or-keystore {
mandatory true; mandatory true;
case local { case local {
if-feature "local-definitions-supported"; if-feature "local-definitions-supported";
container local-definition { container local-definition {
description description
"Container to hold the local key definition."; "Container to hold the local key definition.";
uses ct:asymmetric-key-pair-with-certs-grouping; uses asymmetric-key-pair-with-certs-grouping;
} }
} }
case keystore { case keystore {
if-feature "keystore-supported"; if-feature "keystore-supported";
leaf keystore-reference { leaf keystore-reference {
type ks:asymmetric-key-ref; type ks:asymmetric-key-ref;
description description
"A reference to an asymmetric-key (and all of its "A reference to an asymmetric-key (and all of its
associated certificates) in the keystore."; associated certificates) in the keystore.";
} }
skipping to change at page 14, line 45 skipping to change at page 22, line 47
(and its associated private key) to be either stored locally, (and its associated private key) to be either stored locally,
within the using data model, or be a reference to a specific within the using data model, or be a reference to a specific
certificate in the keystore."; certificate in the keystore.";
choice local-or-keystore { choice local-or-keystore {
mandatory true; mandatory true;
case local { case local {
if-feature "local-definitions-supported"; if-feature "local-definitions-supported";
container local-definition { container local-definition {
description description
"Container to hold the local key definition."; "Container to hold the local key definition.";
uses ct:asymmetric-key-pair-with-cert-grouping; uses asymmetric-key-pair-with-cert-grouping;
} }
} }
case keystore { case keystore {
if-feature "keystore-supported"; if-feature "keystore-supported";
leaf keystore-reference { container keystore-reference {
type ks:asymmetric-key-certificate-ref; uses asymmetric-key-certificate-ref-grouping;
description description
"A reference to a specific certificate (and its "A reference to a specific certificate (and its
associated private key) in the keystore."; associated private key) in the keystore.";
} }
} }
description description
"A choice between an inlined definition and a definition "A choice between an inlined definition and a definition
that exists in the keystore."; that exists in the keystore.";
} }
} }
skipping to change at page 15, line 33 skipping to change at page 23, line 35
"A list of asymmetric keys."; "A list of asymmetric keys.";
list asymmetric-key { list asymmetric-key {
key "name"; key "name";
description description
"An asymmetric key."; "An asymmetric key.";
leaf name { leaf name {
type string; type string;
description description
"An arbitrary name for the asymmetric key."; "An arbitrary name for the asymmetric key.";
} }
uses ct:asymmetric-key-pair-with-certs-grouping; uses ks:asymmetric-key-pair-with-certs-grouping;
} }
} }
} container symmetric-keys {
description
"A list of symmetric keys.";
list symmetric-key {
key "name";
description
"A symmetric key.";
leaf name {
type string;
description
"An arbitrary name for the symmetric key.";
}
uses ks:symmetric-key-grouping;
}
}
} // grouping keystore-grouping
/*********************************/ /*********************************/
/* Protocol accessible nodes */ /* Protocol accessible nodes */
/*********************************/ /*********************************/
container keystore { container keystore {
nacm:default-deny-write; nacm:default-deny-write;
description description
"The keystore contains a list of keys."; "The keystore contains a list of keys.";
uses keystore-grouping; uses keystore-grouping;
} }
rpc generate-symmetric-key {
//nacm:default-deny-all;
description
"Requests the device to generate an symmetric key using
the specified key algorithm, optionally encrypted using
a key in the keystore. The output is this RPC can be
used as input to a subsequent configuration request.";
input {
leaf algorithm {
type identityref {
base "ct:encryption-algorithm";
}
mandatory true;
description
"The algorithm to be used when generating the key.";
reference
"RFC CCCC: Common YANG Data Types for Cryptography";
}
container encrypt-with {
presence
"Indicates that the key should be encrypted using
the specified symmetric or asymmetric key. If not
specified, then the private key is not encrypted
when returned.";
description
"A container for the 'key-type' choice.";
choice key-type {
mandatory true;
description
"Choice between a symmetric and asymmetric key.";
leaf symmetric-key {
type leafref {
path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key/"
+ "ks:name";
}
description
"Identifies a symmetric key used to encrypt this key.";
}
leaf asymmetric-key {
type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-"
+ "key/ks:name";
}
description
"Identifies an asymmetric key used to encrypt this
key.";
}
}
}
}
output {
uses ks:symmetric-key-grouping;
}
} // end generate-symmetric-key
rpc generate-asymmetric-key {
//nacm:default-deny-all;
description
"Requests the device to generate an asymmetric key using
the specified key algorithm, optionally encrypted using
a key in the keystore. The output is this RPC can be
used as input to a subsequent configuration request.";
input {
leaf algorithm {
type identityref {
base "ct:asymmetric-key-algorithm";
}
mandatory true;
description
"The algorithm to be used when generating the key.";
reference
"RFC CCCC: Common YANG Data Types for Cryptography";
}
container encrypt-with {
presence
"Indicates that the key should be encrypted using
the specified symmetric or asymmetric key. If not
specified, then the private key is not encrypted
when returned.";
description
"A container for the 'key-type' choice.";
choice key-type {
mandatory true;
description
"Choice between a symmetric and asymmetric key.";
leaf symmetric-key {
type leafref {
path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key/"
+ "ks:name";
}
description
"Identifies a symmetric key used to encrypt this key.";
}
leaf asymmetric-key {
type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-"
+ "key/ks:name";
}
description
"Identifies an asymmetric key used to encrypt this
key.";
}
}
}
}
output {
uses ks:asymmetric-key-pair-grouping;
}
} // end generate-asymmetric-key
} }
<CODE ENDS> <CODE ENDS>
4. Security Considerations 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.
skipping to change at page 21, line 27 skipping to change at page 32, line 27
o Renamed feature from 'local-keys-supported' to 'local-definitions- o Renamed feature from 'local-keys-supported' to 'local-definitions-
supported' (same name used in truststore) supported' (same name used in truststore)
o Removed the either-all-or-none 'must' expressions for the key's o Removed the either-all-or-none 'must' expressions for the key's
3-tuple values (since the values are now 'mandatory true' in 3-tuple values (since the values are now 'mandatory true' in
crypto-types) crypto-types)
o Example updated to reflect 'mandatory true' change in crypto-types o Example updated to reflect 'mandatory true' change in crypto-types
draft draft
A.11. 10 to 11
o Replaced typedef asymmetric-key-certificate-ref with grouping
asymmetric-key-certificate-ref-grouping.
o Added feature feature 'key-generation'.
o 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.
o Added new 'symmetric-keys' lists, as a sibling to the existing
'asymmetric-keys' list.
o Added RPCs (not actions) 'generate-symmetric-key' and 'generate-
asymmetric-key' to *return* a (potentially encrypted) key.
Acknowledgements Acknowledgements
The authors would like to thank for following for lively discussions The authors would like to thank for following for lively discussions
on list and in the halls (ordered by last name): Andy Bierman, Martin on list and in the halls (ordered by last name): Andy Bierman, Martin
Bjorklund, Benoit Claise, Ramkumar Dhanapal, Mehmet Ersue, Balazs Bjorklund, Benoit Claise, Ramkumar Dhanapal, Mehmet Ersue, Balazs
Kovacs, David Lamparter, Ladislav Lhotka, Alan Luchuk, Mahesh Kovacs, David Lamparter, Ladislav Lhotka, Alan Luchuk, Mahesh
Jethanandani, Radek Krejci, Reshad Rahman, Tom Petch, Juergen Jethanandani, Radek Krejci, Reshad Rahman, Tom Petch, Juergen
Schoenwaelder, Phil Shafer, Sean Turner, Eric Voit, Bert Wijnen, and Schoenwaelder, Phil Shafer, Sean Turner, Eric Voit, Bert Wijnen, and
Liang Xia. Liang Xia.
 End of changes. 29 change blocks. 
91 lines changed or deleted 623 lines changed or added

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