Adding TestVNF netconf server
[demo.git] / vnfs / TestVNF / netconftemplates / netconftemplates / ietf-netconf-acm@2012-02-22.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-netconf-acm {
3   namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm";
4   prefix nacm;
5
6   import ietf-yang-types {
7     prefix yang;
8   }
9
10   organization
11     "IETF NETCONF (Network Configuration) Working Group";
12   contact
13     "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
14      WG List:  &lt;mailto:netconf@ietf.org&gt;
15
16      WG Chair: Mehmet Ersue
17                &lt;mailto:mehmet.ersue@nsn.com&gt;
18
19      WG Chair: Bert Wijnen
20                &lt;mailto:bertietf@bwijnen.net&gt;
21
22      Editor:   Andy Bierman
23                &lt;mailto:andy@yumaworks.com&gt;
24
25      Editor:   Martin Bjorklund
26                &lt;mailto:mbj@tail-f.com&gt;";
27   description
28     "NETCONF Access Control Model.
29
30      Copyright (c) 2012 IETF Trust and the persons identified as
31      authors of the code.  All rights reserved.
32
33      Redistribution and use in source and binary forms, with or
34      without modification, is permitted pursuant to, and subject
35      to the license terms contained in, the Simplified BSD
36      License set forth in Section 4.c of the IETF Trust's
37      Legal Provisions Relating to IETF Documents
38      (http://trustee.ietf.org/license-info).
39
40      This version of this YANG module is part of RFC 6536; see
41      the RFC itself for full legal notices.";
42
43   revision 2012-02-22 {
44     description
45       "Initial version";
46     reference
47       "RFC 6536: Network Configuration Protocol (NETCONF)
48                  Access Control Model";
49   }
50
51   extension default-deny-write {
52     description
53       "Used to indicate that the data model node
54        represents a sensitive security system parameter.
55
56        If present, and the NACM module is enabled (i.e.,
57        /nacm/enable-nacm object equals 'true'), the NETCONF server
58        will only allow the designated 'recovery session' to have
59        write access to the node.  An explicit access control rule is
60        required for all other users.
61
62        The 'default-deny-write' extension MAY appear within a data
63        definition statement.  It is ignored otherwise.";
64   }
65
66   extension default-deny-all {
67     description
68       "Used to indicate that the data model node
69        controls a very sensitive security system parameter.
70
71        If present, and the NACM module is enabled (i.e.,
72        /nacm/enable-nacm object equals 'true'), the NETCONF server
73        will only allow the designated 'recovery session' to have
74        read, write, or execute access to the node.  An explicit
75        access control rule is required for all other users.
76
77        The 'default-deny-all' extension MAY appear within a data
78        definition statement, 'rpc' statement, or 'notification'
79        statement.  It is ignored otherwise.";
80   }
81
82   typedef user-name-type {
83     type string {
84       length "1..max";
85     }
86     description
87       "General Purpose Username string.";
88   }
89
90   typedef matchall-string-type {
91     type string {
92       pattern "\\*";
93     }
94     description
95       "The string containing a single asterisk '*' is used
96        to conceptually represent all possible values
97        for the particular leaf using this data type.";
98   }
99
100   typedef access-operations-type {
101     type bits {
102       bit create {
103         description
104           "Any protocol operation that creates a
105            new data node.";
106       }
107       bit read {
108         description
109           "Any protocol operation or notification that
110            returns the value of a data node.";
111       }
112       bit update {
113         description
114           "Any protocol operation that alters an existing
115            data node.";
116       }
117       bit delete {
118         description
119           "Any protocol operation that removes a data node.";
120       }
121       bit exec {
122         description
123           "Execution access to the specified protocol operation.";
124       }
125     }
126     description
127       "NETCONF Access Operation.";
128   }
129
130   typedef group-name-type {
131     type string {
132       length "1..max";
133       pattern "[^\\*].*";
134     }
135     description
136       "Name of administrative group to which
137        users can be assigned.";
138   }
139
140   typedef action-type {
141     type enumeration {
142       enum "permit" {
143         description
144           "Requested action is permitted.";
145       }
146       enum "deny" {
147         description
148           "Requested action is denied.";
149       }
150     }
151     description
152       "Action taken by the server when a particular
153        rule matches.";
154   }
155
156   typedef node-instance-identifier {
157     type yang:xpath1.0;
158     description
159       "Path expression used to represent a special
160        data node instance identifier string.
161
162        A node-instance-identifier value is an
163        unrestricted YANG instance-identifier expression.
164        All the same rules as an instance-identifier apply
165        except predicates for keys are optional.  If a key
166        predicate is missing, then the node-instance-identifier
167        represents all possible server instances for that key.
168
169        This XPath expression is evaluated in the following context:
170
171         o  The set of namespace declarations are those in scope on
172            the leaf element where this type is used.
173
174         o  The set of variable bindings contains one variable,
175            'USER', which contains the name of the user of the current
176             session.
177
178         o  The function library is the core function library, but
179            note that due to the syntax restrictions of an
180            instance-identifier, no functions are allowed.
181
182         o  The context node is the root node in the data tree.";
183   }
184
185   container nacm {
186     nacm:default-deny-all;
187     description
188       "Parameters for NETCONF Access Control Model.";
189     leaf enable-nacm {
190       type boolean;
191       default "true";
192       description
193         "Enables or disables all NETCONF access control
194          enforcement.  If 'true', then enforcement
195          is enabled.  If 'false', then enforcement
196          is disabled.";
197     }
198
199     leaf read-default {
200       type action-type;
201       default "permit";
202       description
203         "Controls whether read access is granted if
204          no appropriate rule is found for a
205          particular read request.";
206     }
207
208     leaf write-default {
209       type action-type;
210       default "deny";
211       description
212         "Controls whether create, update, or delete access
213          is granted if no appropriate rule is found for a
214          particular write request.";
215     }
216
217     leaf exec-default {
218       type action-type;
219       default "permit";
220       description
221         "Controls whether exec access is granted if no appropriate
222          rule is found for a particular protocol operation request.";
223     }
224
225     leaf enable-external-groups {
226       type boolean;
227       default "true";
228       description
229         "Controls whether the server uses the groups reported by the
230          NETCONF transport layer when it assigns the user to a set of
231          NACM groups.  If this leaf has the value 'false', any group
232          names reported by the transport layer are ignored by the
233          server.";
234     }
235
236     leaf denied-operations {
237       type yang:zero-based-counter32;
238       config false;
239       mandatory true;
240       description
241         "Number of times since the server last restarted that a
242          protocol operation request was denied.";
243     }
244
245     leaf denied-data-writes {
246       type yang:zero-based-counter32;
247       config false;
248       mandatory true;
249       description
250         "Number of times since the server last restarted that a
251          protocol operation request to alter
252          a configuration datastore was denied.";
253     }
254
255     leaf denied-notifications {
256       type yang:zero-based-counter32;
257       config false;
258       mandatory true;
259       description
260         "Number of times since the server last restarted that
261          a notification was dropped for a subscription because
262          access to the event type was denied.";
263     }
264
265     container groups {
266       description
267         "NETCONF Access Control Groups.";
268       list group {
269         key "name";
270         description
271           "One NACM Group Entry.  This list will only contain
272            configured entries, not any entries learned from
273            any transport protocols.";
274         leaf name {
275           type group-name-type;
276           description
277             "Group name associated with this entry.";
278         }
279
280         leaf-list user-name {
281           type user-name-type;
282           description
283             "Each entry identifies the username of
284              a member of the group associated with
285              this entry.";
286         }
287       }
288     }
289
290     list rule-list {
291       key "name";
292       ordered-by user;
293       description
294         "An ordered collection of access control rules.";
295       leaf name {
296         type string {
297           length "1..max";
298         }
299         description
300           "Arbitrary name assigned to the rule-list.";
301       }
302
303       leaf-list group {
304         type union {
305           type matchall-string-type;
306           type group-name-type;
307         }
308         description
309           "List of administrative groups that will be
310            assigned the associated access rights
311            defined by the 'rule' list.
312
313            The string '*' indicates that all groups apply to the
314            entry.";
315       }
316
317       list rule {
318         key "name";
319         ordered-by user;
320         description
321           "One access control rule.
322
323            Rules are processed in user-defined order until a match is
324            found.  A rule matches if 'module-name', 'rule-type', and
325            'access-operations' match the request.  If a rule
326            matches, the 'action' leaf determines if access is granted
327            or not.";
328         leaf name {
329           type string {
330             length "1..max";
331           }
332           description
333             "Arbitrary name assigned to the rule.";
334         }
335
336         leaf module-name {
337           type union {
338             type matchall-string-type;
339             type string;
340           }
341           default "*";
342           description
343             "Name of the module associated with this rule.
344
345              This leaf matches if it has the value '*' or if the
346              object being accessed is defined in the module with the
347              specified module name.";
348         }
349
350         choice rule-type {
351           description
352             "This choice matches if all leafs present in the rule
353              match the request.  If no leafs are present, the
354              choice matches all requests.";
355           case protocol-operation {
356             leaf rpc-name {
357               type union {
358                 type matchall-string-type;
359                 type string;
360               }
361               description
362                 "This leaf matches if it has the value '*' or if
363                  its value equals the requested protocol operation
364                  name.";
365             }
366           }
367
368           case notification {
369             leaf notification-name {
370               type union {
371                 type matchall-string-type;
372                 type string;
373               }
374               description
375                 "This leaf matches if it has the value '*' or if its
376                  value equals the requested notification name.";
377             }
378           }
379
380           case data-node {
381             leaf path {
382               type node-instance-identifier;
383               mandatory true;
384               description
385                 "Data Node Instance Identifier associated with the
386                  data node controlled by this rule.
387
388                  Configuration data or state data instance
389                  identifiers start with a top-level data node.  A
390                  complete instance identifier is required for this
391                  type of path value.
392
393                  The special value '/' refers to all possible
394                  datastore contents.";
395             }
396           }
397         }
398
399         leaf access-operations {
400           type union {
401             type matchall-string-type;
402             type access-operations-type;
403           }
404           default "*";
405           description
406             "Access operations associated with this rule.
407
408              This leaf matches if it has the value '*' or if the
409              bit corresponding to the requested operation is set.";
410         }
411
412         leaf action {
413           type action-type;
414           mandatory true;
415           description
416             "The access control action associated with the
417              rule.  If a rule is determined to match a
418              particular request, then this object is used
419              to determine whether to permit or deny the
420              request.";
421         }
422
423         leaf comment {
424           type string;
425           description
426             "A textual description of the access rule.";
427         }
428       }
429     }
430   }
431 }
432 </data>
433 </rpc-reply>