Internet Engineering Task Force                               A. Bierman
Internet-Draft                                         InterWorking Labs
Intended status: Standards Track                       February 25, 2010
Expires: August 29, 2010


          Network Configuration Protocol Access Control Model
                draft-bierman-netconf-access-control-01

Abstract

   The standardization of network configuration interfaces for use with
   the NETCONF protocol requires a structured and secure operating
   environment, which promotes human usability and multi-vendor
   interoperability.  There is a need for standard mechanisms to
   restrict NETCONF protocol access for particular users to a pre-
   configured subset of all available NETCONF operations and content.
   This document discusses requirements for a suitable access control
   model, and provides one solution which meets these requirements.

Status of this Memo

   This Internet-Draft is submitted to IETF in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   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."

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt.

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on August 29, 2010.

Copyright Notice

   Copyright (c) 2010 IETF Trust and the persons identified as the
   document authors.  All rights reserved.




Bierman                  Expires August 29, 2010                [Page 1]


Internet-Draft                    NACM                     February 2010


   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 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 BSD License.


Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.1.  Terminology  . . . . . . . . . . . . . . . . . . . . . . .  4
       1.1.1.  Requirements Notation  . . . . . . . . . . . . . . . .  4
       1.1.2.  NETCONF Terms  . . . . . . . . . . . . . . . . . . . .  4
       1.1.3.  NACM Terms . . . . . . . . . . . . . . . . . . . . . .  5
   2.  Access Control Requirements  . . . . . . . . . . . . . . . . .  6
     2.1.  Protocol Control Points  . . . . . . . . . . . . . . . . .  6
     2.2.  Simplicity . . . . . . . . . . . . . . . . . . . . . . . .  7
     2.3.  Procedural Interface . . . . . . . . . . . . . . . . . . .  7
     2.4.  Database Access  . . . . . . . . . . . . . . . . . . . . .  8
     2.5.  Users and Groups . . . . . . . . . . . . . . . . . . . . .  8
     2.6.  Maintenance  . . . . . . . . . . . . . . . . . . . . . . .  9
     2.7.  Configuration Capabilities . . . . . . . . . . . . . . . .  9
     2.8.  Identifying Security Holes . . . . . . . . . . . . . . . .  9
     2.9.  Data Shadowing . . . . . . . . . . . . . . . . . . . . . . 10
     2.10. NETCONF Specific Requirements  . . . . . . . . . . . . . . 11
   3.  NETCONF Access Control Model (NACM)  . . . . . . . . . . . . . 12
     3.1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . 12
       3.1.1.  Features . . . . . . . . . . . . . . . . . . . . . . . 12
       3.1.2.  External Dependencies  . . . . . . . . . . . . . . . . 13
       3.1.3.  Message Processing Model . . . . . . . . . . . . . . . 13
     3.2.  Model Components . . . . . . . . . . . . . . . . . . . . . 15
       3.2.1.  Users  . . . . . . . . . . . . . . . . . . . . . . . . 15
       3.2.2.  Groups . . . . . . . . . . . . . . . . . . . . . . . . 16
       3.2.3.  Sessions . . . . . . . . . . . . . . . . . . . . . . . 16
       3.2.4.  Access Permissions . . . . . . . . . . . . . . . . . . 16
       3.2.5.  Global Enforcement Controls  . . . . . . . . . . . . . 17
       3.2.6.  Access Control Rules . . . . . . . . . . . . . . . . . 17
     3.3.  Access Control Enforcement Procedures  . . . . . . . . . . 17
       3.3.1.  Initial Operation  . . . . . . . . . . . . . . . . . . 17
       3.3.2.  Session Establishment  . . . . . . . . . . . . . . . . 18
       3.3.3.  'access-denied' Error Handling . . . . . . . . . . . . 18
       3.3.4.  Incoming RPC Message Validation  . . . . . . . . . . . 18
       3.3.5.  Data Node Access Validation  . . . . . . . . . . . . . 21
       3.3.6.  Outgoing <rpc-reply> Authorization . . . . . . . . . . 23



Bierman                  Expires August 29, 2010                [Page 2]


Internet-Draft                    NACM                     February 2010


       3.3.7.  Outgoing <notification> Authorization  . . . . . . . . 23
     3.4.  Data Model Definitions . . . . . . . . . . . . . . . . . . 26
       3.4.1.  High Level Procedures  . . . . . . . . . . . . . . . . 26
       3.4.2.  Data Organization  . . . . . . . . . . . . . . . . . . 26
       3.4.3.  YANG Module  . . . . . . . . . . . . . . . . . . . . . 27
     3.5.  IANA Considerations  . . . . . . . . . . . . . . . . . . . 36
     3.6.  Security Considerations  . . . . . . . . . . . . . . . . . 36
   4.  Normative References . . . . . . . . . . . . . . . . . . . . . 39
   Appendix A.  Usage Examples  . . . . . . . . . . . . . . . . . . . 40
     A.1.  <groups> Example . . . . . . . . . . . . . . . . . . . . . 40
     A.2.  <module-rule> Example  . . . . . . . . . . . . . . . . . . 41
     A.3.  <rpc-rule> Example . . . . . . . . . . . . . . . . . . . . 42
     A.4.  <data-rule> Example  . . . . . . . . . . . . . . . . . . . 43
     A.5.  <notification-rule> Example  . . . . . . . . . . . . . . . 44
   Appendix B.  Open Issues . . . . . . . . . . . . . . . . . . . . . 46
   Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 47



































Bierman                  Expires August 29, 2010                [Page 3]


Internet-Draft                    NACM                     February 2010


1.  Introduction

   The NETCONF protocol does not provide any standard mechanisms to
   restrict the operations and content that each user is authorized to
   use.  Any user that is able to start a NETCONF session is allowed to
   access every protocol operation, all database content, and all
   notification content.

   There is a need for the inter-operable management of the controlled
   access to operator selected portions of the available NETCONF content
   within a particular server.

   This document addresses NETCONF protocol access control mechanisms
   for the RPC, Operations, and Content layers, as defined in [RFC4741],
   and [RFC5277].  It contains three main sections:

   1.  Access Control Requirements

   2.  NETCONF Access Control Model (NACM)

   3.  YANG Data Model (nacm.yang)

1.1.  Terminology

1.1.1.  Requirements Notation

   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].

1.1.2.  NETCONF Terms

   The following terms are defined in RFC 4741 and are not redefined
   here:

   o  client

   o  operation

   o  RPC operation

   o  server

   o  session

   o  user





Bierman                  Expires August 29, 2010                [Page 4]


Internet-Draft                    NACM                     February 2010


1.1.3.  NACM Terms

   The following terms are used throughout this documentation:

   access control:  A security feature provided by the NETCONF server,
      which allows an operator to 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 desired by the operator to
      enforce a particular access control policy.

   access control rule:  The conceptual criteria used to determine if a
      particular NETCONF protocol operation should be permitted or
      denied.

   superuser:  The special administrative user account which is given
      unlimited NETCONF access, and is exempt from all access control
      enforcement.
































Bierman                  Expires August 29, 2010                [Page 5]


Internet-Draft                    NACM                     February 2010


2.  Access Control Requirements

