blob: 32574065498ff6dce224888daa1f9c834087556a [file] [log] [blame]
Radek Krejcice24ab82015-10-08 15:37:02 +02001<?xml version="1.0" encoding="UTF-8"?>
Michal Vasko583c15b2018-07-03 14:24:51 +02002<module name="ietf-netconf-acm"
3 xmlns="urn:ietf:params:xml:ns:yang:yin:1"
4 xmlns:nacm="urn:ietf:params:xml:ns:yang:ietf-netconf-acm"
5 xmlns:yang="urn:ietf:params:xml:ns:yang:ietf-yang-types">
Radek Krejcice24ab82015-10-08 15:37:02 +02006 <namespace uri="urn:ietf:params:xml:ns:yang:ietf-netconf-acm"/>
7 <prefix value="nacm"/>
8 <import module="ietf-yang-types">
9 <prefix value="yang"/>
10 </import>
11 <organization>
12 <text>IETF NETCONF (Network Configuration) Working Group</text>
13 </organization>
14 <contact>
Michal Vasko583c15b2018-07-03 14:24:51 +020015 <text>WG Web: &lt;https://datatracker.ietf.org/wg/netconf/&gt;
Radek Krejcice24ab82015-10-08 15:37:02 +020016WG List: &lt;mailto:netconf@ietf.org&gt;
17
Michal Vasko583c15b2018-07-03 14:24:51 +020018Author: Andy Bierman
Radek Krejcice24ab82015-10-08 15:37:02 +020019 &lt;mailto:andy@yumaworks.com&gt;
20
Michal Vasko583c15b2018-07-03 14:24:51 +020021Author: Martin Bjorklund
Radek Krejcice24ab82015-10-08 15:37:02 +020022 &lt;mailto:mbj@tail-f.com&gt;</text>
23 </contact>
24 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +020025 <text>Network Configuration Access Control Model.
Radek Krejcice24ab82015-10-08 15:37:02 +020026
Michal Vasko583c15b2018-07-03 14:24:51 +020027Copyright (c) 2012 - 2018 IETF Trust and the persons
28identified as authors of the code. All rights reserved.
Radek Krejcice24ab82015-10-08 15:37:02 +020029
30Redistribution and use in source and binary forms, with or
31without modification, is permitted pursuant to, and subject
32to the license terms contained in, the Simplified BSD
33License set forth in Section 4.c of the IETF Trust's
34Legal Provisions Relating to IETF Documents
Michal Vasko583c15b2018-07-03 14:24:51 +020035(https://trustee.ietf.org/license-info).
Radek Krejcice24ab82015-10-08 15:37:02 +020036
Michal Vasko583c15b2018-07-03 14:24:51 +020037This version of this YANG module is part of RFC 8341; see
Radek Krejcice24ab82015-10-08 15:37:02 +020038the RFC itself for full legal notices.</text>
39 </description>
Michal Vasko583c15b2018-07-03 14:24:51 +020040 <revision date="2018-02-14">
41 <description>
42 <text>Added support for YANG 1.1 actions and notifications tied to
43data nodes. Clarified how NACM extensions can be used by
44other data models.</text>
45 </description>
46 <reference>
47 <text>RFC 8341: Network Configuration Access Control Model</text>
48 </reference>
49 </revision>
Radek Krejcice24ab82015-10-08 15:37:02 +020050 <revision date="2012-02-22">
51 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +020052 <text>Initial version.</text>
Radek Krejcice24ab82015-10-08 15:37:02 +020053 </description>
54 <reference>
55 <text>RFC 6536: Network Configuration Protocol (NETCONF)
56 Access Control Model</text>
57 </reference>
58 </revision>
59 <extension name="default-deny-write">
60 <description>
61 <text>Used to indicate that the data model node
62represents a sensitive security system parameter.
63
Michal Vasko583c15b2018-07-03 14:24:51 +020064If present, the NETCONF server will only allow the designated
65'recovery session' to have write access to the node. An
66explicit access control rule is required for all other users.
67
68If the NACM module is used, then it must be enabled (i.e.,
69/nacm/enable-nacm object equals 'true'), or this extension
70is ignored.
Radek Krejcice24ab82015-10-08 15:37:02 +020071
72The 'default-deny-write' extension MAY appear within a data
73definition statement. It is ignored otherwise.</text>
74 </description>
75 </extension>
76 <extension name="default-deny-all">
77 <description>
78 <text>Used to indicate that the data model node
79controls a very sensitive security system parameter.
80
Michal Vasko583c15b2018-07-03 14:24:51 +020081If present, the NETCONF server will only allow the designated
82'recovery session' to have read, write, or execute access to
83the node. An explicit access control rule is required for all
84other users.
85
86If the NACM module is used, then it must be enabled (i.e.,
87/nacm/enable-nacm object equals 'true'), or this extension
88is ignored.
Radek Krejcice24ab82015-10-08 15:37:02 +020089
90The 'default-deny-all' extension MAY appear within a data
91definition statement, 'rpc' statement, or 'notification'
92statement. It is ignored otherwise.</text>
93 </description>
94 </extension>
95 <typedef name="user-name-type">
96 <type name="string">
97 <length value="1..max"/>
98 </type>
99 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +0200100 <text>General-purpose username string.</text>
Radek Krejcice24ab82015-10-08 15:37:02 +0200101 </description>
102 </typedef>
103 <typedef name="matchall-string-type">
104 <type name="string">
105 <pattern value="\*"/>
106 </type>
107 <description>
108 <text>The string containing a single asterisk '*' is used
109to conceptually represent all possible values
110for the particular leaf using this data type.</text>
111 </description>
112 </typedef>
113 <typedef name="access-operations-type">
114 <type name="bits">
115 <bit name="create">
116 <description>
117 <text>Any protocol operation that creates a
118new data node.</text>
119 </description>
120 </bit>
121 <bit name="read">
122 <description>
123 <text>Any protocol operation or notification that
124returns the value of a data node.</text>
125 </description>
126 </bit>
127 <bit name="update">
128 <description>
129 <text>Any protocol operation that alters an existing
130data node.</text>
131 </description>
132 </bit>
133 <bit name="delete">
134 <description>
135 <text>Any protocol operation that removes a data node.</text>
136 </description>
137 </bit>
138 <bit name="exec">
139 <description>
140 <text>Execution access to the specified protocol operation.</text>
141 </description>
142 </bit>
143 </type>
144 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +0200145 <text>Access operation.</text>
Radek Krejcice24ab82015-10-08 15:37:02 +0200146 </description>
147 </typedef>
148 <typedef name="group-name-type">
149 <type name="string">
150 <length value="1..max"/>
151 <pattern value="[^\*].*"/>
152 </type>
153 <description>
154 <text>Name of administrative group to which
155users can be assigned.</text>
156 </description>
157 </typedef>
158 <typedef name="action-type">
159 <type name="enumeration">
160 <enum name="permit">
161 <description>
162 <text>Requested action is permitted.</text>
163 </description>
164 </enum>
165 <enum name="deny">
166 <description>
167 <text>Requested action is denied.</text>
168 </description>
169 </enum>
170 </type>
171 <description>
172 <text>Action taken by the server when a particular
173rule matches.</text>
174 </description>
175 </typedef>
176 <typedef name="node-instance-identifier">
177 <type name="yang:xpath1.0"/>
178 <description>
179 <text>Path expression used to represent a special
Michal Vasko583c15b2018-07-03 14:24:51 +0200180data node, action, or notification instance-identifier
181string.
Radek Krejcice24ab82015-10-08 15:37:02 +0200182
183A node-instance-identifier value is an
184unrestricted YANG instance-identifier expression.
Michal Vasko583c15b2018-07-03 14:24:51 +0200185All the same rules as an instance-identifier apply,
186except that predicates for keys are optional. If a key
Radek Krejcice24ab82015-10-08 15:37:02 +0200187predicate is missing, then the node-instance-identifier
188represents all possible server instances for that key.
189
Michal Vasko583c15b2018-07-03 14:24:51 +0200190This XML Path Language (XPath) expression is evaluated in the
191following context:
Radek Krejcice24ab82015-10-08 15:37:02 +0200192
Michal Vasko583c15b2018-07-03 14:24:51 +0200193 o The set of namespace declarations are those in scope on
194 the leaf element where this type is used.
Radek Krejcice24ab82015-10-08 15:37:02 +0200195
Michal Vasko583c15b2018-07-03 14:24:51 +0200196 o The set of variable bindings contains one variable,
197 'USER', which contains the name of the user of the
198 current session.
Radek Krejcice24ab82015-10-08 15:37:02 +0200199
Michal Vasko583c15b2018-07-03 14:24:51 +0200200 o The function library is the core function library, but
201 note that due to the syntax restrictions of an
202 instance-identifier, no functions are allowed.
Radek Krejcice24ab82015-10-08 15:37:02 +0200203
Michal Vasko583c15b2018-07-03 14:24:51 +0200204 o The context node is the root node in the data tree.
205
206The accessible tree includes actions and notifications tied
207to data nodes.</text>
Radek Krejcice24ab82015-10-08 15:37:02 +0200208 </description>
209 </typedef>
210 <container name="nacm">
211 <nacm:default-deny-all/>
212 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +0200213 <text>Parameters for NETCONF access control model.</text>
Radek Krejcice24ab82015-10-08 15:37:02 +0200214 </description>
215 <leaf name="enable-nacm">
216 <type name="boolean"/>
217 <default value="true"/>
218 <description>
219 <text>Enables or disables all NETCONF access control
220enforcement. If 'true', then enforcement
221is enabled. If 'false', then enforcement
222is disabled.</text>
223 </description>
224 </leaf>
225 <leaf name="read-default">
226 <type name="action-type"/>
227 <default value="permit"/>
228 <description>
229 <text>Controls whether read access is granted if
230no appropriate rule is found for a
231particular read request.</text>
232 </description>
233 </leaf>
234 <leaf name="write-default">
235 <type name="action-type"/>
236 <default value="deny"/>
237 <description>
238 <text>Controls whether create, update, or delete access
239is granted if no appropriate rule is found for a
240particular write request.</text>
241 </description>
242 </leaf>
243 <leaf name="exec-default">
244 <type name="action-type"/>
245 <default value="permit"/>
246 <description>
247 <text>Controls whether exec access is granted if no appropriate
248rule is found for a particular protocol operation request.</text>
249 </description>
250 </leaf>
251 <leaf name="enable-external-groups">
252 <type name="boolean"/>
253 <default value="true"/>
254 <description>
255 <text>Controls whether the server uses the groups reported by the
256NETCONF transport layer when it assigns the user to a set of
257NACM groups. If this leaf has the value 'false', any group
258names reported by the transport layer are ignored by the
259server.</text>
260 </description>
261 </leaf>
262 <leaf name="denied-operations">
263 <type name="yang:zero-based-counter32"/>
264 <config value="false"/>
265 <mandatory value="true"/>
266 <description>
267 <text>Number of times since the server last restarted that a
268protocol operation request was denied.</text>
269 </description>
270 </leaf>
271 <leaf name="denied-data-writes">
272 <type name="yang:zero-based-counter32"/>
273 <config value="false"/>
274 <mandatory value="true"/>
275 <description>
276 <text>Number of times since the server last restarted that a
277protocol operation request to alter
278a configuration datastore was denied.</text>
279 </description>
280 </leaf>
281 <leaf name="denied-notifications">
282 <type name="yang:zero-based-counter32"/>
283 <config value="false"/>
284 <mandatory value="true"/>
285 <description>
286 <text>Number of times since the server last restarted that
287a notification was dropped for a subscription because
288access to the event type was denied.</text>
289 </description>
290 </leaf>
291 <container name="groups">
292 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +0200293 <text>NETCONF access control groups.</text>
Radek Krejcice24ab82015-10-08 15:37:02 +0200294 </description>
295 <list name="group">
296 <key value="name"/>
297 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +0200298 <text>One NACM group entry. This list will only contain
Radek Krejcice24ab82015-10-08 15:37:02 +0200299configured entries, not any entries learned from
300any transport protocols.</text>
301 </description>
302 <leaf name="name">
303 <type name="group-name-type"/>
304 <description>
305 <text>Group name associated with this entry.</text>
306 </description>
307 </leaf>
308 <leaf-list name="user-name">
309 <type name="user-name-type"/>
310 <description>
311 <text>Each entry identifies the username of
312a member of the group associated with
313this entry.</text>
314 </description>
315 </leaf-list>
316 </list>
317 </container>
318 <list name="rule-list">
319 <key value="name"/>
320 <ordered-by value="user"/>
321 <description>
322 <text>An ordered collection of access control rules.</text>
323 </description>
324 <leaf name="name">
325 <type name="string">
326 <length value="1..max"/>
327 </type>
328 <description>
329 <text>Arbitrary name assigned to the rule-list.</text>
330 </description>
331 </leaf>
332 <leaf-list name="group">
333 <type name="union">
334 <type name="matchall-string-type"/>
335 <type name="group-name-type"/>
336 </type>
337 <description>
338 <text>List of administrative groups that will be
339assigned the associated access rights
340defined by the 'rule' list.
341
342The string '*' indicates that all groups apply to the
343entry.</text>
344 </description>
345 </leaf-list>
346 <list name="rule">
347 <key value="name"/>
348 <ordered-by value="user"/>
349 <description>
350 <text>One access control rule.
351
352Rules are processed in user-defined order until a match is
353found. A rule matches if 'module-name', 'rule-type', and
354'access-operations' match the request. If a rule
Michal Vasko583c15b2018-07-03 14:24:51 +0200355matches, the 'action' leaf determines whether or not
356access is granted.</text>
Radek Krejcice24ab82015-10-08 15:37:02 +0200357 </description>
358 <leaf name="name">
359 <type name="string">
360 <length value="1..max"/>
361 </type>
362 <description>
363 <text>Arbitrary name assigned to the rule.</text>
364 </description>
365 </leaf>
366 <leaf name="module-name">
367 <type name="union">
368 <type name="matchall-string-type"/>
369 <type name="string"/>
370 </type>
371 <default value="*"/>
372 <description>
373 <text>Name of the module associated with this rule.
374
375This leaf matches if it has the value '*' or if the
376object being accessed is defined in the module with the
377specified module name.</text>
378 </description>
379 </leaf>
380 <choice name="rule-type">
381 <description>
382 <text>This choice matches if all leafs present in the rule
383match the request. If no leafs are present, the
384choice matches all requests.</text>
385 </description>
386 <case name="protocol-operation">
387 <leaf name="rpc-name">
388 <type name="union">
389 <type name="matchall-string-type"/>
390 <type name="string"/>
391 </type>
392 <description>
393 <text>This leaf matches if it has the value '*' or if
394its value equals the requested protocol operation
395name.</text>
396 </description>
397 </leaf>
398 </case>
399 <case name="notification">
400 <leaf name="notification-name">
401 <type name="union">
402 <type name="matchall-string-type"/>
403 <type name="string"/>
404 </type>
405 <description>
406 <text>This leaf matches if it has the value '*' or if its
407value equals the requested notification name.</text>
408 </description>
409 </leaf>
410 </case>
411 <case name="data-node">
412 <leaf name="path">
413 <type name="node-instance-identifier"/>
414 <mandatory value="true"/>
415 <description>
Michal Vasko583c15b2018-07-03 14:24:51 +0200416 <text>Data node instance-identifier associated with the
417data node, action, or notification controlled by
418this rule.
Radek Krejcice24ab82015-10-08 15:37:02 +0200419
Michal Vasko583c15b2018-07-03 14:24:51 +0200420Configuration data or state data
421instance-identifiers start with a top-level
422data node. A complete instance-identifier is
423required for this type of path value.
Radek Krejcice24ab82015-10-08 15:37:02 +0200424
425The special value '/' refers to all possible
426datastore contents.</text>
427 </description>
428 </leaf>
429 </case>
430 </choice>
431 <leaf name="access-operations">
432 <type name="union">
433 <type name="matchall-string-type"/>
434 <type name="access-operations-type"/>
435 </type>
436 <default value="*"/>
437 <description>
438 <text>Access operations associated with this rule.
439
440This leaf matches if it has the value '*' or if the
441bit corresponding to the requested operation is set.</text>
442 </description>
443 </leaf>
444 <leaf name="action">
445 <type name="action-type"/>
446 <mandatory value="true"/>
447 <description>
448 <text>The access control action associated with the
Michal Vasko583c15b2018-07-03 14:24:51 +0200449rule. If a rule has been determined to match a
Radek Krejcice24ab82015-10-08 15:37:02 +0200450particular request, then this object is used
451to determine whether to permit or deny the
452request.</text>
453 </description>
454 </leaf>
455 <leaf name="comment">
456 <type name="string"/>
457 <description>
458 <text>A textual description of the access rule.</text>
459 </description>
460 </leaf>
461 </list>
462 </list>
463 </container>
464</module>