--- 1/draft-ietf-netmod-acl-model-17.txt 2018-03-16 03:13:33.772001086 -0700 +++ 2/draft-ietf-netmod-acl-model-18.txt 2018-03-16 03:13:33.880003660 -0700 @@ -1,46 +1,46 @@ NETMOD WG M. Jethanandani Internet-Draft Intended status: Standards Track L. Huang -Expires: September 4, 2018 General Electric +Expires: September 16, 2018 General Electric S. Agarwal D. Blair Cisco Systems, Inc. - March 3, 2018 + March 15, 2018 Network Access Control List (ACL) YANG Data Model - draft-ietf-netmod-acl-model-17 + draft-ietf-netmod-acl-model-18 Abstract - This document defines a data model for Access Control List (ACL). - ACL is a ordered-by-user set of rules, used to configure the - forwarding behavior in device. Each rule is used to find a match on - a packet, and define actions that will be performed on the packet. + This document defines a data model for Access Control List (ACL). An + ACL is a user-ordered set of rules, used to configure the forwarding + behavior in device. Each rule is used to find a match on a packet, + and define actions that will be performed on the packet. 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 September 4, 2018. + This Internet-Draft will expire on September 16, 2018. Copyright Notice Copyright (c) 2018 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 @@ -48,70 +48,71 @@ 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. Definitions and Acronyms . . . . . . . . . . . . . . . . 4 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 + 1.3. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4 2. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 4 - 3. Understanding ACL's Filters and Actions . . . . . . . . . . . 4 + 3. Understanding ACL's Filters and Actions . . . . . . . . . . . 5 3.1. ACL Modules . . . . . . . . . . . . . . . . . . . . . . . 5 4. ACL YANG Models . . . . . . . . . . . . . . . . . . . . . . . 9 4.1. IETF Access Control List module . . . . . . . . . . . . . 9 4.2. IETF Packet Fields module . . . . . . . . . . . . . . . . 24 4.3. An ACL Example . . . . . . . . . . . . . . . . . . . . . 36 - 4.4. Port Range Usage Example . . . . . . . . . . . . . . . . 37 - 5. Security Considerations . . . . . . . . . . . . . . . . . . . 40 - 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 41 - 6.1. URI Registration . . . . . . . . . . . . . . . . . . . . 41 - 6.2. YANG Module Name Registration . . . . . . . . . . . . . . 41 - 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 42 - 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 - 8.1. Normative References . . . . . . . . . . . . . . . . . . 42 - 8.2. Informative References . . . . . . . . . . . . . . . . . 44 - Appendix A. Extending ACL model examples . . . . . . . . . . . . 44 - A.1. A company proprietary module example . . . . . . . . . . 44 - A.2. Linux nftables . . . . . . . . . . . . . . . . . . . . . 48 - A.3. Ethertypes . . . . . . . . . . . . . . . . . . . . . . . 49 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 57 + 4.4. Port Range Usage and Other Examples . . . . . . . . . . . 37 + 5. Security Considerations . . . . . . . . . . . . . . . . . . . 41 + 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 42 + 6.1. URI Registration . . . . . . . . . . . . . . . . . . . . 42 + 6.2. YANG Module Name Registration . . . . . . . . . . . . . . 42 + 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 43 + 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 43 + 8.1. Normative References . . . . . . . . . . . . . . . . . . 43 + 8.2. Informative References . . . . . . . . . . . . . . . . . 45 + Appendix A. Extending ACL model examples . . . . . . . . . . . . 46 + A.1. A company proprietary module example . . . . . . . . . . 46 + A.2. Linux nftables . . . . . . . . . . . . . . . . . . . . . 49 + A.3. Ethertypes . . . . . . . . . . . . . . . . . . . . . . . 50 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 58 1. Introduction Access Control List (ACL) is one of the basic elements used to configure device forwarding behavior. It is used in many networking technologies such as Policy Based Routing, Firewalls etc. - An ACL is an ordered-by-user set of rules that is used to filter + An ACL is an user-ordered set of rules, that is used to filter traffic on a networking device. Each rule is represented by an Access Control Entry (ACE). Each ACE has a group of match criteria and a group of action criteria. - The match criteria consist of a tuple of packet header match criteria - and can have metadata match criteria as well. + The match criteria allows for definition of packet headers and + metadata, all of which must be true for the match to occur. o Packet header matches apply to fields visible in the packet such - as address or class of service or port numbers. + as address or Class of Service (CoS) or port numbers. - o In case vendor supports it, metadata matches apply to fields + o In case a vendor supports it, metadata matches apply to fields associated with the packet but not in the packet header such as input interface or overall packet length The actions specify what to do with the packet when the matching criteria is met. These actions are any operations that would apply to the packet, such as counting, policing, or simply forwarding. The - list of potential actions is endless depending on the capabilities of - the networked devices. + list of potential actions is unbounded depending on the capabilities + of the networking devices. Access Control List is also widely knowns as ACL (pronounce as [ak-uh l]) or Access List. In this document, Access Control List, ACL and Access List are used interchangeably. The matching of filters and actions in an ACE/ACL are triggered only after application/attachment of the ACL to an interface, VRF, vty/tty session, QoS policy, routing protocols amongst various other config attachment points. Once attached, it is used for filtering traffic using the match criteria in the ACE's and taking appropriate @@ -126,33 +127,35 @@ summarizes all of the substitutions that are needed. Please note that no other RFC Editor instructions are specified anywhere else in this document. Artwork in this document contains shorthand references to drafts in progress. Please apply the following replacements o "XXXX" --> the assigned RFC value for this draft both in this draft and in the YANG models under the revision statement. - o Revision date in model, in the format 2018-03-03 needs to get + o Revision date in model, in the format 2018-03-15 needs to get updated with the date the draft gets approved. The date also needs to get reflected on the line with . o Replace "I-D.ietf-netmod-yang-tree-diagrams" with the assigned RFC number. 1.1. Definitions and Acronyms ACE: Access Control Entry ACL: Access Control List + CoS: Class of Service + DSCP: Differentiated Services Code Point ICMP: Internet Control Message Protocol IP: Internet Protocol IPv4: Internet Protocol version 4 IPv6: Internet Protocol version 6 @@ -163,93 +166,94 @@ UDP: User Datagram Protocol 1.2. 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. +1.3. Tree Diagram + + For a reference to the annotations used in tree diagrams included in + this draft, please see YANG Tree Diagrams + [I-D.ietf-netmod-yang-tree-diagrams]. + 2. Problem Statement This document defines a YANG [RFC7950] data model for the configuration of ACLs. It is very important that model can be used easily by applications/attachments. ACL implementations in every device may vary greatly in terms of the filter constructs and actions that they support. Therefore this draft proposes a model that can be augmented by standard extensions and vendor proprietary models. 3. Understanding ACL's Filters and Actions Although different vendors have different ACL data models, there is a common understanding of what Access Control List (ACL) is. A network - system usually have a list of ACLs, and each ACL contains an ordered + system usually has a list of ACLs, and each ACL contains an ordered list of rules, also known as Access Control Entries (ACE). Each ACE has a group of match criteria and a group of action criteria. The - match criteria consist of packet header matching. It as also - possible for ACE to match on metadata, if supported by the vendor. - Packet header matching applies to fields visible in the packet such - as address or class of service or port numbers. Metadata matching - applies to fields associated with the packet, but not in the packet - header such as input interface, packet length, or source or - destination prefix length. The actions can be any sort of operation - from logging to rate limiting or dropping to simply forwarding. - Actions on the first matching ACE are applied with no processing of - subsequent ACEs. + match criteria allows for definition of packet headers or metadata, + if supported by the vendor. Packet header matching applies to fields + visible in the packet such as address or CoS or port numbers. + Metadata matching applies to fields associated with the packet, but + not in the packet header such as input interface, packet length, or + source or destination prefix length. The actions can be any sort of + operation from logging to rate limiting or dropping to simply + forwarding. Actions on the first matching ACE are applied with no + processing of subsequent ACEs. The model also includes a container to hold overall operational state for each ACL and operational state for each ACE. One ACL can be - applied to multiple targets within the device, such as interfaces of - a networked device, applications or features running in the device, - etc. When applied to interfaces of a networked device, the ACL is - applied in a direction which indicates if it should be applied to - packet entering (input) or leaving the device (output). An example - in the appendix shows how to express it in YANG model. + applied to multiple targets within the device, such as interface of a + networking device, applications or features running in the device, + etc. When applied to interfaces of a networked device, distinct ACLs + are defined for the ingress (input) or egress (output) interface. This draft tries to address the commonalities between all vendors and create a common model, which can be augmented with proprietary - models. The base model is simple and with this design we hope to - achieve enough flexibility for each vendor to extend the base model. + models. The base model is simple in design, and we hope to achieve + enough flexibility for each vendor to extend the base model. The use of feature statements in the model allows vendors to advertise match rules they are capable and willing to support. There are two sets of feature statements a device needs to advertise. The first set of feature statements specify the capability of the device. These include features such as "Device can support ethernet headers" or "Device can support of IPv4 headers". The second set of feature statements specify the combinations of headers the device is willing to support. These include features such as "Plain IPv6 ACL supported" or "Ethernet, IPv4 and IPv6 ACL combinations supported". 3.1. ACL Modules There are two YANG modules in the model. The first module, "ietf- access-control-list", defines generic ACL aspects which are common to all ACLs regardless of their type or vendor. In effect, the module can be viewed as providing a generic ACL "superclass". It imports the second module, "ietf-packet-fields". The match container in "ietf-access-control-list" uses groupings in "ietf-packet-fields" to specify match fields such as port numbers or protocol. The - combination of if-feature checks and must statements allow for the - selection of relevant match fields that a user can define rules for. + combination of 'if-feature' checks and 'must' statements allow for + the selection of relevant match fields that a user can define rules + for. - If there is a need to define new "matches" choice, such as IPFIX + If there is a need to define a new "matches" choice, such as IPFIX [RFC7011], the container "matches" can be augmented. - For a reference to the annotations used in the diagram below, see - YANG Tree Diagrams [I-D.ietf-netmod-yang-tree-diagrams]. - module: ietf-access-control-list - +--rw access-lists + +--rw acls +--rw acl* [name] | +--rw name string | +--rw type? acl-type | +--rw aces | +--rw ace* [name] | +--rw name string | +--rw matches | | +--rw (l2)? | | | +--:(eth) | | | +--rw eth {match-on-eth}? @@ -378,73 +382,73 @@ | | +--rw logging? identityref | +--ro statistics {acl-aggregate-stats}? | +--ro matched-packets? yang:counter64 | +--ro matched-octets? yang:counter64 +--rw attachment-points +--rw interface* [interface-id] {interface-attachment}? +--rw interface-id if:interface-ref +--rw ingress | +--rw acl-sets | +--rw acl-set* [name] - | +--rw name -> /access-lists/acl/name + | +--rw name -> /acls/acl/name | +--ro ace-statistics* [name] {interface-stats}? | +--ro name - | | -> /access-lists/acl/aces/ace/name + | | -> /acls/acl/aces/ace/name | +--ro matched-packets? yang:counter64 | +--ro matched-octets? yang:counter64 +--rw egress +--rw acl-sets +--rw acl-set* [name] - +--rw name -> /access-lists/acl/name + +--rw name -> /acls/acl/name +--ro ace-statistics* [name] {interface-stats}? +--ro name - | -> /access-lists/acl/aces/ace/name + | -> /acls/acl/aces/ace/name +--ro matched-packets? yang:counter64 +--ro matched-octets? yang:counter64 4. ACL YANG Models 4.1. IETF Access Control List module - "ietf-access-control-list" is the standard top level module for - access lists. The "access-lists" container stores a list of "acl". - Each "acl" has information identifying the access list by a name - ("name") and a list ("aces") of rules associated with the "name". - Each of the entries in the list ("aces"), indexed by the string - "name", has containers defining "matches" and "actions". + "ietf-access-control-list" module defines the "acls" container that + has a list of "acl". Each "acl" has information identifying the + access list by a name ("name") and a list ("aces") of rules + associated with the "name". Each of the entries in the list + ("aces"), indexed by the string "name", has containers defining + "matches" and "actions". The model defines several ACL types and actions in the form of identities and features. Features are used by implementors to select the ACL types the system can support and identities are used to validate the types that have been selected. These types are implicitly inherited by the "ace", thus safeguarding against misconfiguration of "ace" types in an "acl". The "matches" define criteria used to identify patterns in "ietf- packet-fields". The choice statements within the match container allow for selection of one header within each of "l2", "l3", or "l4" headers. The "actions" define behavior to undertake once a "match" has been identified. In addition to permit and deny for actions, a - logging option allows for a match to be logged that can be used to - determine which rule was matched upon. The model also defines the - ability for ACL's to be attached to a particular interface. + logging option allows for a match to be logged that can later be used + to determine which rule was matched upon. The model also defines the + ability for ACLs to be attached to a particular interface. Statistics in the ACL can be collected for an "ace" or for an "interface". The feature statements defined for statistics can be used to determine whether statistics are being collected per "ace", or per "interface". This module imports definitions from Common YANG Data Types [RFC6991], and A YANG Data Model for Interface Management [I-D.ietf-netmod-rfc7223bis]. - file "ietf-access-control-list@2018-03-03.yang" + file "ietf-access-control-list@2018-03-15.yang" module ietf-access-control-list { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list"; prefix acl; import ietf-yang-types { prefix yang; reference "RFC 6991 - Common YANG Data Types."; @@ -457,29 +461,30 @@ } import ietf-interfaces { prefix if; reference "I-D.draft-ietf-netmod-rfc7223bis - A YANG Data Model for Interface Management."; } organization - "IETF NETMOD (NETCONF Data Modeling Language) + "IETF NETMOD (Network Modeling Language) Working Group"; contact "WG Web: http://tools.ietf.org/wg/netmod/ WG List: netmod@ietf.org Editor: Mahesh Jethanandani mjethanandani@gmail.com + Editor: Lisa Huang lyihuang16@gmail.com Editor: Sonal Agarwal sagarwal12@gmail.com Editor: Dana Blair dblair@cisco.com"; description "This YANG module defines a component that describe the configuration of Access Control Lists (ACLs). @@ -489,21 +494,21 @@ 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 2018-03-03 { + revision 2018-03-15 { description "Initial version."; reference "RFC XXX: Network Access Control List (ACL) YANG Data Model."; } /* * Identities */ @@ -559,118 +563,118 @@ identity acl-base { description "Base Access Control List type for all Access Control List type identifiers."; } identity ipv4-acl-type { base acl:acl-base; if-feature "ipv4"; description - "ACL that primarily matches on fields from the IPv4 header + "An ACL that matches on fields from the IPv4 header (e.g. IPv4 destination address) and layer 4 headers (e.g. TCP destination port). An acl of type ipv4 does not contain matches on fields in the ethernet header or the IPv6 header."; } + identity ipv6-acl-type { base acl:acl-base; if-feature "ipv6"; description - "ACL that primarily matches on fields from the IPv6 header + "An ACL that matches on fields from the IPv6 header (e.g. IPv6 destination address) and layer 4 headers (e.g. TCP destination port). An acl of type ipv6 does not contain matches on fields in the ethernet header or the IPv4 header."; } identity eth-acl-type { base acl:acl-base; if-feature "eth"; description - "ACL that primarily matches on fields in the ethernet header, + "An ACL that matches on fields in the ethernet header, like 10/100/1000baseT or WiFi Access Control List. An acl of type ethernet does not contain matches on fields in the IPv4 header, IPv6 header or layer 4 headers."; } identity mixed-eth-ipv4-acl-type { base "acl:eth-acl-type"; base "acl:ipv4-acl-type"; if-feature "mixed-eth-ipv4"; description - "ACL that contains a mix of entries that - primarily match on fields in ethernet headers, - entries that primarily match on IPv4 headers. + "An ACL that contains a mix of entries that + match on fields in ethernet headers, + entries that match on IPv4 headers. Matching on layer 4 header fields may also exist in the list."; } identity mixed-eth-ipv6-acl-type { base "acl:eth-acl-type"; base "acl:ipv6-acl-type"; if-feature "mixed-eth-ipv6"; description "ACL that contains a mix of entries that - primarily match on fields in ethernet headers, entries - that primarily match on fields in IPv6 headers. Matching on + match on fields in ethernet headers, entries + that match on fields in IPv6 headers. Matching on layer 4 header fields may also exist in the list."; } identity mixed-eth-ipv4-ipv6-acl-type { base "acl:eth-acl-type"; base "acl:ipv4-acl-type"; base "acl:ipv6-acl-type"; if-feature "mixed-eth-ipv4-ipv6"; description "ACL that contains a mix of entries that - primarily match on fields in ethernet headers, entries - that primarily match on fields in IPv4 headers, and entries - that primarily match on fields in IPv6 headers. Matching on + match on fields in ethernet headers, entries + that match on fields in IPv4 headers, and entries + that match on fields in IPv6 headers. Matching on layer 4 header fields may also exist in the list."; } /* * Features */ /* * Features supported by device */ feature match-on-eth { description - "Device can support matching on ethernet headers."; + "The device can support matching on ethernet headers."; } feature match-on-ipv4 { description - "Device can support matching on IPv4 headers."; + "The device can support matching on IPv4 headers."; } feature match-on-ipv6 { description - "Device can support matching on IPv6 headers."; + "The device can support matching on IPv6 headers."; } feature match-on-tcp { description - "Device can support TCP headers."; + "The device can support TCP headers."; } feature match-on-udp { description - "Device can support UDP header."; + "The device can support UDP header."; } feature match-on-icmp { description - "Device can support ICMP header."; + "The device can support ICMP header."; } - /* * Header classifications combinations supported by * device */ feature eth { if-feature "match-on-eth"; description "Plain Ethernet ACL supported"; } @@ -783,106 +786,105 @@ An implementation that provides counters per entry per interface is not required to also provide an aggregate count, e.g., per entry -- the user is expected to be able implement the required aggregation if such a count is needed."; } } /* * Configuration data nodes */ - container access-lists { + container acls { description "This is a top level container for Access Control Lists. - It can have one or more Access Control Lists."; + It can have one or more acl nodes."; list acl { key "name"; description "An Access Control List(ACL) is an ordered list of - Access List Entries (ACE). Each Access Control Entry has a + Access Control Entries (ACE). Each ACE has a list of match criteria and a list of actions. Since there are several kinds of Access Control Lists implemented with different attributes for different vendors, this model accommodates customizing - Access Control Lists for each kind and for each vendor."; + Access Control Lists for each kind and, for each vendor."; leaf name { type string { length "1..64"; } description - "The name of access-list. A device MAY restrict the length + "The name of access list. A device MAY restrict the length and value of this name, possibly space and special characters are not allowed."; } leaf type { type acl-type; description "Type of access control list. Indicates the primary intended type of match criteria (e.g. ethernet, IPv4, IPv6, mixed, etc) used in the list instance."; } container aces { description - "The access-list-entries container contains - a list of access-list-entries(ACE)."; + "The aces container contains one or more ace nodes."; list ace { key "name"; ordered-by user; description - "List of access list entries(ACE)"; + "List of Access Control Entries (ACEs)"; leaf name { type string { length "1..64"; } description - "A unique name identifying this Access List + "A unique name identifying this Access Control Entry(ACE)."; } container matches { description "The rules in this set determine what fields will be matched upon before any action is taken on them. The rules are selected based on the feature set defined by the server and the acl-type defined. If no matches are defined in a particular container, then any packet will match that container. If no matches are specified at all in an ACE, then any packet will match the ACE."; choice l2 { container eth { - when "derived-from-or-self(../../../../type, " + + when "derived-from-or-self(/acls/acl/type, " + "'acl:eth-acl-type')"; if-feature match-on-eth; uses pf:acl-eth-header-fields; description "Rule set that matches ethernet headers."; } description "Match layer 2 headers, for example ethernet header fields."; } choice l3 { container ipv4 { - when "derived-from-or-self(../../../../type, " + + when "derived-from-or-self(/acls/acl/type, " + "'acl:ipv4-acl-type')"; if-feature match-on-ipv4; uses pf:acl-ip-header-fields; uses pf:acl-ipv4-header-fields; description "Rule set that matches IPv4 headers."; } container ipv6 { - when "derived-from-or-self(../../../../type, " + + when "derived-from-or-self(/acls/acl/type, " + "'acl:ipv6-acl-type')"; if-feature match-on-ipv6; uses pf:acl-ip-header-fields; uses pf:acl-ipv6-header-fields; description "Rule set that matches IPv6 headers."; } description "Choice of either ipv4 or ipv6 headers"; } @@ -894,38 +896,40 @@ container source-port { choice source-port { case range-or-operator { uses pf:port-range-or-operator; description "Source port definition from range or operator."; } description "Choice of source port definition using - range/operator or referring to a group of - source ports"; + range/operator or a choice to support future + 'case' statements, such as one enabling a + group of source ports to be referenced."; } description "Source port definition."; } container destination-port { choice destination-port { case range-or-operator { uses pf:port-range-or-operator; description "Destination port definition from range or operator."; } description "Choice of destination port definition using - range/operator or referring to a group of - destination ports."; + range/operator or a choice to support future + 'case' statements, such as one enabling a + group of destination ports to be referenced."; } description "Destination port definition."; } description "Rule set that matches TCP headers."; } container udp { if-feature match-on-udp; @@ -933,38 +937,40 @@ container source-port { choice source-port { case range-or-operator { uses pf:port-range-or-operator; description "Source port definition from range or operator."; } description "Choice of source port definition using - range/operator or referring to a group of - source ports."; + range/operator or a choice to support future + 'case' statements, such as one enabling a + group of source ports to be referenced."; } description "Source port definition."; } container destination-port { choice destination-port { case range-or-operator { uses pf:port-range-or-operator; description "Destination port definition from range or operator."; } description "Choice of destination port definition using - range/operator or referring to a group of - destination ports."; + range/operator or a choice to support future + 'case' statements, such as one enabling a + group of destination ports to be referenced."; } description "Destination port definition."; } description "Rule set that matches UDP headers."; } container icmp { if-feature match-on-icmp; @@ -1046,35 +1051,35 @@ interface"; list acl-set { key "name"; ordered-by user; description "List of ingress ACLs on the interface"; leaf name { type leafref { - path "/access-lists/acl/name"; + path "/acls/acl/name"; } description "Reference to the ACL name applied on ingress"; } list ace-statistics { if-feature "interface-stats"; key "name"; config false; description - "List of access list entries(ACE)"; + "List of Access Control Entries (ACEs)"; leaf name { type leafref { - path "/access-lists/acl/aces/ace/name"; + path "/acls/acl/aces/ace/name"; } description "The ace name"; } uses acl-counters; } } } } @@ -1086,28 +1091,27 @@ leaf interface-id { type if:interface-ref; description "Reference to the interface id list key"; } container ingress { uses interface-acl; description - "The ACL's applied to ingress interface"; + "The ACLs applied to ingress interface"; } container egress { uses interface-acl; description - "The ACL's applied to egress interface"; + "The ACLs applied to egress interface"; } - } } } } 4.2. IETF Packet Fields module The packet fields module defines the necessary groups for matching on @@ -1111,34 +1115,34 @@ 4.2. IETF Packet Fields module The packet fields module defines the necessary groups for matching on fields in the packet including ethernet, ipv4, ipv6, and transport layer fields. The "type" node determines which of these fields get included for any given ACL with the exception of TCP, UDP and ICMP header fields. Those fields can be used in conjunction with any of the above layer 2 or layer 3 fields. Since the number of match criteria is very large, the base draft does - not include these directly but references them by "uses" to keep the - base module simple. In case more match conditions are needed, those - can be added by augmenting choices within container "matches" in - ietf-access-control-list.yang model. + not include these directly but references them by 'uses' statement to + keep the base module simple. In case more match conditions are + needed, those can be added by augmenting choices within container + "matches" in ietf-access-control-list.yang model. This module imports definitions from Common YANG Data Types [RFC6991] and references IP [RFC0791], ICMP [RFC0792], Definition of the Differentiated Services Field in the IPv4 and IPv6 Headers [RFC2474], The Addition of Explicit Congestion Notification (ECN) to IP [RFC3168], , IPv6 Scoped Address Architecture [RFC4007], IPv6 Addressing Architecture [RFC4291], A Recommendation for IPv6 Address Text Representation [RFC5952], IPv6 [RFC8200]. - file "ietf-packet-fields@2018-03-03.yang" + file "ietf-packet-fields@2018-03-15.yang" module ietf-packet-fields { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields"; prefix packet-fields; import ietf-inet-types { prefix inet; reference "RFC 6991 - Common YANG Data Types."; @@ -1136,34 +1140,34 @@ module ietf-packet-fields { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields"; prefix packet-fields; import ietf-inet-types { prefix inet; reference "RFC 6991 - Common YANG Data Types."; } - import ietf-yang-types { prefix yang; reference "RFC 6991 - Common YANG Data Types."; } + import ietf-ethertypes { prefix eth; reference "RFC XXXX - Network ACL YANG Model."; } organization - "IETF NETMOD (NETCONF Data Modeling Language) Working + "IETF NETMOD (Network Modeling Language) Working Group"; contact "WG Web: http://tools.ietf.org/wg/netmod/ WG List: netmod@ietf.org Editor: Mahesh Jethanandani mjethanandani@gmail.com Editor: Lisa Huang lyihuang16@gmail.com @@ -1183,26 +1187,27 @@ 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 2018-03-03 { + revision 2018-03-15 { description "Initial version."; reference "RFC XXX: Network Access Control List (ACL) YANG Data Model."; } + /* * Typedefs */ typedef operator { type enumeration { enum lte { description "Less than or equal."; } enum gte { @@ -1271,21 +1277,21 @@ } description "Grouping for port definitions in the form of a choice statement."; } grouping acl-ip-header-fields { description "IP header fields common to ipv4 and ipv6"; reference - "RFC 791."; + "RFC 791: Internet Protocol."; leaf dscp { type inet:dscp; description "Differentiated Services Code Point."; reference "RFC 2474: Definition of Differentiated services field (DS field) in the IPv4 and IPv6 headers."; } @@ -1285,59 +1291,63 @@ description "Differentiated Services Code Point."; reference "RFC 2474: Definition of Differentiated services field (DS field) in the IPv4 and IPv6 headers."; } leaf ecn { type uint8 { range 0..3; - } description "Explicit Congestion Notification."; reference - "RFC 3168."; + "RFC 3168: Explicit Congestion Notification."; } leaf length { type uint16; description "In IPv4 header field, this field is known as the Total Length. Total Length is the length of the datagram, measured in octets, including internet header and data. In IPv6 header field, this field is known as the Payload Length, the length of the IPv6 payload, i.e. the rest of the packet following the IPv6 header, in octets."; reference - "RFC 791, RFC 2460"; + "RFC 791: Internet Protocol, + RFC 8200: IPv6."; } leaf ttl { type uint8; description "This field indicates the maximum time the datagram is allowed to remain in the internet system. If this field contains the - value zero, then the datagram must be destroyed. + value zero, then the datagram must be dropped. In IPv6, this field is known as the Hop Limit."; - reference "RFC 791, RFC 2460"; + reference + "RFC 791: Internet Protocol, + RFC 8200: IPv6."; } leaf protocol { type uint8; description "Internet Protocol number. Refers to the protocol of the payload. In IPv6, this field is known as 'next-header."; - reference "RFC 791, RFC 2460."; + reference + "RFC 791: Internet Protocol, + RFC 8200: IPv6."; } } grouping acl-ipv4-header-fields { description "Fields in IPv4 header."; leaf ihl { type uint8 { range "5..60"; @@ -1527,43 +1538,47 @@ size of 20 bytes and maximum of 60 bytes, allowing for up to 40 bytes of options in the header."; } leaf reserved { type uint8; description "Reserved for future use."; } + leaf flags { type bits { bit cwr { position 1; description "Congestion Window Reduced (CWR) flag is set by the sending host to indicate that it received a TCP segment with the ECE flag set and had responded in congestion control mechanism."; - reference "RFC 3168"; + reference + "RFC 3168: Explicit Congestion Notification."; } bit ece { position 2; description "ECN-Echo has a dual role, depending on the value of the SYN flag. It indicates: If the SYN flag is set (1), that the TCP peer is ECN capable. If the SYN flag is clear (0), that a packet with Congestion Experienced flag set (ECN=11) in IP header was received during normal transmission (added to header by RFC 3168). This serves as an indication of network congestion (or impending congestion) to the TCP sender."; + reference + "RFC 3168: Explicit Congestion Notification."; } bit urg { position 3; description "Indicates that the Urgent pointer field is significant."; } bit ack { position 4; description "Indicates that the Acknowledgment field is significant. @@ -1591,30 +1606,32 @@ and others when it is clear."; } bit fin { position 8; description "Last package from sender."; } } description "Also known as Control Bits. Contains 9 1-bit flags."; + reference + "RFC 793: TCP."; } leaf window-size { type uint16; + units "bytes"; description "The size of the receive window, which specifies - the number of window size units (by default, - bytes) (beyond the segment identified by the - sequence number in the acknowledgment field) - that the sender of this segment is currently + the number of window size units beyond the segment + identified by the sequence number in the acknowledgment + field that the sender of this segment is currently willing to receive."; } leaf urgent-pointer { type uint16; description "This field is an offset from the sequence number indicating the last urgent data byte."; } @@ -1664,28 +1682,28 @@ grouping acl-icmp-header-fields { description "Collection of ICMP header fields that can be used to setup a match filter."; leaf type { type uint8; description "Also known as Control messages."; - reference "RFC 792"; + reference + "RFC 792: ICMP."; } leaf code { type uint8; description "ICMP subtype. Also known as Control messages."; - } leaf rest-of-header { type uint32; description "Four-bytes field, contents vary based on the ICMP type and code."; } } } @@ -1692,175 +1710,186 @@ 4.3. An ACL Example Requirement: Deny tcp traffic from 192.0.2.0/24, destined to 198.51.100.0/24. Here is the acl configuration xml for this Access Control List: + [note: '\' line wrapping for formatting only] + - + sample-ipv4-acl ipv4-acl-type rule1 6 - 192.0.2.0/24 - 198.51.100.0/24 + 198.51.100.0/24 + 192.0.2.0/24 drop - + The acl and aces can be described in CLI as the following: - access-list ipv4 sample-ipv4-acl + acl ipv4 sample-ipv4-acl deny tcp 192.0.2.0/24 198.51.100.0/24 -4.4. Port Range Usage Example +4.4. Port Range Usage and Other Examples When a lower-port and an upper-port are both present, it represents a range between lower-port and upper-port with both the lower-port and - upper-port are included. When only a lower-port presents, it - represents a single port. + upper-port included. When only a port is present, it represents a + port, with the operator specifying the range. - With the follow XML example: + The following XML example represents a configuration where traffic to + source ports 16384, 16385, 16386, and 16387 is dropped. + + [note: '\' line wrapping for formatting only] - + - sample-ipv4-acl + sample-port-acl ipv4-acl-type rule1 16384 16387 drop - + - This represents source ports 16384, 16385, 16386, and 16387. + The following XML example represents a configuration where all ping + echo requests are dropped. - With the follow XML example: + [note: '\' line wrapping for formatting only] - + - sample-ipv4-acl - ipv4-acl-type + sample-icmp-acl rule1 - - - 16384 - 65535 - - + + 8 + 0 + drop - + - This represents source ports greater than or equal to 16384 and less - than equal to 65535. + The following XML example represents a configuration of a single + port, port 21 that accepts traffic. - With the follow XML example: + [note: '\' line wrapping for formatting only] - + sample-ipv4-acl ipv4-acl-type rule1 eq 21 - drop + accept - + - This represents port 21. + The following XML example represents a configuration specifying all + ports that are not equal to 21, that will drop packets destined for + those ports. - With the following XML example, the configuration is specifying all - ports that are not equal to 21. + [note: '\' line wrapping for formatting only] - + sample-ipv4-acl ipv4-acl-type rule1 neq 21 drop - + 5. Security Considerations The YANG module specified in this document defines a schema for data that is designed to be accessed via network management protocol such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport layer and the mandatory-to-implement secure transport is SSH [RFC6242]. The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC5246]. @@ -1872,35 +1901,35 @@ There are a number of data nodes defined in the YANG module which are writable/creatable/deletable (i.e., config true, which is the default). These data nodes may be considered sensitive or vulnerable in some network environments. Write operations (e.g., ) to these data nodes without proper protection can have a negative effect on network operations. These are the subtrees and data nodes and their sensitivity/ vulnerability: - /access-lists/acl/aces: This list specifies all the configured - access control entries on the device. Unauthorized write access - to this list can allow intruders to access and control the system. + /acls/acl/aces: This list specifies all the configured access + control entries on the device. Unauthorized write access to this + list can allow intruders to access and control the system. Unauthorized read access to this list can allow intruders to spoof packets with authorized addresses thereby compromising the system. 6. IANA Considerations - This document registers three URIs and three YANG module. + This document registers three URIs and three YANG modules. 6.1. URI Registration - This document registers three URI in the IETF XML registry [RFC3688]. - Following the format in RFC 3688, the following registration is - requested to be made: + This document registers three URIs in the IETF XML registry + [RFC3688]. Following the format in RFC 3688, the following + registration is requested to be made: URI: urn:ietf:params:xml:ns:yang:ietf-access-control-list URI: urn:ietf:params:xml:ns:yang:ietf-packet-fields URI: urn:ietf:params:xml:ns:yang:ietf-ethertypes Registrant Contact: The IESG. XML: N/A, the requested URI is an XML namespace. 6.2. YANG Module Name Registration @@ -2059,50 +2088,51 @@ A.1. A company proprietary module example Module "example-newco-acl" is an example of company proprietary model that augments "ietf-acl" module. It shows how to use 'augment' with an XPath expression to add additional match criteria, action criteria, and default actions when no ACE matches are found. All these are company proprietary extensions or system feature extensions. "example-newco-acl" is just an example and it is expected that vendors will create their own proprietary models. + [note: '\' line wrapping for formatting only] + module example-newco-acl { yang-version 1.1; namespace "http://example.com/ns/example-newco-acl"; prefix example-newco-acl; import ietf-access-control-list { prefix "acl"; } organization "Newco model group."; contact "abc@newco.com"; description "This YANG module augments IETF ACL Yang."; - revision 2018-03-03 { + revision 2018-03-15 { description "Creating NewCo proprietary extensions to ietf-acl model"; reference "RFC XXXX: Network Access Control List (ACL) YANG Data Model"; } - - augment "/acl:access-lists/acl:acl/" + + augment "/acl:acls/acl:acl/" + "acl:aces/acl:ace/" + "acl:matches" { description "Newco proprietary simple filter matches"; choice protocol-payload-choice { description "Newco proprietary payload match condition"; list protocol-payload { key value-keyword; ordered-by user; description "Match protocol payload"; uses match-simple-payload-protocol-value; @@ -2111,21 +2141,21 @@ choice metadata { description "Newco proprietary interface match condition"; leaf packet-length { type uint16; description "Match on packet length"; } } } - augment "/acl:access-lists/acl:acl/" + + augment "/acl:acls/acl:acl/" + "acl:aces/acl:ace/" + "acl:actions" { description "Newco proprietary simple filter actions"; choice action { description ""; case count { description "Count the packet in the named counter"; leaf count { type uint32; description "Count"; @@ -2136,29 +2166,30 @@ leaf policer { type string; description "Name of the policer"; } } case hiearchical-policer { leaf hierarchitacl-policer { type string; description "Name of the hierarchical policer."; + } description "Name of hierarchical policer to use to rate-limit traffic"; } } } - augment "/acl:access-lists/acl:acl" + + augment "/acl:acls/acl:acl" + "/acl:aces/acl:ace/" + "acl:actions" { leaf default-action { type identityref { base acl:forwarding-action; } default acl:drop; description "Actions that occur if no ace is matched."; } @@ -2167,59 +2198,63 @@ } grouping match-simple-payload-protocol-value { description "Newco proprietary payload"; leaf value-keyword { type enumeration { enum icmp { description "Internet Control Message Protocol"; } enum icmp6 { - description "Internet Control Message Protocol Version 6"; + description + "Internet Control Message Protocol + Version 6"; } enum range { description "Range of values"; } } description "(null)"; } } } - The following figure is the tree structure of example-newco-acl. In - this example, /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf- - acl:ace/ietf-acl:matches are augmented with two new choices, - protocol-payload-choice and metadata. The protocol-payload-choice - uses a grouping with an enumeration of all supported protocol values. + The following figure is the tree diagram of example-newco-acl. In + this example, /ietf-acl:acls/ietf-acl:acl/ietf-acl:aces/ietf-acl:ace/ + ietf-acl:matches are augmented with two new choices, protocol- + payload-choice and metadata. The protocol-payload-choice uses a + grouping with an enumeration of all supported protocol values. Metadata matches apply to fields associated with the packet but not - in the packet header such as overall packet length. In other - example, /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf- - acl:ace/ietf-acl:actions are augmented with new choice of actions. + in the packet header such as overall packet length. In another + example, /ietf-acl:acls/ietf-acl:acl/ietf-acl:aces/ietf-acl:ace/ietf- + acl:actions are augmented with a new choice of actions. + + [note: '\' line wrapping for formatting only] module: example-newco-acl - augment /acl:access-lists/acl:acl/acl:aces/acl:ace/acl:matches: + augment /acl:acls/acl:acl/acl:aces/acl:ace/acl:matches: +--rw (protocol-payload-choice)? | +--:(protocol-payload) | +--rw protocol-payload* [value-keyword] | +--rw value-keyword enumeration +--rw (metadata)? +--:(packet-length) +--rw packet-length? uint16 - augment /acl:access-lists/acl:acl/acl:aces/acl:ace/acl:actions: + augment /acl:acls/acl:acl/acl:aces/acl:ace/acl:actions: +--rw (action)? +--:(count) | +--rw count? uint32 +--:(policer) | +--rw policer? string +--:(hiearchical-policer) +--rw hierarchitacl-policer? string - augment /acl:access-lists/acl:acl/acl:aces/acl:ace/acl:actions: + augment /acl:acls/acl:acl/acl:aces/acl:ace/acl:actions: +--rw default-action? identityref A.2. Linux nftables As Linux platform is becoming more popular as networking platform, the Linux data model is changing. Previously ACLs in Linux were highly protocol specific and different utilities were used (iptables, ip6tables, arptables, ebtables), so each one had separate data model. Recently, this has changed and a single utility, nftables, has been developed. With a single application, it has a single data model for @@ -2250,21 +2285,21 @@ this draft and Linux nftables. A.3. Ethertypes The ACL module is dependent on the definition of ethertypes. IEEE owns the allocation of those ethertypes. This model is being included here to enable definition of those types till such time that IEEE takes up the task of publication of the model that defines those ethertypes. At that time, this model can be deprecated. - file "ietf-ethertypes@2018-03-03.yang" + file "ietf-ethertypes@2018-03-15.yang" module ietf-ethertypes { namespace "urn:ietf:params:xml:ns:yang:ietf-ethertypes"; prefix ethertypes; organization "IETF NETMOD (NETCONF Data Modeling Language)"; contact "WG Web: @@ -2275,24 +2310,23 @@ description "This module contains the common definitions for the Ethertype used by different modules. It is a placeholder module, till such time that IEEE starts a project to define these Ethertypes and publishes a standard. At that time this module can be deprecated."; - revision 2018-03-03 { + revision 2018-03-15 { description "Initial revision."; - reference "RFC XXXX: IETF Ethertype YANG Data Module."; } typedef ethertype { type union { type uint16; type enumeration { enum ipv4 { value 2048; @@ -2293,29 +2327,29 @@ typedef ethertype { type union { type uint16; type enumeration { enum ipv4 { value 2048; description "Internet Protocol version 4 (IPv4) with a hex value of 0x0800."; reference - "RFC 791, Internet Protocol."; + "RFC 791: Internet Protocol."; } enum arp { value 2054; description "Address Resolution Protocol (ARP) with a hex value of 0x0806."; reference - "RFC 826 An Ethernet Address Resolution Protocol."; + "RFC 826: An Ethernet Address Resolution Protocol."; } enum wlan { value 2114; description "Wake-on-LAN. Hex value of 0x0842."; } enum trill { value 8947; description "Transparent Interconnection of Lots of Links. @@ -2369,29 +2402,30 @@ enum ipx { value 33079; description "Internetwork Packet Exchange (IPX). Hex value of 0x8137."; } enum qnx { value 33284; description "QNX Qnet. Hex value of 0x8204."; + } enum ipv6 { value 34525; description "Internet Protocol Version 6 (IPv6). Hex value of 0x86DD."; - reference - "RFC 8200, 8201."; + "RFC 8200: IPv6 + RFC 8201: Path MTU Discovery for IPv6."; } enum efc { value 34824; description "Ethernet flow control using pause frames. Hex value of 0x8808"; reference "IEEE Std. 802.1Qbb."; } enum esp { @@ -2405,45 +2439,45 @@ value 34841; description "CobraNet. Hex value of 0x"; } enum mpls-unicast { value 34887; description "MultiProtocol Label Switch (MPLS) unicast traffic. Hex value of 0x8847."; reference - "RFC 3031."; + "RFC 3031: MPLS Architecture."; } enum mpls-multicast { value 34888; description "MultiProtocol Label Switch (MPLS) multicast traffic. Hex value of 0x8848."; reference - "RFC 3031."; + "RFC 3031: MPLS Architecture."; } enum pppoe-discovery { value 34915; description "Point-to-Point Protocol over Ethernet. Used during the discovery process. Hex value of 0x8863."; reference - "RFC 2516."; + "RFC 2516: A method for Transmitting PPPoE."; } enum pppoe-session { value 34916; description "Point-to-Point Protocol over Ethernet. Used during session stage. Hex value of 0x8864."; reference - "RFC 2516."; + "RFC 2516: A method for Transmitting PPPoE."; } enum intel-ans { value 34925; description "Intel Advanced Networking Services. Hex value of 0x886D."; } enum jumbo-frames { value 34928; description @@ -2609,21 +2642,21 @@ value 35119; description "High-availability Seamless Redundancy (HSR). Hex value of 0x892F."; reference "IEC 62439-3:2016."; } } } description - "The uint16 type placeholder type is defined to enable + "The uint16 type placeholder is defined to enable users to manage their own ethertypes not covered by the module. Otherwise the module contains enum definitions for the more commonly used ethertypes."; } } Authors' Addresses