2.1.  Protocol Control Points

   The NETCONF protocol allows new operations to be added at any time,
   and the YANG data modeling language supports this feature.  It is not
   possible to design an ACM for NETCONF which only focuses on a static
   set of operations, like some other protocols.  Since few assumptions
   can be made about an arbitrary protocol operation, the NETCONF
   architectural server components must be protected at several
   conceptual control points.



              +-------------+             +-------------+
 client       |    RPC      |             |   prune     |      client
 request -->  |  operation  |             | restricted  | ---> reply
              |  allowed?   |             | <rpc-reply> |
              +-------------+             |   nodes?    |
                    |                     +-------------+
                    | if any database or
                    | state data is accessed
                    | by the operation
                    V
              +-------------+             +----------------+
              |  data node  |             |   prune        |
              |   access    |             | restricted     |
              |  allowed?   |             | <notification> | ---> client
              +-------------+             | event or data? |     session
                                          +----------------+


                                 Figure 1

   The following access control points are defined:

   RPC operation:  Configurable permission to invoke specific RPC
      operations is required.  Wildcard or multiple target mechanisms to
      reduce configuration and effort are also required.

   NETCONF database:  Configurable permission to read and/or alter
      specific data nodes within any conceptual database is required.
      Wildcard or multiple target mechanisms to reduce configuration and
      effort are also required.







Bierman                  Expires August 29, 2010                [Page 6]


Internet-Draft                    NACM                     February 2010


   RPC Reply Content:  Configurable permission to read specific data
      nodes within any conceptual RPC output section is required.
      Unauthorized data is silently omitted from the reply, instead of
      dropping the reply or sending an 'access-denied' error.

   Notification Content:  Configurable permission to receive specific
      notification event types is required.

2.2.  Simplicity

   Experience has shown that a complicated ACM will not be widely
   deployed, because it is too hard to use.  The key factor that is
   ignored in such solutions is the concept of 'localized cost'.  It
   should be easy to do simple things, and hard to do complex things,
   instead of hard to do everything.

   Configuration of the access control system must be simple to use.
   Simple and common tasks should be easy to configure, and require
   little expertise or domain-specific knowledge.  Complex tasks should
   be possible using additional mechanisms which may require additional
   expertise.

   A single set of access control rules should be able to control all
   types of NETCONF RPC operation invocation, all conceptual database
   access, and all NETCONF session output.

   Protocol access should be defined with a small and familiar set of
   permissions such as 'read', 'write', and 'execute'.

   Default access control policy needs to be as secure as possible.

   Access control does not need to be applied to NETCONF <hello>
   messages.

2.3.  Procedural Interface

   The NETCONF protocol uses a procedural interface model, and an
   extensible set of protocol operations, including vendor-specific
   'actions'.  Access control for any possible protocol operation is
   required.

   It must be possible to configure the ACM to permit or deny access to
   specific NETCONF operations.

   YANG modules should be designed so that different access levels for
   input parameters to RPC operations is not required.  However, since
   this cannot always be avoided, then it should be possible to control
   access to specific input parameters.  If a restricted parameter is



Bierman                  Expires August 29, 2010                [Page 7]


Internet-Draft                    NACM                     February 2010


   used, then the request is rejected with an 'access-denied' error.

2.4.  Database Access

   It must be possible control access to specific nodes and sub-trees
   within the conceptual NETCONF database.

   In order for a user to obtain access to a particular database node,
   the user must be authorized to have the same requested access to the
   specified node, and all of its ancestors.

   The same access control rules apply to all conceptual databases.  For
   example, the candidate configuration or the running configuration.

   Only the standard NETCONF databases (candidate, running, and startup)
   are controlled y the ACM.  Local or remote files or databases
   accessed via the <url> parameter are optional to support.

   The non-volatile startup configuration needs to be loaded into the
   running configuration without applying any access control rules.
   This operation is conceptually performed by the superuser account.

   Only the superuser should be able to alter the factory-default access
   control rules.

   Read operations for restricted configuration data, either directly or
   via wildcard access, are silently omitted from the <rpc-reply>.

   Create, merge, replace, and delete operations on a database node for
   which the user does not have 'write' access permission is rejected
   with an 'access-denied' error.  The specific restricted database
   nodes must not be exposed in any <rpc-error> elements within the
   reply.

2.5.  Users and Groups

   The server must obtain a user name from the underlying NETCONF
   transport, such as an SSH user name.

   It must be possible to specify access control rules for a single user
   or a configurable group of users.

   A configurable superuser account is needed which bypasses all access
   control rules.  This is needed in case the access control rules are
   mis-configured, and all access is denied.

   The ACM must support the concept of administrative groups, to support
   the well-established distinction between a root account and other



Bierman                  Expires August 29, 2010                [Page 8]


Internet-Draft                    NACM                     February 2010


   types of less-privileged conceptual user accounts.  These groups must
   be configurable by the operator.

2.6.  Maintenance

   It should be possible to disable part or all of the access control
   model without deleting any configuration.  By default, only the
   'superuser' should be able to perform this task.

   It should be possible to configure a 'superuser' account so that all
   access control is disabled for just this user.  This allows the
   access control rules to always be modified without completely
   disabling access control for all users.

2.7.  Configuration Capabilities

   Suitable control and monitoring mechanisms are needed to allow an
   operator to easily manage all aspects of the ACM behavior.  A
   standard XML data model, suitable for use with the <edit-config>
   operation must be available for this purpose.

   All standard access control parameters must persist in non-volatile
   storage, and be used upon the next reboot.

   Access control rules to restrict operations on specific sub-trees
   within the configuration database must be supported.  Existing
   mechanisms should be used to identify the sub-tree(s) for this
   purpose.

2.8.  Identifying Security Holes

   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 commands in NETCONF, not
   just data and notifications.

   It is customary 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:

   o  This documentation-only forces operators to study the RFC and
      determine if there are any potential security holes introduced by
      a new YANG module.

   o  If any security holes are identified, then the operator must study
      some more RFC text, and determine out how to close the security
      hole(s).




Bierman                  Expires August 29, 2010                [Page 9]


Internet-Draft                    NACM                     February 2010


   o  The ACM on each server must be configured to close the security
      holes, e.g., require privileged access to read or write the
      specific data identified in the Security Considerations section.

   o  If the ACM is not pre-configured, then there will be a time window
      of vulnerability, after the new module is loaded, and before the
      new access control rules for that module are configured, enabled,
      and debugged.

   Often, the operator 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 should be able to use machine-readable
   statements to identity NETCONF content which should be protected by
   default.  This will allow client and server tools to automatically
   close data-model specific security holes by requiring 'superuser'
   access unless an access control rule is explicitly configured to
   allow the requested operation.

2.9.  Data Shadowing

   One of the more complicated security administration problems is
   identifying data nodes which shadow or mirror the content of another
   data node.  An access control rule to prevent read operations for a
   particular node may be insufficient to prevent access to the data
   node with the copied value.

   If the YANG leafref data type is used, then this data shadowing can
   be detected by applications (and the server stack), and prevented.

   If the description statement, other documentation, or no
   documentation exists to identify a data shadow problem, then it may
   not be detected.

   Since NETCONF allows any vendor operation to be added to the
   protocol, there is no way to reliably identify all of the operations
   that may expose copies of sensitive data nodes in <rpc-reply&gt
   messages.

   A NETCONF server must insure than unauthorized access to its
   conceptual databases and non-configuration data nodes is prevented.
   However, if a NETCONF operation accesses device instrumentation
   instead of the protected data node, then this access will not be
   protected.

   It is beyond the scope of this document to define access control



Bierman                  Expires August 29, 2010               [Page 10]


Internet-Draft                    NACM                     February 2010


   enforcement procedures for underlying device instrumentation that may
   exist to support the NETCONF server operation.  An operator must
   identify each operation that the server provides, and decide if it
   needs any access control applied to it.

   Proprietary protocol operations should be properly documented by the
   vendor, so it is clear to operators what data nodes (if any) are
   affected by the operation, and what information (if any) is returned
   in the <rpc-reply> message.

