idnits 2.17.1 draft-ietf-netconf-keystore-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 202 has weird spacing: '...request bin...' == Line 206 has weird spacing: '...gorithm ide...' == Line 218 has weird spacing: '...ost-key bin...' == Line 223 has weird spacing: '...on-date yan...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (June 13, 2017) is 2508 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 2986 ** Obsolete normative reference: RFC 6536 (Obsoleted by RFC 8341) Summary: 2 errors (**), 0 flaws (~~), 6 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NETCONF Working Group K. Watsen 3 Internet-Draft Juniper Networks 4 Intended status: Standards Track June 13, 2017 5 Expires: December 15, 2017 7 Keystore Model 8 draft-ietf-netconf-keystore-02 10 Abstract 12 This document defines a YANG data module for a system-level keystore 13 mechanism, that might be used to hold onto private keys and 14 certificates that are trusted by the system advertising support for 15 this module. 17 Editorial Note (To be removed by RFC Editor) 19 This draft contains many placeholder values that need to be replaced 20 with finalized values at the time of publication. This note 21 summarizes all of the substitutions that are needed. No other RFC 22 Editor instructions are specified elsewhere in this document. 24 Artwork in this document contains shorthand references to drafts in 25 progress. Please apply the following replacements: 27 o "VVVV" --> the assigned RFC value for this draft 29 Artwork in this document contains placeholder values for the date of 30 publication of this draft. Please apply the following replacement: 32 o "2017-06-13" --> the publication date of this draft 34 The following Appendix section is to be removed prior to publication: 36 o Appendix A. Change Log 38 Status of This Memo 40 This Internet-Draft is submitted in full conformance with the 41 provisions of BCP 78 and BCP 79. 43 Internet-Drafts are working documents of the Internet Engineering 44 Task Force (IETF). Note that other groups may also distribute 45 working documents as Internet-Drafts. The list of current Internet- 46 Drafts is at http://datatracker.ietf.org/drafts/current/. 48 Internet-Drafts are draft documents valid for a maximum of six months 49 and may be updated, replaced, or obsoleted by other documents at any 50 time. It is inappropriate to use Internet-Drafts as reference 51 material or to cite them other than as "work in progress." 53 This Internet-Draft will expire on December 15, 2017. 55 Copyright Notice 57 Copyright (c) 2017 IETF Trust and the persons identified as the 58 document authors. All rights reserved. 60 This document is subject to BCP 78 and the IETF Trust's Legal 61 Provisions Relating to IETF Documents 62 (http://trustee.ietf.org/license-info) in effect on the date of 63 publication of this document. Please review these documents 64 carefully, as they describe your rights and restrictions with respect 65 to this document. Code Components extracted from this document must 66 include Simplified BSD License text as described in Section 4.e of 67 the Trust Legal Provisions and are provided without warranty as 68 described in the Simplified BSD License. 70 Table of Contents 72 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 73 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 74 1.2. Tree Diagram Notation . . . . . . . . . . . . . . . . . . 3 75 2. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 4 76 2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 4 77 2.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 5 78 2.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 10 79 3. Design Considerations . . . . . . . . . . . . . . . . . . . . 21 80 4. Security Considerations . . . . . . . . . . . . . . . . . . . 22 81 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 82 5.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 23 83 5.2. The YANG Module Names Registry . . . . . . . . . . . . . 23 84 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 24 85 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 86 7.1. Normative References . . . . . . . . . . . . . . . . . . 24 87 7.2. Informative References . . . . . . . . . . . . . . . . . 25 88 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 26 89 A.1. server-model-09 to 00 . . . . . . . . . . . . . . . . . . 26 90 A.2. keychain-00 to keystore-00 . . . . . . . . . . . . . . . 26 91 A.3. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 26 92 A.4. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 26 93 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 26 95 1. Introduction 97 This document defines a YANG [RFC6020] data module for a system-level 98 keystore mechanism, which can be used to hold onto private keys and 99 certificates that are trusted by the system advertising support for 100 this module. 102 This module provides a centralized location for security sensitive 103 data, so that the data can be then referenced by other modules. 104 There are two types of data that are maintained by this module: 106 o Private keys, and any associated public certificates. 108 o Sets of trusted certificates. 110 This document extends special consideration for systems that have 111 Trusted Protection Modules (TPMs). These systems are unique in that 112 the TPM must be directed to generate new private keys (it is not 113 possible to load a private key into a TPM) and it is not possible to 114 backup/restore the TPM's private keys as configuration. 116 It is not required that a system has an operating system level 117 keystore utility to implement this module. 119 1.1. Requirements Language 121 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 122 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 123 document are to be interpreted as described in RFC 2119 [RFC2119]. 125 1.2. Tree Diagram Notation 127 A simplified graphical representation of the data models is used in 128 this document. The meaning of the symbols in these diagrams is as 129 follows: 131 o Brackets "[" and "]" enclose list keys. 133 o Braces "{" and "}" enclose feature names, and indicate that the 134 named feature must be present for the subtree to be present. 136 o Abbreviations before data node names: "rw" means configuration 137 (read-write) and "ro" state data (read-only). 139 o Symbols after data node names: "?" means an optional node, "!" 140 means a presence container, and "*" denotes a list and leaf-list. 142 o Parentheses enclose choice and case nodes, and case nodes are also 143 marked with a colon (":"). 145 o Ellipsis ("...") stands for contents of subtrees that are not 146 shown. 148 2. The Keystore Model 150 The keystore module defined in this section provides a configurable 151 object having the following characteristics: 153 o A semi-configurable list of private keys, each with one or more 154 associated certificates. Private keys MUST be either preinstalled 155 (e.g., a key associated to an IDevID [Std-802.1AR-2009] 156 certificate), be generated by request, or be loaded by request. 157 Each private key is MAY have associated certificates, either 158 preinstalled or configured after creation. 160 o A configurable list of lists of trust anchor certificates. This 161 enables the server to have use-case specific trust anchors. For 162 instance, one list of trust anchors might be used to authenticate 163 management connections (e.g., client certificate-based 164 authentication for NETCONF or RESTCONF connections), and a 165 different list of trust anchors might be used for when connecting 166 to a specific Internet-based service (e.g., a zero touch bootstrap 167 server). 169 o An RPC to generate a certificate signing request for an existing 170 private key, a passed subject, and an optional attributes. The 171 signed certificate returned from an external certificate authority 172 (CA) can be later set using a standard configuration change 173 request (e.g., ). 175 o An RPC to request the server to generate a new private key using 176 the specified algorithm and key length. 178 o An RPC to request the server to load a new private key. 180 2.1. Overview 182 The keystore module has the following tree diagram. Please see 183 Section 1.2 for information on how to interpret this diagram. 185 module: ietf-keystore 186 +--rw keystore 187 +--rw keys 188 | +--rw key* [name] 189 | | +--rw name string 190 | | +--rw algorithm-identifier identityref 191 | | +--rw private-key union 192 | | +--ro public-key binary 193 | | +--rw certificates 194 | | | +--rw certificate* [name] 195 | | | +--rw name string 196 | | | +--rw value? binary 197 | | +---x generate-certificate-signing-request 198 | | +---w input 199 | | | +---w subject binary 200 | | | +---w attributes? binary 201 | | +--ro output 202 | | +--ro certificate-signing-request binary 203 | +---x generate-private-key 204 | +---w input 205 | +---w name string 206 | +---w algorithm identityref 207 +--rw trusted-certificates* [name] 208 | +--rw name string 209 | +--rw description? string 210 | +--rw trusted-certificate* [name] 211 | +--rw name string 212 | +--rw certificate? binary 213 +--rw trusted-host-keys* [name] 214 +--rw name string 215 +--rw description? string 216 +--rw trusted-host-key* [name] 217 +--rw name string 218 +--rw host-key binary 220 notifications: 221 +---n certificate-expiration 222 +--ro certificate instance-identifier 223 +--ro expiration-date yang:date-and-time 225 2.2. Example Usage 227 The following example illustrates what a fully configured keystore 228 object might look like. The private-key shown below is consistent 229 with the generate-private-key and generate-certificate-signing- 230 request examples above. This example also assumes that the resulting 231 CA-signed certificate has been configured back onto the server. 233 Lastly, this example shows that three lists of trusted certificates 234 having been configured. 236 238 239 240 241 ex-rsa-key 242 rsa1024 243 Base64-encoded RSA Private Key 244 Base64-encoded RSA Public Key 245 246 247 ex-rsa-cert 248 Base64-encoded PKCS#7 249 250 251 253 254 tls-ec-key 255 secp256r1 256 Base64-encoded EC Private Key 257 Base64-encoded EC Public Key 258 259 260 tls-ec-cert 261 Base64-encoded PKCS#7 262 263 264 266 267 tpm-protected-key 268 rsa2048 269 Base64-encoded RSA Private Key 270 Base64-encoded RSA Public Key 271 272 273 builtin-idevid-cert 274 Base64-encoded PKCS#7 275 276 277 my-ldevid-cert 278 Base64-encoded PKCS#7 279 280 282 283 285 286 287 explicitly-trusted-client-certs 288 289 Specific client authentication certificates for explicitly 290 trusted clients. These are needed for client certificates 291 that are not signed by a trusted CA. 292 293 294 George Jetson 295 Base64-encoded X.509v3 296 297 299 300 explicitly-trusted-server-certs 301 302 Specific server authentication certificates for explicitly 303 trusted servers. These are needed for server certificates 304 that are not signed by a trusted CA. 305 306 307 Fred Flintstone 308 Base64-encoded X.509v3 309 310 312 313 314 deployment-specific-ca-certs 315 316 Trust anchors (i.e. CA certs) that are used to authenticate 317 client connections. Clients are authenticated if their 318 certificate has a chain of trust to one of these configured 319 CA certificates. 320 321 322 ca.example.com 323 Base64-encoded X.509v3 324 325 327 328 329 common-ca-certs 330 331 Trusted certificates to authenticate common HTTPS servers. 332 These certificates are similar to those that might be 333 shipped with a web browser. 334 335 336 ex-certificate-authority 337 Base64-encoded X.509v3 338 339 341 342 343 explicitly-trusted-ssh-host-keys 344 345 Trusted SSH host keys used to authenticate SSH servers. 346 These host keys would be analogous to those stored in 347 a known_hosts file in OpenSSH. 348 349 350 corp-fw1 351 Base64-encoded OneAsymmetricKey 352 353 355 357 The following example illustrates the "generate-certificate-signing- 358 request" action in use with the NETCONF protocol. 360 REQUEST 361 ------- 363 365 366 368 369 370 ex-key-sect571r1 371 372 373 cztvaWRoc2RmZ2tqaHNkZmdramRzZnZzZGtmam5idnNvO2R 374 manZvO3NkZmJpdmhzZGZpbHVidjtvc2lkZmhidml1bHNlmO 375 Z2aXNiZGZpYmhzZG87ZmJvO3NkZ25iO29pLmR6Zgo= 376 377 378 bwtakWRoc2RmZ2tqaHNkZmdramRzZnZzZGtmam5idnNvut4 379 arnZvO3NkZmJpdmhzZGZpbHVidjtvc2lkZmhidml1bHNkYm 380 Z2aXNiZGZpYmhzZG87ZmJvO3NkZ25iO29pLmC6Rhp= 381 382 383 384 385 386 387 389 RESPONSE 390 -------- 392 394 396 LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNrekNDQWZ5Z 397 0F3SUJBZ0lKQUpRT2t3bGpNK2pjTUEwR0NTcUdTSWIzRFFFQkJRVU 398 FNRFF4Q3pBSkJnTlYKQkFZVEFsVlRNUkF3RGdZRFZRUUtFd2RsZUd 399 GdGNHeGxNUk13RVFZRFZRUURFd3BEVWt3Z1NYTnpkV1Z5TUI0WApE 400 diR1V4RXpBUkJnTlZCQU1UQ2tOU1RDQkpjM04xWlhJd2daOHdEUVl 401 KS29aSWh2Y04KQVFFQkJRQURnWTBBTUlHSkFvR0JBTXVvZmFPNEV3 402 El1QWMrQ1RsTkNmc0d6cEw1Um5ydXZsOFRIcUJTdGZQY3N0Zk1KT1 403 FaNzlnNlNWVldsMldzaHE1bUViCkJNNitGNzdjbTAvU25FcFE0TnV 404 bXBDT2YKQWdNQkFBR2pnYXd3Z2Frd0hRWURWUjBPQkJZRUZKY1o2W 405 URiR0lPNDB4ajlPb3JtREdsRUNCVTFNR1FHQTFVZApJd1JkTUZ1QU 406 ZKY1o2WURiR0lPNDB4ajlPb3JtREdsRUNCVTFvVGlrTmpBME1Rc3d 407 mMKTUE0R0ExVWREd0VCL3dRRUF3SUNCREFTQmdOVkhSTUJBZjhFQ0 408 RBR0FRSC9BZ0VBTUEwR0NTcUdTSWIzRFFFQgpCUVVBQTRHQkFMMmx 409 rWmFGNWcyaGR6MVNhZnZPbnBneHA4eG00SHRhbStadHpLazFlS3Bx 410 TXp4YXJCbFpDSHlLCklVbC9GVzRtV1RQS1VDeEtFTE40NEY2Zmk2d 411 c4d0tSSElkYW1WL0pGTmlQS0VXSTF4K1I1aDZmazcrQzQ1QXg1RWV 412 SWHgzZjdVM2xZTgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== 413 414 416 The following example illustrates the "generate-private-key" action 417 in use with the RESTCONF protocol and JSON encoding. 419 REQUEST 420 ------- 422 ['\' line wrapping added for formatting only] 424 POST https://example.com/restconf/data/ietf-keystore:keystore/\ 425 keys/generate-private-key HTTP/1.1 426 HOST: example.com 427 Content-Type: application/yang.operation+json 429 { 430 "ietf-keystore:input" : { 431 "name" : "ex-key-sect571r1", 432 "algorithm" : "sect571r1" 433 } 434 } 436 RESPONSE 437 -------- 439 HTTP/1.1 204 No Content 440 Date: Mon, 31 Oct 2015 11:01:00 GMT 441 Server: example-server 443 The following example illustrates a "certificate-expiration" 444 notification in XML. 446 ['\' line wrapping added for formatting only] 448 450 2016-07-08T00:01:00Z 451 453 /ks:keystore/ks:private-keys/ks:private-key\ 454 /ks:certificate-chains/ks:certificate-chain/ks:certificate[3]\ 455 456 2016-08-08T14:18:53-05:00 457 458 460 2.3. YANG Module 462 This YANG module makes extensive use of data types defined in 463 [RFC5280] and [RFC5958]. 465 file "ietf-keystore@2017-06-13.yang" 467 module ietf-keystore { 468 yang-version 1.1; 470 namespace "urn:ietf:params:xml:ns:yang:ietf-keystore"; 471 prefix "ks"; 473 import ietf-yang-types { 474 prefix yang; 475 reference 476 "RFC 6991: Common YANG Data Types"; 477 } 479 import ietf-netconf-acm { 480 prefix nacm; 481 reference 482 "RFC 6536: Network Configuration Protocol (NETCONF) Access 483 Control Model"; 484 } 486 organization 487 "IETF NETCONF (Network Configuration) Working Group"; 489 contact 490 "WG Web: 491 WG List: 493 Author: Kent Watsen 494 "; 496 description 497 "This module defines a keystore to centralize management 498 of security credentials. 500 Copyright (c) 2014 IETF Trust and the persons identified 501 as authors of the code. All rights reserved. 503 Redistribution and use in source and binary forms, with 504 or without modification, is permitted pursuant to, and 505 subject to the license terms contained in, the Simplified 506 BSD License set forth in Section 4.c of the IETF Trust's 507 Legal Provisions Relating to IETF Documents 508 (http://trustee.ietf.org/license-info). 510 This version of this YANG module is part of RFC VVVV; see 511 the RFC itself for full legal notices."; 513 revision "2017-06-13" { 514 description 515 "Initial version"; 516 reference 517 "RFC VVVV: NETCONF Server and RESTCONF Server Configuration 518 Models"; 519 } 521 // Identities 523 identity key-algorithm { 524 description 525 "Base identity from which all key-algorithms are derived."; 526 } 528 identity rsa1024 { 529 base key-algorithm; 530 description 531 "The RSA algorithm using a 1024-bit key."; 532 reference 533 "RFC3447: Public-Key Cryptography Standards (PKCS) #1: 534 RSA Cryptography Specifications Version 2.1."; 535 } 537 identity rsa2048 { 538 base key-algorithm; 539 description 540 "The RSA algorithm using a 2048-bit key."; 541 reference 542 "RFC3447: Public-Key Cryptography Standards (PKCS) #1: 543 RSA Cryptography Specifications Version 2.1."; 544 } 546 identity rsa3072 { 547 base key-algorithm; 548 description 549 "The RSA algorithm using a 3072-bit key."; 550 reference 551 "RFC3447: Public-Key Cryptography Standards (PKCS) #1: 552 RSA Cryptography Specifications Version 2.1."; 553 } 555 identity rsa4096 { 556 base key-algorithm; 557 description 558 "The RSA algorithm using a 4096-bit key."; 559 reference 560 "RFC3447: Public-Key Cryptography Standards (PKCS) #1: 562 RSA Cryptography Specifications Version 2.1."; 563 } 565 identity rsa7680 { 566 base key-algorithm; 567 description 568 "The RSA algorithm using a 7680-bit key."; 569 reference 570 "RFC3447: Public-Key Cryptography Standards (PKCS) #1: 571 RSA Cryptography Specifications Version 2.1."; 572 } 574 identity rsa15360 { 575 base key-algorithm; 576 description 577 "The RSA algorithm using a 15360-bit key."; 578 reference 579 "RFC3447: Public-Key Cryptography Standards (PKCS) #1: 580 RSA Cryptography Specifications Version 2.1."; 581 } 583 identity secp192r1 { 584 base key-algorithm; 585 description 586 "The secp192r1 algorithm."; 587 reference 588 "RFC5480: 589 Elliptic Curve Cryptography Subject Public Key Information."; 590 } 592 identity secp256r1 { 593 base key-algorithm; 594 description 595 "The secp256r1 algorithm."; 596 reference 597 "RFC5480: 598 Elliptic Curve Cryptography Subject Public Key Information."; 599 } 601 identity secp384r1 { 602 base key-algorithm; 603 description 604 "The secp384r1 algorithm."; 605 reference 606 "RFC5480: 607 Elliptic Curve Cryptography Subject Public Key Information."; 608 } 609 identity secp521r1 { 610 base key-algorithm; 611 description 612 "The secp521r1 algorithm."; 613 reference 614 "RFC5480: 615 Elliptic Curve Cryptography Subject Public Key Information."; 616 } 618 // data model 620 container keystore { 621 nacm:default-deny-write; 622 description 623 "The keystore contains both active material (e.g., private keys 624 and passwords) and passive material (e.g., trust anchors). 626 The active material can be used to support either a server (e.g., 627 a TLS/SSH server's private) or a client (a private key used for 628 TLS/SSH client-certificate based authentication, or a password 629 used for SSH/HTTP-client authentication). 631 The passive material can be used to support either a server 632 (e.g., client certificates to trust) or clients (e.g., server 633 certificates to trust)."; 635 container keys { 636 description 637 "A list of keys maintained by the keystore."; 638 list key { 639 key name; 640 description 641 "A key maintained by the keystore."; 642 leaf name { 643 type string; 644 description 645 "An arbitrary name for the key."; 646 } 647 leaf algorithm-identifier { 648 type identityref { 649 base "key-algorithm"; 650 } 651 mandatory true; 652 description 653 "Identifies which algorithm is to be used to generate the 654 key."; 655 // no 'params' like in RFC 5912? - none are set for 656 // algs we care about, but what about the future? 658 } 659 leaf private-key { 660 nacm:default-deny-all; 661 type union { 662 type binary; 663 type enumeration { 664 enum "INACCESSIBLE" { 665 description 666 "The private key is inaccessible due to being protected 667 by a cryptographic hardware module (e.g., a TPM)."; 668 } 669 } 670 } 671 mandatory true; 672 description 673 "A binary string that contains the value of the private 674 key. The interpretation of the content is defined in the 675 registration of the key algorithm. For example, a DSA key 676 is an INTEGER, an RSA key is represented as RSAPrivateKey 677 as defined in [RFC3447], and an Elliptic Curve Cryptography 678 (ECC) key is represented as ECPrivateKey as defined in 679 [RFC5915]"; // text lifted from RFC5958 680 } 682 // no key usage (ref: RFC 5912, pg 101 -- too X.509 specific?) 684 leaf public-key { 685 type binary; 686 config false; 687 mandatory true; 688 description 689 "A binary string that contains the value of the public 690 key. The interpretation of the content is defined in the 691 registration of the key algorithm. For example, a DSA key 692 is an INTEGER, an RSA key is represented as RSAPublicKey 693 as defined in [RFC3447], and an Elliptic Curve Cryptography 694 (ECC) key is represented using the 'publicKey' described in 695 [RFC5915]"; 696 } 697 container certificates { 698 description 699 "Certificates associated with this private key. More 700 than one certificate per key is enabled to support, 701 for instance, a TPM-protected key that has associated 702 both IDevID and LDevID certificates."; 703 list certificate { 704 key name; 705 description 706 "A certificate for this private key."; 707 leaf name { 708 type string; 709 description 710 "An arbitrary name for the certificate. The name 711 must be a unique across all keys, not just within 712 this key."; 713 } 714 leaf value { 715 type binary; 716 description 717 "An unsigned PKCS #7 SignedData structure, as specified 718 by Section 9.1 in RFC 2315, containing just certificates 719 (no content, signatures, or CRLs), encoded using ASN.1 720 distinguished encoding rules (DER), as specified in 721 ITU-T X.690. 723 This structure contains, in order, the certificate 724 itself and all intermediate certificates leading up 725 to a trust anchor certificate. The certificate MAY 726 optionally include the trust anchor certificate."; 727 reference 728 "RFC 2315: 729 PKCS #7: Cryptographic Message Syntax Version 1.5. 730 ITU-T X.690: 731 Information technology - ASN.1 encoding rules: 732 Specification of Basic Encoding Rules (BER), 733 Canonical Encoding Rules (CER) and Distinguished 734 Encoding Rules (DER)."; 735 } 736 } 737 } 738 action generate-certificate-signing-request { 739 description 740 "Generates a certificate signing request structure for 741 the associated private key using the passed subject and 742 attribute values. The specified assertions need to be 743 appropriate for the certificate's use. For example, 744 an entity certificate for a TLS server SHOULD have 745 values that enable clients to satisfy RFC 6125 746 processing."; 747 input { 748 leaf subject { 749 type binary; 750 mandatory true; 751 description 752 "The 'subject' field from the CertificationRequestInfo 753 structure as specified by RFC 2986, Section 4.1 encoded 754 using the ASN.1 distinguished encoding rules (DER), as 755 specified in ITU-T X.690."; 756 reference 757 "RFC 2986: 758 PKCS #10: Certification Request Syntax Specification 759 Version 1.7. 760 ITU-T X.690: 761 Information technology - ASN.1 encoding rules: 762 Specification of Basic Encoding Rules (BER), 763 Canonical Encoding Rules (CER) and Distinguished 764 Encoding Rules (DER)."; 765 } 766 leaf attributes { 767 type binary; 768 description 769 "The 'attributes' field from the CertificationRequestInfo 770 structure as specified by RFC 2986, Section 4.1 encoded 771 using the ASN.1 distinguished encoding rules (DER), as 772 specified in ITU-T X.690."; 773 reference 774 "RFC 2986: 775 PKCS #10: Certification Request Syntax Specification 776 Version 1.7. 777 ITU-T X.690: 778 Information technology - ASN.1 encoding rules: 779 Specification of Basic Encoding Rules (BER), 780 Canonical Encoding Rules (CER) and Distinguished 781 Encoding Rules (DER)."; 782 } 783 } 784 output { 785 leaf certificate-signing-request { 786 type binary; 787 mandatory true; 788 description 789 "A CertificationRequest structure as specified by RFC 790 2986, Section 4.1 encoded using the ASN.1 distinguished 791 encoding rules (DER), as specified in ITU-T X.690."; 792 reference 793 "RFC 2986: 794 PKCS #10: Certification Request Syntax Specification 795 Version 1.7. 796 ITU-T X.690: 797 Information technology - ASN.1 encoding rules: 798 Specification of Basic Encoding Rules (BER), 799 Canonical Encoding Rules (CER) and Distinguished 800 Encoding Rules (DER)."; 802 } 803 } 804 } 805 } // end key 807 action generate-private-key { 808 description 809 "Requests the device to generate a private key using the 810 specified key algorithm. This action is primarily to 811 support cryptographic processors that MUST generate 812 the private key themselves. The resulting key is 813 considered operational state and hence initially only 814 present in the datastore, as defined in 815 [I-D.netmod-revised-datastores]."; 816 input { 817 leaf name { 818 type string; 819 mandatory true; 820 description 821 "The name this private-key should have when listed 822 in /keys/key. As such, the passed value MUST NOT 823 match any existing 'name' value."; 824 } 825 leaf algorithm { 826 type identityref { 827 base "key-algorithm"; 828 } 829 mandatory true; 830 description 831 "The algorithm to be used when generating the key."; 832 } 833 } 834 } // end generate-private-key 835 } // end keys 837 list trusted-certificates { 838 key name; 839 description 840 "A list of trusted certificates. These certificates 841 can be used by a server to authenticate clients, or by 842 clients to authenticate servers. The certificates may 843 be endpoint specific or for certificate authorities, 844 to authenticate many clients at once. Each list of 845 certificates SHOULD be specific to a purpose, as the 846 list as a whole may be referenced by other modules. 847 For instance, a NETCONF server model might point to 848 a list of certificates to use when authenticating 849 client certificates."; 851 leaf name { 852 type string; 853 description 854 "An arbitrary name for this list of trusted certificates."; 855 } 856 leaf description { 857 type string; 858 description 859 "An arbitrary description for this list of trusted 860 certificates."; 861 } 862 list trusted-certificate { 863 key name; 864 description 865 "A trusted certificate for a specific use. Note, this 866 'certificate' is a list in order to encode any 867 associated intermediate certificates."; 868 leaf name { 869 type string; 870 description 871 "An arbitrary name for this trusted certificate. Must 872 be unique across all lists of trusted certificates 873 (not just this list) so that a leafref to it from 874 another module can resolve to unique values."; 875 } 876 leaf certificate { // rename to 'data'? 877 type binary; 878 description 879 "An X.509 v3 certificate structure as specified by RFC 880 5280, Section 4 encoded using the ASN.1 distinguished 881 encoding rules (DER), as specified in ITU-T X.690."; 882 reference 883 "RFC 5280: 884 Internet X.509 Public Key Infrastructure Certificate 885 and Certificate Revocation List (CRL) Profile. 886 ITU-T X.690: 887 Information technology - ASN.1 encoding rules: 888 Specification of Basic Encoding Rules (BER), 889 Canonical Encoding Rules (CER) and Distinguished 890 Encoding Rules (DER)."; 891 } 892 } 893 } 895 list trusted-host-keys { 896 key name; 897 description 898 "A list of trusted host-keys. These host-keys can be used 899 by clients to authenticate SSH servers. The host-keys are 900 endpoint specific. Each list of host-keys SHOULD be 901 specific to a purpose, as the list as a whole may be 902 referenced by other modules. For instance, a NETCONF 903 client model might point to a list of host-keys to use 904 when authenticating servers host-keys."; 905 leaf name { 906 type string; 907 description 908 "An arbitrary name for this list of trusted SSH host keys."; 909 } 910 leaf description { 911 type string; 912 description 913 "An arbitrary description for this list of trusted SSH host 914 keys."; 915 } 916 list trusted-host-key { 917 key name; 918 description 919 "A trusted host key."; 920 leaf name { 921 type string; 922 description 923 "An arbitrary name for this trusted host-key. Must be 924 unique across all lists of trusted host-keys (not just 925 this list) so that a leafref to it from another module 926 can resolve to unique values. 928 Note that, for when the SSH client is able to listen 929 for call-home connections as well, there is no reference 930 identifier (e.g., hostname, IP address, etc.) that it 931 can use to uniquely identify the server with. The 932 call-home draft recommends SSH servers use X.509v3 933 certificates (RFC6187) when calling home."; 934 } 935 leaf host-key { // rename to 'data'? 936 type binary; 937 mandatory true; 938 description // is this the correct type? 939 "An OneAsymmetricKey 'publicKey' structure as specified 940 by RFC 5958, Section 2 encoded using the ASN.1 941 distinguished encoding rules (DER), as specified 942 in ITU-T X.690."; 943 reference 944 "RFC 5958: 945 Asymmetric Key Packages 946 ITU-T X.690: 948 Information technology - ASN.1 encoding rules: 949 Specification of Basic Encoding Rules (BER), 950 Canonical Encoding Rules (CER) and Distinguished 951 Encoding Rules (DER)."; 952 } 953 } 954 } 955 } 957 notification certificate-expiration { 958 description 959 "A notification indicating that a configured certificate is 960 either about to expire or has already expired. When to send 961 notifications is an implementation specific decision, but 962 it is RECOMMENDED that a notification be sent once a month 963 for 3 months, then once a week for four weeks, and then once 964 a day thereafter."; 965 leaf certificate { 966 type instance-identifier; 967 mandatory true; 968 description 969 "Identifies which certificate is expiring or is expired."; 970 } 971 leaf expiration-date { 972 type yang:date-and-time; 973 mandatory true; 974 description 975 "Identifies the expiration date on the certificate."; 976 } 977 } 979 } 981 983 3. Design Considerations 985 This document uses PKCS #10 [RFC2986] for the "generate-certificate- 986 signing-request" action. The use of Certificate Request Message 987 Format (CRMF) [RFC4211] was considered, but is was unclear if there 988 was market demand for it, and so support for CRMF has been left out 989 of this specification. If it is desired to support CRMF in the 990 future, placing a "choice" statement in both the input and output 991 statements, along with an "if-feature" statement on the CRMF option, 992 would enable a backwards compatible solution. 994 This document puts a limit of the number of elliptical curves 995 supported by default. This was done to match industry trends in IETF 996 best practice (e.g., matching work being done in TLS 1.3). If 997 additional algorithms are needed, they MAY be augmented in by another 998 module, or added directly in a future version of this document. 1000 For the trusted-certificates list, Trust Anchor Format [RFC5914] was 1001 evaluated and deemed inappropriate due to this document's need to 1002 also support pinning. That is, pinning a client-certificate to 1003 support NETCONF over TLS client authentication. 1005 4. Security Considerations 1007 The YANG module defined in this document is designed to be accessed 1008 via YANG based management protocols, such as NETCONF [RFC6241] and 1009 RESTCONF [RFC8040]. Both of these protocols have mandatory-to- 1010 implement secure transport layers (e.g., SSH, TLS) with mutual 1011 authentication. 1013 The NETCONF access control model (NACM) [RFC6536] provides the means 1014 to restrict access for particular users to a pre-configured subset of 1015 all available protocol operations and content. 1017 There are a number of data nodes defined in this YANG module that are 1018 writable/creatable/deletable (i.e., config true, which is the 1019 default). These data nodes may be considered sensitive or vulnerable 1020 in some network environments. Write operations (e.g., edit-config) 1021 to these data nodes without proper protection can have a negative 1022 effect on network operations. These are the subtrees and data nodes 1023 and their sensitivity/vulnerability: 1025 /: The entire data tree defined by this module is sensitive to 1026 write operations. For instance, the addition or removal of 1027 keys, certificates, trusted anchors, etc., can dramatically 1028 alter the implemented security policy. This being the case, 1029 the top-level node in this module is marked with the NACM value 1030 'default-deny-write'. 1032 /keystore/keys/key/private-key: When writing this node, 1033 implementations MUST ensure that the strength of the key being 1034 configured is not greater than the strength of the underlying 1035 secure transport connection over which it is communicated. 1036 Implementations SHOULD fail the write-request if ever the 1037 strength of the private key is greater then the strength of the 1038 underlying transport, and alert the client that the strength of 1039 the key may have been compromised. Additionally, when deleting 1040 this node, implementations SHOULD automatically (without 1041 explicit request) zeroize these keys in the most secure manner 1042 available, so as to prevent the remnants of their persisted 1043 storage locations from being analyzed in any meaningful way. 1045 Some of the readable data nodes in this YANG module may be considered 1046 sensitive or vulnerable in some network environments. It is thus 1047 important to control read access (e.g., via get, get-config, or 1048 notification) to these data nodes. These are the subtrees and data 1049 nodes and their sensitivity/vulnerability: 1051 /keystore/keys/key/private-key: This node is additionally 1052 sensitive to read operations such that, in normal use cases, it 1053 should never be returned to a client. The best reason for 1054 returning this node is to support backup/restore type 1055 workflows. This being the case, this node is marked with the 1056 NACM value 'default-deny-all'. 1058 Some of the RPC operations in this YANG module may be considered 1059 sensitive or vulnerable in some network environments. It is thus 1060 important to control access to these operations. These are the 1061 operations and their sensitivity/vulnerability: 1063 generate-certificate-signing-request: For this RPC operation, it 1064 is RECOMMENDED that implementations assert channel binding 1065 [RFC5056], so as to ensure that the application layer that sent 1066 the request is the same as the device authenticated when the 1067 secure transport layer was established. 1069 5. IANA Considerations 1071 5.1. The IETF XML Registry 1073 This document registers one URI in the IETF XML registry [RFC3688]. 1074 Following the format in [RFC3688], the following registration is 1075 requested: 1077 URI: urn:ietf:params:xml:ns:yang:ietf-keystore 1078 Registrant Contact: The NETCONF WG of the IETF. 1079 XML: N/A, the requested URI is an XML namespace. 1081 5.2. The YANG Module Names Registry 1083 This document registers one YANG module in the YANG Module Names 1084 registry [RFC6020]. Following the format in [RFC6020], the the 1085 following registration is requested: 1087 name: ietf-keystore 1088 namespace: urn:ietf:params:xml:ns:yang:ietf-keystore 1089 prefix: kc 1090 reference: RFC VVVV 1092 6. Acknowledgements 1094 The authors would like to thank for following for lively discussions 1095 on list and in the halls (ordered by last name): Andy Bierman, Martin 1096 Bjorklund, Benoit Claise, Mehmet Ersue, Balazs Kovacs, David 1097 Lamparter, Alan Luchuk, Ladislav Lhotka, Radek Krejci, Tom Petch, 1098 Juergen Schoenwaelder; Phil Shafer, Sean Turner, and Bert Wijnen. 1100 7. References 1102 7.1. Normative References 1104 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1105 Requirement Levels", BCP 14, RFC 2119, 1106 DOI 10.17487/RFC2119, March 1997, 1107 . 1109 [RFC2986] Nystrom, M. and B. Kaliski, "PKCS #10: Certification 1110 Request Syntax Specification Version 1.7", RFC 2986, 1111 DOI 10.17487/RFC2986, November 2000, 1112 . 1114 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1115 Housley, R., and W. Polk, "Internet X.509 Public Key 1116 Infrastructure Certificate and Certificate Revocation List 1117 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 1118 . 1120 [RFC5958] Turner, S., "Asymmetric Key Packages", RFC 5958, 1121 DOI 10.17487/RFC5958, August 2010, 1122 . 1124 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1125 the Network Configuration Protocol (NETCONF)", RFC 6020, 1126 DOI 10.17487/RFC6020, October 2010, 1127 . 1129 [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration 1130 Protocol (NETCONF) Access Control Model", RFC 6536, 1131 DOI 10.17487/RFC6536, March 2012, 1132 . 1134 7.2. Informative References 1136 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1137 DOI 10.17487/RFC3688, January 2004, 1138 . 1140 [RFC4211] Schaad, J., "Internet X.509 Public Key Infrastructure 1141 Certificate Request Message Format (CRMF)", RFC 4211, 1142 DOI 10.17487/RFC4211, September 2005, 1143 . 1145 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 1146 Channels", RFC 5056, DOI 10.17487/RFC5056, November 2007, 1147 . 1149 [RFC5914] Housley, R., Ashmore, S., and C. Wallace, "Trust Anchor 1150 Format", RFC 5914, DOI 10.17487/RFC5914, June 2010, 1151 . 1153 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 1154 and A. Bierman, Ed., "Network Configuration Protocol 1155 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 1156 . 1158 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 1159 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 1160 . 1162 [Std-802.1AR-2009] 1163 IEEE SA-Standards Board, "IEEE Standard for Local and 1164 metropolitan area networks - Secure Device Identity", 1165 December 2009, . 1168 Appendix A. Change Log 1170 A.1. server-model-09 to 00 1172 o This draft was split out from draft-ietf-netconf-server-model-09. 1174 o Removed key-usage parameter from generate-private-key action. 1176 o Now /private-keys/private-key/certificates/certificate/name must 1177 be globally unique (unique across all private keys). 1179 o Added top-level 'trusted-ssh-host-keys' and 'user-auth- 1180 credentials' to support SSH client modules. 1182 A.2. keychain-00 to keystore-00 1184 o Renamed module from "keychain" to "keystore" (Issue #3) 1186 A.3. 00 to 01 1188 o Replaced the 'certificate-chain' structures with PKCS#7 1189 structures. (Issue #1) 1191 o Added 'private-key' as a configurable data node, and removed the 1192 'generate-private-key' and 'load-private-key' actions. (Issue #2) 1194 o Moved 'user-auth-credentials' to the ietf-ssh-client module. 1195 (Issues #4 and #5) 1197 A.4. 01 to 02 1199 o Added back 'generate-private-key' action. 1201 o Removed 'RESTRICTED' enum from the 'private-key' leaf type. 1203 o Fixed up a few description statements. 1205 Author's Address 1207 Kent Watsen 1208 Juniper Networks 1210 EMail: kwatsen@juniper.net