NETMOD Working Group                                               Q. Wu
Internet-Draft                                                    Huawei
Intended status: Standards Track                              B. Lengyel
Expires: August 15, 19, 2020                                Ericsson Hungary
                                                                  Y. Niu
                                                                  Huawei
                                                       February 12, 16, 2020

                        Factory Default Setting
                  draft-ietf-netmod-factory-default-11
                  draft-ietf-netmod-factory-default-12

Abstract

   This document defines a method to reset a server to its factory
   default content.  The reset operation may be used, e.g., when the
   existing configuration has major errors so re-starting the
   configuration process from scratch is the best option.

   A new "factory-reset" RPC is defined.  When resetting a device, all
   previous configuration settings will be lost and replaced by the
   factory default content.

   A new optional "factory-default" read-only datastore is defined, that
   contains the factory default configuration for the device.

Status of This Memo

   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 August 15, 19, 2020.

Copyright Notice

   Copyright (c) 2020 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.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Factory-Reset RPC . . . . . . . . . . . . . . . . . . . . . .   3
   3.  Factory-Default Datastore . . . . . . . . . . . . . . . . . .   4
   4.  YANG Module . . . . . . . . . . . . . . . . . . . . . . . . .   5
   5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   7
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .   7
   7.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   7
   8.  Contributors  . . . . . . . . . . . . . . . . . . . . . . . .   8
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   8
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .   8
     9.2.  Informative References  . . . . . . . . . . . . . . . . .   8
   Appendix A.  Changes between revisions  . . . . . . . . . . . . .   9
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  11

1.  Introduction

   This document defines a method to reset a server to its factory
   default content.  The reset operation may be used, e.g., when the
   existing configuration has major errors so re-starting the
   configuration process from scratch is the best option.

   A "factory-reset" RPC is defined.  When resetting a device, all
   previous configuration settings will be lost and replaced by the
   factory default content.

   A "factory-default" read-only datastore is defined, that contains the
   data to replace the contents of implemented read-write conventional
   configuration datastores at reset.  This datastore can also be used
   in the <get-data> operation.

   The YANG data model in this document conforms to the Network
   Management Datastore Architecture defined in [RFC8342].

1.1.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

   The following terms are defined in [RFC8342] [RFC7950] and are not
   redefined here:

   o  server

   o  startup configuration datastore

   o  candidate configuration datastore

   o  running configuration datastore

   o  intended configuration datastore

   o  operational state datastore

   o  conventional configuration datastore

   o  RPC operation

   The following terms are defined in this document as follows:

   o  factory-default datastore: A read-only configuration datastore
      holding a preconfigured initial configuration that is used to
      initialize the configuration of a server.

2.  Factory-Reset RPC

   A new "factory-reset" RPC is introduced.  Upon receiving the RPC

   o  All supported conventional read-write configuration datastores
      (i.e. <running>, <startup>, and <candidate>) are all reset to the
      contents of <factory-default>.

   o  Read-only datastores receive their content from other
      datastores(e.g. <intended> gets its content from <running>).

   o  All data in any ephemeral datastores MUST be discarded.

   o  The contents of the <operational> datastore MUST reflect the
      operational state of the device after applying the factory default
      configuration.

   In addition, the "factory-reset" RPC MUST restore non-volatile
   storage to factory condition.  Depending on the system, this may
   entail deleting dynamically generated files, such as those containing
   keys (e.g., /etc/ssl/private), certificates (e.g., /etc/ssl), logs
   (e.g., /var/log), and temporary files (e.g., /tmp/*).  All security
   sensitive data (i.e., private keys, passwords, etc.)  SHOULD be
   overwritten with zeros or a pattern before deletion.  The "factory-
   reset" RPC MAY also be used to trigger some other resetting tasks
   such as restarting the node or some of the software processes.

   Note that operators should be aware that since all read-write
   datastores are immediately reset to factory default, the device may
   become unreachable on the network.  It is important to understand how
   a given vendor's device will behave after the RPC is executed.
   Implementors SHOULD reboot the device or otherwise restart processes
   needed to bootstrap it.

3.  Factory-Default Datastore

   Following the guidelines for defining Datastores in the appendix A of
   [RFC8342], this document introduces a new optional datastore resource
   named "factory-default" that represents a preconfigured minimal
   initial configuration that can be used to initialize the
   configuration of a server.  A device MAY implement the "factory-
   reset" RPC without implementing the "factory-default" datastore,
   which would only eliminate the ability to programmatically determine
   the factory default configuration.

   o  Name: "factory-default"

   o  YANG modules: all

   o  YANG nodes: all "config true" data nodes

   o  Management operations: The content of the datastore is set by the
      server in an implementation dependent manner.  The content can not
      be changed by management operations via NETCONF, RESTCONF, the CLI
      etc.  unless specialized, dedicated operations are provided.  The
      datastore can be read using the standard NETCONF/RESTCONF protocol
      operations.  The "factory-reset" operation copies the factory
      default content to <running> and, if present, <startup> and/or
      <candidate> and then the content of these datastores is propagated
      automatically to any other read only datastores, e.g., <intended>
      and <operational>.

   o  Origin: This document does not define a new origin identity as it
      does not interact with <operational> datastore.

   o  Protocols: RESTCONF, NETCONF and other management protocol.

   o  Defining YANG module: "ietf-factory-default".

   The contents of <factory-default> is defined by the device vendor and
   MUST persist across device restarts.

4.  YANG Module

   This module imports typedefs from uses the "datastore" identity [RFC8342], and it references the
   "default-deny-all" extension statement from [RFC8341].

  <CODE BEGINS> file "ietf-factory-default@2019-11-27.yang"
     module ietf-factory-default {
       yang-version 1.1;
       namespace "urn:ietf:params:xml:ns:yang:ietf-factory-default";
       prefix fd;

       import ietf-datastores {
         prefix ds;
         reference
           "RFC 8342: Network Management Datastore Architecture (NMDA)";
       }
       import ietf-netconf-acm {
         prefix nacm;
         reference
          "RFC8341: Network Configuration Access Control Model";
       }

       organization
         "IETF NETMOD (Network Modeling) Working Group";
       contact
         "WG Web:   <https://tools.ietf.org/wg/netconf/>
          WG List:  <mailto:netconf@ietf.org>

          Editor:   Qin Wu
                    <mailto:bill.wu@huawei.com>
          Editor:   Balazs Lengyel
                    <mailto:balazs.lengyel@ericsson.com>
          Editor:   Ye Niu
                    <mailto:niuye@huawei.com>";
       description
         "This module defines an RPC called 'factory-reset', and a
          datastore identity called 'factory-default'.

          It provides functionality to reset a server to its
          factory default configuration and, when supported, to discover
          the factory default configuration contents independent of
          resetting the server.

          Copyright (c) 2019 2020 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 2019-11-27 {
         description
           "Initial revision.";
         reference
           "RFC XXXX: Factory default Setting";
       }

       feature factory-default-datastore {
         description
           "Indicates that the factory default configuration is
            available as a datastore.";
       }

       rpc factory-reset {
         nacm:default-deny-all;
         description
           "The server resets the content of all read-write
            configuration datastores (i.e.,<running>, <startup>,
            and <candidate>) to their factory default content.";
       }

       identity factory-default {
         if-feature "factory-default-datastore";
         base ds:datastore;
         description
           "This read-only datastore contains the factory default
           configuration for the device used to replace the contents
           of the read-write conventional configuration datastores
           during a 'factory-reset' RPC operation.";
       }
     }
  <CODE ENDS>

5.  IANA Considerations

   This document registers one URI in the IETF XML Registry [RFC3688].
   The following registration has been made:

     URI: urn:ietf:params:xml:ns:yang:ietf-factory-default
     Registrant Contact: The IESG.
     XML: N/A, the requested URI is an XML namespace.

   This document registers one YANG module in the YANG Module Names
   Registry [RFC6020].  The following registration has been made:

     name: ietf-factory-default
     namespace: urn:ietf:params:xml:ns:yang:ietf-factory-default
     prefix: fd
     RFC: xxxx

6.  Security Considerations

   The YANG module defined in this document extends the base operations
   for NETCONF [RFC6241] and 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 [RFC8446].

   Access to the "factory-reset" RPC operation is considered sensitive
   and therefore has been restricted using the "default-deny-all" access
   control defined in [RFC8341].

   The "factory-reset" RPC can prevent any further management of the
   device if the session and client config is included in the factory
   default contents.

   The operational disruption caused by setting the config to factory
   default contents varies greatly depending on the implementation and
   current config.

7.  Acknowledgements

   Thanks to Juergen Schoenwaelder, Ladislav Lhotka, Alex Campbell, Joe
   Clarke, Robert Wilton, Kent Watsen, Joel Jaeggli, Lou Berger, Andy
   Bierman, Susan Hares to review this draft and provide important input
   to this document.

8.  Contributors

      Rohit R Ranade
      Huawei
      Email: rohitrranade@huawei.com

9.  References

9.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8342]  Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
              and R. Wilton, "Network Management Datastore Architecture
              (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
              <https://www.rfc-editor.org/info/rfc8342>.

9.2.  Informative References

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

Appendix A.  Changes between revisions

   Editorial Note (To be removed by RFC Editor)

   v11 - 12

   o  Fix IDnits and reference issues from Shepherd review.

   v10 - 11

   o  Incorporate additional Shepherd review's comments.

   v09 - 10

   o  Incorporate Shepherd review's comments.

   v08 - 09

   o  Provide some guideline for operators and implementor who implement
      factory defaut method.

   v07 - 08

   o  Provide clarification and recommendation on the relationship
      between factory-reset RPC and reboot.

   o  Nits fixed based on YANG Doctor Review.

   v06 - 07

   o  Remove Factory default content specification;

   o  Remove reference to YANG instance data file format and zero touch
      provision [RFC8573];

   o  Remove copy-config operation extension on factory-default
      datastore

   v05 - 06

   o  Additional text to enhance security section.

   o  Add nacm:default-deny-all on "factory-reset" RPC.

   o  A few clarification on Factory default content specification.

   v03 - 04

   o  Additional text to clarify factory-reset RPC usage.

   v02 - 03

   o  Update security consideration section.

   v01 - v02

   o  Address security issue in the security consideration section.

   o  Remove an extension to the NETCONF <copy-config> operation which
      allows it to operate on the factory-default datastore.

   o  Add an extension to the NETCONF <get-config> operation which
      allows it to operate on the factory-default datastore.

   v00 - v01

   o  Change YANG server into server defined in NMDA architecture based
      on discussion.

   o  Allow reset the content of all read-write configuraton datastores
      to its factory default content except <candidate>.

   o  Add clarification text on factory-reset protocol operation
      behavior.

   v03 - v00

   o  Change draft name from draft-wu to draft-ietf-netmod-factory-
      default-00 without content changes.

   v02 - v03
   o  Change reset-datastore RPC into factory-reset RPC to allow reset
      the whole device with factory default content.

   o  Remove target datastore parameter from factory-reset RPC.

   o  Other editorial changes.

   v01 - v02

   o  Add copy-config based on Rob's comment.

   o  Reference Update.

   v03 - v00 - v01

   o  Changed name from draft-wu-netconf-restconf-factory-restore to
      draft-wu-netmod-factory-default

   o  Removed copy-config ; reset-datastore is enough

   v02 - v03

   o  Restructured

   o  Made new datastore optional

   o  Removed Netconf capability

   o  Listed Open issues

   v01 - v02

   o  -

   v00 - v01

   o  -

Authors' Addresses

   Qin Wu
   Huawei
   101 Software Avenue, Yuhua District
   Nanjing, Jiangsu  210012
   China

   Email: bill.wu@huawei.com
   Balazs Lengyel
   Ericsson Hungary
   Magyar Tudosok korutja 11
   1117 Budapest
   Hungary

   Phone: +36-70-330-7909
   Email: balazs.lengyel@ericsson.com

   Ye Niu
   Huawei

   Email: niuye@huawei.com