2.10.  NETCONF Specific Requirements

   The server must be able to identify the specific protocol access
   request at the 4 access control points defined above.

   The server must be able to identify any database access request, even
   for proprietary operations.

   A session must always be authorized to invoke the <close-session>
   operation, defined in [RFC4741].

   A session must always be authorized to receive the <replayComplete>
   and <notificationComplete> notification events, defined in [RFC5277]

   The set of module name strings used within one particular server must
   be unique.

   Within a single server, the module namespace URI associated with a
   specific module name string must persist across a reboot, and never
   change, once assigned.





















Bierman                  Expires August 29, 2010               [Page 11]


Internet-Draft                    NACM                     February 2010


3.  NETCONF Access Control Model (NACM)

3.1.  Introduction

   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.

3.1.1.  Features

   The NACM data model provides the following features:

   o  Independent control of RPC, data, and notification access.

   o  Very simple access control rules configuration data model which is
      easy to use.

   o  The concept of a 'superuser' type of account is supported, but
      configuration of user accounts is beyond the scope of this
      document.  The server must be able to determine if a superuser
      account is available, and if so, the actual user name for this
      account.  A session associated with the superuser account will
      bypass all access control enforcement.

   o  A simple and familiar set of permissions is used:

      read:  If granted, then the session is authorized to receive the
         associated data within an <rpc-reply> or <notification>
         message.

      write:  If granted, then the session is authorized to alter the
         associated data node.

      exec:  If granted, then the session is authorized to invoke the
         associated RPC operation.

   o  Support for YANG security tagging (e.g., nacm:secure extension)
      allows default security modes to automatically exclude sensitive
      data.

   o  Separate default access modes for read, write, and execute
      permissions.

   o  Access control rules are applied to configurable groups of users.

   o  The entire ACM can be disabled or downgraded during operation, in
      order to debug operational problems.



Bierman                  Expires August 29, 2010               [Page 12]


Internet-Draft                    NACM                     February 2010


   o  Access control rule are simple to configure.

   o  The number of denied RPC operation requests and denied database
      write requests can be monitored by the client.

   o  Simple unconstrained YANG instance identifiers are used to
      configure access control rules for specific data nodes, or child
      nodes within specific RPC input, RPC output, and notification
      event type content.

3.1.2.  External Dependencies

   The NETCONF [RFC4741] protocol is used for all management purposes
   within this document.  The server must support the features
   identified by the 'NETCONF-base' capability.  It is expected that the
   mandatory transport mapping NETCONF Over SSH [RFC4742] is also
   supported by the server, and that the server has access to the user
   name associated with each session.

   The YANG Data Modeling Language [I-D.ietf-netmod-yang] is used to
   define the NETCONF data models specified in this document.  The YANG
   instance-identifier data type can be used to configure data-node-
   specific access control rules.

3.1.3.  Message Processing Model

   The following diagram shows the NETCONF message flow model, including
   the points at which access control is applied, during NETCONF message
   processing.






















Bierman                  Expires August 29, 2010               [Page 13]


Internet-Draft                    NACM                     February 2010


                    +-------------------------+
                    |       session           |
                    |      (username)         |
                    +-------------------------+
                       |                 ^
                       V                 |
             +--------------+     +---------------+
             |   message    |     |   message     |
             | dispatcher   |     |   generator   |
             +--------------+     +---------------+
                  |                  ^         ^
                  V                  |         |
         +===========+     +-------------+   +----------------+
         |   <rpc>   |---> | <rpc-reply> |   | <notification> |
         | acc. ctl  |     |  generator  |   |  generator     |
         +===========+     +-------------+   +----------------+
               |              ^    ^                ^
               V       +------+    |                |
         +-----------+ |   +=============+  +================+
         |   <rpc>   | |   | <rpc-reply> |  | <notification> |
         | processor |-+   |  acc. ctl   |  |  access ctl    |
         +-----------+     +=============+  +================+
               |   |                  ^        ^
               V   +----------------+ |        |
         +===========+              | |        |
         | data node |              | |        |
         | acc. ctl  | -----------+ | |        |
         +===========+            | | |        |
               |                  | | |        |
               V                  V V |        |
         +---------------+      +-----------------+
         | configuration | ---> |     server      |
         |   database    |      | instrumentation |
         |               | <--- |                 |
         +---------------+      +-----------------+



                                 Figure 2

   The follow high-level sequence of conceptual processing steps is
   executed for each received <rpc> message, if access control
   enforcement is enabled:

   o  Access control is applied to all <rpc> messages (except <close-
      session>) received by the server, individually, for each active
      session, unless the user identity for the session is the
      'superuser'.



Bierman                  Expires August 29, 2010               [Page 14]


Internet-Draft                    NACM                     February 2010


   o  If the session is authorized to execute the specified RPC
      operation, then processing continues, otherwise the request is
      rejected with an 'access-denied' error.

   o  If the configuration database or conceptual state data is accessed
      by the RPC operation, then the configuration access must be
      authorized first.  If the session is authorized to perform the
      requested operation on the requested data, then processing
      continues.

   The follow sequence of conceptual processing steps is executed for
   each generated notification event, if access control enforcement is
   enabled:

   o  Server instrumentation generates a conceptual notification, for a
      particular subscription.

   o  The notification access control enforcer checks the notification
      event type, and if it is one which the session is not authorized
      to read, then the notification is dropped for that subscription.

3.2.  Model Components

   This section defines the conceptual components related to access
   control model.

3.2.1.  Users

   A 'user' is the conceptual identity, which is associated with the
   access permissions granted to a particular session.  A user is
   identified by a string which must be unique within the server.
   Configuration of users is beyond the scope of this document.

   The user name string is usually derived from the transport layer
   during session establishment.  A server is required to have an
   authenticated user name for a session before <rpc> requests will be
   accepted.  Otherwise all requests must be rejected with an 'access-
   denied' error-tag value.

   The server should support a 'superuser' administrative user account,
   which will bypass all access control enforcement.  This is useful for
   restricting initial access and repairing a broken access control
   configuration.  This account may be configurable to use a specific
   user, or disabled completely.  Some systems have factory-selected
   superuser account names.  There is no need to standardize the exact
   user name for the superuser account.  If no such account, then all
   NETCONF access will be controlled.




Bierman                  Expires August 29, 2010               [Page 15]


Internet-Draft                    NACM                     February 2010


3.2.2.  Groups

   Access to a specific NETCONF protocol mechanism is granted to a
   session, associated with a group, not a user.

   A group is identified by its YANG group identity, which must use the
   'nacm-groups' identity as its base.

   All group names must be unique within the server.

   A group member is identified by a user name string.

   The same user may be configured in multiple groups.

   The server should support the 3 default group identities defined in
   this document (admin, monitor, guest), however these roles are just
   unique identities, provided for operator convenience.  There is no
   standard behavior defined for each group identity.  That is up to the
   operator who configures the groups.

3.2.3.  Sessions

   A session is simply a NETCONF session, which is the entity which is
   granted access to specific NETCONF protocol mechanisms.

   A session is associated with a single user name for the lifetime of
   the session.

3.2.4.  Access Permissions

   The access permissions are the NETCONF protocol specific set of
   permissions that have been assigned to a particular session role or
   group.  The same access permissions should stay in affect for the
   lifetime of a session.

   The access control model treats RPC operation execution separately
   from configuration database access and outgoing messages:

   read:  Read access to conceptual server data, <rpc-reply> and
      <notification> content.

   write:  Write access to any configuration database.

   exec:  Permission to invoke an RPC operation.







Bierman                  Expires August 29, 2010               [Page 16]


Internet-Draft                    NACM                     February 2010


