--- 1/draft-ietf-netmod-acl-model-11.txt 2017-09-01 13:13:12.031638313 -0700 +++ 2/draft-ietf-netmod-acl-model-12.txt 2017-09-01 13:13:12.107640141 -0700 @@ -1,64 +1,63 @@ -NETMOD WG D. Bogdanovic -Internet-Draft Volta Networks -Intended status: Standards Track M. Jethanandani -Expires: December 17, 2017 Cisco Systems, Inc - L. Huang - General Electric +NETMOD WG M. Jethanandani +Internet-Draft Cisco Systems, Inc +Intended status: Standards Track L. Huang +Expires: March 5, 2018 General Electric S. Agarwal Cisco Systems, Inc. D. Blair Cisco Systems, INc - June 15, 2017 + September 1, 2017 Network Access Control List (ACL) YANG Data Model - draft-ietf-netmod-acl-model-11 + draft-ietf-netmod-acl-model-12 Abstract This document describes a data model of Access Control List (ACL) basic building blocks. Editorial Note (To be removed by RFC Editor) This draft contains many placeholder values that need to be replaced with finalized values at the time of publication. This note 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. + 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 (Oct 12, 2016) needs to get updated with - the date the draft gets approved. The date also needs to get - reflected on the line with . + o Revision date in model needs to get updated with the date the + draft gets approved. The date also needs to get reflected on the + line with . 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 http://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 December 17, 2017. + This Internet-Draft will expire on March 5, 2018. Copyright Notice Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents @@ -71,41 +70,40 @@ Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 2. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 4 3. Understanding ACL's Filters and Actions . . . . . . . . . . . 4 3.1. ACL Modules . . . . . . . . . . . . . . . . . . . . . . . 5 4. ACL YANG Models . . . . . . . . . . . . . . . . . . . . . . . 9 4.1. IETF Access Control List module . . . . . . . . . . . . . 9 4.2. IETF Packet Fields module . . . . . . . . . . . . . . . . 18 - 4.3. An ACL Example . . . . . . . . . . . . . . . . . . . . . 28 - 4.4. Port Range Usage Example . . . . . . . . . . . . . . . . 28 - 5. Security Considerations . . . . . . . . . . . . . . . . . . . 29 - 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30 - 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 30 - 8. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 31 - 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 31 - 9.1. Normative References . . . . . . . . . . . . . . . . . . 31 - 9.2. Informative References . . . . . . . . . . . . . . . . . 32 - Appendix A. Extending ACL model examples . . . . . . . . . . . . 32 - A.1. Example of extending existing model for route filtering . 32 - A.2. A company proprietary module example . . . . . . . . . . 34 - A.3. Example to augment model with mixed ACL type . . . . . . 42 - A.4. Linux nftables . . . . . . . . . . . . . . . . . . . . . 43 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 44 + 4.3. An ACL Example . . . . . . . . . . . . . . . . . . . . . 31 + 4.4. Port Range Usage Example . . . . . . . . . . . . . . . . 32 + 5. Security Considerations . . . . . . . . . . . . . . . . . . . 33 + 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 + 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 34 + 8. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 35 + 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 35 + 9.1. Normative References . . . . . . . . . . . . . . . . . . 35 + 9.2. Informative References . . . . . . . . . . . . . . . . . 36 + Appendix A. Extending ACL model examples . . . . . . . . . . . . 36 + A.1. Example of extending existing model for route filtering . 36 + A.2. A company proprietary module example . . . . . . . . . . 38 + A.3. Linux nftables . . . . . . . . . . . . . . . . . . . . . 44 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 45 1. Introduction - Access Control List (ACL) is one of the basic elements to configure - device forwarding behavior. It is used in many networking concepts - such as Policy Based Routing, Firewalls etc. + 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 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. @@ -113,21 +111,21 @@ o Packet header matches apply to fields visible in the packet such as address or class of service or port numbers. o In case 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 innovations of + list of potential actions is endless depending on the capabilities of the networked 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 @@ -217,64 +215,70 @@ 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 acl* [acl-type acl-name] +--rw acl-name string +--rw acl-type acl-type +--ro acl-oper-data - +--rw access-list-entries + +--rw aces +--rw ace* [rule-name] +--rw rule-name string +--rw matches | +--rw l2-acl {l2-acl}? | | +--rw destination-mac-address? yang:mac-ad dress | | +--rw destination-mac-address-mask? yang:mac-ad dress | | +--rw source-mac-address? yang:mac-ad dress | | +--rw source-mac-address-mask? yang:mac-ad dress | | +--rw ether-type? string | +--rw ipv4-acl {ipv4-acl}? - | | +--rw tos? uint8 + | | +--rw dscp? inet:dscp + | | +--rw ecn? uint8 | | +--rw length? uint16 | | +--rw ttl? uint8 | | +--rw protocol? uint8 | | +--rw source-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw operation? operator | | +--rw destination-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw opearations? operator | | +--rw ihl? uint8 | | +--rw flags? bits | | +--rw offset? uint16 | | +--rw identification? uint16 | | +--rw destination-ipv4-network? inet:ipv4-prefi x | | +--rw source-ipv4-network? inet:ipv4-prefi x | +--rw ipv6-acl {ipv6-acl}? - | | +--rw tos? uint8 + | | +--rw dscp? inet:dscp + | | +--rw ecn? uint8 | | +--rw length? uint16 | | +--rw ttl? uint8 | | +--rw protocol? uint8 | | +--rw source-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw operation? operator | | +--rw destination-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw opearations? operator | | +--rw next-header? uint8 | | +--rw destination-ipv6-network? inet:ipv6-prefi x | | +--rw source-ipv6-network? inet:ipv6-prefi x | | +--rw flow-label? inet:ipv6-flow- label | +--rw l2-l3-ipv4-acl {mixed-ipv4-acl}? | | +--rw destination-mac-address? yang:mac-ad dress @@ -272,122 +276,133 @@ | | +--rw destination-ipv6-network? inet:ipv6-prefi x | | +--rw source-ipv6-network? inet:ipv6-prefi x | | +--rw flow-label? inet:ipv6-flow- label | +--rw l2-l3-ipv4-acl {mixed-ipv4-acl}? | | +--rw destination-mac-address? yang:mac-ad dress | | +--rw destination-mac-address-mask? yang:mac-ad + dress | | +--rw source-mac-address? yang:mac-ad dress | | +--rw source-mac-address-mask? yang:mac-ad dress | | +--rw ether-type? string - | | +--rw tos? uint8 + | | +--rw dscp? inet:dscp + | | +--rw ecn? uint8 | | +--rw length? uint16 | | +--rw ttl? uint8 | | +--rw protocol? uint8 | | +--rw source-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw operation? operator | | +--rw destination-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw opearations? operator | | +--rw ihl? uint8 | | +--rw flags? bits | | +--rw offset? uint16 | | +--rw identification? uint16 | | +--rw destination-ipv4-network? inet:ipv4-p refix | | +--rw source-ipv4-network? inet:ipv4-p refix | +--rw l2-l3-ipv6-acl {mixed-ipv6-acl}? | | +--rw destination-mac-address? yang:mac-ad dress | | +--rw destination-mac-address-mask? yang:mac-ad dress | | +--rw source-mac-address? yang:mac-ad dress | | +--rw source-mac-address-mask? yang:mac-ad dress | | +--rw ether-type? string - | | +--rw tos? uint8 + | | +--rw dscp? inet:dscp + | | +--rw ecn? uint8 | | +--rw length? uint16 | | +--rw ttl? uint8 | | +--rw protocol? uint8 | | +--rw source-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw operation? operator | | +--rw destination-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw opearations? operator | | +--rw next-header? uint8 | | +--rw destination-ipv6-network? inet:ipv6-p refix | | +--rw source-ipv6-network? inet:ipv6-p refix - | | +--rw flow-label? inet:ipv6-f - low-label + | | +--rw flow-label? + | | inet:ipv6-flow-label | +--rw l2-l3-ipv4-ipv6-acl {l2-l3-ipv4-ipv6-acl}? | | +--rw destination-mac-address? yang:mac-ad dress | | +--rw destination-mac-address-mask? yang:mac-ad dress | | +--rw source-mac-address? yang:mac-ad dress | | +--rw source-mac-address-mask? yang:mac-ad dress | | +--rw ether-type? string - | | +--rw tos? uint8 + | | +--rw dscp? inet:dscp + | | +--rw ecn? uint8 | | +--rw length? uint16 | | +--rw ttl? uint8 | | +--rw protocol? uint8 | | +--rw source-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw operation? operator | | +--rw destination-port-range! | | | +--rw lower-port inet:port-number | | | +--rw upper-port? inet:port-number + | | | +--rw opearations? operator | | +--rw ihl? uint8 | | +--rw flags? bits | | +--rw offset? uint16 | | +--rw identification? uint16 | | +--rw destination-ipv4-network? inet:ipv4-p refix | | +--rw source-ipv4-network? inet:ipv4-p refix | | +--rw next-header? uint8 | | +--rw destination-ipv6-network? inet:ipv6-p refix | | +--rw source-ipv6-network? inet:ipv6-p refix - | | +--rw flow-label? inet:ipv6-f - low-label + | | +--rw flow-label? + | | inet:ipv6-flow-label | +--rw tcp-acl {tcp-acl}? | | +--rw sequence-number? uint32 | | +--rw acknowledgement-number? uint32 | | +--rw data-offset? uint8 | | +--rw reserved? uint8 - | | +--rw flags? uint16 + | | +--rw flags? bits | | +--rw window-size? uint16 | | +--rw urgent-pointer? uint16 | | +--rw options? uint32 | +--rw udp-acl {udp-acl}? | | +--rw length? uint16 | +--rw icmp-acl {icmp-acl}? | | +--rw type? uint8 | | +--rw code? uint8 | | +--rw rest-of-header? uint32 | +--rw any-acl! {any-acl}? + | +--rw interface? if:interface-ref +--rw actions | +--rw (packet-handling)? | | +--:(deny) | | | +--rw deny? empty | | +--:(permit) | | +--rw permit? empty | +--rw logging? boolean +--ro ace-oper-data +--ro match-counter? yang:counter64 @@ -402,89 +417,88 @@ associated with the "acl-name". Each of the entries in the list("access-list-entries"), indexed by the string "rule-name", has containers defining "matches" and "actions". The "matches" define criteria used to identify patterns in "ietf- packet-fields". 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. - file "ietf-access-control-list@2017-06-16.yang" + file "ietf-access-control-list@2017-09-01.yang" module ietf-access-control-list { namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list"; prefix acl; + import ietf-yang-types { prefix yang; } + import ietf-packet-fields { prefix packet-fields; } + + import ietf-interfaces { + prefix if; + } + organization "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; contact "WG Web: http://tools.ietf.org/wg/netmod/ WG List: netmod@ietf.org - Editor: Dean Bogdanovic - ivandean@gmail.com + Editor: Mahesh Jethanandani mjethanandani@gmail.com Editor: Lisa Huang lyihuang16@gmail.com Editor: Sonal Agarwal agarwaso@cisco.com Editor: Dana Blair dblair@cisco.com"; description - "This YANG module defines a component that describing the + "This YANG module defines a component that describe the configuration of Access Control Lists (ACLs). - Copyright (c) 2016 IETF Trust and the persons identified as + + Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; - revision 2017-06-16 { + revision 2017-09-01 { description "Added feature and identity statements for different types of rule matches. Split the matching rules based on the feature statement and added a must statement within each container."; reference "RFC XXX: Network Access Control List (ACL) YANG Data Model."; } - revision 2016-10-12 { - description - "Base model for Network Access Control List (ACL)."; - reference - "RFC XXXX: Network Access Control List (ACL) - YANG Data Model"; - } - /* * Identities */ identity acl-base { description "Base Access Control List type for all Access Control List type identifiers."; - } identity ipv4-acl { base acl:acl-base; description "ACL that primarily 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-acl does not contain matches on fields in the ethernet header or the IPv6 header."; } @@ -604,21 +616,21 @@ */ typedef acl-type { type identityref { base acl-base; } description "This type is used to refer to an Access Control List (ACL) type"; } - typedef access-control-list-ref { + typedef acl-ref { type leafref { path "/access-lists/acl/acl-name"; } description "This type is used by data models that need to reference an Access Control List"; } /* * Configuration data nodes @@ -650,21 +662,21 @@ 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 acl-oper-data { config false; description "Overall Access Control List operational data"; } - container access-list-entries { + container aces { description "The access-list-entries container contains a list of access-list-entries(ACE)."; list ace { key "rule-name"; ordered-by user; description "List of access list entries(ACE)"; leaf rule-name { type string; @@ -761,20 +773,27 @@ "Rule set that defines ICMP headers."; } container any-acl { if-feature any-acl; must "../../../../acl-type = 'any-acl'"; presence "Matches any"; description "Rule set that allows for a any ACL."; } + + leaf interface { + type if:interface-ref; + description + "Interface name that is specified to + match upon."; + } } container actions { description "Definitions of action criteria for this Access List Entry."; choice packet-handling { default "deny"; description "Packet handling action."; @@ -785,23 +804,25 @@ "Deny action."; } } case permit { leaf permit { type empty; description "Permit action."; } } + } leaf logging { type boolean; + default "false"; description "Log the rule on which the match occurred. Setting the value to true enables logging, whereas setting the value to false disables it."; } } /* * Operational state data nodes */ container ace-oper-data { @@ -831,156 +851,220 @@ 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. - file "ietf-packet-fields@2017-06-16.yang" - + file "ietf-packet-fields@2017-09-01.yang" module ietf-packet-fields { namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields"; prefix packet-fields; import ietf-inet-types { prefix inet; } import ietf-yang-types { prefix yang; } organization "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; contact "WG Web: http://tools.ietf.org/wg/netmod/ WG List: netmod@ietf.org - Editor: Dean Bogdanovic - ivandean@gmail.com Editor: Mahesh Jethanandani - mahesh@cisco.com + mjethanandani@gmail.com Editor: Lisa Huang lyihuang16@gmail.com Editor: Sonal Agarwal agarwaso@cisco.com Editor: Dana Blair dblair@cisco.com"; description "This YANG module defines groupings that are used by ietf-access-control-list YANG module. Their usage is not limited to ietf-access-control-list and can be used anywhere as applicable. - Copyright (c) 2016 IETF Trust and the persons identified as + Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; - revision 2017-06-16 { + revision 2017-09-01 { description "Added header fields for TCP, UDP, and ICMP."; reference "RFC XXX: Network Access Control List (ACL) YANG Data Model."; } - revision 2016-10-12 { + /* + * Typedefs + */ + typedef operator { + type enumeration { + enum lt { description - "Initial version of packet fields used by - ietf-access-control-list"; - reference - "RFC XXXX: Network Access Control List (ACL) - YANG Data Model"; + "Less than."; + } + enum gt { + description + "Greater than."; + } + enum eq { + description + "Equal to."; + } + enum neq { + description + "Not equal to."; + } + } + description + "The source and destination port range definitions + can be further qualified using an operator. An + operator is needed only if lower-port is specified + and upper-port is not specified. The operator + therefore further qualifies lower-port only."; } grouping acl-transport-header-fields { description "Transport header fields"; container source-port-range { presence "Enables setting source port range"; description "Inclusive range representing source ports to be used. + When only lower-port is present, it represents a single + port and eq operator is assumed to be default. + + When both lower-port and upper-port are specified, + it implies a range inclusive of both values. + + If no port is specified, 'any' (wildcard) is assumed."; - When only lower-port is present, it represents a single port."; leaf lower-port { type inet:port-number; mandatory true; description "Lower boundary for port."; } leaf upper-port { type inet:port-number; must ". >= ../lower-port" { error-message "The upper-port must be greater than or equal to lower-port"; } description - "Upper boundary for port . If existing, the upper port + "Upper boundary for port. If it exists, the upper port must be greater or equal to lower-port."; } + leaf operation { + type operator; + must "(lower-port and not(upper-port))" { + error-message + "If lower-port is specified, and an operator is also + specified, then upper-port should not be specified."; + description + "If lower-port is specified, and an operator is also + specified, then upper-port should not be specified."; + } + default eq; + description + "Operator to be applied on the lower-port."; + } } container destination-port-range { presence "Enables setting destination port range"; description "Inclusive range representing destination ports to be used. When only lower-port is present, it represents a single - port."; + port and eq operator is assumed to be default. + + When both lower-port and upper-port are specified, + it implies a range inclusive of both values. + + If no port is specified, 'any' (wildcard) is assumed. "; leaf lower-port { type inet:port-number; mandatory true; description - "Lower boundary for port."; } leaf upper-port { type inet:port-number; must ". >= ../lower-port" { error-message "The upper-port must be greater than or equal to lower-port"; } - description "Upper boundary for port. If existing, the upper port must be greater or equal to lower-port"; } + leaf opearations { + type operator; + must "(lower-port and not(upper-port))" { + error-message + "If lower-port is specified, and an operator is also + specified, then upper-port should not be specified."; + description + "If lower-port is specified, and an operator is also + specified, then upper-port should not be specified."; + } + default eq; + description + "Operator to be applied on the lower-port."; } } + } + grouping acl-ip-header-fields { description "IP header fields common to ipv4 and ipv6"; reference "RFC 791."; - leaf tos { - type uint8; + leaf dscp { + type inet:dscp; description - "Also known as Traffic Class in IPv6. The Type of Service (TOS) - provides an indication of the abstract parameters of the - quality of service desired."; + "Differentiated Services Code Point."; reference - "RFC 719, RFC 2460"; + "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."; } 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 @@ -1193,41 +1278,109 @@ 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 uint16; + type bits { + bit ns { + position 0; + description + "ECN-nonce concealment protection"; + reference "RFC 3540)."; + } + 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"; + } + 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."; + } + 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. + All packets after the initial SYN packet sent by the + client should have this flag set."; + } + bit psh { + position 5; + description + "Push function. Asks to push the buffered data to the + receiving application."; + } + bit rst { + position 6; + description + "Reset the connection."; + + } + bit syn { + position 7; + description + "Synchronize sequence numbers. Only the first packet + sent from each end should have this flag set. Some + other flags and fields change meaning based on this + flag, and some are only valid for when it is set, + 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."; } leaf window-size { type uint16; 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 willing to receive."; } leaf urgent-pointer { type uint16; description - "This field s an offset from the sequence number + "This field is an offset from the sequence number indicating the last urgent data byte."; } leaf options { type uint32; description "The length of this field is determined by the data offset field. Options have up to three fields: Option-Kind (1 byte), Option-Length (1 byte), Option-Data (variable). The Option-Kind @@ -1302,40 +1456,40 @@ 11.11.11.1/24. Here is the acl configuration xml for this Access Control List: sample-ipv4-acl - ipv4 - + ipv4-acl + rule1 - - 10.10.10.1/24 - + + tcp 11.11.11.1/24 + + 10.10.10.1/24 + + - + deny - - tcp - - + The acl and aces can be described in CLI as the following: access-list ipv4 sample-ipv4-acl deny tcp 10.10.10.1/24 11.11.11.1/24 4.4. Port Range Usage Example @@ -1365,20 +1519,28 @@ than equal to 65535. With the follow XML snippet: 21 This represents port 21. + With the following XML snippet, the configuration is specifying all + ports that are not equal to 21. + + + 21 + neq + + 5. Security Considerations The YANG module defined in this memo is designed to be accessed via the NETCONF [RFC6241]. The lowest NETCONF layer is the secure transport layer and the mandatory-to-implement secure transport is SSH [RFC6242]. The NETCONF Access Control Model ( NACM [RFC6536]) provides the means to restrict access for particular NETCONF users to a pre-configured subset of all available NETCONF protocol operations and content. @@ -1427,122 +1589,117 @@ Alex Clemm, Andy Bierman and Lisa Huang started it by sketching out an initial IETF draft in several past IETF meetings. That draft included an ACL YANG model structure and a rich set of match filters, and acknowledged contributions by Louis Fourie, Dana Blair, Tula Kraiser, Patrick Gili, George Serpa, Martin Bjorklund, Kent Watsen, and Phil Shafer. Many people have reviewed the various earlier drafts that made the draft went into IETF charter. Dean Bogdanovic, Kiran Agrahara Sreenivasa, Lisa Huang, and Dana - Blair each evaluated the YANG model in previous draft separately and - then work together, to created a new ACL draft that can be supported - by different vendors. The new draft removes vendor specific - features, and gives examples to allow vendors to extend in their own - proprietary ACL. The earlier draft was superseded with the new one - that received more participation from many vendors. + Blair each evaluated the YANG model in previous drafts separately, + and then worked together to created a ACL draft that was supported by + different vendors. That draft removed vendor specific features, and + gave examples to allow vendors to extend in their own proprietary + ACL. The earlier draft was superseded with this updated draft and + received more participation from many vendors. Authors would like to thank Jason Sterne, Lada Lhotka, Juergen Schoenwalder, and David Bannister for their review of and suggestions to the draft. 8. Open Issues o The current model does not support the concept of "containers" used to contain multiple addresses per rule entry. - o The current model defines 'any' rule as a presence container, - allowing a user to define any 'any' rule. - o The model defines 'ether-type' node as a string. Ideally, this should be a well defined list of all Ethernet Types assigned by IEEE. - o Should this draft include route-policy definition as defined in - draft-ietf-rtgwg-policy-model? - 9. References 9.1. Normative References [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, - DOI 10.17487/RFC3688, January 2004, - . + DOI 10.17487/RFC3688, January 2004, . [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, - DOI 10.17487/RFC6020, October 2010, - . + DOI 10.17487/RFC6020, October 2010, . [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, - . + . [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, - . + . [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration Protocol (NETCONF) Access Control Model", RFC 6536, - DOI 10.17487/RFC6536, March 2012, - . + DOI 10.17487/RFC6536, March 2012, . 9.2. Informative References [I-D.ietf-netmod-yang-tree-diagrams] Bjorklund, M. and L. Berger, "YANG Tree Diagrams", draft- - ietf-netmod-yang-tree-diagrams-00 (work in progress), June + ietf-netmod-yang-tree-diagrams-01 (work in progress), June 2017. [RFC5101] Claise, B., Ed., "Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information", RFC 5101, DOI 10.17487/RFC5101, January - 2008, . + 2008, . Appendix A. Extending ACL model examples A.1. Example of extending existing model for route filtering With proposed modular design, it is easy to extend the model with other features. Those features can be standard features, like route filters. Route filters match on specific IP addresses or ranges of prefixes. Much like ACLs, they include some match criteria and corresponding match action(s). For that reason, it is very simple to extend existing ACL model with route filtering. The combination of a route prefix and prefix length along with the type of match determines how route filters are evaluated against incoming routes. Different vendors have different match types and in this model we are using only ones that are common across all vendors participating in this draft. As in this example, the base ACL model can be extended with company proprietary extensions, described in the next section. module: example-ext-route-filter - augment /ietf-acl:access-lists/ietf-acl:acl/ - ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:matches: + augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac + e/ietf-acl:matches: +--rw (route-prefix)? +--:(range) +--rw (ipv4-range)? | +--:(v4-lower-bound) | | +--rw v4-lower-bound? inet:ipv4-prefix | +--:(v4-upper-bound) | +--rw v4-upper-bound? inet:ipv4-prefix +--rw (ipv6-range)? +--:(v6-lower-bound) | +--rw v6-lower-bound? inet:ipv6-prefix +--:(v6-upper-bound) +--rw v6-upper-bound? inet:ipv6-prefix - file "example-ext-route-filter@2016-10-12.yang" + file "example-ext-route-filter@2017-09-01.yang" module example-ext-route-filter { namespace "urn:ietf:params:xml:ns:yang:example-ext-route-filter"; prefix example-ext-route-filter; + import ietf-inet-types { prefix "inet"; } import ietf-access-control-list { prefix "ietf-acl"; } organization "Route model group."; @@ -1550,32 +1707,33 @@ "abc@abc.com"; description " This module describes route filter as a collection of match prefixes. When specifying a match prefix, you can specify an exact match with a particular route or a less precise match. You can configure either a common action that applies to the entire list or an action associated with each prefix. "; - revision 2016-10-12 { + revision 2017-09-01 { description "Creating Route-Filter extension model based on ietf-access-control-list model"; - reference " "; + reference "Example route filter"; } - augment "/ietf-acl:access-lists/ietf-acl:acl/" - + "ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:matches"{ + + augment "/ietf-acl:access-lists/ietf-acl:acl/" + + "ietf-acl:aces/ietf-acl:ace/ietf-acl:matches" { description " This module augments the matches container in the ietf-acl - module with route filter specific actions - "; + module with route filter specific actions"; + choice route-prefix{ description "Define route filter match criteria"; case range { description "Route falls between the lower prefix/prefix-length and the upperprefix/prefix-length."; choice ipv4-range { description "Defines the IPv4 prefix range"; leaf v4-lower-bound { type inet:ipv4-prefix; @@ -1622,58 +1781,43 @@ 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 found, as well how to attach an Access Control List to an interface. All these are company proprietary extensions or system feature extensions. "example-newco-acl" is just an example and it is expected from vendors to create their own proprietary models. The following figure is the tree structure of example-newco-acl. In - this example, /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:access- - list-entries/ 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 input interface or - overall packet length. In other example, /ietf-acl:access-lists/ - ietf-acl:acl/ietf-acl:access-list-entries/ ietf-acl:ace/ietf- - acl:actions are augmented with new choice of actions. + 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. + Metadata matches apply to fields associated with the packet but not + in the packet header such as input interface or 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. module: example-newco-acl - augment /ietf-acl:access-lists/ietf-acl:acl/ - ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:matches: - +--rw vlan-tagged? uint16 - +--rw mpls-unicast? uint16 - +--rw mpls-multicast? uint16 - +--rw ipv4? uint16 - +--rw ipv6? uint16 - augment /ietf-acl:access-lists/ietf-acl:acl/ - ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:matches: - +--rw ipv4-ttl? uint8 - +--rw ipv4-len? uint16 - +--rw ipv4-ihl? uint8 - +--rw ipv4-id? uint16 - +--rw ipv4-flags? ipv4-flags-type - +--rw ipv4-offset? uint16 - augment /ietf-acl:access-lists/ietf-acl:acl/ - ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:matches: + augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac + e/ietf-acl:matches: +--rw (protocol-payload-choice)? | +--:(protocol-payload) | +--rw protocol-payload* [value-keyword] | +--rw value-keyword enumeration +--rw (metadata)? +--:(interface-name) +--rw interface-name* [input-interface] +--rw input-interface ietf-if:interface-ref - augment /ietf-acl:access-lists/ietf-acl:acl/ - ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:actions: + augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac + e/ietf-acl:actions: +--rw (action)? +--:(count) | +--rw count? string +--:(policer) | +--rw policer? string +--:(hiearchical-policer) +--rw hierarchitacl-policer? string augment /ietf-acl:access-lists/ietf-acl:acl: +--rw default-actions +--rw deny? empty @@ -1671,30 +1815,30 @@ +--:(count) | +--rw count? string +--:(policer) | +--rw policer? string +--:(hiearchical-policer) +--rw hierarchitacl-policer? string augment /ietf-acl:access-lists/ietf-acl:acl: +--rw default-actions +--rw deny? empty augment /ietf-if:interfaces/ietf-if:interface: - +--rw acl - +--rw acl-name? ietf-acl:access-control-list-ref + +--rw acl-name? ietf-acl:acl-ref +--ro match-counter? yang:counter64 +--rw (direction)? +--:(in) | +--rw in? empty +--:(out) +--rw out? empty - augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:acl-oper-data: + augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac + e/ietf-acl:ace-oper-data: +--ro targets +--ro (interface)? +--:(interface-name) +--ro interface-name* ietf-if:interface-ref module example-newco-acl { yang-version 1.1; namespace "urn:newco:params:xml:ns:yang:example-newco-acl"; @@ -1712,159 +1856,33 @@ import ietf-yang-types { prefix yang; } organization "Newco model group."; contact "abc@newco.com"; description - "This YANG module augment IETF ACL Yang."; + "This YANG module augments IETF ACL Yang."; - revision 2016-10-12{ + revision 2017-09-01 { description "Creating NewCo proprietary extensions to ietf-acl model"; + reference "RFC XXXX: Network Access Control List (ACL) YANG Data Model"; - - } - - typedef known-ether-type { - type enumeration { - enum "ipv4" { - value 2048; // 0x0800 - description "Internet Protocol version 4 (IPv4)"; - } - enum "vlan-tagged" { - value 33024; // 0x8100 - description - "VLAN-tagged frame (IEEE 802.1Q) & Shortest Path - Bridging IEEE 802.1aq[4]"; - } - enum "ipv6" { - value 34525; // 0x86DD - description "Internet Protocol Version 6 (IPv6)"; - } - enum "mpls-unicast" { - value 34887; // 0x8847 - description "MPLS unicast"; - } - enum "mpls-multicast" { - value 34888; // 0x8848 - description "MPLS multicast"; - } - } - description "Listing supported Ethertypes"; - } - - typedef ipv4-flags-type { - type bits { - bit ipv4-reserved { - position 0; - description "reserved bit"; - } - bit ipv4-DF { - position 1; - description "DF bit"; - } - bit ipv4-MF { - position 2; - description "MF bit"; - } - } - description "IPv4 flag types"; - } - augment "/ietf-acl:access-lists/ietf-acl:acl/" + - "ietf-acl:access-list-entries/ietf-acl:ace/" + - "ietf-acl:matches" { - when "ietf-acl:access-lists/ietf-acl:acl/" + - "ietf-acl:acl-type = 'ace-eth'"; - - description "additional MAC header matching"; - - leaf vlan-tagged { - type uint16; - description "Ethernet frame with VLAN tag"; } - leaf mpls-unicast { - type uint16; - description "Ethernet frame with MPLS unicast payload"; - } - - leaf mpls-multicast { - type uint16; - description "Ethernet frame with MPLS multicast payload"; - } - - leaf ipv4 { - type uint16; - description "Ethernet frame with IPv4 unicast payload"; - } - - leaf ipv6 { - type uint16; - description "Ethernet frame with IPv4 unicast payload"; - } - } augment "/ietf-acl:access-lists/ietf-acl:acl/" + - "ietf-acl:access-list-entries/ietf-acl:ace/" + - "ietf-acl:matches" { - when "ietf-acl:access-lists/ietf-acl:acl/" + - "ietf-acl:acl-type = 'ipv4-acl'"; - - description "additional IP header information"; - - leaf ipv4-ttl { - type uint8; - description "time to live of a given packet as - defined in RFC791"; - } - - leaf ipv4-len { - type uint16; - description "total packet length as defined in RFC791"; - } - - leaf ipv4-ihl { - type uint8 { - range 0..15; - } - description "Internet Header Length in 32 bit words - (see RFC791). Note that while the minimum - value for this field in a packet is 5, - we leave open the possibility here that - the packet has been corrupted."; - } - - leaf ipv4-id { - type uint16; - description "Identification as decribed in RFC791"; - } - - leaf ipv4-flags { - type ipv4-flags-type; - description "IPv4 flags as defined in RFC791"; - } - - leaf ipv4-offset { - type uint16 { - range 0..8191; - } - description "Matches on the packet fragment offset"; - } - } - - augment "/ietf-acl:access-lists/ietf-acl:acl/" + - "ietf-acl:access-list-entries/ietf-acl:ace/" + + "ietf-acl:aces/ietf-acl:ace/" + "ietf-acl:matches" { description "Newco proprietary simple filter matches"; choice protocol-payload-choice { description "Newo proprietary payload match condition"; list protocol-payload { key value-keyword; ordered-by user; description "Match protocol payload"; uses match-simple-payload-protocol-value; } @@ -1875,21 +1893,21 @@ list interface-name { key input-interface; ordered-by user; description "Match interface name"; uses metadata; } } } augment "/ietf-acl:access-lists/ietf-acl:acl/" + - "ietf-acl:access-list-entries/ietf-acl:ace/" + + "ietf-acl:aces/ietf-acl:ace/" + "ietf-acl:actions" { description "Newco proprietary simple filter actions"; choice action { description ""; case count { description "Count the packet in the named counter"; leaf count { type string; description ""; } @@ -1944,36 +1961,36 @@ enum icmp { description "Internet Control Message Protocol"; } enum icmp6 { description "Internet Control Message Protocol Version 6"; } enum range { description "Range of values"; } } - description "(null)"; } } augment "/ietf-if:interfaces/ietf-if:interface" { description "Apply ACL to interfaces"; container acl{ description "ACL related properties."; leaf acl-name { - type ietf-acl:access-control-list-ref; + type ietf-acl:acl-ref; description "Access Control List name."; } leaf match-counter { type yang:counter64; config false; + description "Total match count for Access Control List on this interface"; } choice direction { description "Applying ACL in which traffic direction"; leaf in { type empty; description "Inbound traffic"; } @@ -1979,71 +1996,46 @@ } leaf out { type empty; description "Outbound traffic"; } } } } augment "/ietf-acl:access-lists/ietf-acl:acl/" + - "ietf-acl:acl-oper-data" { + "ietf-acl:aces/ietf-acl:ace/" + + "ietf-acl:ace-oper-data" { description "This is an example on how to apply acl to a target to collect operational data"; container targets { description "To which object is the ACL attached to"; choice interface { description "Access Control List was attached to this interface"; leaf-list interface-name{ type ietf-if:interface-ref { require-instance true; } description "Attached to this interface name"; } } } } + } Draft authors expect that different vendors will provide their own yang models as in the example above, which is the augmentation of the base model -A.3. Example to augment model with mixed ACL type - - As vendors (or IETF) add more features to ACL, the model is easily - augmented. One of such augmentations can be to add support for mixed - type of ACLs, where acl-type-base can be augmented like in example - below: - - identity mixed-l3-acl { - base "access-control-list:acl-type-base"; - description "ACL that contains a mix of entries that - primarily match on fields in IPv4 headers and entries - that primarily match on fields in IPv6 headers. - Matching on layer 4 header fields may also exist in the - list. An acl of type mixed-l3-acl does not contain - matches on fields in the ethernet header."; - } - - identity mixed-l2-l3-acl { - base "access-control-list:acl-type-base"; - 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 layer 4 header fields may also - exist in the list."; - } - -A.4. Linux nftables +A.3. 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 filewall filters and it follows very similarly to the ietf-access- control list module proposed in this draft. The nftables support input and output ACEs and each ACE can be defined with match and @@ -2065,34 +2057,28 @@ } } We can see that there are many similarities between Linux nftables and IETF ACL YANG data models and its extension models. It should be fairly easy to do translation between ACL YANG model described in this draft and Linux nftables. Authors' Addresses - Dean Bogdanovic - Volta Networks - - Email: ivandean@gmail.com - Mahesh Jethanandani Cisco Systems, Inc Email: mjethanandani@gmail.com Lisa Huang General Electric Email: lyihuang16@gmail.com Sonal Agarwal Cisco Systems, Inc. Email: agarwaso@cisco.com - - Dana + Dana Blair Cisco Systems, INc Email: dblair@cisco.com