Adding TestVNF netconf server
[demo.git] / vnfs / TestVNF / netconftemplates / netconftemplates / ietf-keystore@2016-10-31.yang
1 <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-1">
2   <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module ietf-keystore {
3   yang-version 1.1;
4   namespace "urn:ietf:params:xml:ns:yang:ietf-keystore";
5   prefix ks;
6
7   import ietf-yang-types {
8     prefix yang;
9     reference
10       "RFC 6991: Common YANG Data Types";
11   }
12
13   organization
14     "IETF NETCONF (Network Configuration) Working Group";
15   contact
16     "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
17      WG List:  &lt;mailto:netconf@ietf.org&gt;
18
19      WG Chair: Mehmet Ersue
20                &lt;mailto:mehmet.ersue@nsn.com&gt;
21
22      WG Chair: Mahesh Jethanandani
23                &lt;mailto:mjethanandani@gmail.com&gt;
24
25      Editor:   Kent Watsen
26                &lt;mailto:kwatsen@juniper.net&gt;";
27   description
28     "This module defines a keystore to centralize management of
29      security credentials.
30
31      Copyright (c) 2014 IETF Trust and the persons identified as
32      authors of the code. All rights reserved.
33
34      Redistribution and use in source and binary forms, with or
35      without modification, is permitted pursuant to, and subject
36      to the license terms contained in, the Simplified BSD
37      License set forth in Section 4.c of the IETF Trust's
38      Legal Provisions Relating to IETF Documents
39      (http://trustee.ietf.org/license-info).
40
41      This version of this YANG module is part of RFC VVVV; see
42      the RFC itself for full legal notices.";
43
44   revision 2016-10-31 {
45     description
46       "Initial version";
47     reference
48       "RFC VVVV: NETCONF Server and RESTCONF Server Configuration
49                  Models";
50   }
51
52   identity key-algorithm {
53     description
54       "Base identity from which all key-algorithms are derived.";
55   }
56
57   identity rsa {
58     base key-algorithm;
59     description
60       "The RSA algorithm.";
61     reference
62       "RFC3447: Public-Key Cryptography Standards (PKCS) #1:
63                 RSA Cryptography Specifications Version 2.1.";
64   }
65
66   identity secp192r1 {
67     base key-algorithm;
68     description
69       "The secp192r1 algorithm.";
70     reference
71       "RFC5480:
72          Elliptic Curve Cryptography Subject Public Key Information.";
73   }
74
75   identity secp256r1 {
76     base key-algorithm;
77     description
78       "The secp256r1 algorithm.";
79     reference
80       "RFC5480:
81          Elliptic Curve Cryptography Subject Public Key Information.";
82   }
83
84   identity secp384r1 {
85     base key-algorithm;
86     description
87       "The secp384r1 algorithm.";
88     reference
89       "RFC5480:
90          Elliptic Curve Cryptography Subject Public Key Information.";
91   }
92
93   identity secp521r1 {
94     base key-algorithm;
95     description
96       "The secp521r1 algorithm.";
97     reference
98       "RFC5480:
99          Elliptic Curve Cryptography Subject Public Key Information.";
100   }
101
102   container keystore {
103     description
104       "A list of private-keys and their associated certificates, as
105        well as lists of trusted certificates for client certificate
106        authentication.  RPCs are provided to generate a new private
107        key and to generate a certificate signing requests.";
108     container private-keys {
109       description
110         "A list of private key maintained by the keystore.";
111       list private-key {
112         key "name";
113         description
114           "A private key.";
115         leaf name {
116           type string;
117           description
118             "An arbitrary name for the private key.";
119         }
120
121         leaf algorithm {
122           type identityref {
123             base key-algorithm;
124           }
125           config false;
126           description
127             "The algorithm used by the private key.";
128         }
129
130         leaf key-length {
131           type uint32;
132           config false;
133           description
134             "The key-length used by the private key.";
135         }
136
137         leaf public-key {
138           type binary;
139           config false;
140           mandatory true;
141           description
142             "An OneAsymmetricKey 'publicKey' structure as specified
143              by RFC 5958, Section 2 encoded using the ASN.1
144              distinguished encoding rules (DER), as specified
145              in ITU-T X.690.";
146           reference
147             "RFC 5958:
148                 Asymmetric Key Packages
149              ITU-T X.690:
150                 Information technology - ASN.1 encoding rules:
151                 Specification of Basic Encoding Rules (BER),
152                 Canonical Encoding Rules (CER) and Distinguished
153                 Encoding Rules (DER).";
154         }
155
156         container certificate-chains {
157           description
158             "Certificate chains associated with this private key.
159              More than one chain per key is enabled to support,
160              for instance, a TPM-protected key that has associated
161              both IDevID and LDevID certificates.";
162           list certificate-chain {
163             key "name";
164             description
165               "A certificate chain for this public key.";
166             leaf name {
167               type string;
168               description
169                 "An arbitrary name for the certificate chain.  The
170                  name must be a unique across all private keys, not
171                  just within this private key.";
172             }
173
174             leaf-list certificate {
175               type binary;
176               ordered-by user;
177               description
178                 "An X.509 v3 certificate structure as specified by RFC
179                  5280, Section 4 encoded using the ASN.1 distinguished
180                  encoding rules (DER), as specified in ITU-T X.690.
181                  The list of certificates that run from the server
182                  certificate towards the trust anchor.  The chain MAY
183                  include the trust anchor certificate itself.";
184               reference
185                 "RFC 5280:
186                    Internet X.509 Public Key Infrastructure Certificate
187                    and Certificate Revocation List (CRL) Profile.
188                  ITU-T X.690:
189                     Information technology - ASN.1 encoding rules:
190                     Specification of Basic Encoding Rules (BER),
191                     Canonical Encoding Rules (CER) and Distinguished
192                     Encoding Rules (DER).";
193             }
194           }
195         }
196
197         action generate-certificate-signing-request {
198           description
199             "Generates a certificate signing request structure for
200              the associated private key using the passed subject and
201              attribute values.  Please review both the Security
202              Considerations and Design Considerations sections in
203              RFC VVVV for more information regarding this action
204              statement.";
205           input {
206             leaf subject {
207               type binary;
208               mandatory true;
209               description
210                 "The 'subject' field from the CertificationRequestInfo
211                  structure as specified by RFC 2986, Section 4.1 encoded
212                  using the ASN.1 distinguished encoding rules (DER), as
213                  specified in ITU-T X.690.";
214               reference
215                 "RFC 2986:
216                    PKCS #10: Certification Request Syntax Specification
217                    Version 1.7.
218                  ITU-T X.690:
219                     Information technology - ASN.1 encoding rules:
220                     Specification of Basic Encoding Rules (BER),
221                     Canonical Encoding Rules (CER) and Distinguished
222                     Encoding Rules (DER).";
223             }
224
225             leaf attributes {
226               type binary;
227               description
228                 "The 'attributes' field from the CertificationRequestInfo
229                  structure as specified by RFC 2986, Section 4.1 encoded
230                  using the ASN.1 distinguished encoding rules (DER), as
231                  specified in ITU-T X.690.";
232               reference
233                 "RFC 2986:
234                    PKCS #10: Certification Request Syntax Specification
235                    Version 1.7.
236                  ITU-T X.690:
237                     Information technology - ASN.1 encoding rules:
238                     Specification of Basic Encoding Rules (BER),
239                     Canonical Encoding Rules (CER) and Distinguished
240                     Encoding Rules (DER).";
241             }
242           }
243
244           output {
245             leaf certificate-signing-request {
246               type binary;
247               mandatory true;
248               description
249                 "A CertificationRequest structure as specified by RFC
250                  2986, Section 4.1 encoded using the ASN.1 distinguished
251                  encoding rules (DER), as specified in ITU-T X.690.";
252               reference
253                 "RFC 2986:
254                    PKCS #10: Certification Request Syntax Specification
255                    Version 1.7.
256                  ITU-T X.690:
257                     Information technology - ASN.1 encoding rules:
258                     Specification of Basic Encoding Rules (BER),
259                     Canonical Encoding Rules (CER) and Distinguished
260                     Encoding Rules (DER).";
261             }
262           }
263         }
264       }
265
266       action generate-private-key {
267         description
268           "Requests the device to generate a private key using the
269            specified algorithm and key length.";
270         input {
271           leaf name {
272             type string;
273             mandatory true;
274             description
275               "The name this private-key should have when listed
276                in /keystore/private-keys.  As such, the passed
277                value must not match any existing 'name' value.";
278           }
279
280           leaf algorithm {
281             type identityref {
282               base key-algorithm;
283             }
284             mandatory true;
285             description
286               "The algorithm to be used when generating the key.";
287           }
288
289           leaf key-length {
290             type uint32;
291             description
292               "For algorithms that need a key length specified
293                when generating the key.";
294           }
295         }
296       }
297
298       action load-private-key {
299         description
300           "Requests the device to load a private key";
301         input {
302           leaf name {
303             type string;
304             mandatory true;
305             description
306               "The name this private-key should have when listed
307                in /keystore/private-keys.  As such, the passed
308                value must not match any existing 'name' value.";
309           }
310
311           leaf private-key {
312             type binary;
313             mandatory true;
314             description
315               "An OneAsymmetricKey structure as specified by RFC
316                5958, Section 2 encoded using the ASN.1 distinguished
317                encoding rules (DER), as specified in ITU-T X.690.
318                Note that this is the raw private with no shrouding
319                to protect it.  The strength of this private key
320                MUST NOT be greater than the strength of the secure
321                connection over which it is communicated.  Devices
322                SHOULD fail this request if ever that happens.";
323             reference
324               "RFC 5958:
325                   Asymmetric Key Packages
326                ITU-T X.690:
327                   Information technology - ASN.1 encoding rules:
328                   Specification of Basic Encoding Rules (BER),
329                   Canonical Encoding Rules (CER) and Distinguished
330                   Encoding Rules (DER).";
331           }
332         }
333       }
334     }
335
336     list trusted-certificates {
337       key "name";
338       description
339         "A list of trusted certificates.  These certificates
340          can be used by a server to authenticate clients, or by clients
341          to authenticate servers.  The certificates may be endpoint
342          specific or for certificate authorities (to authenticate many
343          clients at once.  Each list of certificates SHOULD be specific
344          to a purpose, as the list as a whole may be referenced by other
345          modules.  For instance, a NETCONF server model might point to
346          a list of certificates to use when authenticating client
347          certificates.";
348       leaf name {
349         type string;
350         description
351           "An arbitrary name for this list of trusted certificates.";
352       }
353
354       leaf description {
355         type string;
356         description
357           "An arbitrary description for this list of trusted
358            certificates.";
359       }
360
361       list trusted-certificate {
362         key "name";
363         description
364           "A trusted certificate for a specific use.  Note, this
365            'certificate' is a list in order to encode any
366            associated intermediate certificates.";
367         leaf name {
368           type string;
369           description
370             "An arbitrary name for this trusted certificate. Must
371              be unique across all lists of trusted certificates
372              (not just this list) so that a leafref to it from
373              another module can resolve to unique values.";
374         }
375
376         leaf certificate {
377           type binary;
378           description
379             "An X.509 v3 certificate structure as specified by RFC
380              5280, Section 4 encoded using the ASN.1 distinguished
381              encoding rules (DER), as specified in ITU-T X.690.";
382           reference
383             "RFC 5280:
384                Internet X.509 Public Key Infrastructure Certificate
385                and Certificate Revocation List (CRL) Profile.
386              ITU-T X.690:
387                 Information technology - ASN.1 encoding rules:
388                 Specification of Basic Encoding Rules (BER),
389                 Canonical Encoding Rules (CER) and Distinguished
390                 Encoding Rules (DER).";
391         }
392       }
393     }
394
395     list trusted-ssh-host-keys {
396       key "name";
397       description
398         "A list of trusted host-keys.  These host-keys can be used
399          by clients to authenticate SSH servers.  The host-keys are
400          endpoint specific.  Each list of host-keys SHOULD be
401          specific to a purpose, as the list as a whole may be
402          referenced by other modules.  For instance, a NETCONF
403          client model might point to a list of host-keys to use
404          when authenticating servers host-keys.";
405       leaf name {
406         type string;
407         description
408           "An arbitrary name for this list of trusted SSH host keys.";
409       }
410
411       leaf description {
412         type string;
413         description
414           "An arbitrary description for this list of trusted SSH host
415            keys.";
416       }
417
418       list trusted-host-key {
419         key "name";
420         description
421           "A trusted host key.";
422         leaf name {
423           type string;
424           description
425             "An arbitrary name for this trusted host-key. Must be
426              unique across all lists of trusted host-keys (not just
427              this list) so that a leafref to it from another module
428              can resolve to unique values.
429
430              Note that, for when the SSH client is able to listen
431              for call-home connections as well, there is no reference
432              identifier (e.g., hostname, IP address, etc.) that it
433              can use to uniquely identify the server with.  The
434              call-home draft recommends SSH servers use X.509v3
435              certificates (RFC6187) when calling home.";
436         }
437
438         leaf host-key {
439           type binary;
440           mandatory true;
441           description
442             "An OneAsymmetricKey 'publicKey' structure as specified
443              by RFC 5958, Section 2 encoded using the ASN.1
444              distinguished encoding rules (DER), as specified
445              in ITU-T X.690.";
446           reference
447             "RFC 5958:
448                 Asymmetric Key Packages
449              ITU-T X.690:
450                 Information technology - ASN.1 encoding rules:
451                 Specification of Basic Encoding Rules (BER),
452                 Canonical Encoding Rules (CER) and Distinguished
453                 Encoding Rules (DER).";
454         }
455       }
456     }
457
458     container user-auth-credentials {
459       description
460         "A list of user authentication credentials that can be used
461          by an SSH client to log into an SSH server, using any of
462          the supported authentication methods (e.g., password,
463          public key, client certificate, etc.).";
464       list user-auth-credential {
465         key "username";
466         description
467           "The authentication credentials for a specific user.";
468         leaf username {
469           type string;
470           description
471             "The username of this user.  This will be the username
472              used, for instance, to log into an SSH server.";
473         }
474
475         list auth-method {
476           key "priority";
477           description
478             "A method of authenticating as this user.";
479           leaf priority {
480             type uint8;
481             description
482               "When multiple authentication methods in this list are
483                supported by the server, the one with the lowest priority
484                value will be the one that is used.";
485           }
486
487           choice auth-type {
488             description
489               "The authentication type.";
490             leaf-list certificate {
491               type leafref {
492                 path "/keystore/private-keys/private-key/certificate-chains/certificate-chain/name";
493               }
494               ordered-by user;
495               description
496                 "A list of references to certificates that can be used
497                  for user authentication.  When multiple certificates
498                  in this list supported by the server, the one that
499                  comes before the others in the leaf-list will be
500                  used.";
501             }
502
503             leaf-list public-key {
504               type leafref {
505                 path "/keystore/private-keys/private-key/name";
506               }
507               ordered-by user;
508               description
509                 "A list of references to public keys that can be used
510                  for user authentication.  When multiple public keys
511                  in this list supported by the server, the one that
512                  comes before the others in the leaf-list will be
513                  used.";
514             }
515
516             leaf ciphertext-password {
517               type string;
518               description
519                 "An ciphertext password.  The method of encipherment
520                  and how that method can be determined from this
521                  string is implementation-specific.";
522             }
523
524             leaf cleartext-password {
525               type string;
526               description
527                 "An cleartext password.";
528             }
529           }
530         }
531       }
532     }
533   }
534
535   notification certificate-expiration {
536     description
537       "A notification indicating that a configured certificate is
538        either about to expire or has already expired.  When to send
539        notifications is an implementation specific decision, but
540        it is RECOMMENDED that a notification be sent once a month
541        for 3 months, then once a week for four weeks, and then once
542        a day thereafter.";
543     leaf certificate {
544       type instance-identifier;
545       mandatory true;
546       description
547         "Identifies which certificate is expiring or is expired.";
548     }
549
550     leaf expiration-date {
551       type yang:date-and-time;
552       mandatory true;
553       description
554         "Identifies the expiration date on the certificate.";
555     }
556   }
557 }
558 </data>
559 </rpc-reply>