3.2.5.  Global Enforcement Controls

   A global on/off switch is provided to enable or disable all access
   control enforcement.

   An on/off switch is provided to enable or disable default access to
   invoke RPC operations.

   An on/off switch is provided to enable or disable default permission
   to receive data in replies and notifications.

   An on/off switch is provided to enable or disable default access to
   alter configuration data.

3.2.6.  Access Control Rules

   There are 4 types of rules available in NACM:

   module rule:  Controls access for definitions in a specific module,
      identified by its name.

   RPC operation rule:  Controls access for a specific RPC operation,
      identified by its 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 module and name.

3.3.  Access Control Enforcement Procedures

   There are seven separate phases that must be addressed, four of which
   are related to the NETCONF message processing model.  In addition,
   the initial start-up mode for a NETCONF server, session
   establishment, and 'access-denied' error handling procedures must
   also be considered.

3.3.1.  Initial Operation

   Upon the very first start-up of the NETCONF server, the access
   control configuration will probably not be present.  If not, a server
   should not allow any write access to any session role except
   'superuser' type of account in this state.

   There is no requirement to enforce access control rules before or
   while the non-volatile configuration data is processed and loaded



Bierman                  Expires August 29, 2010               [Page 17]


Internet-Draft                    NACM                     February 2010


   into the running configuration.

3.3.2.  Session Establishment

   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.

   A server should not include any sensitive information in any
   <capability> elements within the <hello> exchange.

   Once session establishment is completed, and a user identity has been
   authenticated, a NETCONF server will enforce the access control
   rules, based on the supplied user identity and the configuration data
   stored on the server.

3.3.3.  'access-denied' Error Handling

   The 'access-denied' error-tag is generated when the access control
   system denies access to either a request to invoke an RPC operation
   or a request to perform a particular operation on the configuration
   database.

   A server must not include any sensitive information in any <error-
   info> elements within the <rpc-error> response.

3.3.4.  Incoming RPC Message Validation

   The diagram below shows the basic conceptual structure of the access
   control processing model for incoming NETCONF <rpc> messages, within
   a server.



















Bierman                  Expires August 29, 2010               [Page 18]


Internet-Draft                    NACM                     February 2010


                   NETCONF server
                  +------------+
                  |    XML     |
                  |   message  |
                  | dispatcher |
                  +------------+
                         |
                         |
                         V
                  +------------+
                  | NC-base NS |
                  |   <rpc>    |
                  +------------+
                    |   |  |
                    |   |  +-------------------------+
                    |   +------------+               |
                    V                V               V
               +-----------+ +---------------+ +------------+
               | acme NS   | | NC-base NS    | | NC-base NS |
               | <my-edit> | | <edit-config> | | <unlock>   |
               +-----------+ +---------------+ +------------+
                      |               |
                      |               |
                      V               V
                    +----------------------+
                    |                      |
                    |    configuration     |
                    |      database        |
                    +----------------------+



                                 Figure 3

   Access control begins with the message dispatcher.  Only well-formed
   XML messages should be processed by the server.

   A server should not allow access to configuration databases through
   any top level element except the <rpc> element in the NETCONF-base
   namespace.  If it does, the server should still enforce access
   control to configuration data, even if the access is from some
   mechanism outside the standard protocol operations.

   After the server validates the <rpc> element, and determines the
   namespace URI and the element name of the RPC operation being
   requested, the RPC access control enforcer verifies that the session
   is authorized to invoke the RPC operation.




Bierman                  Expires August 29, 2010               [Page 19]


Internet-Draft                    NACM                     February 2010


   The RPC operation is authorized by following these steps:

   1.   If the <enable-nacm> parameter is set to 'false', then the RPC
        operation is permitted.

   2.   If the session is associated with the 'superuser' account, then
        the RPC operation is permitted.

   3.   If the requested operation is the NETCONF <close-session>
        operation, then the RPC operation is permitted.

   4.   Check all the <group> entries for ones that contain a <user-
        name> entry that matches the user name for the session making
        the request.

   5.   If no groups are found:

        *  If the requested RPC operation is associated with a YANG
           module advertised in the server capabilities, and the rpc
           statement contains a nacm:secure or nacm:very-secure
           extension, then the RPC operation is denied.

        *  If the <exec-default> parameter is set to 'permit', then
           permit the RPC operation, otherwise deny the request.

   6.   Check if there are any matching <rpc-rule> entries for the
        requested RPC operation.  Any matching rules are processing in
        user-defined order, in case there are multiple <rpc-rule>
        entries for the requested RPC operation.

   7.   If an <rpc-rule> entry is found, then check the <allowed-rights>
        bits field for the entry, otherwise continue.  If the 'exec' bit
        is present in the <allowed-rights> bits field then the RPC
        operation is permitted, otherwise it is denied.

   8.   Check if there are any matching <module-rule> entries for the
        same module as the requested RPC operation.  Any matching rules
        are processing in user-defined order, in case there are multiple
        <module-rule> entries for the module containing the requested
        RPC operation.

   9.   If a <module-rule> entry is found, then check the <allowed-
        rights> bits field for the entry, otherwise continue.  If the
        'exec' bit is present in the <allowed-rights> bits field then
        the RPC operation is permitted, otherwise it is denied.

   10.  If the requested operation is identified an a nacm:secure or
        nacm:very-secure RPC operation, then the RPC operation is



Bierman                  Expires August 29, 2010               [Page 20]


Internet-Draft                    NACM                     February 2010


        denied.

   11.  If the <exec-default> parameter is set to 'permit', then permit
        the RPC operation, otherwise deny the request.

   If the session is not authorized to invoke the RPC operation then an
   <rpc-error> is generated with the following information:

   error-tag:  access-denied

   error-path:  /rpc/method-QName, where 'method-QName' is a qualified
      name identifying the actual RPC operation name.  For example,
      '/rpc/edit-config' represents the <edit-config> operation in the
      NETCONF base namespace..

   If the configuration database is accessed, either directly or as a
   side effect of the RPC operation, then the server must intercept the
   operation and make sure the session is authorized to perform the
   requested operation on the specified data.

3.3.5.  Data Node Access Validation

   If a data node within a configuration database is accessed, or a
   conceptual non-configuration node is accessed, then the server must
   ensure that the client session is authorized to perform the requested
   operation (read or write) on the specified data node.

   The data node access request is authorized by following these steps:

   1.   If the <enable-nacm> parameter is set to 'false', then the data
        node access request is permitted.

   2.   If the session is associated with the 'superuser' account, then
        the data node access request is permitted.

   3.   Check all the <group> entries for ones that contain a <user-
        name> entry that matches the user name for the session making
        the request.

   4.   If no groups are found:

        *  If the requested data node is associated with a YANG module
           advertised in the server capabilities, and the data
           definition statements (or any of its ancestors) contains a
           nacm:secure or nacm:very-secure extension, then the data node
           access request is denied.





Bierman                  Expires August 29, 2010               [Page 21]


Internet-Draft                    NACM                     February 2010


        *  For a read request, if the <read-default> parameter is set to
           'permit', then permit the data node access request, otherwise
           deny the request.

        *  For a write request, if the <write-default> parameter is set
           to 'permit', then permit the data node access request,
           otherwise deny the request.

   5.   Check if there are any matching <data-rule> entries for the
        requested data node access request.  Any matching rules are
        processing in user-defined order, in case there are multiple
        <data-rule> entries for the requested data node.

   6.   If an <data-rule> entry is found, then check the <allowed-
        rights> bits field for the entry, otherwise continue.

        1.  For a read operation, if the 'read' bit is present in the
            <allowed-rights> bits field then the request is permitted,
            otherwise it is denied.

        2.  For a write operation, if the 'write' bit is present in the
            <allowed-rights> bits field then the request is permitted,
            otherwise it is denied.

   7.   Check if there are any matching <module-rule> entries for the
        same module as the requested data node.  Any matching rules are
        processing in user-defined order, in case there are multiple
        <module-rule> entries for the module containing the requested
        data node.

   8.   If a <module-rule> entry is found, then check the <allowed-
        rights> bits field for the entry, otherwise continue.

        1.  For a read operation, if the 'read' bit is present in the
            <allowed-rights> bits field then the request is permitted,
            otherwise it is denied.

        2.  For a write operation, if the 'write' bit is present in the
            <allowed-rights> bits field then the request is permitted,
            otherwise it is denied.

   9.   For a read request, if the requested data node is identified an
        a nacm:very-secure definition, then the data node access request
        is denied.

   10.  For a write request, if the requested data node is identified an
        a nacm:secure or nacm:very-secure definition, then the data node
        access request is denied.



