RFC 6536
Network Configuration Protocol (NETCONF) Access Control Model
RFC 6536: Network Configuration Protocol (NETCONF) Access Control Model π
Bestie, here's the header info: this is an IETF doc from March 2012 (ISSN 2070-1721). It's a Standards Track document, so it's an actual official spec π . The authors are A. Bierman (YumaWorks) and M. Bjorklund (Tail-f Systems). The title block doesn't list any RFCs that it obsoletes or updates, so nothing is being replaced or patched here πΈ.
Abstract β¨
okay so the whole point is that standardizing network configuration interfaces for NETCONF needs a structured, secure environment that normal humans can actually use and that different vendors can work together on π«Ά. We also need standard ways to lock a particular user down to a pre-set subset of NETCONF protocol operations and content. This doc defines exactly that access control model π.
Status of This Memo π¦
this is an Internet Standards Track document π.
it's a product of the Internet Engineering Task Force (IETF) and represents the consensus of the IETF community. it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). more info on Internet Standards is in Section 2 of RFC 5741 π.
for the current status, any errata, and how to give feedback, check http://www.rfc-editor.org/info/rfc6536 π§.
Copyright Notice π
Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved.
this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication. please read these carefully, because they spell out your rights and restrictions for this document π. code components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License π.
Table of Contents ποΈ
1. Introduction ....................................................3
1.1. Terminology ................................................3
2. Access Control Design Objectives ................................4
2.1. Access Control Points ......................................5
2.2. Simplicity .................................................5
2.3. Procedural Interface .......................................6
2.4. Datastore Access ...........................................6
2.5. Users and Groups ...........................................6
2.6. Maintenance ................................................6
2.7. Configuration Capabilities .................................7
2.8. Identifying Security-Sensitive Content .....................7
3. NETCONF Access Control Model (NACM) .............................8
3.1. Introduction ...............................................8
3.1.1. Features ............................................8
3.1.2. External Dependencies ...............................9
3.1.3. Message Processing Model ............................9
3.2. Datastore Access ..........................................11
3.2.1. Access Rights ......................................11
3.2.2. <get> and <get-config> Operations ..................12
3.2.3. <edit-config> Operation ............................12
3.2.4. <copy-config> Operation ............................13
3.2.5. <delete-config> Operation ..........................14
3.2.6. <commit> Operation .................................14
3.2.7. <discard-changes> Operation ........................14
3.2.8. <kill-session> Operation ...........................14
3.3. Model Components ..........................................15
3.3.1. Users ..............................................15
3.3.2. Groups .............................................15
3.3.3. Emergency Recovery Session .........................15
3.3.4. Global Enforcement Controls ........................15
3.3.4.1. enable-nacm Switch ........................15
3.3.4.2. read-default Switch .......................16
3.3.4.3. write-default Switch ......................16
3.3.4.4. exec-default Switch .......................16
3.3.4.5. enable-external-groups Switch .............17
3.3.5. Access Control Rules ...............................17
3.4. Access Control Enforcement Procedures .....................17
3.4.1. Initial Operation ..................................17
3.4.2. Session Establishment ..............................18
3.4.3. "access-denied" Error Handling .....................18
3.4.4. Incoming RPC Message Validation ....................18
3.4.5. Data Node Access Validation ........................21
3.4.6. Outgoing <notification> Authorization ..............23
3.5. Data Model Definitions ....................................26
3.5.1. Data Organization ..................................26
3.5.2. YANG Module ........................................26
3.6. IANA Considerations .......................................36
3.7. Security Considerations ...................................36
3.7.1. NACM Configuration and Monitoring Considerations ...37
3.7.2. General Configuration Issues .......................38
3.7.3. Data Model Design Considerations ...................40
4. References .....................................................40
4.1. Normative References ......................................40
4.2. Informative References ....................................41
Appendix A. Usage Examples .......................................42
A.1. <groups> Example ..........................................42
A.2. Module Rule Example .......................................43
A.3. Protocol Operation Rule Example ...........................44
A.4. Data Node Rule Example ....................................46
A.5. Notification Rule Example .................................48
1. Introduction β¨
okay so NETCONF doesn't come with any standard way to restrict which protocol operations and content each user is allowed to touch π. that's a real gap.
we need interoperable management of controlled access to the parts of NETCONF content that an administrator picks, inside one particular server π§.
this doc covers access control for the Operations and Content layers of NETCONF, as defined in [RFC6241] π. it has three main sections:
- Access Control Design Objectives
- NETCONF Access Control Model (NACM)
- YANG Data Model (ietf-netconf-acm.yang)
1.1. Terminology π
the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be read as described in [RFC2119] π .
these terms are defined in [RFC6241] and aren't redefined here:
- client
- datastore
- protocol operation
- server
- session
- user
these terms are defined in [RFC6020] and also aren't redefined here:
- data node
- data definition statement
these terms get used all throughout the doc:
access control: a security feature from the NETCONF server that lets an administrator restrict access to a subset of all NETCONF protocol operations and data, based on various criteria π.
access control model (ACM): a conceptual model used to configure and monitor the access control procedures the administrator wants, so a particular access control policy gets enforced π.
access control rule: the criterion used to decide whether a particular NETCONF protocol operation gets permitted or denied π¦.
access operation: how a request tries to access a conceptual object. it's one of "none", "read", "create", "delete", "update", or "execute" πΈ.
recovery session: a special administrative session that gets unlimited NETCONF access and is exempt from all access control enforcement π. the mechanism(s) a server uses to control and identify whether a session is a recovery session are implementation specific and outside the scope of this document π.
write access: shorthand for the "create", "delete", and "update" access operations π.
2. Access Control Design Objectives π
this section lays out the design objectives for the NETCONF Access Control Model presented in Section 3 π―.
2.1. Access Control Points π
NETCONF lets new protocol operations get added at any time, and the YANG Data Modeling Language supports that π. so it isn't possible to design an ACM for NETCONF that only focuses on a static set of protocol operations, unlike some other protocols do. since few assumptions can be made about an arbitrary protocol operation, the NETCONF architectural server components need protecting at three conceptual control points π‘οΈ.
these access control points are described in Figure 1 and go like this:
protocol operation: permission to invoke specific protocol operations β¨.
datastore: permission to read and/or alter specific data nodes within any datastore π¦.
notification: permission to receive specific notification event types π.
+-------------+ +-------------+
client | protocol | | data node |
request --> | operation | -------------> | access |
| allowed? | datastore | allowed? |
+-------------+ or state +-------------+
data access
+----------------+
| notification |
event --> | allowed? |
+----------------+
Figure 1
2.2. Simplicity π«§
there's concern that a complicated ACM won't get widely deployed because it's too hard to use π©. so it needs to be easy to do simple things and possible to do complex things, instead of hard to do everything π.
configuring the access control system needs to be as simple as possible. simple and common tasks need to be easy to configure and should require little expertise or domain-specific knowledge. complex tasks are possible using additional mechanisms, which may require extra expertise π§ .
a single set of access control rules ought to be able to control all types of NETCONF protocol operation invocation, all datastore access, and all notification events πͺ.
access control ought to be defined with a small and familiar set of permissions, while still allowing full control of NETCONF datastore access π.
2.3. Procedural Interface π§
the NETCONF protocol uses a remote procedure call model and an extensible set of protocol operations. access control for any possible protocol operation is necessary π.
2.4. Datastore Access ποΈ
it's necessary to control access to specific nodes and subtrees within the NETCONF datastore, no matter which protocol operation was used to access the datastore, whether it's standard or proprietary π π.
2.5. Users and Groups
Okay so bestie, we need to be able to set up access control rules for one specific user OR for a configurable group of users. Both have to work π
The ACM needs administrative groups π so it can keep the classic split between a root account and the less-privileged user accounts. The administrator is the one who configures these groups.
It's necessary that the user-to-group mapping can be handed off to a central server, like a RADIUS server [RFC2865][RFC5607]. Here's the tea: authentication happens in the NETCONF transport layer, but RADIUS does authentication and service authorization at the same time. So the underlying NETCONF transport needs to be able to report a set of group names associated with the user to that server. The administrator also has to be able to turn off the use of these group names within the ACM π
2.6. Maintenance
It ought to be possible to disable part or all of the access control model enforcement procedures without deleting any access control rules π§
2.7. Configuration Capabilities
Suitable configuration and monitoring mechanisms are needed so the admin can easily manage every aspect of the ACM's behavior π A standard data model is also needed for this, one that works with the <edit-config> protocol operation.
Access control rules that restrict access operations on specific subtrees within the configuration datastore need to be supported too β¨
2.8. Identifying Security-Sensitive Content
Okay, this one is SO important. Identifying security-sensitive content is one of the most important parts of the data model documentation, and it's one of the biggest concerns during deployment π This applies to protocol operations in NETCONF, not just to data and notifications.
It is mandatory for security-sensitive objects to be documented in the Security Considerations section of an RFC. This is nice, but it is not good enough, and here's why:
- This documentation-only approach forces administrators to study the RFC and figure out whether a new data model introduces any potential security risks. π
- If any security risks are identified, the administrator then has to study even more RFC text and work out how to mitigate them.
- The ACM on each server must be configured to mitigate the security risks, for example by requiring privileged access to read or write the specific data identified in the Security Considerations section.
- If the ACM is not pre-configured, there will be a window of vulnerability after the new data model is loaded and before the new access control rules for that data model are configured, enabled, and debugged. Not it. π ββοΈ
Often, the administrator just wants to disable default access to the secure content, so no inadvertent or malicious changes can be made to the server. This lets the default rules be more lenient without significantly increasing the security risk π¦
A data model designer needs to be able to use machine-readable statements to identify NETCONF content that needs to be protected by default. This lets client and server tools automatically identify data-model-specific security risks by denying access to sensitive data unless the user is explicitly authorized to perform the requested access operation. Iconic design, honestly π
3. NETCONF Access Control Model (NACM) π
3.1. Introduction
This section gives a high-level overview of the access control model structure. It describes the NETCONF protocol message processing model and the conceptual access control requirements within that model π
3.1.1. Features
The NACM data model gives you these features, and they are giving main character energy:
- Independent control of remote procedure call (RPC), data, and notification access. π
- A simple access control rules configuration data model that is easy to use.
- The concept of an emergency recovery session is supported, but configuring the server for this purpose is beyond the scope of this document. An emergency recovery session bypasses all access control enforcement, so it can initialize or repair the NACM configuration π
- A simple and familiar set of datastore permissions.
- Support for YANG security tagging (for example, the
"nacm:default-deny-write"statement) lets default security modes automatically exclude sensitive data π - Separate default access modes for read, write, and execute permissions.
- Access control rules are applied to configurable groups of users π«Ά
- The access control enforcement procedures can be disabled during operation, without deleting any access control rules, so you can debug operational problems π§
- Access control rules are simple to configure. β¨
- The number of denied protocol operation requests and denied datastore write requests can be monitored by the client π
- Simple unconstrained YANG instance identifiers are used to configure access control rules for specific data nodes π¦
3.1.2. External Dependencies
The NETCONF protocol [RFC6241] is used for all management purposes within this document π§
The YANG Data Modeling Language [RFC6020] is used to define the NETCONF data models specified in this document π
3.1.3. Message Processing Model
Here's the conceptual message flow model, showing the points where access control gets applied during NETCONF message processing. Look at all those boxes π₯Ή
+-------------------------+
| session |
| (username) |
+-------------------------+
| ^
V |
+--------------+ +---------------+
| message | | message |
| dispatcher | | generator |
+--------------+ +---------------+
| ^ ^
V | |
+===========+ +-------------+ +----------------+
| <rpc> |---> | <rpc-reply> | | <notification> |
| acc. ctl | | generator | | generator |
+===========+ +-------------+ +----------------+
| ^ ^ ^
V +------+ | |
+-----------+ | +=============+ +================+
| <rpc> | | | read | | <notification> |
| processor |-+ | data node | | access ctl |
| | | acc. ctl | | |
+-----------+ +=============+ +================+
| | ^ ^
V +----------------+ | |
+===========+ | | |
| write | | | |
| data node | | | |
| acc. ctl | -----------+ | | |
+===========+ | | | |
| | | | |
V V V | |
+---------------+ +-----------------+
| configuration | ---> | server |
| datastore | | instrumentation |
| | <--- | |
+---------------+ +-----------------+
Figure 2
Here's the high-level sequence of conceptual processing steps that runs for each received <rpc> message, if access control enforcement is enabled:
- For each active session, access control is applied individually to all
<rpc>messages (except<close-session>) received by the server, unless the session is identified as a recovery session. π - If the user is authorized to execute the specified protocol operation, processing continues. Otherwise, the request is rejected with an
"access-denied"error. π« - If the configuration datastore or conceptual state data is accessed by the protocol operation, the server checks whether the client is authorized to access the nodes in the datastore. If the user is authorized to perform the requested access operation on the requested data, processing continues. π
The following sequence of conceptual processing steps runs for each generated notification event, if access control enforcement is enabled:
- Server instrumentation generates a notification for a particular subscription. π
- The notification access control enforcer checks the notification event type. If the user is not authorized to read it, the notification is dropped for that subscription. π
3.2. Datastore Access
The same access control rules apply to all datastores, for example the candidate configuration datastore or the running configuration datastore. No favorites here π
Only the standard NETCONF datastores (candidate, running, and startup) are controlled by NACM. Local or remote files or datastores accessed via the <url> parameter are not controlled by NACM π
3.2.1. Access Rights
A small set of hard-wired datastore access rights is needed to control access to all possible NETCONF protocol operations, including vendor extensions to the standard protocol operation set. Small but mighty πͺ
The "CRUDX" model can support all NETCONF protocol operations:
- Create: allows the client to add a new data node instance to a datastore. π±
- Read: allows the client to read a data node instance from a datastore or receive the notification event type. π
- Update: allows the client to update an existing data node instance in a datastore. βοΈ
- Delete: allows the client to delete a data node instance from a datastore. ποΈ
- eXec: allows the client to execute the protocol operation. β‘
3.2.2. <get> and <get-config> Operations
Data nodes the client doesn't have read access to are silently omitted from the <rpc-reply> message. This is done so NETCONF filters for <get> and <get-config> work properly, instead of causing an "access-denied" error because the filter criteria would otherwise include unauthorized read access to some data nodes π₯Ί For NETCONF filtering purposes, the selection criteria is applied to the subset of nodes the user is authorized to read, not the entire datastore. Filters only see what you're allowed to see, periodt π
3.2.3. <edit-config> Operation β¨
Okay so, NACM access rights aren't directly tied to the <edit-config> "operation" attribute, even though they're kinda similar π
. Instead, an access right covers every protocol operation that would end up doing a particular access operation on the target datastore. This section breaks down how those rights apply to each access operation that <edit-config> supports π¦.
If the effective access operation is "none" (aka default-operation="none") for a data node, then no access control is applied to that node. This is needed so you can reach a subtree inside a bigger structure πΈ. For example, a user might be allowed to create a new "/interfaces/interface" list entry but not allowed to create or delete its parent container ("/interfaces"). If "/interfaces" already exists in the target datastore, then the effective operation for the "/interfaces" node is "none" whenever an "/interfaces/interface" list entry gets edited.
If the protocol operation would create a datastore node and the user doesn't have "create" access permission for that node, the protocol operation gets rejected with an "access-denied" error β.
If the protocol operation would delete a datastore node and the user doesn't have "delete" access permission for that node, the protocol operation gets rejected with an "access-denied" error β.
If the protocol operation would modify a datastore node and the user doesn't have "update" access permission for that node, the protocol operation gets rejected with an "access-denied" error β.
A "merge" or "replace" <edit-config> operation can include data nodes that don't actually change anything in the existing datastore. Like, a container or list node might just be there for naming purposes and doesn't alter its matching datastore node at all π§. These unaltered data nodes get ignored by the server and don't need any access rights from the client π«Ά.
A "merge" <edit-config> operation can also leave out particular child data nodes that are sitting in the datastore. Those missing nodes, within the scope of the "merge" <edit-config> operation, get ignored by the server and don't need any access rights from the client either π.
The contents of specific restricted datastore nodes MUST NOT be exposed in any <rpc-error> elements within the reply. π
3.2.4. <copy-config> Operation π
Access control for the <copy-config> protocol operation needs special thinking, because the administrator might be replacing the entire target datastore π.
If the source of the <copy-config> protocol operation is the running configuration datastore and the target is the startup configuration datastore, then the client only needs permission to execute the <copy-config> protocol operation β¨.
Otherwise:
- If the source of the
<copy-config>operation is a datastore, then data nodes the client doesn't have read access to get silently omitted π. - If the target of the
<copy-config>operation is a datastore, the client needs access to the modified nodes, specifically:- If the protocol operation would create a datastore node and the user doesn't have "create" access permission for that node, the protocol operation gets rejected with an "access-denied" error β.
- If the protocol operation would delete a datastore node and the user doesn't have "delete" access permission for that node, the protocol operation gets rejected with an "access-denied" error β.
- If the protocol operation would modify a datastore node and the user doesn't have "update" access permission for that node, the protocol operation gets rejected with an "access-denied" error β.
3.2.5. <delete-config> Operation π«
Access to the <delete-config> protocol operation is denied by default π. The "exec-default" leaf doesn't apply to this protocol operation. Access control rules must be explicitly configured to allow invocation by a non-recovery session π
.
3.2.6. <commit> Operation π₯
The server MUST figure out the exact nodes in the running configuration datastore that are actually different, and then only check "create", "update", and "delete" access permissions for that set of nodes. That set could be empty π« .
For example, if a session can read the entire datastore but can only change one leaf, that session needs to be able to edit and commit that one leaf π.
3.2.7. <discard-changes> Operation π§Ή
The client only needs permission to execute the <discard-changes> protocol operation. No datastore permissions are needed π.
3.2.8. <kill-session> Operation π
The <kill-session> operation doesn't directly alter a datastore. However, it lets one session disrupt another session that's editing a datastore π¬.
Access to the <kill-session> protocol operation is denied by default π. The "exec-default" leaf doesn't apply to this protocol operation. Access control rules must be explicitly configured to allow invocation by a non-recovery session π.
3.3. Model Components π§©
This section defines the conceptual components related to the access control model β¨.
3.3.1. Users π©βπ»
A "user" is the conceptual entity that's associated with the access permissions granted to a particular session. A user is identified by a string that's unique within the server πͺͺ.
As described in [RFC6241], the username string is derived from the transport layer during session establishment. If the transport layer can't authenticate the user, the session gets terminated πͺ.
3.3.2. Groups π―
Access to a specific NETCONF protocol operation is granted to a session that's associated with a group, not a user π«Ά.
A group is identified by its name. All group names are unique within the server π·οΈ.
A group member is identified by a username string π§Έ.
The same user can be a member of multiple groups πΈ.
3.3.3. Emergency Recovery Session π
The server MAY support a recovery session mechanism, which bypasses all access control enforcement. This is useful for restricting initial access and repairing a broken access control configuration π οΈ.
3.3.4. Global Enforcement Controls ποΈ
There are five global controls that help control how access control gets enforced π.
3.3.4.1. enable-nacm Switch π
A global "enable-nacm" on/off switch is provided to enable or disable all access control enforcement. When this global switch is set to "true", then all requests are checked against the access control rules and only permitted if they're configured to allow that specific access request β . When this global switch is set to "false", then all access requested is permitted π·.
3.3.4.2. read-default Switch π
An on/off "read-default" switch is provided to enable or disable default access to receive data in replies and notifications. When the "enable-nacm" global switch is set to "true", then this global switch matters if no matching access control rule is found to explicitly permit or deny read access to the requested NETCONF datastore data or notification event type π€.
When this global switch is set to "permit" and no matching access control rule is found for the NETCONF datastore read or notification event requested, then access is permitted β .
When this global switch is set to "deny" and no matching access control rule is found for the NETCONF datastore read or notification event requested, then access is denied β.
3.3.4.3. write-default Switch βοΈ
An on/off "write-default" switch is provided to enable or disable default access to alter configuration data. When the "enable-nacm" global switch is set to "true", then this global switch matters if no matching access control rule is found to explicitly permit or deny write access to the requested NETCONF datastore data π .
When this global switch is set to "permit" and no matching access control rule is found for the NETCONF datastore write requested, then access is permitted β .
When this global switch is set to "deny" and no matching access control rule is found for the NETCONF datastore write requested, then access is denied β.
3.3.4.4. exec-default Switch β‘
An on/off "exec-default" switch is provided to enable or disable default access to execute protocol operations. When the "enable-nacm" global switch is set to "true", then this global switch matters if no matching access control rule is found to explicitly permit or deny access to the requested NETCONF protocol operation π―.
When this global switch is set to "permit" and no matching access control rule is found for the NETCONF protocol operation requested, then access is permitted β .
When this global switch is set to "deny" and no matching access control rule is found for the NETCONF protocol operation requested, then access is denied β.
3.3.4.5. enable-external-groups Switch π
When this global switch is set to "true", the group names reported by the NETCONF transport layer for a session are used together with the locally configured group names to determine the access control rules for that session π€.
When this switch is set to "false", the group names reported by the NETCONF transport layer are ignored by NACM π ββοΈ.
3.3.5. Access Control Rules π
There are four types of rules available in NACM π«:
- module rule: controls access for definitions in a specific YANG module, identified by its name π¦.
- protocol operation rule: controls access for a specific protocol operation, identified by its YANG module and name ποΈ.
- data node rule: controls access for a specific data node, identified by its path location within the conceptual XML document for the data node πΊοΈ.
- notification rule: controls access for a specific notification event type, identified by its YANG module and name π.
3.4. Access Control Enforcement Procedures π¦
There are seven separate phases that need to be addressed. Four of them are related to the NETCONF message processing model (Section 3.1.3) π§ . On top of that, the initial startup mode for a NETCONF server, session establishment, and "access-denied" error-handling procedures also need to be considered π«£.
The server MUST use the access control rules in effect at the time it starts processing the message. The same access control rules MUST stay in effect for the processing of the entire message πβ¨.
3.4.1. Initial Operation π
Upon the very first startup of the NETCONF server, the access control configuration will probably not be present. If it isn't, a server MUST NOT allow any write access to any session role except a recovery session π‘οΈ.
Access rules are enforced any time a request is initiated from a user session πββοΈ. Access control is not enforced for server-initiated access requests, such as the initial load of the running datastore during bootup π₯Ύ.
3.4.2. Session Establishment β¨
okay so the access control model only applies to the well-formed XML that gets passed between a client and a server AFTER session establishment is done AND the <hello> exchange has been successfully completed π°οΈ timing is everything bestie π
once session establishment is finished and a user has been authenticated, the NETCONF transport layer tells the NETCONF server the username plus a possibly empty set of group names for that user π«Ά then the server enforces the access control rules based on that username, those group names, and the configuration data stored on the server. it's giving teamwork π§
3.4.3. "access-denied" Error Handling π
the access-denied error-tag shows up whenever the access control system says no, either to a request to invoke a protocol operation or to a request to do a particular access operation on the configuration datastore. the vibe is "not today, sweetie" π
A server MUST NOT include any information the client is not allowed to read in any <error-info> elements within the <rpc-error> response. this one is serious, so no leaking secrets in your error messages, periodt π
3.4.4. Incoming RPC Message Validation π¦
here's the diagram of the basic structure of the access control processing model for incoming NETCONF <rpc> messages inside a server. it's giving flowchart energy π
NETCONF server
+------------+
| XML |
| message |
| dispatcher |
+------------+
|
|
V
+------------+
| NC-base NS |
| <rpc> |
+------------+
| | |
| | +-------------------------+
| +------------+ |
V V V
+-----------+ +---------------+ +------------+
| Vendor NS | | NC-base NS | | NC-base NS |
| <my-edit> | | <edit-config> | | <unlock> |
+-----------+ +---------------+ +------------+
| |
| |
V V
+----------------------+
| |
| configuration |
| datastore |
+----------------------+
Figure 3
access control starts at the message dispatcher π
once the server validates the <rpc> element and works out the namespace URI and the element name of the protocol operation being requested, it checks that the user is authorized to invoke that operation π
The server MUST separately authorize every protocol operation by following these steps: π
- if the
enable-nacmleaf is set tofalse, the protocol operation is permitted. no checks, go wild πΈ - if the requesting session is identified as a recovery session, the protocol operation is permitted. recovery sessions have main character energy π
- if the requested operation is the NETCONF
<close-session>protocol operation, the protocol operation is permitted. you can always say goodbye π«Ά - check all the
groupentries for ones that contain auser-nameentry that equals the username for the session making the request. if theenable-external-groupsleaf istrue, add to these groups the set of groups provided by the transport layer. collecting the squad π§ - if no groups are found, continue with step 10. no squad, no cap π
- process all rule-list entries, in the order they appear in the configuration. if a rule-list's
groupleaf-list does not match any of the user's groups, move on to the next rule-list entry. π - for each rule-list entry found, process all rules, in order, until a rule that matches the requested access operation is found. a rule matches if all of the following criteria are met:
- the rule's
module-nameleaf is*or equals the name of the YANG module where the protocol operation is defined. - the rule does not have a
rule-typedefined, or therule-typeisprotocol-operationand therpc-nameis*or equals the name of the requested protocol operation. - the rule's
access-operationsleaf has theexecbit set or has the special value*.
- the rule's
- if a matching rule is found, the
actionleaf is checked. if it is equal topermit, the protocol operation is permitted; otherwise, it is denied. the rule decides, full stop π - at this point, no matching rule was found in any rule-list entry. plot twist π
- if the requested protocol operation is defined in a YANG module advertised in the server capabilities and the
rpcstatement contains anacm:default-deny-allstatement, the protocol operation is denied. the default-deny is lowkey strict π - if the requested protocol operation is the NETCONF
<kill-session>or<delete-config>, the protocol operation is denied. these two are protected, no exceptions π - if the
exec-defaultleaf is set topermit, permit the protocol operation; otherwise, deny the request. the final fallback decides the vibe π
if the user is not authorized to invoke the protocol operation, an <rpc-error> gets generated with the following information:
error-tag: access-denied
error-path: identifies the requested protocol operation. the example below represents the <edit-config> protocol operation in the NETCONF base namespace:
<error-path
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
/nc:rpc/nc:edit-config
</error-path>
if a datastore gets accessed, either directly or as a side effect of the protocol operation, the server has to intercept that access. the server MUST intercept the access operation and make sure the user is authorized to perform the requested access operation on the specified data, as defined in Section 3.4.5. no sneaking past the bouncer π«
3.4.5. Data Node Access Validation πΈ
if a data node inside a datastore gets accessed, the server MUST ensure that the user is authorized to perform the requested "read", "create", "update", or "delete" access operation on that data node. every single one gets checked π«Ά
the data node access request is authorized by following these steps: π
- if the
enable-nacmleaf is set tofalse, the access operation is permitted. easy pass π¦ - if the requesting session is identified as a recovery session, the access operation is permitted. recovery sessions are iconic π
- check all the
groupentries for ones that contain auser-nameentry that equals the username for the session making the request. if theenable-external-groupsleaf istrue, add to these groups the set of groups provided by the transport layer. squad assembly time π§ - if no groups are found, continue with step 9. solo mode π
- process all rule-list entries, in the order they appear in the configuration. if a rule-list's
groupleaf-list does not match any of the user's groups, move on to the next rule-list entry. π - for each rule-list entry found, process all rules, in order, until a rule that matches the requested access operation is found. a rule matches if all of the following criteria are met:
- the rule's
module-nameleaf is*or equals the name of the YANG module where the requested data node is defined. - the rule does not have a
rule-typedefined, or therule-typeisdata-nodeand thepathmatches the requested data node. - for a "read" access operation, the rule's
access-operationsleaf has thereadbit set or has the special value*. - for a "create" access operation, the rule's
access-operationsleaf has thecreatebit set or has the special value*. - for a "delete" access operation, the rule's
access-operationsleaf has thedeletebit set or has the special value*. - for an "update" access operation, the rule's
access-operationsleaf has theupdatebit set or has the special value*.
- the rule's
- if a matching rule is found, the
actionleaf is checked. if it is equal topermit, the data node access is permitted; otherwise, it is denied. for a "read" access operation, "denied" means the requested data is not returned in the reply. no data for you π - at this point, no matching rule was found in any rule-list entry. the rules are silent, so the fallbacks take over π
- for a "read" access operation, if the requested data node is defined in a YANG module advertised in the server capabilities and the data definition statement contains a
nacm:default-deny-allstatement, the requested data node is not included in the reply. hidden from the reply, bestie π - for a "write" access operation, if the requested data node is defined in a YANG module advertised in the server capabilities and the data definition statement contains a
nacm:default-deny-writeor anacm:default-deny-allstatement, the data node access request is denied. no writing allowed here π - for a "read" access operation, if the
read-defaultleaf is set topermit, include the requested data node in the reply; otherwise, do not include it in the reply. the read-default decides who gets seen π - for a "write" access operation, if the
write-defaultleaf is set topermit, permit the data node access request; otherwise, deny the request. and that's the whole write-default tea β
π that's the whole access control enforcement for incoming messages and data nodes, and the next part picks up from here π
3.4.6. Outgoing <notification> Authorization π
okay so, access control rules for the child nodes inside a notification event type element are out of scope for this doc π ββοΈ. the logic is simple though: if the user is allowed to get a notification event type, they're automatically allowed to get whatever data is inside it π
here's the conceptual message processing model for outgoing <notification> messages, bestie π§
NETCONF server
+------------+
| XML |
| message |
| generator |
+------------+
^
|
+----------------+
| <notification> |
| generator |
+----------------+
^
|
+=================+
| <notification> |
| access control |
| <eventType> |
+=================+
^
|
+------------------------+
| server instrumentation |
+------------------------+
| ^
V |
+----------------------+
| configuration |
| datastore |
+----------------------+
Figure 4
okay, now the main event π generating a notification for a specific subscription [RFC5277] goes through these steps:
- if the
enable-nacmleaf is set tofalse, the notification is permitted β¨ - if the session is identified as a recovery session, the notification is permitted π«Ά
- if the notification is the NETCONF
<replayComplete>or<notificationComplete>event type [RFC5277], the notification is permitted πΈ - check all the
groupentries for ones that contain auser-nameentry that equals the username for the session making the request. if theenable-external-groupsleaf istrue, add to these groups the set of groups provided by the transport layer π - if no groups are found, continue with step 10 π
- process all rule-list entries, in the order they appear in the configuration. if a rule-list's
groupleaf-list does not match any of the user's groups, proceed to the next rule-list entry π - for each rule-list entry found, process all rules, in order, until a rule that matches the requested access operation is found. a rule matches if all of the following criteria are met:
- the rule's
module-nameleaf is*or equals the name of the YANG module where the notification is defined π¦ - the rule does not have a
rule-typedefined, or therule-typeisnotificationand thenotification-nameis*and equals the name of the notification π - the rule's
access-operationsleaf has thereadbit set or has the special value*π
- the rule's
- if a matching rule is found, then the
actionleaf is checked. if it is equal topermit, permit the notification; otherwise, drop the notification for the associated subscription π₯ - otherwise, no matching rule was found in any rule-list entry π
- if the requested notification is defined in a YANG module advertised in the server capabilities and the
notificationstatement contains anacm:default-deny-allstatement, then the notification is dropped for the associated subscription π - if the
read-defaultleaf is set topermit, permit the notification; otherwise, drop the notification for the associated subscription π
3.5. Data Model Definitions π§
3.5.1. Data Organization ποΈ
this diagram shows you the whole vibe and structure of the NACM YANG module, iykyk π¦
+--rw nacm
+--rw enable-nacm? boolean
+--rw read-default? action-type
+--rw write-default? action-type
+--rw exec-default? action-type
+--rw enable-external-groups? boolean
+--ro denied-operations yang:zero-based-counter32
+--ro denied-data-writes yang:zero-based-counter32
+--ro denied-notifications yang:zero-based-counter32
+--rw groups
| +--rw group [name]
| +--rw name group-name-type
| +--rw user-name* user-name-type
+--rw rule-list [name]
+--rw name string
+--rw group* union
+--rw rule [name]
+--rw name string
+--rw module-name? union
+--rw (rule-type)?
| +--:(protocol-operation)
| | +--rw rpc-name? union
| +--:(notification)
| | +--rw notification-name? union
| +--:(data-node)
| +--rw path node-instance-identifier
+--rw access-operations? union
+--rw action action-type
+--rw comment? string
3.5.2. YANG Module π
this next bit is the normative NETCONF content, which means the server MUST by supported β¨ (yes, the RFC literally says "MUST by", not "MUST be". I'm not fixing it, I'm just quoting it π )
the ietf-netconf-acm YANG module imports typedefs from [RFC6021] π·
<CODE BEGINS> file "ietf-netconf-acm@2012-02-22.yang"
module ietf-netconf-acm {
namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm";
prefix "nacm";
import ietf-yang-types {
prefix yang;
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>
WG Chair: Mehmet Ersue
<mailto:mehmet.ersue@nsn.com>
WG Chair: Bert Wijnen
<mailto:bertietf@bwijnen.net>
Editor: Andy Bierman
<mailto:andy@yumaworks.com>
Editor: Martin Bjorklund
<mailto:mbj@tail-f.com>";
description
"NETCONF Access Control Model.
Copyright (c) 2012 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
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC 6536; see
the RFC itself for full legal notices.";
revision "2012-02-22" {
description
"Initial version";
reference
"RFC 6536: Network Configuration Protocol (NETCONF)
Access Control Model";
}
/*
* Extension statements
*/
extension default-deny-write {
description
"Used to indicate that the data model node
represents a sensitive security system parameter.
If present, and the NACM module is enabled (i.e.,
/nacm/enable-nacm object equals 'true'), the NETCONF server
will only allow the designated 'recovery session' to have
write access to the node. An explicit access control rule is
required for all other users.
The 'default-deny-write' extension MAY appear within a data
definition statement. It is ignored otherwise.";
}
extension default-deny-all {
description
"Used to indicate that the data model node
controls a very sensitive security system parameter.
If present, and the NACM module is enabled (i.e.,
/nacm/enable-nacm object equals 'true'), the NETCONF server
will only allow the designated 'recovery session' to have
read, write, or execute access to the node. An explicit
access control rule is required for all other users.
The 'default-deny-all' extension MAY appear within a data
definition statement, 'rpc' statement, or 'notification'
statement. It is ignored otherwise.";
}
/*
* Derived types
*/
typedef user-name-type {
type string {
length "1..max";
}
description
"General Purpose Username string.";
}
typedef matchall-string-type {
type string {
pattern "\*";
}
description
"The string containing a single asterisk '*' is used
to conceptually represent all possible values
for the particular leaf using this data type.";
}
typedef access-operations-type {
type bits {
bit create {
description
"Any protocol operation that creates a
new data node.";
}
bit read {
description
"Any protocol operation or notification that
returns the value of a data node.";
}
bit update {
description
"Any protocol operation that alters an existing
data node.";
}
bit delete {
description
"Any protocol operation that removes a data node.";
}
bit exec {
description
"Execution access to the specified protocol operation.";
}
}
description
"NETCONF Access Operation.";
}
typedef group-name-type {
type string {
length "1..max";
pattern "[^\*].*";
}
description
"Name of administrative group to which
users can be assigned.";
}
typedef action-type {
type enumeration {
enum permit {
description
"Requested action is permitted.";
}
enum deny {
description
"Requested action is denied.";
}
}
description
"Action taken by the server when a particular
rule matches.";
}
typedef node-instance-identifier {
type yang:xpath1.0;
description
"Path expression used to represent a special
data node instance identifier string.
A node-instance-identifier value is an
unrestricted YANG instance-identifier expression.
All the same rules as an instance-identifier apply
except predicates for keys are optional. If a key
predicate is missing, then the node-instance-identifier
represents all possible server instances for that key.
This XPath expression is evaluated in the following context:
o The set of namespace declarations are those in scope on
the leaf element where this type is used.
o The set of variable bindings contains one variable,
'USER', which contains the name of the user of the current
session.
o The function library is the core function library, but
note that due to the syntax restrictions of an
instance-identifier, no functions are allowed.
o The context node is the root node in the data tree.";
}
/*
* Data definition statements
*/
container nacm {
nacm:default-deny-all;
description
"Parameters for NETCONF Access Control Model.";
leaf enable-nacm {
type boolean;
default true;
description
"Enables or disables all NETCONF access control
enforcement. If 'true', then enforcement
is enabled. If 'false', then enforcement
is disabled.";
}
leaf read-default {
type action-type;
default "permit";
description
"Controls whether read access is granted if
no appropriate rule is found for a
particular read request.";
}
leaf write-default {
type action-type;
default "deny";
description
"Controls whether create, update, or delete access
is granted if no appropriate rule is found for a
particular write request.";
}
leaf exec-default {
type action-type;
default "permit";
description
"Controls whether exec access is granted if no appropriate
rule is found for a particular protocol operation request.";
}
leaf enable-external-groups {
type boolean;
default true;
description
"Controls whether the server uses the groups reported by the
NETCONF transport layer when it assigns the user to a set of
NACM groups. If this leaf has the value 'false', any group
names reported by the transport layer are ignored by the
server.";
}
leaf denied-operations {
type yang:zero-based-counter32;
config false;
mandatory true;
description
"Number of times since the server last restarted that a
protocol operation request was denied.";
}
leaf denied-data-writes {
type yang:zero-based-counter32;
config false;
mandatory true;
description
"Number of times since the server last restarted that a
protocol operation request to alter
a configuration datastore was denied.";
}
leaf denied-notifications {
type yang:zero-based-counter32;
config false;
mandatory true;
description
"Number of times since the server last restarted that
a notification was dropped for a subscription because
access to the event type was denied.";
}
container groups {
description
"NETCONF Access Control Groups.";
list group {
key name;
description
"One NACM Group Entry. This list will only contain
configured entries, not any entries learned from
any transport protocols.";
leaf name {
type group-name-type;
description
"Group name associated with this entry.";
}
leaf-list user-name {
type user-name-type;
description
"Each entry identifies the username of
a member of the group associated with
this entry.";
}
}
}
list rule-list {
key "name";
ordered-by user;
description
"An ordered collection of access control rules.";
leaf name {
type string {
length "1..max";
}
description
"Arbitrary name assigned to the rule-list.";
}
leaf-list group {
type union {
type matchall-string-type;
type group-name-type;
}
description
"List of administrative groups that will be
assigned the associated access rights
defined by the 'rule' list.
The string '*' indicates that all groups apply to the
entry.";
}
list rule {
key "name";
ordered-by user;
description
"One access control rule.
Rules are processed in user-defined order until a match is
found. A rule matches if 'module-name', 'rule-type', and
'access-operations' match the request. If a rule
matches, the 'action' leaf determines if access is granted
or not.";
leaf name {
type string {
length "1..max";
}
description
"Arbitrary name assigned to the rule.";
}
leaf module-name {
type union {
type matchall-string-type;
type string;
}
default "*";
description
"Name of the module associated with this rule.
This leaf matches if it has the value '*' or if the
object being accessed is defined in the module with the
specified module name.";
}
choice rule-type {
description
"This choice matches if all leafs present in the rule
match the request. If no leafs are present, the
choice matches all requests.";
case protocol-operation {
leaf rpc-name {
type union {
type matchall-string-type;
type string;
}
description
"This leaf matches if it has the value '*' or if
its value equals the requested protocol operation
name.";
}
}
case notification {
leaf notification-name {
type union {
type matchall-string-type;
type string;
}
description
"This leaf matches if it has the value '*' or if its
value equals the requested notification name.";
}
}
case data-node {
leaf path {
type node-instance-identifier;
mandatory true;
description
"Data Node Instance Identifier associated with the
data node controlled by this rule.
Configuration data or state data instance
identifiers start with a top-level data node. A
complete instance identifier is required for this
type of path value.
The special value '/' refers to all possible
datastore contents.";
}
}
}
leaf access-operations {
type union {
type matchall-string-type;
type access-operations-type;
}
default "*";
description
"Access operations associated with this rule.
This leaf matches if it has the value '*' or if the
bit corresponding to the requested operation is set.";
}
leaf action {
type action-type;
mandatory true;
description
"The access control action associated with the
rule. If a rule is determined to match a
particular request, then this object is used
to determine whether to permit or deny the
request.";
}
leaf comment {
type string;
description
"A textual description of the access rule.";
}
}
}
}
}
<CODE ENDS>
3.6. IANA Considerations π
okay so this section is where IANA gets its homework π this document registers one URI in "The IETF XML Registry" π and it follows the format in [RFC3688], so the entry looks like this:
URI: urn:ietf:params:xml:ns:yang:ietf-netconf-acm
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.
it also registers one module in the "YANG Module Names" registry π¦ following the format in [RFC6020], and that entry is:
Name: ietf-netconf-acm
Namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-acm
Prefix: nacm
reference: RFC 6536
the module is literally named ietf-netconf-acm, and the reference points right back at RFC 6536 πΈ so everything lines up, bestie π«Ά
3.7. Security Considerations π₯
okay this part is serious, so let's go π₯Ή this entire document is about access control requirements and mechanisms for restricting NETCONF protocol behavior within a given session. this section is the checklist for admins who are setting up a NETCONF server with NACM π
3.7.1. NACM Configuration and Monitoring Considerations π
configuring the access control system is highly sensitive to system security π a server might decide not to let anyone configure certain parts of it, like the global security level or the groups that get access to system resources. no cap, that's a whole vibe of "some things are off limits" π
by default, NACM enforcement is enabled π by default, "read" access to all datastore contents is also enabled (unless "nacm:default-deny-all" is specified for the data definition), and "exec" access is enabled for safe protocol operations β¨ so an admin needs to make sure NACM is enabled and also decide whether those default access parameters are set right π make sure these data nodes are properly configured:
/nacm/enable-nacm(default "true")/nacm/read-default(default "permit")/nacm/write-default(default "deny")/nacm/exec-default(default "permit")
an admin also needs to restrict write access to all configurable objects in this data model π« like, lock it down bestie π
if write access is allowed for configuring access control rules, then care needs to be taken not to disrupt the access control enforcement π§ for example, if the NACM access control rules are edited directly within the running configuration datastore (i.e., :writable-running capability is supported and used), then care needs to be taken not to allow unintended access while the edits are being done. it's giving "don't accidentally open the door while you're redecorating" πͺπ
an admin needs to make sure that the translation from a transport- or implementation-dependent user identity to a NACM username is unique and correct π this requirement is specified in detail in Section 2.2 of [RFC6241] π
an admin also needs to be aware that the YANG data structures representing access control rules (/nacm/rule-list and /nacm/rule-list/rule) are ordered by the client π¦ the server will evaluate the access control rules according to their relative conceptual order within the running datastore configuration. so the order really really matters, iykyk π
the /nacm/groups data structure contains the administrative group names used by the server β those group names may be configured locally and/or provided through an external protocol, such as RADIUS [RFC2865][RFC5607]. main character energy, but also a potential trust issue π
an admin needs to be aware of the security properties of any external protocol that the NETCONF transport layer uses to figure out group names π for example, if that protocol doesn't protect against man-in-the-middle attacks, an attacker might be able to inject group names that are configured in NACM, so that a user gets more permissions than they should π± in those cases, the administrator may wish to disable the usage of such group names by setting /nacm/enable-external-groups to "false" π thank you for coming to my TED talk on not letting strangers hand out VIP passes ποΈ
finally, an admin needs to restrict read access to the following objects within this data model, since they reveal access control configuration that could be considered sensitive π«£
/nacm/enable-nacm/nacm/read-default/nacm/write-default/nacm/exec-default/nacm/enable-external-groups/nacm/groups/nacm/rule-list
3.7.2. General Configuration Issues β οΈπ
okay bestie, this one is important π there's a risk that calling non-standard protocol operations will have undocumented side effects π so an administrator needs to write access control rules that keep the configuration datastore safe from those surprise side effects π‘οΈ
it's also possible for a session that has some write access (say it's allowed to invoke <edit-config>) but has zero access to a certain datastore subtree full of sensitive data to figure out whether that data exists π it can do this by spamming edit requests (create, update, or delete) and maybe getting access-denied errors back. these "fishing" attacks can reveal whether specific sensitive data is present or absent, even when the error-path field isn't in the <rpc-error> response π£ not me being impressed by how sneaky that is π
the set of NETCONF capabilities on a server might change over time π if that happens, new protocol operations, notifications, and/or datastore content could have shown up on the device. so the administrator has to make sure the access control rules are still correct for that new stuff. figuring out how to detect NETCONF capability changes on a particular device is outside the scope of this document π
the data model definition itself (like a YANG when-stmt) might help an unauthorized session work out whether sensitive data nodes exist, or even what their values are, just by checking the presence and values of other data nodes π§© lowkey sneaky!!
there's also a risk that non-standard protocol operations, or even the standard <get> protocol operation, could return data that "aliases" or "copies" sensitive data from a different data object πͺ there might be multiple data model definitions that expose, or even configure, the same underlying system instrumentation. main character energy for the wrong reasons π€
a data model can contain external keys (like a YANG leafref) that expose values from a different data structure π admins need to know about sensitive data models that have leafref nodes. that means finding every leafref object that "points" at the sensitive data (meaning the path-stmt values that implicitly or explicitly include the sensitive data node) β¨
it's out of scope for this document to define access control enforcement procedures for the underlying device instrumentation that might exist to support NETCONF server operation π§° an administrator can identify each protocol operation the server provides and then decide whether it needs any access control applied to it π
this document includes the optional use of a recovery session mechanism. it can be used to bypass access control enforcement in emergencies, like NACM configuration errors that cut off all access to the server π how the recovery session mechanism is configured and identified is implementation-specific and outside the scope of this document. an administrator needs to know about any recovery session mechanisms available on the device and make sure they get used appropriately π«Ά
a session can disrupt configuration management even without any write access to the configuration, simply by locking the datastore π this might be done to keep all or part of the configuration stable while it's being retrieved, or it might be a "denial-of-service" attack. the server has no way of knowing which one it is π an administrator may want to restrict exec access to the following protocol operations:
<lock><unlock><partial-lock><partial-unlock>
3.7.3. Data Model Design Considerations π§
designers need to clearly identify any sensitive data, notifications, or protocol operations defined within a YANG module π for those definitions, a nacm:default-deny-write or nacm:default-deny-all statement ought to be present, along with a clear description of the security risks. no skipping this part, bestie π
protocol operations need to be properly documented by the data model designer, so administrators can tell which data nodes (if any) get affected by the protocol operation, and what information (if any) comes back in the <rpc-reply> message π
data models ought to be designed so that different access levels for input parameters to protocol operations aren't needed π ββοΈ using generic protocol operations should be avoided. if different access levels are needed, separate protocol operations should be defined instead β¨
4. References π
4.1. Normative References π
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.
- [RFC5277] Chisholm, S. and H. Trevino, "NETCONF Event Notifications", RFC 5277, July 2008.
- [RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, October 2010.
- [RFC6021] Schoenwaelder, J., "Common YANG Data Types", RFC 6021, October 2010.
- [RFC6241] Enns, R., Bjorklund, M., Schoenwaelder, J., and A. Bierman, "Network Configuration Protocol (NETCONF)", RFC 6241, June 2011.
4.2. Informative References πΈ
- [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, "Remote Authentication Dial In User Service (RADIUS)", RFC 2865, June 2000.
- [RFC5607] Nelson, D. and G. Weber, "Remote Authentication Dial-In User Service (RADIUS) Authorization for Network Access Server (NAS) Management", RFC 5607, July 2009.
Appendix A. Usage Examples π
the following XML snippets are just examples π§ they show how NACM can be configured to handle some access control tasks.
A.1. <groups> Example π―
there needs to be at least one <group> entry for any of the access control rules to be useful π
the XML below shows arbitrary groups and isn't meant to represent any particular use case β¨
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<groups>
<group>
<name>admin</name>
<user-name>admin</user-name>
<user-name>andy</user-name>
</group>
<group>
<name>limited</name>
<user-name>wilma</user-name>
<user-name>bam-bam</user-name>
</group>
<group>
<name>guest</name>
<user-name>guest</user-name>
<user-name>guest@example.com</user-name>
</group>
</groups>
</nacm>
this example has three groups π
- admin: the "admin" group has two users, "admin" and "andy" π
- limited: the "limited" group has two users, "wilma" and "bam-bam" π·
- guest: the "guest" group has two users, "guest" and "guest@example.com" π¦
A.2. Module Rule Example π
module rules control access to all the content defined in a specific module π¦ a module rule has the <module-name> leaf set, but no case in the "rule-type" choice.
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<rule-list>
<name>guest-acl</name>
<group>guest</group>
<rule>
<name>deny-ncm</name>
<module-name>ietf-netconf-monitoring</module-name>
<access-operations>*</access-operations>
<action>deny</action>
<comment>
Do not allow guests any access to the NETCONF
monitoring information.
</comment>
</rule>
</rule-list>
<rule-list>
<name>limited-acl</name>
<group>limited</group>
<rule>
<name>permit-ncm</name>
<module-name>ietf-netconf-monitoring</module-name>
<access-operations>read</access-operations>
<action>permit</action>
<comment>
Allow read access to the NETCONF
monitoring information.
</comment>
</rule>
<rule>
<name>permit-exec</name>
<module-name>*</module-name>
<access-operations>exec</access-operations>
<action>permit</action>
<comment>
Allow invocation of the
supported server operations.
</comment>
</rule>
</rule-list>
<rule-list>
<name>admin-acl</name>
<group>admin</group>
<rule>
<name>permit-all</name>
<module-name>*</module-name>
<access-operations>*</access-operations>
<action>permit</action>
<comment>
Allow the admin group complete access to all
operations and data.
</comment>
</rule>
</rule-list>
</nacm>
this example has four module rules π₯
- deny-ncm: this rule stops the "guest" group from reading any monitoring info in the "ietf-netconf-monitoring" YANG module π ββοΈ
- permit-ncm: this rule lets the "limited" group read the "ietf-netconf-monitoring" YANG module π
- permit-exec: this rule lets the "limited" group invoke any protocol operation the server supports π
- permit-all: this rule gives the "admin" group complete access to all content on the server π no later rule will match for the "admin" group because of this module rule, so it's the end of the line for them π
A.3. Protocol Operation Rule Example π§ββοΈ
protocol operation rules control access to one specific protocol operation π―
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<rule-list>
<name>guest-limited-acl</name>
<group>limited</group>
<group>guest</group>
<rule>
<name>deny-kill-session</name>
<module-name>ietf-netconf</module-name>
<rpc-name>kill-session</rpc-name>
<access-operations>exec</access-operations>
<action>deny</action>
<comment>
Do not allow the limited or guest group
to kill another session.
</comment>
</rule>
<rule>
<name>deny-delete-config</name>
<module-name>ietf-netconf</module-name>
<rpc-name>delete-config</rpc-name>
<access-operations>exec</access-operations>
<action>deny</action>
<comment>
Do not allow limited or guest group
to delete any configurations.
</comment>
</rule>
</rule-list>
<rule-list>
<name>limited-acl</name>
<group>limited</group>
<rule>
<name>permit-edit-config</name>
<module-name>ietf-netconf</module-name>
<rpc-name>edit-config</rpc-name>
<access-operations>exec</access-operations>
<action>permit</action>
<comment>
Allow the limited group to edit the configuration.
</comment>
</rule>
</rule-list>
</nacm>
this example has three protocol operation rules πΈ
- deny-kill-session: this rule stops the "limited" or "guest" groups from invoking the NETCONF
<kill-session>protocol operation π ββοΈ - deny-delete-config: this rule stops the "limited" or "guest" groups from invoking the NETCONF
<delete-config>protocol operation π« - permit-edit-config: this rule lets the "limited" group invoke the NETCONF
<edit-config>protocol operation β¨ this rule won't have any real effect unless theexec-defaultleaf is set to "deny" π
A.4. Data Node Rule Example β¨
Okay so data node rules are how you decide who gets to touch specific data nodes, both config and non-config, inside the NETCONF content the server provides π
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<rule-list>
<name>guest-acl</name>
<group>guest</group>
<rule>
<name>deny-nacm</name>
<path xmlns:n="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
/n:nacm
</path>
<access-operations>*</access-operations>
<action>deny</action>
<comment>
Deny the guest group any access to the /nacm data.
</comment>
</rule>
</rule-list>
<rule-list>
<name>limited-acl</name>
<group>limited</group>
<rule>
<name>permit-acme-config</name>
<path xmlns:acme="http://example.com/ns/netconf">
/acme:acme-netconf/acme:config-parameters
</path>
<access-operations>
read create update delete
</access-operations>
<action>permit</action>
<comment>
Allow the limited group complete access to the acme
NETCONF configuration parameters. Showing long form
of 'access-operations' instead of shorthand.
</comment>
</rule>
</rule-list>
<rule-list>
<name>guest-limited-acl</name>
<group>guest</group>
<group>limited</group>
<rule>
<name>permit-dummy-interface</name>
<path xmlns:acme="http://example.com/ns/itf">
/acme:interfaces/acme:interface[acme:name='dummy']
</path>
<access-operations>read update</access-operations>
<action>permit</action>
<comment>
Allow the limited and guest groups read
and update access to the dummy interface.
</comment>
</rule>
</rule-list>
<rule-list>
<name>admin-acl</name>
<group>admin</group>
<rule>
<name>permit-interface</name>
<path xmlns:acme="http://example.com/ns/itf">
/acme:interfaces/acme:interface
</path>
<access-operations>*</access-operations>
<action>permit</action>
<comment>
Allow admin full access to all acme interfaces.
</comment>
</rule>
</rule-list>
</nacm>
This example has four data node rules, and they're giving main character energy π
- deny-nacm π«: This rule denies the "guest" group any access to the
<nacm>subtree. Note that the default namespace only applies because this subtree is defined in the same namespace as the<data-rule>element π - permit-acme-config π©·: This rule gives the "limited" group read-write access to the acme
<config-parameters>. - permit-dummy-interface π¦: This rule gives the "limited" and "guest" groups read-update access to the acme
<interface>entry named "dummy". This entry cannot be created or deleted by these groups, just altered. Iconic restraint π - permit-interface π: This rule gives the "admin" group read-write access to all acme
<interface>entries.
A.5. Notification Rule Example π
Notification rules are how you control access to a specific notification event type. Literally a bouncer for events π§
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<rule-list>
<name>sys-acl</name>
<group>limited</group>
<group>guest</group>
<rule>
<name>deny-config-change</name>
<module-name>acme-system</module-name>
<notification-name>sys-config-change</notification-name>
<access-operations>read</access-operations>
<action>deny</action>
<comment>
Do not allow the guest or limited groups
to receive config change events.
</comment>
</rule>
</rule-list>
</nacm>
This example has one notification rule π
- deny-config-change π
ββοΈ: This rule stops the "limited" and "guest" groups from receiving the acme
<sys-config-change>event type. No notifications for you, bestie π
Authors' Addresses π«Ά
Andy Bierman YumaWorks
EMail: andy@yumaworks.com
Martin Bjorklund Tail-f Systems
EMail: mbj@tail-f.com
π¦ where this page comes from
- ietf: rfc6536 2012-03
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms