Re: [Dots] Data Channel ACL fragments

<mohamed.boucadair@orange.com> Tue, 24 April 2018 06:48 UTC

Return-Path: <mohamed.boucadair@orange.com>
X-Original-To: dots@ietfa.amsl.com
Delivered-To: dots@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 15A321270AB for <dots@ietfa.amsl.com>; Mon, 23 Apr 2018 23:48:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17QYdwQ1swUB for <dots@ietfa.amsl.com>; Mon, 23 Apr 2018 23:48:50 -0700 (PDT)
Received: from orange.com (mta239.mail.business.static.orange.com [80.12.66.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5C27B12420B for <dots@ietf.org>; Mon, 23 Apr 2018 23:48:49 -0700 (PDT)
Received: from opfedar07.francetelecom.fr (unknown [xx.xx.xx.9]) by opfedar21.francetelecom.fr (ESMTP service) with ESMTP id B9E31100E26; Tue, 24 Apr 2018 08:48:47 +0200 (CEST)
Received: from Exchangemail-eme2.itn.ftgroup (unknown [xx.xx.31.63]) by opfedar07.francetelecom.fr (ESMTP service) with ESMTP id 8ADF3C0060; Tue, 24 Apr 2018 08:48:47 +0200 (CEST)
Received: from OPEXCLILMA3.corporate.adroot.infra.ftgroup ([fe80::60a9:abc3:86e6:2541]) by OPEXCLILM6E.corporate.adroot.infra.ftgroup ([fe80::f5a7:eab1:c095:d9ec%18]) with mapi id 14.03.0389.001; Tue, 24 Apr 2018 08:48:47 +0200
From: mohamed.boucadair@orange.com
To: Jon Shallow <supjps-ietf@jpshallow.com>, "Konda, Tirumaleswar Reddy" <TirumaleswarReddy_Konda@mcafee.com>, "dots@ietf.org" <dots@ietf.org>
Thread-Topic: [Dots] Data Channel ACL fragments
Thread-Index: AQEYhrWXRSNBek+fWBybzdJS41Z0KAI4GsKdAX18SvQDE9KikwNzyn9FAeCfBHcAmG/gMgGrGCDSAZ2/A+cCF5qWXQGy5AXbAg+JyVkByAAwbQHvg6xBAdFnBMIB5XW0gQC6rlcwA1dFhlkCJgU3iQMvoFDAAcXEWBcCAjRLagJU5IDlpBOsveCADBXfIA==
Date: Tue, 24 Apr 2018 06:48:46 +0000
Message-ID: <787AE7BB302AE849A7480A190F8B93302DF10737@OPEXCLILMA3.corporate.adroot.infra.ftgroup>
References: <016401d3cc1c$03321200$09963600$@jpshallow.com> <787AE7BB302AE849A7480A190F8B93302DEF7F97@OPEXCLILMA3.corporate.adroot.infra.ftgroup> <01a701d3cc29$ba915b10$2fb41130$@jpshallow.com> <BN6PR16MB14257B016ED90BC00A9BA3E5EABB0@BN6PR16MB1425.namprd16.prod.outlook.com> <007501d3ccc2$b49f0b00$1ddd2100$@jpshallow.com> <BN6PR16MB1425B5115EC9C603E5E7945AEAB90@BN6PR16MB1425.namprd16.prod.outlook.com> <021301d3cfe7$77e5cbe0$67b163a0$@jpshallow.com> <BN6PR16MB142560DE045B75F16CB4E981EABF0@BN6PR16MB1425.namprd16.prod.outlook.com> <02b001d3d048$a2c68be0$e853a3a0$@jpshallow.com> <BN6PR16MB1425D028388461917E44A9F4EABE0@BN6PR16MB1425.namprd16.prod.outlook.com> <000001d3d0ab$547dec40$fd79c4c0$@jpshallow.com> <DM5PR16MB14363A5B24501ED8ABFB0903EABE0@DM5PR16MB1436.namprd16.prod.outlook.com> <007701d3d0bb$2404c330$6c0e4990$@jpshallow.com> <DM5PR16MB143609A08263017E97C71A17EABE0@DM5PR16MB1436.namprd16.prod.outlook.com> <00a801d3d0c8$67315800$35940800$@jpshallow.com> <BN6PR16MB142519B30BC7F44E332B 7077EAB30@BN6 P R16MB1425.namprd16.prod.outlook.com> <00e901d3d30f$687eb1a0$397c14e0$@jpshallow.com> <BN6PR16MB1425DFC5475D456042FD6F11EAB30@BN6PR16MB1425.namprd16.prod.outlook.com> <013201d3d323$141409d0$3c3c1d70$@jpshallow.com> <BN6PR16MB1425743EE912AC51BE5C7788EAB20@BN6PR16MB1425.namprd16.prod.outlook.com> <787AE7BB302AE849A7480A190F8B93302DF0B47F@OPEXCLILMA3.corporate.adroot.infra.ftgroup> <002101d3d57b$920ebf10$b62c3d30$@jpshallow.com> <787AE7BB302AE849A7480A190F8B93302DF0B4F1@OPEXCLILMA3.corporate.adroot.infra.ftgroup> <006001d3d591$a8d2ae30$fa780a90$@jpshallow.com>
In-Reply-To: <006001d3d591$a8d2ae30$fa780a90$@jpshallow.com>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.168.234.6]
Content-Type: multipart/alternative; boundary="_000_787AE7BB302AE849A7480A190F8B93302DF10737OPEXCLILMA3corp_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/dots/Han50yZjAnE3_7T-X386F-3sWgI>
Subject: Re: [Dots] Data Channel ACL fragments
X-BeenThere: dots@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "List for discussion of DDoS Open Threat Signaling \(DOTS\) technology and directions." <dots.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dots>, <mailto:dots-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dots/>
List-Post: <mailto:dots@ietf.org>
List-Help: <mailto:dots-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dots>, <mailto:dots-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Apr 2018 06:48:53 -0000

Hi all,

Given the clarification provided by the authors of the netmod-acl I-D, the current design for handling IPv6 fragments in the DOTS data channel specification is the appropriate way to proceed.

I consider this issue as closed.

Cheers,
Med

De : Jon Shallow [mailto:supjps-ietf@jpshallow.com]
Envoyé : lundi 16 avril 2018 16:46
À : BOUCADAIR Mohamed IMT/OLN; Konda, Tirumaleswar Reddy; dots@ietf.org
Objet : RE: [Dots] Data Channel ACL fragments

Hi Med,

I think that this comes down to external integration.  Whilst out of scope, the data model communication method for transferring the ACL/ACEs between a DOTS Server and a DOTS Mitigator cannot be using standard netmod-acl as there is no way to define how to handle fragmentation usage in it (following your reasoning/interpretation of netmod-acl) unless there is a separate augmentation in that data model to include fragments definitions.

Perhaps the right answer is to get the text in netmod-acl tightened up for clarity between protocol and next-header (along with what is flags-> fragment really meant to do for an ACL in grouping acl-ipv4-header-fields).

Regards

Jon

From: Dots [mailto: dots-bounces@ietf.org<mailto:dots-bounces@ietf.org>] On Behalf Of mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>
Sent: 16 April 2018 13:23
To: Jon Shallow; Konda, Tirumaleswar Reddy; dots@ietf.org<mailto:dots@ietf.org>
Subject: Re: [Dots] Data Channel ACL fragments

Jon,

I'm afraid the current netmod-acl does not allow to appropriately handle IPv6 fragments (and more filtering based on Extension Header Types in general). At least, the text is not clear whether "protocol" applies for the next-header of the base header or the one of any enclosed EH.

The use of v6-fragment keyword (in the data-channel draft) solves this by performing a check whether a Fragment header is present.

          "ace": [
            {
              "name": "drop-all-fragments",
              "matches": {
                "ipv6": {
                  "v6-fragment"
                }
              },
              "actions": {
                "forwarding": "drop"
              }
            }
          ]

This check is exactly what Cisco and Juniper are doing in the excerpts you provided.

Cheers,
Med

De : Jon Shallow [mailto:supjps-ietf@jpshallow.com]
Envoyé : lundi 16 avril 2018 14:08
À : BOUCADAIR Mohamed IMT/OLN; Konda, Tirumaleswar Reddy; dots@ietf.org<mailto:dots@ietf.org>
Objet : RE: [Dots] Data Channel ACL fragments

Hi Med,

Currently we disagree over IPv6 and fragmentation.

As per https://www.cisco.com/en/US/technologies/tk648/tk872/technologies_white_paper0900aecd8054d37d.html , ACL filtering does work on "fragments".

Filtering Based on Extension Header Type

Routers can be explicitly instructed to look at and act on traffic that contains certain extension header types. This functionality is available on Cisco platforms and can be configured with the help of IPv6 Access List options:

deny protocol {source-ipv6-prefix/prefix-length | any | host source-ipv6-address} [operator [port-number]] {destination-ipv6-prefix/prefix-length | any | host destination-ipv6-address} [operator [port-number]] [dest-option-type [doh-number | doh-type]] [dscp value] [flow-label value] [fragments] [log] [log-input] [mobility] [mobility-type [mh-number | mh-type]] [routing] [routing-type routing-number] [sequence value] [time-range name] [undetermined-transport]

Example 1: Access List Filtering based on Extension Header Type
ipv6 access-list EH-type
deny ipv6 any 2001:2B8:1:1::/64 routing

In order to permit or deny certain types of extension headers, routers are configured with the ACL features listed above to filter based on the "Header Type" value (see Table 1).

Note that in this case, the content of the EH is not processed and the router simply makes a decision based on the presence of a certain EH type. Software platforms can also analyze and filter based on additional EH fields such as the "Type Field". These filtering capabilities are very useful in implementing, for instance, security policies such as blocking source routing.
...
Since this functionality is implemented through ACLs, platforms that support hardware forwarding when ACLs are applied, will be able to handle the IPv6 traffic with EHs in hardware as well (Figure 7).

Juniper appears to support this on the MX router (see https://www.juniper.net/documentation/en_US/junos/topics/reference/general/firewall-filter-match-conditions-for-ipv6-traffic.html)

extension-headers header-type

Match an extension header type that is contained in the packet by identifying a Next Header value.
Note: This match condition is only supported on MPCs in MX Series routers.

In the first fragment of a packet, the filter searches for a match in any of the extension header types. When a packet with a fragment header is found (a subsequent fragment), the filter only searches for a match of the next extension header type because the location of other extension headers is unpredictable.
In place of the numeric value, you can specify one of the following text synonyms (the field values are also listed): ah (51), destination (60), esp (50), fragment (44), hop-by-hop (0), mobility (135), or routing (43).
To match any value for the extension header option, use the text synonym any.
For MX Series routers with MPCs, initialize new firewall filters that include this condition by walking the corresponding SNMP MIB.

So, no matter where the fragment header is (even with subsequent extended headers (to me the Authenticating Header, or ESP header is the actual protocol)) before the actual protocol, matching on protocol 44 works and is map-able to Cisco/Juniper ALCs where they do not need to use the control plane - or am I missing something here?

Regards

Jon

From: Dots [mailto:ietf-supjps-dots-bounces@ietf.org] On Behalf Of ietf-supjps-mohamed.boucadair@orange.com<mailto:ietf-supjps-mohamed.boucadair@orange.com>
Sent: 16 April 2018 12:11
To: Konda, Tirumaleswar Reddy; Jon Shallow; dots@ietf.org<mailto:dots@ietf.org>
Subject: Re: [Dots] Data Channel ACL fragments

Hi all,

I do agree with the conclusion of this thread for IPv4 but not for IPv6.

For example, a DOTS client may send this POST request to filter fragmented packets (including atomic ones):

{
  "ietf-dots-data-channel:acls": {
    "acl": [
      {
        "name": "dns-fragments",
        "type": "ipv6-acl-type",
        "aces": {
          "ace": [
            {
              "name": "drop-all-fragments",
              "matches": {
                "ipv6": {
                  "protocol": 44
                }
              },
              "actions": {
                "forwarding": "drop"
              }
            }
          ]
          "ace": [
            {
              "name": "allow-dns-packets",
              "matches": {
                "ipv6": {
                  "destination-ipv6-network": "2001:db8::/32"
                }
                "udp": {
                  "destination-port": {
                    "operator": "eq",
                    "port": 53
                  }
                }
              },
              "actions": {
                "forwarding": "accept"
              }
            }
          ]
        }
      }
    ]
  }
}

But these ACEs are efficient only if the next-header of the IPv6 header points to 44. If the IPv6 packet includes other EHs and the Fragment header is not the one which is immediately preceding the base header, then fragmented packets won't match the "drop-all-fragments" ACE.

Cheers,
Med

De : Konda, Tirumaleswar Reddy [mailto:TirumaleswarReddy_Konda@McAfee.com]
Envoyé : samedi 14 avril 2018 06:48
À : Jon Shallow; BOUCADAIR Mohamed IMT/OLN; dots@ietf.org<mailto:dots@ietf.org>
Objet : RE: [Dots] Data Channel ACL fragments

Sure, Appendix looks like the right place to add the filtering rule examples for both IPv4 and IPv6.

-Tiru

From: Jon Shallow [mailto:supjps-ietf@jpshallow.com]
Sent: Friday, April 13, 2018 6:00 PM
To: Konda, Tirumaleswar Reddy <TirumaleswarReddy_Konda@McAfee.com<mailto:TirumaleswarReddy_Konda@McAfee.com>>; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto:dots@ietf.org>
Subject: RE: [Dots] Data Channel ACL fragments

Hi Tiru,

Thanks.

I think that we do need an example in the draft of how to do this though....

IPv6 will not be using flags, but looking instead for the next header of protocol 44.

Regards

Jon

From: Dots [mailto:ietf-supjps-dots-bounces@ietf.org] On Behalf Of Konda, Tirumaleswar Reddy
Sent: 13 April 2018 13:25
To: Jon Shallow; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto:dots@ietf.org>
Subject: Re: [Dots] Data Channel ACL fragments

[Jon6] - Yes - I stand corrected, your ordering is correct.  A2 no longer needs destination-port.

Yup. The summary of our discussion is to use the flags defined in netmod-acl-model to drop fragments (both initial and non-initial), and v4-fragments and v6-fragments and the associated text added to drop non-initial fragments discussed in Section 4.1 will be removed from the draft.

Cheers
-Tiru

From: Jon Shallow [mailto:supjps-ietf@jpshallow.com]
Sent: Friday, April 13, 2018 3:39 PM
To: Konda, Tirumaleswar Reddy <TirumaleswarReddy_Konda@McAfee.com<mailto:TirumaleswarReddy_Konda@McAfee.com>>; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto:dots@ietf.org>
Subject: RE: [Dots] Data Channel ACL fragments

Hi Tiru,

See inline [Jon6]

Regards

Jon

From: Dots [mailto: dots-bounces@ietf.org<mailto:dots-bounces@ietf.org>] On Behalf Of Konda, Tirumaleswar Reddy
Sent: 13 April 2018 10:03
To: Jon Shallow; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto:dots@ietf.org>
Subject: Re: [Dots] Data Channel ACL fragments

Hi Jon,

Please see inline [TR4]


From: Konda, Tirumaleswar Reddy [mailto: TirumaleswarReddy_Konda@mcafee.com<mailto:TirumaleswarReddy_Konda@mcafee.com>]
Sent: 10 April 2018 07:10
To: Jon Shallow; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto:dots@ietf.org>
Subject: RE: [Dots] Data Channel ACL fragments

[Jon2] The "flags->fragment" definition is ambiguous for an ACE (but valid as to whether to allow a packet to get fragmented or not - is that really a ACE?) which I would like to use.

[TR] I don't get it. What purpose does it serve to create a ACE rule using "fragment" bit ?
[Jon3] Agreed - This definition has not been thought through for an ACE.  I think they have just emulated the DF bit in RFC791 as this general flags definition is the same as for the flags in RFC791.

[TR2] You may want to inform the authors of netmod-acl draft, surprisingly BGP flowspec also uses "fragment" bit.
[Jon4] On my ToDo list for a clean solution.  But we do now have a solution - see below.


"Flags->more" definition covers all fragments but the last fragment... "Offset" is unfortunately not a range, but otherwise would get used for the final fragment.
~jon2

[TR] It looks like two ACE entries are required to drop all the fragments ("flags->more" set to 1 in the first ACE and "flags->more" set to 0 in the second ACE). How to use the "Offset"  field for the final fragment ?

[Jon3] I read "flags-more" to refer to the IP_MF in the IP header (RFC791 MF or more-fragments flag).  This is set for all fragments apart from the final (as in last part of packet, not the order in which they are sent - fortunately that early decision to send them in the wrong order was phased out, but still there in some legacy systems!)

[TR2] Yes, why can't "flags->more" be set to 0 as one ACE entry to drop the final fragment along with "flags->more" set to 1 to drop the first fragment as another ACE entry so as to drop all fragments to the target ?
[Jon4] If "flags->more" is configured and it is configured with a value of 0, this will match not only the final fragment, but also a non-fragmented packet.  If "flags->more" is not configured, then this will match a non-fragmented packet only.

[TR3] net-mod-acl says "Setting the value to 0 indicates this is the last fragment, and setting the value to 1 indicates more fragments are coming.". I think it means, if "flags->more" is set to zero and offset is not zero then it indicates this is the last fragments; the flags can be used in isolation without comparing if offset value is zero or non-zero. We should check with netmod-acl authors for confirmation.

[Jon5].  The netmod-acl text for flags and offset is effectively a word for word copy out of RFC791 3.1 Internet Header Format.  So I think it is meant to be interpreted as being an exact match for the same - including the offset specific value.

  Flags:  3 bits

    Various Control Flags.

      Bit 0: reserved, must be zero
      Bit 1: (DF) 0 = May Fragment,  1 = Don't Fragment.
      Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.

          0   1   2
        +---+---+---+
        |   | D | M |
        | 0 | F | F |
        +---+---+---+

  Fragment Offset:  13 bits

    This field indicates where in the datagram this fragment belongs.

    The fragment offset is measured in units of 8 octets (64 bits).  The
    first fragment has offset zero.


----

Versus

----
    leaf flags {
      type bits {
        bit reserved {
          position 0;
          description
            "Reserved. Must be zero.";
        }
        bit fragment {
          position 1;
          description
            "Setting value to 0 indicates may fragment, while setting
             the value to 1 indicates do not fragment.";
        }
        bit more {
          position 2;
          description
            "Setting the value to 0 indicates this is the last fragment,
             and setting the value to 1 indicates more fragments are
             coming.";
        }
      }
      description
        "Bit definitions for the flags field in IPv4 header.";
    }

    leaf offset {
      type uint16 {
        range "20..65535";
      }

      description
        "The fragment offset is measured in units of 8 octets (64 bits).
         The first fragment has offset zero. The length is 13 bits";
    }

[Jon4] So, a L4 ACE without "flags->more" defined and "allow", followed by an ACE with "flags->more" = 1 and "drop", followed by an ACE with "flags->more" = 0 and "drop" will cause all fragmented packets to get dropped, but still allow through the non-fragmented packet.  So, we have a solution for
"allow all traffic to port 53, but drop all fragmented packets".

[TR3] I don't think the above solution will work. In the above line, I think you  meant L3 ACE, and the first fragment will match the first entry and is allowed.

[Jon5]No, the first ACE is a L3/L4 match.  If you have (a1 allows through all non-fragmented packets, a2 & a3 drops all fragmented packets) the following

[TR4] The first fragment will have both L3 and L4 information, and matches a1 and is allowed, but if the order is changed to a3, a1 and a2 (a3 will drop all fragments except last-fragment, the last fragment will not have L4 info, so will not match a1 but will match a2 and get dropped).

[Jon6] - Yes - I stand corrected, your ordering is correct.  A2 no longer needs destination-port.
~jon6

-Tiru

...
{
       "aces": [{
                                     "ace": {
                                                    "name": "a1",
                                                    "matches": [{
                                                                   "ipv4": {
                                                                                  "destination-network": "1.2.3.0/24"
                                                                   },
                                                                   "udp": {
                                                                                  "destination-port": 53
                                                                   }
                                                    }],
                                                    "actions": {
                                                                   "forwarding": "accept"
                                                    }
                                     }
                      },
                      {
                                     "ace": {
                                                    "name": "a2",
                                                    "matches": [{
                                                                   "ipv4": {
                                                                                  "flags": {
                                                                                                 "destination-network": "1.2.3.0/24",
                                                                                                 "more": 0
                                                                                  },
                                                                                  "udp": {
                                                                                                 "destination-port": 53
                                                                                  }
                                                                   }
                                                    }],
                                                    "actions": {
                                                                   "forwarding": "drop"
                                                    }

                                     }
                      },
                      {
                                     "ace": {
                                                    "name": "a3",
                                                    "matches": [{
                                                                   "ipv4": {
                                                                                  "flags": {
                                                                                                 "more": 1
                                                                                  }
                                                                   }
                                                    }],
                                                    "actions": {
                                                                   "forwarding": "drop"
                                                    }
                                     }
                      }
       ]
}
...
[Jon5] It will work

-Tiru

~jon4

-Tiru

[Jon3] But as the final fragment of the sequence could have any offset, the use of the offset field is not that helpful here.  Even if we do go with our DOTS fragments definition (but widened to cover all fragments), we still cannot generate a netmod-acl entry for onward processing by an upstream mitigator.

[Jon3] FYI, for Juniper, you just need to set 'first-fragment' and 'is-fragment' in their ACL.  BGP FlowSpec does support fragmentation detection properly (RFC5575 Type 12 Fragment).


-Tiru