Bierman                  Expires August 29, 2010               [Page 22]


Internet-Draft                    NACM                     February 2010


   11.  For a read request, if the <read-default> parameter is set to
        'permit', then permit the data node access request, otherwise
        deny the request.

   12.  For a write request, if the <write-default> parameter is set to
        'permit', then permit the data node access request, otherwise
        deny the request.

3.3.6.  Outgoing <rpc-reply> Authorization

   The <rpc-reply> message should be checked by the server to make sure
   no unauthorized data is contained within it.  If so, the restricted
   data must be removed from the message before it is sent to the
   client.

   Configuration of access control rules exclusively for the RPC output
   section, for an <rpc-reply> message that does not return data from a
   conceptual database or non-configuration data suitable for retrieval
   with the <get> operation is outside the scope of this document.  For
   RPC operations which do not access any data nodes, then any client
   authorized to invoke the RPC operation is also authorized to receive
   the <rpc-reply> for that RPC operation.

3.3.7.  Outgoing <notification> Authorization

   The <notification> message should be checked by the server to make
   sure no unauthorized data is contained within it.  If so, the
   restricted data must be removed from the message before it is sent to
   the client.

   Configuration of access control rules specifically for descendent
   nodes of the notification event type element are outside the scope of
   this document.  If the session is authorized to receive the
   notification event type, then it is also authorized to receive any
   data it contains.

   The following figure shows the conceptual message processing model
   for outgoing <notification> messages.













Bierman                  Expires August 29, 2010               [Page 23]


Internet-Draft                    NACM                     February 2010


                   NETCONF server
                  +------------+
                  |    XML     |
                  |   message  |
                  | generator  |
                  +------------+
                        ^
                        |
                +----------------+
                | <notification> |
                |  generator     |
                +----------------+
                        ^
                        |
               +=================+
               | <notification>  |
               |  access control |
               |  <eventType>    |
               +=================+
                        ^
                        |
            +------------------------+
            | server instrumentation |
            +------------------------+
                      |     ^
                      V     |
             +----------------------+
             |    configuration     |
             |      database        |
             +----------------------+



                                 Figure 4

   The generation of a notification event for a specific subscription is
   authorized by following these steps:

   1.   If the <enable-nacm> parameter is set to 'false', then the
        notification event is permitted.

   2.   If the session is associated with the 'superuser' account, then
        the notification event is permitted.

   3.   If the requested operation is the NETCONF <replayComplete> or
        <notificationComplete> event type, then the notification event
        is permitted.




Bierman                  Expires August 29, 2010               [Page 24]


