summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-onap/onf14/provider/src/test/resources/currentRevision/ietf-truststore@2019-07-02.yang
blob: 103827c9e97579285b13aaf0ba0af3ca7c8ad0a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
module ietf-truststore {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-truststore";
  prefix ts;

  import ietf-netconf-acm {
    prefix nacm;
    reference
      "RFC 8341: Network Configuration Access Control Model";
  }
  import ietf-crypto-types {
    prefix ct;
    reference
      "RFC YYYY: Common YANG Data Types for Cryptography";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   <http://datatracker.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>
     Author:   Kent Watsen <mailto:kent+ietf@watsen.net>";
  description
    "This module defines a truststore to centralize management
     of trust anchors including both X.509 certificates and
     SSH host keys.

     Copyright (c) 2019 IETF Trust and the persons identified
     as authors of the code. All rights reserved.

     Redistribution and use in source and binary forms, with
     or without modification, is permitted pursuant to, and
     subject to the license terms contained in, the Simplified
     BSD License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
     itself for full legal notices.;

     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 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.";

  revision 2019-07-02 {
    description
      "Initial version";
    reference
      "RFC XXXX: A YANG Data Model for a Truststore";
  }

  feature truststore-supported {
    description
      "The 'truststore-supported' feature indicates that the
       server supports the truststore.";
  }

  feature local-definitions-supported {
    description
      "The 'local-definitions-supported' feature indicates that
       the server supports locally-defined trust anchors.";
  }

  feature x509-certificates {
    description
      "The 'x509-certificates' feature indicates that the server
       implements the /truststore/certificates subtree.";
  }

  feature ssh-host-keys {
    description
      "The 'ssh-host-keys' feature indicates that the server
       implements the /truststore/host-keys subtree.";
  }

  typedef certificates-ref {
    type leafref {
      path "/ts:truststore/ts:certificates/ts:name";
    }
    description
      "This typedef enables modules to easily define a reference
       to a set of certificates  defined in the truststore.";
  }

  typedef host-keys-ref {
    type leafref {
      path "/ts:truststore/ts:host-keys/ts:name";
    }
    description
      "This typedef enables modules to easily define a reference
       to a set of host keys defined in the truststore.";
  }

  grouping local-or-truststore-certs-grouping {
    description
      "A grouping that expands to allow trust anchors to be
       either stored locally, within the using data model, or be
       a reference to trust anchors stored in the truststore.";
    choice local-or-truststore {
      mandatory true;
      description
        "A choice between an inlined definition and a definition
         that exists in the truststore.";
      case local {
        if-feature "local-definitions-supported";
        container local-definition {
          description
            "Container to hold the local trust anchor definitions.
             A list is defined so as to be symmetric with the
             truststore definition.";
          uses ct:trust-anchor-certs-grouping;
        }
      }
      case truststore {
        if-feature "truststore-supported";
        if-feature "x509-certificates";
        leaf truststore-reference {
          type ts:certificates-ref;
          description
            "A reference to a set of trust anchors that exists
             in the truststore.";
        }
      }
    }
  }

  grouping local-or-truststore-host-keys-grouping {
    description
      "A grouping that expands to allow trust anchors to be
       either stored locally, within the using data model, or be
       a reference to trust anchors stored in the truststore.";
    choice local-or-truststore {
      mandatory true;
      description
        "A choice between an inlined definition and a definition
         that exists in the truststore.";
      case local {
        if-feature "local-definitions-supported";
        container local-definition {
          description
            "Container to hold the local trust anchor definitions.
             A list is defined so as to be symmetric with the
             truststore definition.";
          leaf-list host-key {
            nacm:default-deny-write;
            type ct:ssh-host-key;
            description
              "The binary data for this host key.";
            reference
              "RFC YYYY: Common YANG Data Types for Cryptography";
          }
          uses ct:trust-anchor-certs-grouping;
        }
      }
      case truststore {
        if-feature "truststore-supported";
        if-feature "ssh-host-keys";
        leaf truststore-reference {
          type ts:host-keys-ref;
          description
            "A reference to a set of trust anchors that exists
             in the truststore.";
        }
      }
    }
  }

  grouping truststore-grouping {
    description
      "Grouping definition enables use in other contexts.  If ever
       done, implementations SHOULD augment new 'case' statements
       into local-or-keystore 'choice' statements to supply leafrefs
       to the new location.";
    list certificates {
      if-feature "x509-certificates";
      key "name";
      description
        "A list of certificates.  These certificates can be
         used by a server to authenticate clients, or by a client
         to authenticate servers.  Each list of certificates
         SHOULD be specific to a purpose, as the list as a whole
         may be referenced by other modules.  For instance, a
         RESTCONF server's configuration might use a specific list
         of certificates for when authenticating RESTCONF
         client connections.";
      leaf name {
        type string;
        description
          "An arbitrary name for this list of certificates.";
      }
      leaf description {
        type string;
        description
          "An arbitrary description for this list of
           certificates.";
      }
      list certificate {
        key "name";
        description
          "A certificate.";
        leaf name {
          type string;
          description
            "An arbitrary name for this certificate. The
             name must be unique across all lists of
             certificates (not just this list) so that leafrefs
             from another module can resolve to unique values.";
        }
        uses ct:trust-anchor-cert-grouping {
          refine "cert" {
            mandatory true;
          }
        }
      }
    }
    list host-keys {
      if-feature "ssh-host-keys";
      key "name";
      description
        "A list of host keys.  These host-keys can
         be used by clients to authenticate SSH servers.  Each
         list of host keys SHOULD be specific to a purpose,
         so the list as a whole may be referenced by other modules.
         For instance, a NETCONF client's configuration might
         point to a specific list of host keys for when
         authenticating specific SSH servers.";
      leaf name {
        type string;
        description
          "An arbitrary name for this list of SSH
           host keys.";
      }
      leaf description {
        type string;
        description
          "An arbitrary description for this list of SSH
           host keys.";
      }
      list host-key {
        key "name";
        description
          "A host key.";
        leaf name {
          type string;
          description
            "An arbitrary name for this host-key. Must be
             unique across all lists of host-keys (not just
             this list) so that a leafref to it from another module
             can resolve to unique values.";
        }
        leaf host-key {
          type ct:ssh-host-key;
          mandatory true;
          description
            "The binary public key data for this host key.";
          reference
            "RFC YYYY: Common YANG Data Types for Cryptography";
        }
      }
    }
  }

  container truststore {
    nacm:default-deny-write;
    description
      "The truststore contains sets of X.509 certificates and
       SSH host keys.";
    uses truststore-grouping;
  }
}