RFC 9640: YANG Data Types and Groupings for Cryptography
- K. Watsen
Abstract
This document presents a YANG 1.1 (RFC 7950) module defining identities, typedefs, and groupings useful to cryptographic applications.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
This document presents a YANG 1.1 [RFC7950] module defining identities, typedefs, and groupings useful to cryptographic applications.¶
1.1. Relation to Other RFCs
This document presents a YANG module [RFC7950] that is part of a collection of RFCs that work together to, ultimately, support the configuration of both the clients and servers of both the Network Configuration Protocol (NETCONF) [RFC6241] and RESTCONF [RFC8040].¶
The dependency relationship between the primary YANG groupings defined in the various RFCs is presented in the below diagram. In some cases, a document may define secondary groupings that introduce dependencies not illustrated in the diagram. The labels in the diagram are shorthand names for the defining RFCs. The citation references for the shorthand names are provided below the diagram.¶
Please note that the arrows in the diagram point from referencer to referenced. For example, the "crypto-types" RFC does not have any dependencies, whilst the "keystore" RFC depends on the "crypto-types" RFC.¶
1.2. Specification Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
1.3. Adherence to the NMDA
This document is compliant with the Network Management Datastore
Architecture (NMDA) [RFC8342]. It does not define
any protocol
1.4. Conventions
Various examples in this document use "BASE64VALUE=" as a placeholder value for binary data that has been base64 encoded (per Section 9.8 of [RFC7950]). This placeholder value is used because real base64-encoded structures are often many lines long and hence distracting to the example being presented.¶
Various examples in this document use the XML
[W3C
Various examples in this document contain long lines that may be folded, as described in [RFC8792].¶
2. The "ietf-crypto-types" Module
This section defines a YANG 1.1 [RFC7950] module called
"ietf
2.1. Data Model Overview
This section provides an overview of the "ietf
2.1.1. Features
The following diagram lists all the "feature" statements
defined in the "ietf
The diagram above uses syntax that is similar to but not the same as that in [RFC8340].¶
2.1.2. Identities
The following diagram illustrates the hierarchical relationship
amongst the "identity" statements defined in the "ietf
The diagram above uses syntax that is similar to but not the same as that in [RFC8340].¶
Comments:¶
2.1.3. Typedefs
The following diagram illustrates the relationship amongst the
"typedef" statements defined in the "ietf
The diagram above uses syntax that is similar to but not the same as that in [RFC8340].¶
Comments:¶
2.1.4. Groupings
The "ietf
Each of these groupings are presented in the following subsections.¶
2.1.4.1. The "encrypted-value-grouping" Grouping
The following tree diagram [RFC8340] illustrates the
"encrypted
Comments:¶
2.1.4.2. The "password-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"password
Comments:¶
2.1.4.3. The "symmetric-key-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"symmetric
Comments:¶
2.1.4.4. The "public-key-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"public
Comments:¶
2.1.4.5. The "private-key-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"private
Comments:¶
2.1.4.6. The "asymmetric-key-pair-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"asymmetric
Comments:¶
2.1.4.7. The "certificate-expiration-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"certificate
Comments:¶
2.1.4.8. The "trust-anchor-cert-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"trust
Comments:¶
2.1.4.9. The "end-entity-cert-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"end
Comments:¶
2.1.4.10. The "generate-csr-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"generate
Comments:¶
2.1.4.11. The "asymmetric-key-pair-with-cert-grouping" Grouping
This section presents a tree diagram [RFC8340] illustrating the
"asymmetric
Comments:¶
2.1.5. Protocol-Accessible Nodes
The "ietf
2.2. Example Usage
2.2.1. The "symmetric-key-grouping", "asymmetric-key-pair-with-certs-grouping", and "password-grouping" Groupings
The following non-normative module is constructed in order to illustrate the
use of the "symmetric
Notably, this example module and associated configuration data illustrates that
a hidden private key
2.2.1.1. Example Module
2.2.1.2. Tree Diagram for the Example Module
The tree diagram [RFC8340] for this example module is as follows:¶
2.2.1.3. Usage Example for the Example Module
Finally, the following example illustrates various symmetric and asymmetric keys as they might appear in configuration.¶
2.2.2. The "generate-csr" Action
The following example illustrates the "generate-csr" action, discussed in Section 2.1.4.10, with the NETCONF protocol.¶
REQUEST¶
RESPONSE¶
2.2.3. The "certificate-expiration" Notification
The following example illustrates the "certificate
3. Security Considerations
3.1. No Support for CRMF
This document uses PKCS #10 [RFC2986] for the "generate-csr" action. The use of Certificate Request Message Format (CRMF) [RFC4211] was considered, but it was unclear if there was market demand for it. If it is desired to support CRMF in the future, a backwards compatible solution can be defined at that time.¶
3.2. No Support for Key Generation
Early revisions of this document included "rpc" statements for generating symmetric and asymmetric keys. These statements were removed due to an inability to obtain consensus for how to generically identify the key algorithm to use. Hence, the solution presented in this document only supports keys to be configured via an external client.¶
Separate protocol
3.3. Unconstrained Public Key Usage
This module defines the "public
The "asymmetric
The "asymmetric
3.4. Unconstrained Private Key Usage
This module defines the "asymmetric
The "asymmetric
3.5. Cleartext Passwords and Keys
The module contained within this document enables, only when specific "feature" statements are enabled, for the cleartext value of passwords and keys to be stored in the configuration database. Storing cleartext values for passwords and keys is NOT RECOMMENDED.¶
3.6. Encrypting Passwords and Keys
The module contained within this document enables cleartext passwords and keys to be encrypted via another key, either symmetric or asymmetric. Both formats use a CMS structure (EncryptedData and EnvelopedData, respectively), which allows any encryption algorithm to be used.¶
To securely encrypt a password or key with a symmetric key, a proper block cipher mode, such as an Authenticated Encryption with Associated Data (AEAD) or Cipher Block Chaining (CBC), MUST be used. This ensures that a random Initialization Vector (IV) is part of the input, which guarantees that the output for encrypting the same password or key still produces a different unpredictable ciphertext. This avoids leaking that some encrypted keys or passwords are the same and makes it much harder to pre-generate rainbow tables to brute-force attack weak passwords. The Electronic Codebook (ECB) block cipher mode MUST NOT be used.¶
3.7. Deletion of Cleartext Key Values
This module defines storage for cleartext key values that SHOULD be zeroized when deleted so as to prevent the remnants of their persisted storage locations from being analyzed in any meaningful way.¶
The cleartext key values are the "cleartext
3.8. Considerations for the "ietf-crypto-types" YANG Module
This section is modeled after the template defined in Section 3.7.1 of [RFC8407].¶
The "ietf
The Network Configuration Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular users to a preconfigured subset of all available protocol operations and content.¶
Since the module in this document only defines groupings, these considerations are primarily for the designers of other modules that use these groupings.¶
Some of the readable data nodes defined in this YANG module
may be considered sensitive or vulnerable in some network
environments. It is thus important to control read access
(e.g., via get, get-config, or notification) to these
data nodes. The following subtrees and data nodes have particular
sensitivity
All the writable data nodes defined by all the groupings defined
in this module may be considered sensitive or vulnerable in
some network environments. For instance, even the modification
of a public key or a certificate can dramatically alter the
implemented security policy. For this reason, the NACM extension
"default
Some of the operations in this YANG module may be considered
sensitive or vulnerable in some network environments. It is
thus important to control access to these operations. These
are the operations and their sensitivity
4. IANA Considerations
4.1. The IETF XML Registry
IANA has registered the following URI in the "ns" registry of the "IETF XML Registry" [RFC3688].¶
4.2. The YANG Module Names Registry
IANA has registered the following YANG module in the "YANG Module Names" registry [RFC6020].¶
5. References
5.1. Normative References
- [ITU.X680.2021]
-
ITU-T, "Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation", ITU-T Recommendation X.680, ISO/IEC 8824-1:2021, , <https://
www >..itu .int /rec /T -REC -X .680 -202102 -I - [ITU.X690.2021]
-
ITU-T, "Information Technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)", ITU-T Recommendation X.690, ISO/IEC 8825-1:2021, , <https://
www >..itu .int /rec /T -REC -X .690 -202102 -I - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC2986]
-
Nystrom, M. and B. Kaliski, "PKCS #10: Certification Request Syntax Specification Version 1.7", RFC 2986, DOI 10
.17487 , , <https:///RFC2986 www >..rfc -editor .org /info /rfc2986 - [RFC4252]
-
Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) Authentication Protocol", RFC 4252, DOI 10
.17487 , , <https:///RFC4252 www >..rfc -editor .org /info /rfc4252 - [RFC4253]
-
Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) Transport Layer Protocol", RFC 4253, DOI 10
.17487 , , <https:///RFC4253 www >..rfc -editor .org /info /rfc4253 - [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 , , <https:///RFC5280 www >..rfc -editor .org /info /rfc5280 - [RFC5652]
-
Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, DOI 10
.17487 , , <https:///RFC5652 www >..rfc -editor .org /info /rfc5652 - [RFC5915]
-
Turner, S. and D. Brown, "Elliptic Curve Private Key Structure", RFC 5915, DOI 10
.17487 , , <https:///RFC5915 www >..rfc -editor .org /info /rfc5915 - [RFC5958]
-
Turner, S., "Asymmetric Key Packages", RFC 5958, DOI 10
.17487 , , <https:///RFC5958 www >..rfc -editor .org /info /rfc5958 - [RFC6031]
-
Turner, S. and R. Housley, "Cryptographic Message Syntax (CMS) Symmetric Key Package Content Type", RFC 6031, DOI 10
.17487 , , <https:///RFC6031 www >..rfc -editor .org /info /rfc6031 - [RFC6241]
-
Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10
.17487 , , <https:///RFC6241 www >..rfc -editor .org /info /rfc6241 - [RFC6960]
-
Santesson, S., Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, "X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP", RFC 6960, DOI 10
.17487 , , <https:///RFC6960 www >..rfc -editor .org /info /rfc6960 - [RFC6991]
-
Schoenwaelder, J., Ed., "Common YANG Data Types", RFC 6991, DOI 10
.17487 , , <https:///RFC6991 www >..rfc -editor .org /info /rfc6991 - [RFC7093]
-
Turner, S., Kent, S., and J. Manger, "Additional Methods for Generating Key Identifiers Values", RFC 7093, DOI 10
.17487 , , <https:///RFC7093 www >..rfc -editor .org /info /rfc7093 - [RFC7950]
-
Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10
.17487 , , <https:///RFC7950 www >..rfc -editor .org /info /rfc7950 - [RFC8017]
-
Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, "PKCS #1: RSA Cryptography Specifications Version 2.2", RFC 8017, DOI 10
.17487 , , <https:///RFC8017 www >..rfc -editor .org /info /rfc8017 - [RFC8040]
-
Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10
.17487 , , <https:///RFC8040 www >..rfc -editor .org /info /rfc8040 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8341]
-
Bierman, A. and M. Bjorklund, "Network Configuration Access Control Model", STD 91, RFC 8341, DOI 10
.17487 , , <https:///RFC8341 www >..rfc -editor .org /info /rfc8341 - [RFC8446]
-
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10
.17487 , , <https:///RFC8446 www >..rfc -editor .org /info /rfc8446 - [RFC9000]
-
Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based Multiplexed and Secure Transport", RFC 9000, DOI 10
.17487 , , <https:///RFC9000 www >..rfc -editor .org /info /rfc9000
5.2. Informative References
- [HTTP
-CLIENT -SERVER] -
Watsen, K., "YANG Groupings for HTTP Clients and HTTP Servers", Work in Progress, Internet-Draft, draft
-ietf , , <https://-netconf -http -client -server -23 datatracker >..ietf .org /doc /html /draft -ietf -netconf -http -client -server -23 - [NETCONF
-CLIENT -SERVER] -
Watsen, K., "NETCONF Client and Server Models", Work in Progress, Internet-Draft, draft
-ietf , , <https://-netconf -netconf -client -server -37 datatracker >..ietf .org /doc /html /draft -ietf -netconf -netconf -client -server -37 - [RESTCONF
-CLIENT -SERVER] -
Watsen, K., "RESTCONF Client and Server Models", Work in Progress, Internet-Draft, draft
-ietf , , <https://-netconf -restconf -client -server -38 datatracker >..ietf .org /doc /html /draft -ietf -netconf -restconf -client -server -38 - [RFC3688]
-
Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10
.17487 , , <https:///RFC3688 www >..rfc -editor .org /info /rfc3688 - [RFC4211]
-
Schaad, J., "Internet X.509 Public Key Infrastructure Certificate Request Message Format (CRMF)", RFC 4211, DOI 10
.17487 , , <https:///RFC4211 www >..rfc -editor .org /info /rfc4211 - [RFC5056]
-
Williams, N., "On the Use of Channel Bindings to Secure Channels", RFC 5056, DOI 10
.17487 , , <https:///RFC5056 www >..rfc -editor .org /info /rfc5056 - [RFC6020]
-
Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10
.17487 , , <https:///RFC6020 www >..rfc -editor .org /info /rfc6020 - [RFC7317]
-
Bierman, A. and M. Bjorklund, "A YANG Data Model for System Management", RFC 7317, DOI 10
.17487 , , <https:///RFC7317 www >..rfc -editor .org /info /rfc7317 - [RFC8259]
-
Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10
.17487 , , <https:///RFC8259 www >..rfc -editor .org /info /rfc8259 - [RFC8340]
-
Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", BCP 215, RFC 8340, DOI 10
.17487 , , <https:///RFC8340 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 , , <https:///RFC8342 www >..rfc -editor .org /info /rfc8342 - [RFC8407]
-
Bierman, A., "Guidelines for Authors and Reviewers of Documents Containing YANG Data Models", BCP 216, RFC 8407, DOI 10
.17487 , , <https:///RFC8407 www >..rfc -editor .org /info /rfc8407 - [RFC8792]
-
Watsen, K., Auerswald, E., Farrel, A., and Q. Wu, "Handling Long Lines in Content of Internet-Drafts and RFCs", RFC 8792, DOI 10
.17487 , , <https:///RFC8792 www >..rfc -editor .org /info /rfc8792 - [RFC9641]
-
Watsen, K., "A YANG Data Model for a Truststore", RFC 9641, DOI 10
.17487 , , <https:///RFC9641 www >..rfc -editor .org /info /rfc9641 - [RFC9642]
-
Watsen, K., "A YANG Data Model for a Keystore", RFC 9642, DOI 10
.17487 , , <https:///RFC9642 www >..rfc -editor .org /info /rfc9642 - [RFC9643]
-
Watsen, K. and M. Scharf, "YANG Groupings for TCP Clients and TCP Servers", RFC 9643, DOI 10
.17487 , , <https:///RFC9643 www >..rfc -editor .org /info /rfc9643 - [RFC9644]
-
Watsen, K., "YANG Groupings for SSH Clients and SSH Servers", RFC 9644, DOI 10
.17487 , , <https:///RFC9644 www >..rfc -editor .org /info /rfc9644 - [RFC9645]
-
Watsen, K., "YANG Groupings for TLS Clients and TLS Servers", RFC 9645, DOI 10
.17487 , , <https:///RFC9645 www >..rfc -editor .org /info /rfc9645 - [W3C
.REC -xml -20081126] -
Bray, T., Paoli, J., Sperberg
-Mc , Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", World Wide Web Consortium Recommendation RECQueen, C.M. -xml , , <https://-20081126 www >..w3 .org /TR /2008 /REC -xml -20081126 /
Acknowledgements
The authors would like to thank the following for lively discussions on list and in the halls (ordered by first name): Balázs Kovács, Carsten Bormann, Dale Worley, Eric Voit, Éric Vyncke, Francesca Palombini, Jürgen Schönwälder, Lars Eggert, Liang Xia, Mahesh Jethanandani, Martin Björklund, Murray Kucherawy, Nick Hancock, Orie Steele, Paul Wouters, Rich Salz, Rifaat Shekh-Yusef, Rob Wilton, Roman Danyliw, Russ Housley, Sandra Murphy, Tom Petch, Valery Smyslov, Wang Haiguang, Warren Kumari, and Zaheduzzaman Sarker.¶