Internet-Draft                    NACM                     February 2010


   4.   Check all the <group> entries for ones that contain a <user-
        name> entry that matches the user name for the session that
        started the notification subscription.

   5.   If no groups are found:

        *  If the requested notification is associated with a YANG
           module advertised in the server capabilities, and the
           notification statement contains a nacm:secure or nacm:very-
           secure extension, then the notification event is dropped for
           the associated subscription.

        *  If the <read-default> parameter is set to 'permit', then
           permit the notification event, otherwise drop this event type
           for the associated subscription.

   6.   Check if there are any matching <notification-rule> entries for
        the specific notification event type being delivered to the
        subscription.  Any matching rules are processing in user-defined
        order, in case there are multiple <notification-rule> entries
        for the requested notification event type.

   7.   If a <notification-rule> entry is found, then check the
        <allowed-rights> bits field for the entry, otherwise continue.
        If the 'read' bit is present in the <allowed-rights> bits field
        then the notification event type is permitted, otherwise it is
        dropped for the associated subscription.

   8.   Check if there are any matching <module-rule> entries for the
        same module as the notification event type.  Any matching rules
        are processing in user-defined order, in case there are multiple
        <module-rule> entries for the module containing the notification
        event type.

   9.   If a <module-rule> entry is found, then check the <allowed-
        rights> bits field for the entry, otherwise continue.  If the
        'read' bit is present in the <allowed-rights> bits field then
        the notification event type is permitted, otherwise it is
        dropped for the associated subscription.

   10.  If the requested event type is identified an a nacm:very-secure
        notification definition, then the notification event type is
        denied.

   11.  If the <read-default> parameter is set to 'permit', then permit
        the notification event type, otherwise it is dropped for the
        associated subscription.`<




Bierman                  Expires August 29, 2010               [Page 25]


Internet-Draft                    NACM                     February 2010


3.4.  Data Model Definitions

   This section defines the semantics of the conceptual data structures
   found in the data model in Section 3.4.

3.4.1.  High Level Procedures

   There are some high level management procedures that an administrator
   needs to consider before using this access control model:

   1.  Configure the global settings.

   2.  Configure one or more user groups.

   3.  Configure zero or more access control rules for specific modules.

   4.  Configure zero or more access control rules for specific RPC
       operations.

   5.  Configure zero or more access control rules for data node access.

   6.  Configure zero or more access control rules for notification
       event type access.

3.4.2.  Data Organization

   The top-level element is called <nacm>, and it is defined the 'nacm'
   module namespace.

   There are several data structures defined as child nodes of the
   <nacm> element:

   leaf <enable-nacm>:  On/off boolean switch to enable or disable
      access control enforcement.

   leaf <read-default>:  Enumeration to permit or deny default read
      access requests.

   leaf <write-default>:  Enumeration to permit or deny default write
      access requests.

   leaf <exec-default>:  Enumeration to permit or deny default RPC
      operation execution requests.

   leaf <denied-rpcs>:  Read-only counter of the number of times the
      server has denied an RPC operation request, since the last reboot
      of the server.




Bierman                  Expires August 29, 2010               [Page 26]


Internet-Draft                    NACM                     February 2010


   leaf <denied-data-writes>:  Read-only counter of the number of times
      the server has denied a data node write request, since the last
      reboot of the server.

   container <groups>:  Configures the groups used within the access
      control system.

      list <group>:  A list of user names belonging to the same
         administrative group.

   container <rules>:  Configures the access control rules used within
      the server.

      list <module-rule>:  Configures the access control rules for a
         specific module.

      list <rpc-rule>:  Configures the access control rules for RPC
         operation invocation.

      list <data-rule>:  Configures the access control rules for
         configuration database access.

      list <notification-rule>:  Configures the access control rules for
         controlling delivery of <notification> events.

3.4.3.  YANG Module

   The following YANG module is provided to specify the normative
   NETCONF content that must by supported by the server.


   <CODE BEGINS> file="nacm.yang"

   module nacm {

       namespace "file://draft-bierman-netconf-access-control-01.txt";

       prefix "nacm";

       import ietf-yang-types { prefix yang; }

       organization  "Netconf Central, Inc.";

       contact "Andy Bierman <andy@netconfcentral.org>.";

       description
         "NETCONF Server Access Control Model";




Bierman                  Expires August 29, 2010               [Page 27]


Internet-Draft                    NACM                     February 2010


       revision 2010-02-21 {
           description
             "Initial version (work-in-progress).";
       }

       typedef nacm-user-name {
           description "General Purpose User Name string.";
           type string {
               length "1..64";
               pattern '[a-z,A-Z,_][a-z,A-Z,0-9,\-,_,@,.]{0,63}';
           }
       }

       typedef nacm-rights {
         description
           "NETCONF Access Rights";

         type bits {
           bit read {
              description
                 "Read access allowed to all specified data.
                  Any protocol operation or notification that
                  returns data to an application is a read
                  operation.";
           }
           bit write {
              description
                 "Write access allowed to all specified data.
                  Any protocol operation that alters a database
                  is a write operation.";

           }
           bit exec {
              description
                 "Execution access to the specified RPC operation.
                  Any RPC operation invocation is an exec operation.";
           }
         }
       }

       typedef nacm-group {
         description
           "Type of administrative group that can be
            assigned to the user, and specified in
            an access control rule.

            The identityref data type is used to allow as
            many groups to be added as needed.  There are



Bierman                  Expires August 29, 2010               [Page 28]


Internet-Draft                    NACM                     February 2010


            no standard semantics for each identity.
            It simply represents a unique group name.";

         type identityref {
            base nacm-groups;
         }
       }

       typedef nacm-action {
          description
             "Action taken by the server when a particular
              rule matches.";
          type enumeration {
              enum permit {
                  description "Requested action is permitted.";
              }
              enum deny {
                  description "Requested action is denied.";
              }
          }
       }

       typedef schema-instance-identifier {
         description
           "Path expression used to represent a special
            schema-instance identifier string.

            A schema-instance-identifier value string 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 schema-instance-identifier
            represents all possible server instances for that key.";
         type string;
       }

       extension secure {
         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 'superuser' to have write or execute
            default nacm-rights for the node.  An explicit access
            control rule is required for all other users.

            The 'secure' extension may appear within a data, rpc,
            or notification node definition.  It is ignored



Bierman                  Expires August 29, 2010               [Page 29]


Internet-Draft                    NACM                     February 2010


            otherwise.";
       }

       extension very-secure {
         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 'superuser' to have read, write, or execute
            default nacm-rights for the node.  An explicit access
            control rule is required for all other users.

            The 'very-secure' extension may appear within a data, rpc,
            or notification node definition.  It is ignored
            otherwise.";
       }

       identity nacm-groups {
          description
             "Root of all NETCONF Administrative Groups";
       }

       identity admin {
          description
             "Example Administrator group.";
          base nacm-groups;
       }

       identity monitor {
          description
             "Example Monitoring group.";
          base nacm-groups;
       }

       identity guest {
          description
             "Example Guest group.";
          base nacm-groups;
       }

       container nacm {
           nacm:very-secure;

           description
             "Parameters for NETCONF Access Control Model.";

           presence



Bierman                  Expires August 29, 2010               [Page 30]


Internet-Draft                    NACM                     February 2010


            "An empty nacm container indicates that the
             NACM service is running, and possibly using
             all default parameters.";

           leaf enable-nacm {
              description
                "Enable or disable all NETCONF access control
                 enforcement.  If 'true', then enforcement
                 is enabled.  If 'false', then enforcement
                 is disabled.";
              type boolean;
              default true;
           }

           leaf read-default {
               description
                 "Controls whether read access is granted if
                  no appropriate rule is found for a
                  particular read request.";
               type nacm-action;
               default "permit";
           }

           leaf write-default {
               description
                 "Controls whether write access is granted if
                  no appropriate rule is found for a
                  particular write request.";
               type nacm-action;
               default "deny";
           }

           leaf exec-default {
               description
                 "Controls whether exec access is granted if
                  no appropriate rule is found for a
                  particular RPC operation request.";
               type nacm-action;
               default "permit";
           }

           leaf denied-rpcs {
               description
                 "Number of times an RPC operation request was denied";
               type yang:zero-based-counter32;
               config false;
           }




Bierman                  Expires August 29, 2010               [Page 31]


Internet-Draft                    NACM                     February 2010


           leaf denied-data-writes {
               description
                 "Number of times a request to alter a data node
                  was denied.";
               type yang:zero-based-counter32;
               config false;
           }

           container groups {
               description
                 "NACM Group Table";

               list group {
                   description "One NACM Group Entry";

                   key group-identity;

                   leaf group-identity {
                       description
                         "Group identity associated with this entry.";
                       type nacm-group;
                   }

                   leaf-list user-name {
                       description
                         "Each entry identifies the user name of
                          a member of the group associated with
                          this entry.";
                       type nacm-user-name;
                   }
               }
           }

           container rules {
               description
                 "NETCONF Access Control Rules.";

               grouping common-rule-parms {
                   leaf rule-name {
                       description
                         "Arbitrary name assigned to the
                          access control rule.";
                       type string {
                          length "1..1023";
                       }
                   }

                   leaf allowed-rights {



Bierman                  Expires August 29, 2010               [Page 32]


Internet-Draft                    NACM                     February 2010


                       description
                         "List of access rights granted to
                          specified administrative groups for the
                          content specified by the associated path.";
                       type nacm-rights;
                       mandatory true;
                   }

                   leaf-list allowed-group {
                       description
                         "List of administrative groups which will be
                          assigned the associated access rights
                          for the content specified by the associated
                          path.";
                       type nacm-group;
                       min-elements 1;
                   }

                   leaf comment {
                       description
                         "A textual description of the access rule.";
                       type string {
                         length "0..4095";
                       }
                   }
               }

               list module-rule {
                   description
                      "One Module Access Rule.
                       Rules are processed in user-defined order.
                       A module rule is considered a match if
                       the XML namespace for the specified module
                       name matches the XML namespace used within
                       a NETCONF PDU, and the administrative group
                       associated with the requesting session is
                       specified in the 'allowed-group' leaf-list.";

                   ordered-by user;

                   key "module-name rule-name";

                   leaf module-name {
                       description
                         "Name of the module associated with
                          this rule.";
                       type string {
                           length "1..max";



Bierman                  Expires August 29, 2010               [Page 33]


Internet-Draft                    NACM                     February 2010


                       }
                   }

                   uses common-rule-parms;
               }

               list rpc-rule {
                   description
                      "One RPC Operation Access Rule.
                       Rules are processed in user-defined order.
                       An RPC rule is considered a match if
                       the module name of the requested RPC
                       operation matches 'rpc-module-name',
                       the requested RPC operation matches
                       'rpc-name', and an administrative group
                       associated with the session user
                       is listed in the 'allowed-group'
                       leaf-list";

                   ordered-by user;

                   key "rpc-module-name
                        rpc-name
                        rule-name";

                   leaf rpc-module-name {
                       description
                         "Name of the module defining this
                          RPC operation.";
                       type string {
                           length "1..max";
                       }
                   }

                   leaf rpc-name {
                       description
                         "Name of the RPC operation.";
                       type string {
                           length "1..max";
                       }
                   }

                   uses common-rule-parms;
               }

               list data-rule {
                   description
                     "One Data Access Control Rule.



Bierman                  Expires August 29, 2010               [Page 34]


Internet-Draft                    NACM                     February 2010


                      Rules are processed in user-defined order.
                      A data rule is considered to match when
                      the path expression identifies
                      the same node that is being accessed
                      in the NETCONF database, and the administrative
                      group associated with the session is identified
                      in the 'allowed-group' leaf-list.";

                   key "rule-name";

                   ordered-by user;

                   leaf path {
                     description
                       "Schema 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 database contents.";

                     type schema-instance-identifier;
                     mandatory true;
                   }

                   uses common-rule-parms;
               }

               list notification-rule {
                   description
                      "One Notification Access Rule.
                       A notification is considered a match if
                       the module name of the requested
                       event type matches 'notification-module-name',
                       the requested event type matches the
                       'notification-name', and the administrative group
                       associated with the requesting session
                       is listed in the 'allowed-group' leaf-list.";

                   ordered-by user;

                   key "notification-module-name
                        notification-name



Bierman                  Expires August 29, 2010               [Page 35]


Internet-Draft                    NACM                     February 2010


                        rule-name";

                   leaf notification-module-name {
                       description
                         "Name of the module defining this
                          notification event type.";
                       type string {
                           length "1..max";
                       }
                   }

                   leaf notification-name {
                       description
                         "Name of the notification event.";
                       type string {
                           length "1..max";
                       }
                   }

                   uses common-rule-parms;
               }
           }
       }

   }





   <CODE ENDS>

                                 Figure 5

3.5.  IANA Considerations

   There are two actions that are requested of IANA:

   1.  register data model schema namespace URI (TBD)

   2.  register data model name ('nacm')

3.6.  Security Considerations

   This entire document discusses access control requirements and
   mechanisms for restricting NETCONF protocol behavior within a given
   session.




Bierman                  Expires August 29, 2010               [Page 36]


Internet-Draft                    NACM                     February 2010


   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 which allowed access to system resources.

   This document incorporates the optional use of a superuser account,
   which can be used to bypass access control enforcement.
   Configuration user accounts is outside the scope of this document,
   however it is suggested that the 'root' account not be used for
   NETCONF over SSH servers, because 'root' SSH logins should be
   disabled in the SSH server.

   If the server chooses to allow user configuration of the access
   control system, then only sessions using the 'superuser'
   administrative user should be allowed to have write access to the
   data model.

   If the server chooses to allow user retrieval of the access control
   system configuration, then only sessions using the 'superuser'
   administrative user should be allowed to have read access to the data
   model.

   There is a risk that invocation of non-standard RPC operations will
   have undocumented side effects.  An administrator should construct
   access control rules such that the configuration database is
   protected from such side effects.  Also, such RPC operations should
   never be invoked by a session using the 'superuser' administrative
   user.

   There is a risk that non-standard RPC operations, or even the
   standard <get> operation, may return data which 'aliases' or 'copies'
   sensitive data from a different data object.  In this case, the
   namespace and/or the element name will not match the values for the
   sensitive data, which is then fully or partially copied into a
   different namespace and/or element.  An administrator should avoid
   using data models which use this practice.

   An administrator should restrict write access to all configurable
   objects within this data model.  It is suggested that only sessions
   using the 'superuser' administrative role be permitted to configure
   the data model defined in this document.

   If write access is allowed for configuration of access control rules,
   then care must be taken not to disrupt the access control
   enforcement.

   An administrator should restrict read access to the following objects
   within this data model, which reveal access control configuration



Bierman                  Expires August 29, 2010               [Page 37]


Internet-Draft                    NACM                     February 2010


   which could be considered sensitive.

   o  enable-nacm

   o  read-default

   o  write-default

   o  exec-default

   o  groups

   o  rules






































Bierman                  Expires August 29, 2010               [Page 38]


Internet-Draft                    NACM                     February 2010


4.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC4741]  Enns, R., "NETCONF Configuration Protocol", RFC 4741,
              December 2006.

   [RFC4742]  Wasserman, M. and T. Goddard, "Using the NETCONF
              Configuration Protocol over Secure SHell (SSH)", RFC 4742,
              December 2006.

   [RFC5277]  Chisholm, S. and H. Trevino, "NETCONF Event
              Notifications", RFC 5277, July 2008.

   [W3C.REC-xml]
              Bray, T., Paoli, J., Sperberg-McQueen, C., and E. Maler,
              "Extensible Markup Language (XML) 1.0 (2nd ed)", W3C REC-
              xml, October 2000, <http://www.w3.org/TR/REC-xml>.

   [I-D.ietf-netmod-yang]
              Bjorklund, M., "YANG - A data modeling language for
              NETCONF", draft-ietf-netmod-yang-11 (work in progress),
              February 2010.

   [I-D.ietf-netmod-yang-types]
              Schoenwaelder, J., "Common YANG Data Types",
              draft-ietf-netmod-yang-types-07 (work in progress),
              February 2010.






















Bierman                  Expires August 29, 2010               [Page 39]


Internet-Draft                    NACM                     February 2010


Appendix A.  Usage Examples

   The following XML snippets are provided as examples only, to
   demonstrate how NACM can be configured to perform some access control
   tasks.

A.1.  <groups> Example

   There must 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.


  <nc:config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
     <nacm:nacm
        xmlns:nacm="file://draft-bierman-netconf-access-control-01.txt">
        <nacm:groups>
           <nacm:group>
              <nacm:group-identity>nacm:admin</nacm:group-identity>
              <nacm:user-name>admin</nacm:user-name>
              <nacm:user-name>andy</nacm:user-name>
           </nacm:group>
           <nacm:group>
              <nacm:group-identity>nacm:monitor</nacm:group-identity>
              <nacm:user-name>wilma</nacm:user-name>
              <nacm:user-name>bam-bam</nacm:user-name>
           </nacm:group>
           <nacm:group>
              <nacm:group-identity>nacm:guest</nacm:group-identity>
              <nacm:user-name>guest</nacm:user-name>
              <nacm:user-name>guest@example.com</nacm:user-name>
           </nacm:group>
        </nacm:groups>
     </nc:config>
  </nacm:nacm>


   This example shows 3 groups:

   1.  The nacm:admin group contains 2 users named 'admin' and 'andy'.

   2.  The nacm:monitor group contains 2 users named 'wilma' and 'bam-
       bam'.

   3.  The nacm:guest group contains 2 users named 'guest' and
       'guest@example.com'.



Bierman                  Expires August 29, 2010               [Page 40]


Internet-Draft                    NACM                     February 2010


A.2.  <module-rule> Example

   Module rules are used to control access to all the content defined in
   a specific module.  These rules are checked after none of the
   specific rules (i.e., rpc-rule, data-rule, or notification-rule)
   matched the current access request.


  <nc:config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
     <nacm:nacm
        xmlns:nacm="file://draft-bierman-netconf-access-control-01.txt">
        <nacm:rules>
          <nacm:module-rule>
            <nacm:module-name>
              ietf-netconf-monitoring
            </nacm:module-name>
            <nacm:rule-name>1</nacm:rule-name>
            <nacm:allowed-rights>read</nacm:allowed-rights>
            <nacm:allowed-group>nacm:admin</nacm:allowed-group>
            <nacm:allowed-group>nacm:monitor</nacm:allowed-group>
            <nacm:comment>
              do not allow guests to read the netconf information
            </nacm:comment>
          </nacm:module-rule>
          <nacm:module-rule>
            <nacm:module-name>ietf-netconf</nacm:module-name>
            <nacm:rule-name>1</nacm:rule-name>
            <nacm:allowed-rights>read write exec</nacm:allowed-rights>
            <nacm:allowed-group>nacm:admin</nacm:allowed-group>
            <nacm:comment>
              allow admin complete access to the standard operations
            </nacm:comment>
          </nacm:module-rule>
        </nacm:rules>
     </nc:config>
  </nacm:nacm>


   This example shows 2 module rules:

   1.  This rule allows the admin and monitor groups (but not the guest
       group) to read the <netconf-state> sub-tree, which is defined in
       the ietf-netconf-monitoring YANG module.

   2.  This rule allows complete access to the ietf-netconf module for
       the admin group.





Bierman                  Expires August 29, 2010               [Page 41]


Internet-Draft                    NACM                     February 2010


A.3.  <rpc-rule> Example

   RPC rules are used to control access to a specific RPC operation.


  <nc:config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
     <nacm:nacm
        xmlns:nacm="file://draft-bierman-netconf-access-control-01.txt">
        <nacm:rules>
          <nacm:rpc-rule>
            <nacm:rpc-module-name>
              ietf-netconf
            </nacm:rpc-module-name>
            <nacm:rpc-name>
              kill-session
            </nacm:rpc-name>
            <nacm:rule-name>1</nacm:rule-name>
            <nacm:allowed-rights/>
            <nacm:allowed-group>nacm:monitor</nacm:allowed-group>
            <nacm:allowed-group>nacm:guest</nacm:allowed-group>
            <nacm:comment>
              do not allow monitor or guest to kill another session
            </nacm:comment>
          </nacm:rpc-rule>
          <nacm:rpc-rule>
            <nacm:rpc-module-name>
              ietf-netconf
            </nacm:rpc-module-name>
            <nacm:rpc-name>
              delete-config
            </nacm:rpc-name>
            <nacm:rule-name>1</nacm:rule-name>
            <nacm:allowed-rights/>
            <nacm:allowed-group>nacm:monitor</nacm:allowed-group>
            <nacm:allowed-group>nacm:guest</nacm:allowed-group>
            <nacm:comment>
              do not allow monitor or guest to delete any configs
            </nacm:comment>
          </nacm:rpc-rule>
        </nacm:rules>
     </nc:config>
  </nacm:nacm>


   This example shows 2 RPC rules:

   1.  This rule prevents the monitor or guest groups (but not the admin
       group) from invoking the NETCONF <kill-session> RPC operation.



Bierman                  Expires August 29, 2010               [Page 42]


Internet-Draft                    NACM                     February 2010


   2.  This rule prevents the monitor or guest groups (but not the admin
       group) from invoking the NETCONF <delete-config> RPC operation.

A.4.  <data-rule> Example

   Data rules are used to control access to specific (config and non-
   config) data nodes within the NETCONF content provided by the server.


  <nc:config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
     <nacm:nacm
        xmlns:nacm="file://draft-bierman-netconf-access-control-01.txt">
        <nacm:rules>
          <nacm:data-rule>
            <nacm:rule-name>data-1</nacm:rule-name>
            <nacm:path>/nacm:nacm</nacm:path>
            <nacm:allowed-rights>read write</nacm:allowed-rights>
            <nacm:allowed-group>nacm:admin</nacm:allowed-group>
            <nacm:comment>
              allow admin access to /nacm
            </nacm:comment>
          </nacm:data-rule>
          <nacm:data-rule>
            <nacm:rule-name>data-acme-config</nacm:rule-name>
            <nacm:path
               xmlns:acme="http://example.com/ns/netconf">
              /acme:acme-netconf/acme:config-parameters
            </nacm:path>
            <nacm:allowed-rights>read write</nacm:allowed-rights>
            <nacm:allowed-group>nacm:admin</nacm:allowed-group>
            <nacm:allowed-group>nacm:monitor</nacm:allowed-group>
            <nacm:comment>
              allow admin and monitor to access acme
              netconf config parameters.
            </nacm:comment>
          </nacm:data-rule>
          <nacm:data-rule>
            <nacm:rule-name>dummy-itf</nacm:rule-name>
            <nacm:path
               xmlns:acme="http://example.com/ns/itf">
              /acme:interfaces/acme:interface[acme:name='dummy']
            </nacm:path>
            <nacm:allowed-rights>read write</nacm:allowed-rights>
            <nacm:allowed-group>nacm:monitor</nacm:allowed-group>
            <nacm:allowed-group>nacm:guest</nacm:allowed-group>
            <nacm:comment>
              allow monitor and guest full access to acme
              dummy interface



Bierman                  Expires August 29, 2010               [Page 43]


Internet-Draft                    NACM                     February 2010


            </nacm:comment>
          </nacm:data-rule>
          <nacm:data-rule>
            <nacm:rule-name>admin-itf</nacm:rule-name>
            <nacm:path
               xmlns:acme="http://example.com/ns/itf">
              /acme:interfaces/acme:interface
            </nacm:path>
            <nacm:allowed-rights>read write</nacm:allowed-rights>
            <nacm:allowed-group>nacm:admin</nacm:allowed-group>
            <nacm:comment>
              allow admin full access to all acme interfaces
            </nacm:comment>
          </nacm:data-rule>
        </nacm:rules>
     </nc:config>
  </nacm:nacm>


   This example shows 4 data rules:

   data-1:  This rule gives the admin group read-write access to the
      <nacm> sub-tree.

   data-acme-config:  This rule gives the admin and monitor groups read-
      write access to the acme <config-parameters>.

   dummy-itf:  This rule gives the monitor and guest groups read-write
      access to the acme <interface>. entry named 'dummy'.

   admin-itf:  This rule gives the admin group read-write access to all
      acme <interface>. entries.

A.5.  <notification-rule> Example

   Notification rules are used to control access to a specific
   notification event type.














Bierman                  Expires August 29, 2010               [Page 44]


Internet-Draft                    NACM                     February 2010


  <nc:config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
     <nacm:nacm
        xmlns:nacm="file://draft-bierman-netconf-access-control-01.txt">
        <nacm:rules>
          <nacm:notification-rule>
            <nacm:notification-module-name>
              acme-system
            </nacm:notification-module-name>
            <nacm:notification-name>
              sys-config-change
            </nacm:notification-name>
            <nacm:rule-name>1</nacm:rule-name>
            <nacm:allowed-rights/>
            <nacm:allowed-group>nacm:monitor</nacm:allowed-group>
            <nacm:allowed-group>nacm:guest</nacm:allowed-group>
            <nacm:comment>
              only the admin group can receive config change events
            </nacm:comment>
          </nacm:notification-rule>
        </nacm:rules>
     </nc:config>
  </nacm:nacm>


   This example shows 1 notification rule:

   1.  This rule prevents the monitor or guest groups (but not the admin
       group) from receiving the acme <sys-config-change> event type.























Bierman                  Expires August 29, 2010               [Page 45]


Internet-Draft                    NACM                     February 2010


Appendix B.  Open Issues

   1.  Do modules need to be identified by their XML namespace URI, or
       is the module name good enough?

   2.  Are any more wildcard mechanisms needed to specify the scope of
       an access control rule?

   3.  Should regular expressions (module='foo-*') be allowed in schema-
       instance-identifier strings?

   4.  Should XPath be allowed for specifying access control rules for
       data nodes?

   5.  Are any 'access-denied' notifications needed?

   6.  Should data rules support nodes that would not be eligible for
       retrieval with the <get> operation?  If so, should schema nodes
       such as rpc 'input' or 'output' be in the path expression?  How
       would notification content be identified?

   7.  Do any external access control models need to be supported
       somehow?  For example, should the <groups> configuration be
       optionally read-only, so it can just mirror the internal
       (external or proprietary) group configuration?

   8.  Should the nacm:secure and nacm:very-secure extensions be
       optional to support, via a YANG feature?

   9.  Should the default access levels (e.g., read-default) be more
       restrictive by default?  Shiuld these defaults be a vendor
       decision?  An operator decision?  It is important that the server
       be able to install a factory default <nacm> container if needed.


















Bierman                  Expires August 29, 2010               [Page 46]


Internet-Draft                    NACM                     February 2010


Author's Address

   Andy Bierman
   InterWorking Labs
   303 Potrero Street, Suite 52
   Santa Cruz, CA  95060-2760
   USA

   Phone: +1 831 460 7010
   Email: andyb@iwl.com









































Bierman                  Expires August 29, 2010               [Page 47]