Internet Engineering Task Force | A. Bierman |
Internet-Draft | YumaWorks |
Obsoletes: 6536 (if approved) | M. Bjorklund |
Intended status: Standards Track | Tail-f Systems |
Expires: April 23, 2018 | October 20, 2017 |
Network Configuration Access Control Module
draft-ietf-netconf-rfc6536bis-07
The standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) or RESTCONF protocol requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability. There is a need for standard mechanisms to restrict NETCONF or RESTCONF protocol access for particular users to a pre-configured subset of all available NETCONF or RESTCONF protocol operations and content. This document defines such an access control model.
This document obsoletes RFC 6536.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 23, 2018.
Copyright (c) 2017 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 (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
The NETCONF and RESTCONF protocols do not provide any standard mechanisms to restrict the protocol operations and content that each user is authorized to access.
There is a need for interoperable management of the controlled access to administrator-selected portions of the available NETCONF or RESTCONF content within a particular server.
This document addresses access control mechanisms for the Operations and Content layers of NETCONF, as defined in [RFC6241], and RESTCONF, as defined in [RFC8040]. It contains three main sections:
YANG version 1.1 [RFC7950] adds two new constructs that need special access control handling. The "action" statement is similar to the "rpc" statement, except it is located within a data node. The "notification" statement can also be located within a data node.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
The following terms are defined in [I-D.ietf-netmod-revised-datastores] and are not redefined here:
The following terms are defined in [RFC6241] and are not redefined here:
The following terms are defined in [RFC7950] and are not redefined here:
The following terms are defined in [RFC8040] and are not redefined here:
The following term is defined in [RFC7230] and is not redefined here:
The following terms are used throughout this document:
The NACM procedures and data model have been updated to support new data modeling capabilities in the version 1.1. of the YANG data modeling language. The "action" and "notification" statements can be used within data nodes to define data-model specific operations and notifications.
An important use-case for these new YANG statements is the increased access control granularity that can be achieved over top-level "rpc" and "notification" statements. The new "action" and "notification" statements are used within data nodes, and access to the action or notification can be restricted to specific instances of these data nodes.
Support for the RESTCONF protocol has been added. The RESTCONF operations are similar to the NETCONF operations, so a simple mapping to the existing NACM procedures and data model is possible.
This section documents the design objectives for the NETCONF Access Control Model presented in Section 3.
NETCONF allows server implementors to add new custom protocol operations, and the YANG Data Modeling Language supports this feature. These operations can be defined in standard or proprietary YANG modules.
It is not possible to design an ACM for NETCONF that only focuses on a static set of standard protocol operations defined by the NETCONF protocol itself, like some other protocols. Since few assumptions can be made about an arbitrary protocol operation, the NETCONF architectural server components need to be protected at three conceptual control points.
These access control points, described in Figure 1, are as follows:
+-------------+ +-------------+ client | protocol | | data node | request --> | operation | -------------> | access | | allowed? | datastore | allowed? | +-------------+ or state +-------------+ data access +----------------+ | notification | event --> | allowed? | +----------------+
Figure 1
There is concern that a complicated ACM will not be widely deployed because it is too hard to use. It needs to be easy to do simple things and possible to do complex things, instead of hard to do everything.
Configuration of the access control system needs to be as simple as possible. Simple and common tasks need to be easy to configure and require little expertise or domain-specific knowledge. Complex tasks are possible using additional mechanisms, which may require additional 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 datastore access.
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.
It is necessary to control access to specific nodes and subtrees within the datastore, regardless of which protocol operation, standard or proprietary, was used to access the datastore.
It is necessary that access control rules for a single user or a configurable group of users can be configured.
The ACM needs to support the concept of administrative groups, to support the well-established distinction between a root account and other types of less-privileged conceptual user accounts. These groups need to be configurable by the administrator.
It is necessary that the user-to-group mapping can be delegated to a central server, such as a RADIUS server [RFC2865][RFC5607]. Since authentication is performed by the transport layer and RADIUS performs authentication and service authorization at the same time, the underlying transport protocol needs to be able to report a set of group names associated with the user to the server. It is necessary that the administrator can disable the usage of these group names within the ACM.
It ought to be possible to disable part or all of the access control model enforcement procedures without deleting any access control rules.
Suitable configuration and monitoring mechanisms are needed to allow an administrator to easily manage all aspects of the ACM's behavior. A standard data model, suitable for use with the <edit-config> protocol operation, needs to be available for this purpose.
Access control rules to restrict access operations on specific subtrees within the configuration datastore need to be supported.
One of the most important aspects of the data model documentation, and biggest concerns during deployment, is the identification of security-sensitive content. This applies to protocol operations in NETCONF, not just 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, for the following reasons:
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 allows the default rules to be more lenient, without significantly increasing the security risk.
A data model designer needs to be able to use machine-readable statements to identify content that needs to be protected by default. This will allow client and server tools to 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.
This section provides 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.
The NACM data model provides the following features:
The NETCONF protocol is used for network management purposes within this document.
The RESTCONF protocol is used for network management purposes within this document.
The YANG Data Modeling Language is used to define the data models for use with the NETCONF or RESTCONF protocols. YANG is also used to define the data model in this document.
The following diagram shows the conceptual message flow model, including the points at which access control is applied during NETCONF message processing.
RESTCONF operations are mapped to the access control model based on the HTTP method and resource class used in the operation. For example, a POST method on a data resource is considered "write data node" access, but a POST method on an operation resource is considered "operation" access.
+-------------------------+ | session | | (username) | +-------------------------+ | ^ V | +--------------+ +---------------+ | message | | message | | dispatcher | | generator | +--------------+ +---------------+ | | ^ ^ | V | | | +=============+ | | | | pre-read | | | | | data node | | | | | acc. ctl | | | | +=============+ | | | | | | V V | | +===========+ +-------------+ +----------------+ | operation |---> | reply | | <notification> | | acc. ctl | | generator | | generator | +===========+ +-------------+ +----------------+ | ^ ^ ^ V +------+ | | +-----------+ | +=============+ +================+ | operation | | | read | | <notification> | | processor |-+ | data node | | access ctl | | | | acc. ctl | | | +-----------+ +=============+ +================+ | | ^ ^ ^ V +----------------+ | | | +===========+ | | | +============+ | write | | | | | pre-read | | data node | | | | | data node | | acc. ctl | -----------+ | | | | acc. ctl | +===========+ | | | | +============+ | | | | | ^ V V V | | | +---------------+ +-------------------+ | configuration | ---> | server | | datastore | | instrumentation | | | <--- | | +---------------+ +-------------------+
Figure 2
The following high-level sequence of conceptual processing steps is executed for each received <rpc> message, if access control enforcement is enabled:
The following sequence of conceptual processing steps is executed for each generated notification event, if access control enforcement is enabled:
The same access control rules apply to all datastores that support NACM, for example, the candidate configuration datastore or the running configuration datastore.
All conventional configuration datastores and the operational state datastore are controlled by NACM. Local or remote files or datastores accessed via the <url> parameter are not controlled by NACM.
It is possible that new datastores will be defined over time for use with the NETCONF protocol. NACM MAY be applied to other datastores that have similar access rights as defined in NACM. To apply NACM to a new datastore, the new datastore specification needs to define how it maps to the NACM CRUDX access rights. It is possible only a subset of the NACM access rights would be applicable. For example, only retrieval access control would be needed for a read-only datastore. Operations and access rights not supported by the NACM CRUDX model are outside the scope of this document. A datastore does not need to use NACM, e.g., the datastore specification defines something else, or does not use access control.
A small set of hard-wired datastore access rights is needed to control access to all possible protocol operations, including vendor extensions to the standard protocol operation set.
The "CRUDX" model can support all protocol operations:
The RESTCONF protocol utilizes HTTP methods to perform datastore operations, similar to the NETCONF protocol. The NACM procedures were originally written for NETCONF protocol operations so the RESTCONF methods are mapped to NETCONF operations for the purpose of access control processing. The enforcement procedures described within this document apply to both protocols unless explicitly stated otherwise.
The request URI needs to be considered when processing RESTCONF requests on data resources:
Not all RESTCONF methods are subject to access control. The following table specifies how each method is mapped to NETCONF protocol operations. The value "none" indicates that NACM is not applied at all to the specific RESTCONF method.
method | resource class | NETCONF operation | Access operation |
---|---|---|---|
OPTIONS | all | none | N/A |
HEAD | all | <get> | N/A |
GET | all | <get> | N/A |
POST | datastore, data | <edit-config> | create |
POST | operation | specified operation | N/A |
PUT | data | <edit-config> | create, replace |
PUT | datastore | <copy-config> | replace |
PATCH | data, datastore | <edit-config> | merge |
DELETE | data | <edit-config> | delete |
The NACM access rights are not directly coupled to the <get> and <get-config> protocol operations, but apply to all <rpc> operations that would result in a "read" access operation to the target datastore. This section describes how these access rights apply to the specific access operations supported by the <get> and <get-config> protocol operations.
Data nodes to which the client does not have read access are silently omitted from the <rpc-reply> message. This is done to allow NETCONF filters for <get> and <get-config> to function 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 that the user is authorized to read, not the entire datastore.
The NACM access rights are not directly coupled to the <edit-config> "operation" attribute, although they are similar. Instead, a NACM access right applies to all protocol operations that would result in a particular access operation to the target datastore. This section describes how these access rights apply to the specific access operations supported by the <edit-config> protocol operation.
If the effective access operation is "none" (i.e., default-operation="none") for a particular data node, then no access control is applied to that data node. This is required to allow access to a subtree within a larger data structure. For example, a user may be authorized to create a new "/interfaces/interface" list entry but not be authorized to create or delete its parent container ("/interfaces"). If the "/interfaces" container already exists in the target datastore, then the effective operation will be "none" for the "/interfaces" node if an "/interfaces/interface" list entry is edited.
If the protocol operation would result in the creation of a datastore node and the user does not have "create" access permission for that node, the protocol operation is rejected with an "access-denied" error.
If the protocol operation would result in the deletion of a datastore node and the user does not have "delete" access permission for that node, the protocol operation is rejected with an "access-denied" error.
If the protocol operation would result in the modification of a datastore node and the user does not have "update" access permission for that node, the protocol operation is rejected with an "access-denied" error.
A "merge" or "replace" <edit-config> operation may include data nodes that do not alter portions of the existing datastore. For example, a container or list node may be present for naming purposes but does not actually alter the corresponding datastore node. These unaltered data nodes are ignored by the server and do not require any access rights by the client.
A "merge" <edit-config> operation may include data nodes but not include particular child data nodes that are present in the datastore. These missing data nodes within the scope of a "merge" <edit-config> operation are ignored by the server and do not require any access rights by the client.
The contents of specific restricted datastore nodes MUST NOT be exposed in any <rpc-error> elements within the reply.
Access control for the <copy-config> protocol operation requires special consideration because the administrator may 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, the client is only required to have permission to execute the <copy-config> protocol operation.
Otherwise:
Access to the <delete-config> protocol operation is denied by default. The "exec-default" leaf does not apply to this protocol operation. Access control rules must be explicitly configured to allow invocation by a non-recovery session.
The server MUST determine the exact nodes in the running configuration datastore that are actually different and only check "create", "update", and "delete" access permissions for this set of nodes, which could be empty.
For example, if a session can read the entire datastore but only change one leaf, that session needs to be able to edit and commit that one leaf.
The client is only required to have permission to execute the <discard-changes> protocol operation. No datastore permissions are needed.
The <kill-session> operation does not directly alter a datastore. However, it allows one session to disrupt another session that is editing a datastore.
Access to the <kill-session> protocol operation is denied by default. The "exec-default" leaf does not apply to this protocol operation. Access control rules must be explicitly configured to allow invocation by a non-recovery session.
This section defines the conceptual components related to the access control model.
A "user" is the conceptual entity that is associated with the access permissions granted to a particular session. A user is identified by a string that is unique within the server.
As described in [RFC6241], the username string is derived from the transport layer during session establishment. If the transport layer cannot authenticate the user, the session is terminated.
Access to a specific NETCONF protocol operation is granted to a session, 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.
The server MAY support a recovery session mechanism, which will bypass all access control enforcement. This is useful for restricting initial access and repairing a broken access control configuration.
There are five global controls that are used to help control how access control is enforced.
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 configured to allow the specific access request. When this global switch is set to "false", then all access requested are permitted.
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 is relevant if no matching access control rule is found to explicitly permit or deny read access to the requested datastore data or notification event type.
When this global switch is set to "permit" and no matching access control rule is found for the 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 datastore read or notification event requested, then access is denied.
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 is relevant if no matching access control rule is found to explicitly permit or deny write access to the requested datastore data.
When this global switch is set to "permit" and no matching access control rule is found for the 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 datastore write requested, then access is denied.
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 is relevant 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.
When this global switch is set to "true", the group names reported by the transport layer for a session are used together with the locally configured group names to determine the access control rules for the session.
When this switch is set to "false", the group names reported by the transport layer are ignored by NACM.
There are four types of rules available in NACM:
There are seven separate phases that need to be addressed, four of which are related to the NETCONF message processing model (Section 3.1.3). In addition, 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.
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 configuration datastore, during bootup.
The access control model applies specifically to the well-formed XML content transferred between a client and a server after session establishment has been completed and after the <hello> exchange has been successfully completed.
Once session establishment is completed and a user has been authenticated, the transport layer reports the username and a possibly empty set of group names associated with the user to the NETCONF server. The NETCONF server will enforce the access control rules, based on the supplied username, group names, and the configuration data stored on the server.
The "access-denied" error-tag is generated when the access control system denies access to either a request to invoke a protocol operation or a request to perform a particular access operation on the configuration datastore.
A server MUST NOT include any information the client is not allowed to read in any <error-info> elements within the <rpc-error> response.
The diagram below shows the basic conceptual structure of the access control processing model for incoming NETCONF <rpc> messages within a server.
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 begins with the message dispatcher.
After the server validates the <rpc> element and determines the namespace URI and the element name of the protocol operation being requested, the server verifies that the user is authorized to invoke the protocol operation.
The server MUST separately authorize every protocol operation by following these steps:
<error-path xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> /nc:rpc/nc:edit-config </error-path>
If the user is not authorized to invoke the protocol operation, then an <rpc-error> is generated with the following information:
If a datastore is accessed, either directly or as a side effect of the protocol operation, then 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.
If a data node within a datastore is accessed, or an action or notification tied to a data node, then the server MUST ensure that the user is authorized to perform the requested "read", "create", "update", "delete", or "execute" access operation on the specified data node.
If an action is requested to be executed, the server MUST ensure that the user is authorized to perform the "execute" access operation on the requested action.
If a notification tied to a data node is generated, the server MUST ensure that the user is authorized to perform the "read" access operation on the requested notification.
The data node access request is authorized by following these steps:
Configuration of access control rules specifically for descendant nodes of the notification event type element are outside the scope of this document. If the user is authorized to receive the notification event type, then it is also authorized to receive any data it contains.
If the notification is specified within a data subtree, as specified in [RFC7950], then read access to the notification is required. Processing continues as described in Section 3.4.5.
The following figure shows the conceptual message processing model for outgoing <notification> messages.
NETCONF server +------------+ | XML | | message | | generator | +------------+ ^ | +----------------+ | <notification> | | generator | +----------------+ ^ | +=================+ | <notification> | | access control | | <eventType> | +=================+ ^ | +------------------------+ | server instrumentation | +------------------------+ | ^ V | +----------------------+ | configuration | | datastore | +----------------------+
Figure 4
The generation of a notification for a specific subscription [RFC5277] is authorized by following these steps:
The following diagram highlights the contents and structure of the NACM YANG module.
module: ietf-netconf-acm +--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
The following YANG module specifies the normative NETCONF content that MUST by supported by the server.
The "ietf-netconf-acm" YANG module imports typedefs from [RFC6991].
<CODE BEGINS> file "ietf-netconf-acm@2017-10-20.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> Author: Andy Bierman <mailto:andy@yumaworks.com> Author: Martin Bjorklund <mailto:mbj@tail-f.com>"; description "Network Configuration Access Control Model. Copyright (c) 2012, 2017 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 XXXX; see the RFC itself for full legal notices."; revision "2017-10-20" { description "Added support for YANG 1.1 actions and notifications tied to data nodes. Clarify how NACM extensions can be used by other data models."; reference "RFC XXXX: Network Configuration Protocol (NETCONF) Access Control Model"; } 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, 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. If the NACM module is used, then it must be enabled (i.e., /nacm/enable-nacm object equals 'true'), or this extension is ignored. 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, 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. If the NACM module is used, then it must be enabled (i.e., /nacm/enable-nacm object equals 'true'), or this extension is ignored. 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 "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, action, or notification 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. The accessible tree includes actions and notifications tied to data nodes."; } /* * 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, action, or notification 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>
Figure 5
This document reuses the URI for "ietf-netconf-acm" in "The IETF XML Registry".
Name: ietf-netconf-acm Namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-acm Prefix: nacm reference: RFC XXXX
This document updates the module registration in the "YANG Module Names" registry to reference this RFC instead of RFC 6536. Following the format in [RFC6020], the following has been registered.
The YANG module defined in this document is designed to be accessed via network management protocols such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC5246].
The NETCONF access control model [RFCXXXX] provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.
There are a number of data nodes defined in this YANG module that are writable/creatable/deletable (i.e., config true, which is the default). These data nodes may be considered sensitive or vulnerable in some network environments. Write operations (e.g., edit-config) to these data nodes without proper protection can have a negative effect on network operations. These are the subtrees and data nodes and their sensitivity/vulnerability:
This section highlights the issues for an administrator to consider when configuring a NETCONF server with NACM.
Configuration of the access control system is highly sensitive to system security. A server may choose not to allow any user configuration to some portions of it, such as the global security level or the groups that allowed access to system resources.
By default, NACM enforcement is enabled. By default, "read" access to all datastore contents is enabled (unless "nacm:default-deny-all" is specified for the data definition), and "exec" access is enabled for safe protocol operations. An administrator needs to ensure that NACM is enabled and also decide if the default access parameters are set appropriately. Make sure the following data nodes are properly configured:
An administrator needs to restrict write access to all configurable objects within this data model.
If write access is allowed for configuration of 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.
An administrator 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 administrator 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 configuration datastore.
Note that the /nacm/groups data structure contains the administrative group names used by the server. These group names may be configured locally and/or provided through an external protocol, such as RADIUS [RFC2865][RFC5607].
An administrator needs to be aware of the security properties of any external protocol used by the transport layer to determine group names. For example, if this protocol does not 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 it should. In such cases, the administrator may wish to disable the usage of such group names, by setting /nacm/enable-external-groups to "false".
An administrator needs to restrict read access to the following objects within this data model, as they reveal access control configuration that could be considered sensitive.
There is a risk that invocation of non-standard protocol operations will have undocumented side effects. An administrator needs to construct access control rules such that the configuration datastore is protected from such side effects.
It is possible for a session with some write access (e.g., allowed to invoke <edit-config>), but without any access to a particular datastore subtree containing sensitive data, to determine the presence or non-presence of that data. This can be done by repeatedly issuing some sort of edit request (create, update, or delete) and possibly receiving "access-denied" errors in response. These "fishing" attacks can identify the presence or non-presence of specific sensitive data even without the "error-path" field being present within the <rpc-error> response.
It may be possible for the set of NETCONF capabilities on the server to change over time. If so, then there is a risk that new protocol operations, notifications, and/or datastore content have been added to the device. An administrator needs to be sure the access control rules are correct for the new content in this case. Mechanisms to detect NETCONF capability changes on a specific device are outside the scope of this document.
It is possible that the data model definition itself (e.g., YANG when-stmt) will help an unauthorized session determine the presence or even value of sensitive data nodes by examining the presence and values of different data nodes.
There is a risk that non-standard protocol operations, or even the standard <get> protocol operation, may return data that "aliases" or "copies" sensitive data from a different data object. There may simply be multiple data model definitions that expose or even configure the same underlying system instrumentation.
A data model may contain external keys (e.g., YANG leafref), which expose values from a different data structure. An administrator needs to be aware of sensitive data models that contain leafref nodes. This entails finding all the leafref objects that "point" at the sensitive data (i.e., "path-stmt" values) that implicitly or explicitly include the sensitive data node.
It is beyond the scope of this document to define access control enforcement procedures for underlying device instrumentation that may exist to support the NETCONF server operation. An administrator can identify each protocol operation that the server provides and decide if it needs any access control applied to it.
This document incorporates the optional use of a recovery session mechanism, which can be used to bypass access control enforcement in emergencies, such as NACM configuration errors that disable all access to the server. The configuration and identification of such a recovery session mechanism are implementation-specific and outside the scope of this document. An administrator needs to be aware of any recovery session mechanisms available on the device and make sure they are used appropriately.
It is possible for a session to disrupt configuration management, even without any write access to the configuration, by locking the datastore. This may be done to ensure all or part of the configuration remains stable while it is being retrieved, or it may be done as a "denial-of-service" attack. There is no way for the server to know the difference. An administrator may wish to restrict "exec" access to the following protocol operations:
Designers need to clearly identify any sensitive data, notifications, or protocol operations defined within a YANG module. For such definitions, a "nacm:default-deny-write" or "nacm:default-deny-all" statement ought to be present, in addition to a clear description of the security risks.
Protocol operations need to be properly documented by the data model designer, so it is clear to administrators what data nodes (if any) are affected by the protocol operation and what information (if any) is returned in the <rpc-reply> message.
Data models ought to be designed so that different access levels for input parameters to protocol operations are not required. Use of generic protocol operations should be avoided, and if different access levels are needed, separate protocol operations should be defined instead.
[RFC2865] | Rigney, C., Willens, S., Rubens, A. and W. Simpson, "Remote Authentication Dial In User Service (RADIUS)", RFC 2865, DOI 10.17487/RFC2865, June 2000. |
[RFC5607] | Nelson, D. and G. Weber, "Remote Authentication Dial-In User Service (RADIUS) Authorization for Network Access Server (NAS) Management", RFC 5607, DOI 10.17487/RFC5607, July 2009. |
-- RFC Ed.: remove this section before publication.
The NACM issue tracker can be found here: https://github.com/netconf-wg/rfc6536bis/issues
The following XML snippets are provided as examples only, to demonstrate how NACM can be configured to perform some access control tasks.
There needs to be at least one <group> entry in order for any of the access control rules to be useful.
The following XML shows arbitrary groups and is not intended 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 shows three groups:
Module rules are used to 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 shows four module rules:
Protocol operation rules are used to control access to a 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 shows three protocol operation rules:
Data node rules are used to control access to specific (config and non-config) data nodes within the NETCONF content provided by the server.
<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 shows four data node rules:
Notification rules are used to control access to a specific notification event type.
<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 shows one notification rule: