rfc-9642

A YANG Data Model for a Keystore

K. Watsen
date2024-10 streamIETF areaops wgnetconf statusPROPOSED STANDARD pages39 canonicalhttps://www.rfc-editor.org/rfc/rfc9642 doi10.17487/RFC9642 errataview
This document presents a YANG module called "ietf-keystore" that enables centralized configuration of both symmetric and asymmetric keys. The secret value for both key types may be encrypted or hidden. Asymmetric keys may be associated with certificates. Notifications are sent when certificates are about to expire.

Extracted elements (27)

design-rationale §3

Built-in keys (e.g., manufacturer-installed IDevID keys) are represented as 'hidden' keys in the YANG model and are expected to appear in the <operational> datastore with 'or:origin' set to 'or:system', reflecting that they are provided by the server rather than configured by an operator.

yang, netconf, crypto, security, pkix

design-rationale §4.3

The KEK + primary key (PK) indirection model (Section 4.3) is designed to decouple crypto officers from regular administrators during server migrations. A globally unique built-in asymmetric PK encrypts a shared KEK offline per server; regular administrators then only need to swap the server-specific encrypted KEK entry when migrating a configuration, without ever seeing cleartext key material.

yang, netconf, crypto, security

design-rationale §2.1.4

The 'keystore-grouping' grouping is defined separately from the protocol-accessible 'keystore' container specifically to enable the keystore structure to be instantiated in other locations beyond the single top-level central keystore, accommodating modules that may need to place a keystore instance elsewhere in their data model.

yang, netconf, security

interoperability-note §1.4

The 'ietf-keystore' module is compliant with the Network Management Datastore Architecture (NMDA, RFC 8342). Keys and certificates installed during manufacturing are expected to appear in <operational>, and the module uses 'or:origin' annotations accordingly.

yang, netconf

interoperability-note §1.1

The 'ietf-keystore' module is part of a layered suite of YANG modules for NETCONF/RESTCONF client-server configuration. It depends on 'ietf-crypto-types' (RFC 9640) and is itself a dependency of 'tls-client-server' (RFC 9645), 'ssh-client-server' (RFC 9644), and the NETCONF/RESTCONF client-server modules.

yang, netconf, tls, crypto, security

normative-requirement §4.1 MUST

A server MUST possess access to the KEK, or an API using the KEK, so that it can decrypt the other keys in the configuration at runtime.

yang, netconf, crypto, security

normative-requirement §4.2 SHOULD

Each time a new key is configured, it SHOULD be encrypted by a KEK. Server implementations SHOULD provide an API that simultaneously generates and encrypts a key using a KEK so the cleartext value is never exposed to administrators.

yang, netconf, crypto, security

normative-requirement §4.1 MUST

If a key encryption key (KEK) is a symmetric key, the server MUST provide an API for administrators to encrypt other keys without needing to know the symmetric key's cleartext value.

yang, netconf, crypto, security

normative-requirement §5.1 MUST

If the keystore contents are not encrypted when persisted to non-volatile memory, server implementations MUST ensure the persisted storage is inaccessible to unauthorized parties.

yang, netconf, crypto, security

normative-requirement §5.1 RECOMMENDED

It is RECOMMENDED that server implementations encrypt keystore contents when persisted to non-volatile memory and zeroize decrypted keystore contents in volatile memory when not in use. If storing cleartext values, persistence-layer-level encryption SHOULD be used.

yang, netconf, crypto, security

normative-requirement §2.1.3.1 MUST

Servers that define custom keystore locations MUST augment alternate 'encrypted-by' references to those alternate locations into the 'encrypted-by-grouping' choice, since the standard grouping only references the central keystore.

yang, netconf, security

normative-requirement §2.1.3.7 MUST

When the 'keystore-grouping' is instantiated in locations other than the central keystore, implementations MUST augment new 'case' statements into the various inline-or-keystore 'choice' statements to supply leafrefs to the model-specific location(s).

yang, netconf, security

protocol-element §2.2.2

A 'certificate-expiration' notification is defined under each certificate node (guarded by the 'certificate-expiration-notification' feature) and carries a single 'expiration-date' leaf of type 'yang:date-and-time' to alert operators before a certificate expires.

yang, netconf, pkix, security

protocol-element §2.1.4

Each asymmetric key in the keystore carries 'public-key-format' (identityref), 'public-key' (binary), 'private-key-format' (identityref), and a 'private-key-type' choice with three cases: 'cleartext-private-key' (binary), 'hidden-private-key' (empty), or 'encrypted-private-key' (containing 'encrypted-by', 'encrypted-value-format', and 'encrypted-value'). An asymmetric key may also contain a 'certificates' list and a 'generate-csr' action.

