Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 2 | <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 Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 6 | <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 Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 15 | <text>WG Web: <https://datatracker.ietf.org/wg/netconf/> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 16 | WG List: <mailto:netconf@ietf.org> |
| 17 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 18 | Author: Andy Bierman |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 19 | <mailto:andy@yumaworks.com> |
| 20 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 21 | Author: Martin Bjorklund |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 22 | <mailto:mbj@tail-f.com></text> |
| 23 | </contact> |
| 24 | <description> |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 25 | <text>Network Configuration Access Control Model. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 26 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 27 | Copyright (c) 2012 - 2018 IETF Trust and the persons |
| 28 | identified as authors of the code. All rights reserved. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 29 | |
| 30 | Redistribution and use in source and binary forms, with or |
| 31 | without modification, is permitted pursuant to, and subject |
| 32 | to the license terms contained in, the Simplified BSD |
| 33 | License set forth in Section 4.c of the IETF Trust's |
| 34 | Legal Provisions Relating to IETF Documents |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 35 | (https://trustee.ietf.org/license-info). |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 36 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 37 | This version of this YANG module is part of RFC 8341; see |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 38 | the RFC itself for full legal notices.</text> |
| 39 | </description> |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 40 | <revision date="2018-02-14"> |
| 41 | <description> |
| 42 | <text>Added support for YANG 1.1 actions and notifications tied to |
| 43 | data nodes. Clarified how NACM extensions can be used by |
| 44 | other data models.</text> |
| 45 | </description> |
| 46 | <reference> |
| 47 | <text>RFC 8341: Network Configuration Access Control Model</text> |
| 48 | </reference> |
| 49 | </revision> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 50 | <revision date="2012-02-22"> |
| 51 | <description> |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 52 | <text>Initial version.</text> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 53 | </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 |
| 62 | represents a sensitive security system parameter. |
| 63 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 64 | If present, the NETCONF server will only allow the designated |
| 65 | 'recovery session' to have write access to the node. An |
| 66 | explicit access control rule is required for all other users. |
| 67 | |
| 68 | If the NACM module is used, then it must be enabled (i.e., |
| 69 | /nacm/enable-nacm object equals 'true'), or this extension |
| 70 | is ignored. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 71 | |
| 72 | The 'default-deny-write' extension MAY appear within a data |
| 73 | definition 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 |
| 79 | controls a very sensitive security system parameter. |
| 80 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 81 | If present, the NETCONF server will only allow the designated |
| 82 | 'recovery session' to have read, write, or execute access to |
| 83 | the node. An explicit access control rule is required for all |
| 84 | other users. |
| 85 | |
| 86 | If the NACM module is used, then it must be enabled (i.e., |
| 87 | /nacm/enable-nacm object equals 'true'), or this extension |
| 88 | is ignored. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 89 | |
| 90 | The 'default-deny-all' extension MAY appear within a data |
| 91 | definition statement, 'rpc' statement, or 'notification' |
| 92 | statement. 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 Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 100 | <text>General-purpose username string.</text> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 101 | </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 |
| 109 | to conceptually represent all possible values |
| 110 | for 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 |
| 118 | new data node.</text> |
| 119 | </description> |
| 120 | </bit> |
| 121 | <bit name="read"> |
| 122 | <description> |
| 123 | <text>Any protocol operation or notification that |
| 124 | returns 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 |
| 130 | data 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 Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 145 | <text>Access operation.</text> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 146 | </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 |
| 155 | users 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 |
| 173 | rule 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 Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 180 | data node, action, or notification instance-identifier |
| 181 | string. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 182 | |
| 183 | A node-instance-identifier value is an |
| 184 | unrestricted YANG instance-identifier expression. |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 185 | All the same rules as an instance-identifier apply, |
| 186 | except that predicates for keys are optional. If a key |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 187 | predicate is missing, then the node-instance-identifier |
| 188 | represents all possible server instances for that key. |
| 189 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 190 | This XML Path Language (XPath) expression is evaluated in the |
| 191 | following context: |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 192 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 193 | o The set of namespace declarations are those in scope on |
| 194 | the leaf element where this type is used. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 195 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 196 | o The set of variable bindings contains one variable, |
| 197 | 'USER', which contains the name of the user of the |
| 198 | current session. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 199 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 200 | 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 Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 203 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 204 | o The context node is the root node in the data tree. |
| 205 | |
| 206 | The accessible tree includes actions and notifications tied |
| 207 | to data nodes.</text> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 208 | </description> |
| 209 | </typedef> |
| 210 | <container name="nacm"> |
| 211 | <nacm:default-deny-all/> |
| 212 | <description> |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 213 | <text>Parameters for NETCONF access control model.</text> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 214 | </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 |
| 220 | enforcement. If 'true', then enforcement |
| 221 | is enabled. If 'false', then enforcement |
| 222 | is 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 |
| 230 | no appropriate rule is found for a |
| 231 | particular 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 |
| 239 | is granted if no appropriate rule is found for a |
| 240 | particular 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 |
| 248 | rule 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 |
| 256 | NETCONF transport layer when it assigns the user to a set of |
| 257 | NACM groups. If this leaf has the value 'false', any group |
| 258 | names reported by the transport layer are ignored by the |
| 259 | server.</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 |
| 268 | protocol 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 |
| 277 | protocol operation request to alter |
| 278 | a 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 |
| 287 | a notification was dropped for a subscription because |
| 288 | access to the event type was denied.</text> |
| 289 | </description> |
| 290 | </leaf> |
| 291 | <container name="groups"> |
| 292 | <description> |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 293 | <text>NETCONF access control groups.</text> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 294 | </description> |
| 295 | <list name="group"> |
| 296 | <key value="name"/> |
| 297 | <description> |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 298 | <text>One NACM group entry. This list will only contain |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 299 | configured entries, not any entries learned from |
| 300 | any 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 |
| 312 | a member of the group associated with |
| 313 | this 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 |
| 339 | assigned the associated access rights |
| 340 | defined by the 'rule' list. |
| 341 | |
| 342 | The string '*' indicates that all groups apply to the |
| 343 | entry.</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 | |
| 352 | Rules are processed in user-defined order until a match is |
| 353 | found. A rule matches if 'module-name', 'rule-type', and |
| 354 | 'access-operations' match the request. If a rule |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 355 | matches, the 'action' leaf determines whether or not |
| 356 | access is granted.</text> |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 357 | </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 | |
| 375 | This leaf matches if it has the value '*' or if the |
| 376 | object being accessed is defined in the module with the |
| 377 | specified 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 |
| 383 | match the request. If no leafs are present, the |
| 384 | choice 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 |
| 394 | its value equals the requested protocol operation |
| 395 | name.</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 |
| 407 | value 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 Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 416 | <text>Data node instance-identifier associated with the |
| 417 | data node, action, or notification controlled by |
| 418 | this rule. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 419 | |
Michal Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 420 | Configuration data or state data |
| 421 | instance-identifiers start with a top-level |
| 422 | data node. A complete instance-identifier is |
| 423 | required for this type of path value. |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 424 | |
| 425 | The special value '/' refers to all possible |
| 426 | datastore 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 | |
| 440 | This leaf matches if it has the value '*' or if the |
| 441 | bit 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 Vasko | 583c15b | 2018-07-03 14:24:51 +0200 | [diff] [blame] | 449 | rule. If a rule has been determined to match a |
Radek Krejci | ce24ab8 | 2015-10-08 15:37:02 +0200 | [diff] [blame] | 450 | particular request, then this object is used |
| 451 | to determine whether to permit or deny the |
| 452 | request.</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> |