yang, netconf, crypto, pkix, security

protocol-element §2.1.4

Each symmetric key in the keystore carries an optional 'key-format' (identityref) and a 'key-type' choice with three cases: 'cleartext-symmetric-key' (binary), 'hidden-symmetric-key' (empty), or 'encrypted-symmetric-key' (containing 'encrypted-by', 'encrypted-value-format', and 'encrypted-value').

yang, netconf, crypto, security

protocol-element §2.1.3.3

Four 'inline-or-keystore' groupings provide a YANG choice between defining a key inline (guarded by 'inline-definitions-supported') and referencing a key in the central keystore (guarded by 'central-keystore-supported'). The four variants cover: symmetric keys, asymmetric keys without certs, asymmetric keys with certs, and end-entity cert with key.

yang, netconf, crypto, security

protocol-element §2.1.3.2

The 'central-asymmetric-key-certificate-ref-grouping' provides a two-part reference to a certificate: 'asymmetric-key' (leafref to the key name) and 'certificate' (leafref to the certificate name within that key). Each leaf has a 'must' constraint requiring the other leaf to also be present.

yang, netconf, pkix, security

protocol-element §2.1.3.1

The 'encrypted-by-grouping' defines a mandatory choice between referencing a central symmetric key ('symmetric-key-ref') or a central asymmetric key ('asymmetric-key-ref') as the encrypting key. Both cases are guarded by 'central-keystore-supported' and the respective key-type feature.

yang, netconf, crypto, security

protocol-element §2.1.4

The 'generate-csr' action (guarded by 'csr-generation' feature) on an asymmetric key accepts 'csr-format' (identityref) and 'csr-info' as input, and returns a 'p10-csr' (PKCS#10) as output, enabling server-side CSR generation without exposing the private key.

yang, netconf, pkix, crypto, security

protocol-element §2.1.3.7

The 'ietf-keystore' module defines a top-level 'keystore' container (constrained by the 'central-keystore-supported' feature) composed of an 'asymmetric-keys' list and a 'symmetric-keys' list, each entry identified by a 'name' string. The structure for both key types is defined by the 'keystore-grouping' grouping.

yang, netconf, crypto, security

protocol-element §2.1.1

The module defines four YANG features: 'central-keystore-supported' (server supports the top-level keystore container), 'inline-definitions-supported' (server supports locally defined keys), 'asymmetric-keys' (server implements /keystore/asymmetric-keys), and 'symmetric-keys' (server implements /keystore/symmetric-keys).

yang, netconf, security

protocol-element §2.1.2

Two typedefs are defined: 'central-symmetric-key-ref' (leafref to /ks:keystore/ks:symmetric-keys/ks:symmetric-key/ks:name) and 'central-asymmetric-key-ref' (leafref to /ks:keystore/ks:asymmetric-keys/ks:asymmetric-key/ks:name), provided as aids for consuming modules.

yang, netconf, security

registry §6.1

IANA has registered the URI 'urn:ietf:params:xml:ns:yang:ietf-keystore' in the 'ns' registry of the IETF XML Registry (RFC 3688).

yang, netconf, registry

registry §6.2

IANA has registered the YANG module 'ietf-keystore' (prefix 'ks', namespace 'urn:ietf:params:xml:ns:yang:ietf-keystore', not maintained by IANA) in the 'YANG Module Names' registry defined in RFC 6020.

yang, netconf, registry

security-consideration §5.3

All writable data nodes in the 'ietf-keystore' module have the NACM extension 'default-deny-write' applied, because any modification to a key or key reference may dramatically alter the implemented security policy. The 'cleartext-symmetric-key' and 'cleartext-private-key' nodes (imported from RFC 9640) have 'default-deny-all' applied and should never be returned to a client.

yang, netconf, crypto, security

security-consideration §5.3

Built-in key types SHOULD be hidden and/or encrypted (not cleartext). If this is not possible, NACM access control SHOULD be used to limit access to the key's secret data to only the most trusted authorized clients such as an organization's crypto officer.

yang, netconf, crypto, security

security-consideration §5.2

The module does not constrain the usage of private keys (e.g., signature vs. decryption) nor constrain public key usage except where a configured certificate imposes key usage constraints. Implementors should be aware of this unconstrained key usage.

yang, netconf, crypto, security, pkix