<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced.
     An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most
     I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" docName="draft-li-spring-srv6-security-consideration-09"
     ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
 http://umeeting.huawei.com/Portal/business.action?BMECID=1474233&BMETimestamp=1426658395147
	        ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only
         necessary if the full title is longer than 39 characters -->

    <title abbrev="SRv6 Security Considerations">Security Considerations for
    SRv6 Networks</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Cheng Li" initials="C." surname="Li">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street/>

          <!-- Reorder these if your country does things differently -->

          <city/>

          <region/>

          <code/>

          <country>China</country>
        </postal>

        <phone/>

        <email>c.l@huawei.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Zhenbin Li" initials="Z." surname="Li">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street/>

          <!-- Reorder these if your country does things differently -->

          <city/>

          <region/>

          <code/>

          <country>China</country>
        </postal>

        <phone/>

        <email>lizhenbin@huawei.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Chongfeng Xie" initials="C." surname="Xie">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>China Telecom Information Science&amp;Technology Innovation
          park, Beiqijia Town,Changping District</street>

          <city>Beijing</city>

          <region/>

          <code/>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>xiechf@chinatelecom.cn</email>

        <uri/>
      </address>
    </author>

    <author fullname="Hui Tian" initials="H." surname="Tian">
      <organization>CAICT</organization>

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <region/>

          <code/>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>tianhui@caict.ac.cn</email>

        <uri/>
      </address>
    </author>

    <author fullname="Jianwei Mao" initials="J." surname="Mao">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>MaoJianwei@huawei.com</email>

        <uri/>
      </address>
    </author>

    <date day="24" month="October" year="2022"/>

    <!-- If the month and year are both specified and are the current ones,
         xml2rfc will fill in the current day for you. If only the current
         year is specified, xml2rfc will fill in the current day and month for
         you. If the year is not the current one, it is necessary to specify
         at least a month (xml2rfc assumes day="1" if not specified for the
	 purpose of calculating the expiry date).  With drafts it is normally
	 sufficient to specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>Routing</area>

    <workgroup>Spring</workgroup>

    <!-- WG name at the upperleft corner of the doc;
         IETF is fine for individual submissions.  If this element is not
         present, the default is "Network Working Group", which is used by
         the RFC Editor as a nod to the history of the IETF. -->

    <keyword>Segment Routing, Security</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>SRv6 inherits potential security vulnerabilities from Source Routing
      in general, and also from IPv6. This document describes various threats
      and security concerns related to SRv6 networks and existing approaches
      to solve these threats.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Intro" title="Introduction">
      <t>Segment Routing (SR) <xref target="RFC8402"/> is a source routing
      paradigm that explicitly indicates the forwarding path for packets at
      the source node by inserting an ordered list of instructions, called
      segments. A segment can represent a topological or service-based
      instruction.</t>

      <t>When segment routing is deployed on IPv6 <xref target="RFC8200"/>
      dataplane, called SRv6 <xref target="RFC8754"/>, a segment is a 128 bit
      value, and can the IPv6 address of a local interface but it does not
      have to. For supporting SR, a new type of Routing Extension Header is
      defined and called the Segment Routing Header (SRH). The SRH contains a
      list of SIDs and other information such as Segments Left. The SRH is
      defined in <xref target="RFC8754"/>. By using the SRH, an ingress router
      can steer SRv6 packets into an explicit forwarding path so that many use
      cases like Traffic Engineering, Service Function Chaining can be
      deployed easily by SRv6.</t>

      <t>However, SRv6 also brings some new security concerns. This document
      describes various threats to networks deploying SRv6. SRv6 inherits
      potential security vulnerabilities from source routing in general, and
      also from IPv6.</t>

      <t><list style="symbols">
          <t>SRv6 makes use of the SRH which is a new type of Routing
          Extension Header. Therefore, the security properties of the Routing
          Extension Header are addressed by the SRH. See <xref
          target="RFC5095"/> and <xref target="RFC8754"/> for details.</t>

          <t>SRv6 consists of using the SRH on the IPv6 dataplane which
          security properties can be understood based on previous work <xref
          target="RFC4301"/>, <xref target="RFC4302"/>, <xref
          target="RFC4303"/> and <xref target="RFC4942"/>.</t>
        </list></t>

      <t>In this document, we will consider the dangers from the following
      kinds of threats: <list style="symbols">
          <t>Wiretapping/eavesdropping</t>

          <t>Packet Falsification</t>

          <t>Identity Spoofing</t>

          <t>Packet Replay</t>

          <t>DOS/DDOS</t>

          <t>Malicious Packet Data</t>
        </list></t>

      <t>The rest of this document describes the above security threats in
      SRv6 networks and existing approaches to mitigate and avoid the
      threats.</t>
    </section>

    <!-- End of section "Introduction" -->

    <!--  Possible new outline.
	- Introduction, terminology
	- Applicability / target network description
	- Review of related earlier work
	- Kinds of security vulnerabilities
	- Existing approaches to guarding against vulnerabilities
	- Known gaps
  -->

    <section anchor="acronyms_terms" title="Terminology">
      <t>This document uses the terminology defined in <xref
      target="RFC5095"/> and <xref target="RFC8754"/>.</t>

      <t/>

      <t><!--End of section "Terminology" --></t>

      <t/>

      <section title="Requirements Language">
        <t>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 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only
        when, they appear in all capitals, as shown here.</t>
      </section>
    </section>

    <section title="Security Principles of SRv6 Networking ">
      <t>As with other similar source-routing architectures, an attacker may
      manipulate the traffic path by modifying the packet header. SPRING
      architecture <xref target="RFC8402"/> allows clear trust domain
      boundaries so that source-routing information is only usable within the
      trusted domain and never exposed to the outside world. It is expected
      that, by default, explicit routing is only used within the boundaries of
      the administered domain. Therefore, the data plane does not expose any
      source-routing information when a packet leaves the trusted domain.
      Traffic is filtered at the domain boundaries <xref
      target="RFC8402"/>.</t>

      <t>Unless otherwise noted, the discussion in this document pertain to SR
      networks which can be characterized as "trusted domains", i.e., the SR
      routers in the domain are presumed to be operated by the same
      administrative entity without malicious intent and also according to
      specifications of the protocols that they use in the infrastructure.</t>

      <t>This document assumes that the SR-capable routers and transit IPv6
      routers within the SRv6 trusted domains are trustworthy. Hence, the SRv6
      packets are treated as normal IPv6 packets in transit nodes and the SRH
      will not bring new security problem. The security considerations of IPv6
      networks are out of scope of this document.</t>
    </section>

    <section anchor="types" title="Types of Vulnerabilities in SR Networks">
      <t>This section outlines in details the different types of
      vulnerabilities listed in <xref target="Intro"/>. Then, for each type,
      an attempt to determine whether or not the vulnerability exists in a
      trusted domain is made.</t>

      <section anchor="type-eave"
               title="Eavesdropping Vulnerabilities in SRv6 Networks">
        <t>As with practically all kinds of networks, traffic in an SRv6
        network may be vulnerable to eavesdropping.</t>

        <t><list style="symbols">
            <t>Threats: Eavesdropping</t>

            <t>Solutions: Encapsulating Security Payload (ESP, <xref
            target="RFC4303"/>) can be used in order to prevent Eavesdropping.
            The ESP header is either inserted between the IP header and the
            next layer(transport) protocol header, or before an encapsulated
            IP header (tunnel mode). ESP can be used in order to provide
            confidentiality, data origin authentication, connectionless
            integrity, an anti-replay service (a form of partial sequence
            integrity), and (limited) traffic flow confidentiality. The set of
            services provided depends on the selected options at the time of
            the Security Association (SA) establishment and on the location of
            the implementation in a network topology.(add reference to the
            different points explained in this paragraph).</t>

            <t>Conclusion: In tunnel mode of ESP, packets are encrypted and
            can not be eavesdropped in a trusted SRv6 domain. In transport
            mode of ESP, the payload of packets are encrypted and cannot be
            eavesdropped in a trusted SRv6 domain, even if the IPv6 and SRH
            headers are not encrypted.</t>

            <t>Gaps: The IPv6 and SRH headers are not encrypted in transport
            mode of ESP which may be eavesdropped by attackers.</t>
          </list></t>

        <t><figure anchor="esp-transport"
            title="Transport Mode ESP for SRv6 packets">
            <artwork><![CDATA[
+------------------------------------------------------------------+
|IPv6 Header| SRH | ESP|     Payload       |ESP Tail| ESP Auth data|
+------------------------------------------------------------------+
                       |----- Encryption Scope -----|
                  |------ Authentication Scope -----|

]]></artwork>
          </figure></t>

        <t><figure anchor="esp-tunnel"
            title="Tunnel Mode ESP for SRv6 packets">
            <artwork><![CDATA[+----------------------------------------------------------------------+
|New IPv6 Header|SRH|ESP|IPv6 Header|SRH|Payload|ESP Tail|ESP Auth data|
+----------------------------------------------------------------------+
                        |------ Encryption Scope --------|
                    |------- Authentication Scope -------|

]]></artwork>
          </figure></t>
      </section>

      <!-- End of section "Types of Vulnerabilities in SR Networks" -->

      <section anchor="type-false"
               title="Packet Falsification in SRv6 Networks">
        <t>As SRv6 domain is a trusted domain, there is no Packet
        Falsification within the SRv6 domain.</t>

        <t>As the packets from outside of SRv6 domain cannot be trusted, an
        Integrity Verification policy is typically deployed at the external
        interfaces of the ingress SRv6 routers in order to verify the incoming
        packets (i.e., from outside of SRv6 domain <xref target="RFC8986"/>).
        Also, the packets with SRH sent form hosts within the SRv6 domain
        should be verified in order to prevent the falsification between the
        host and the ingress router. <xref target="RFC8986"/>.</t>

        <t><list style="symbols">
            <t>Threats: Packet Falsification</t>

            <t>Solutions: The packets from outside can not be trusted, so
            Integrity Verification policy should be deployed at the external
            interfaces by using , e.g., IPSec <xref target="RFC4301"/> (AH
            <xref target="RFC4302"/>, ESP <xref target="RFC4303"/> ) or HMAC
            <xref target="RFC2104"/>. AH <xref target="RFC4302"/>, ESP <xref
            target="RFC4303"/> and HMAC <xref target="RFC2104"/> can provide
            Integrity Verification for packets, while the ESP can encrypt the
            payload in order to provide higher security. However, it has been
            noted that the AH and ESP are not directly applicable in order to
            reduce the vulnerabilities of SRv6 due to the presence of mutable
            fields in the SRH. In order to solve this problem, <xref
            target="RFC8754"/> defines a mechanism in order to carry HMAC TLV
            in the SRH so to verify the integrity of packets including the SRH
            fields. The HMAC TLV is usually processed based on the local
            policy, only at the ingress router. Within the SRv6 domain, the
            packets are trusted, so HMAC TLV is typically ignored. In other
            words, the segment list is mutable within the SRv6 domain but
            cannot be changed before processing the HMAC TLV.</t>

            <t>Conclusions: There is no Packet Falsification within a trusted
            SRv6 domain. Integrity Verification policy like HMAC processing
            should be deployed at the external interfaces of the ingress SRv6
            routers filtering SRH packets from outside the trusted domain and
            SRH packets from hosts within the SRv6 domain.</t>

            <t>Gaps: IPsec cannot provide verification for SRH.</t>
          </list><figure anchor="ah-transport"
            title="Transport Mode AH and HMAC for SRv6 packets">
            <artwork><![CDATA[
+-----------------------------------------------------------------+
|IPv6 Header   | SRH | AH|     Payload                            |
+-----------------------------------------------------------------+
                       
|--Auth Scope--|HMAC |---------------Auth Scope-------------------|

]]></artwork>
          </figure></t>

        <t><figure anchor="ah-tunnel"
            title="Tunnel Mode AH and HMAC for SRv6 packets">
            <artwork><![CDATA[
+-----------------------------------------------------------------+
|New IPv6 Header|SRH | AH |IPv6 Header|SRH|Payload                |
+-----------------------------------------------------------------+
|--Auth Scope---|HMAC|---------------Auth Scope-------------------|
          
]]></artwork>
          </figure></t>
      </section>

      <section anchor="ID-Spoof" title="Identity Spoofing in SRv6 Networks">
        <t>The same as for Packet Falsification, there is no Identity Spoofing
        possible within the boundaries of a SRv6 trusted domain where all
        nodes are under control of the same administrative organization.</t>

        <t>Authentication policy should be deployed at the external interfaces
        of the ingress SRv6 routers in order to validate the packets from
        outside of SRv6 domain <xref target="RFC8986"/>. Also, the packets
        with SRH sent form hosts inside the SRv6 domain should be validated in
        order to prevent the Identity Spoofing <xref target="RFC8986"/>.</t>

        <t><list style="symbols">
            <t>Threats: Identity Spoofing</t>

            <t>Solutions: IPSec <xref target="RFC4301"/> (AH <xref
            target="RFC4302"/>, ESP <xref target="RFC4303"/> ) or HMAC <xref
            target="RFC2104"/> can be used for Authentication. AH, ESP and
            HMAC can provide Authentication of source node, while the ESP can
            encrypt the payload in order to provide higher security. Same as
            section 3.2.</t>

            <t>Conclusion: There is no Identity Spoofing within a trusted SRv6
            domain. Identity Spoofing policy should be deployed on the
            external interfaces of the ingress SRv6 routers for the packets
            from outside and the packets with SRH from hosts within the SRv6
            domain.</t>

            <t>Gaps: TBA</t>
          </list></t>
      </section>

      <section anchor="type-replay" title="Packet Replay in SRv6 Networks">
        <t>There are no new Packet Replay threat brought by SRH. ESP can be
        applied to SRv6 in order to prevent Packet replay attacks.</t>

        <t><list style="symbols">
            <t>Threats: Packet Replay</t>

            <t>Solutions: ESP <xref target="RFC4303"/> can be used to prevent
            Replay Attacks.</t>

            <t>Conclusion: There are no new Packet Replay threat brought by
            SRH. ESP can be applied to SRv6 in order to prevent Packet replay
            attacks.</t>

            <t>Gaps: TBD</t>
          </list></t>
      </section>

      <!-- End of section "Packet Replay in SR Networks" -->

      <section anchor="type-DDOS" title="DOS/DDOS in SRv6 Networks">
        <t>The generation of ICMPv6 error messages may be used in order to
        attempt DOS(Denial-Of-Service)/DDOS(Distributed Denial-Of-Service)
        attacks by sending an error-causing destination address or SRH in
        back-to-back packets <xref target="RFC8754"/>. An implementation that
        correctly follows Section 2.4 of <xref target="RFC4443"/> would be
        protected by the ICMPv6 rate-limiting mechanism also in the case of
        packets with an SRH.</t>

        <t><list style="symbols">
            <t>Threats: DOS/DDOS</t>

            <t>Solutions: ICMPv6 rate-limiting mechanism as defined in <xref
            target="RFC4443"/></t>

            <t>Conclusions: There are no DOS/DDOS threats within SRv6 domain,
            the threats come from outside of the domain, and can be prevented
            by ICMPv6 rate-limiting mechanism.</t>

            <t>Gaps: TBD</t>
          </list></t>
      </section>

      <section anchor="type-mal"
               title="Malicious Packet Data in SRv6 Networks">
        <t>TBA</t>
      </section>

      <!---->
    </section>

    <section anchor="Effects" title="Effects of the above on SRv6 Use Cases">
      <t>This section describes the effects of the above-mentioned
      vulnerabilities in terms of applicability statement and the use cases
      given in citation.</t>

      <t>TBA.</t>
    </section>

    <!---->

    <section title="Security Policy Design">
      <t>The basic security for intra-domain deployment is described in <xref
      target="RFC8986"/> and the enhanced security mechanism is defined in
      <xref target="RFC8754"/>.</t>

      <t>In <xref target="RFC8986"/>, additional basic security mechanisms are
      defined. For easier understanding, a easy example is shown in <xref
      target="srv6-sec"/>.</t>

      <t><figure anchor="srv6-sec" title="SRv6 Security Policy Design">
          <artwork><![CDATA[

        ***************************              ***** 
        *             (3) h2      *              *   * SRv6 domain
        *               \ |       *              *****
 h1-----A-----B-----C-----D-------E-------F      
      / *    (2)    (2)  (2)      * \    
(1,2,3) *                         *  (1,2)
        *                         *
        ***************************


]]></artwork>
        </figure><list style="symbols">
          <t>A-E: SRv6 Routers inside the SRv6 domain, A and E are the edge
          router, can be called Ingress router instead.</t>

          <t>F: Router F outside the SRv6 domain.</t>

          <t>h1: A host outside the SRv6 domain connects to router Router
          A.</t>

          <t>h2: A host within SRv6 domain, which connects to the Router
          D.</t>

          <t>(1): Security policy 1: ACL for External Interface.</t>

          <t>(2): Security policy 2: ACL for Internal Interfaces.</t>

          <t>(3): Security policy 3: Policy for processing HMAC, should be
          deployed at the ingress nodes.</t>
        </list></t>

      <section title="Basic Security Design">
        <t/>

        <section title="ACL for External Interfaces">
          <t>Typically, in any trusted domain, ingress routers are configured
          with Access Control Lists (ACL) filtering out any packet externally
          received with SA/DA having a domain internal address. An SRv6 router
          typically comply with the same rule.</t>

          <t>A provider would generally do this for its internal address space
          in order to prevent access to internal addresses and in order to
          prevent spoofing. The technique is extended to the local SID space.
          However, in some use cases, Binding SID can be leaked outside of
          SRv6 domain. Detailed ACL should be then configured in order to
          consider the externally advertised Binding SID.</t>
        </section>

        <section title="ACL for Internal Interfaces">
          <t>An SRv6 router MUST support an ACL with the following
          behavior:</t>

          <t><figure>
              <artwork><![CDATA[1. IF (DA == LocalSID) && (SA != internal address or SID space) :
2.    drop
]]></artwork>
            </figure></t>

          <t>This prevents access to locally instantiated SIDs from outside
          the operator's infrastructure. Note that this ACL may not be enabled
          in all cases. For example, specific SIDs can be used to provide
          resources to devices that are outside of the operator's
          infrastructure.</t>
        </section>

        <section title="SID Instantiation">
          <t>As per the End definition <xref target="RFC8986"/>, an SRv6
          router MUST only implement the End behavior on a local IPv6 address
          if that address has been explicitly enabled as an SRv6 SID.</t>

          <t>Packets received with destination address representing a local
          interface that has not been enabled as an SRv6 SID MUST be
          dropped.</t>
        </section>
      </section>

      <section title="Enhanced Security Design">
        <t>HMAC <xref target="RFC2104"/> is the enhanced security mechanism
        for SRv6 as defined in <xref target="RFC8754"/>. HMAC is used for
        validating the packets with SRH sent from hosts within SRv6
        domain.</t>

        <t>Since the SRH is mutable in computing the Integrity Check Value
        (ICV) of AH <xref target="RFC8754"/>, so AH can not be directly
        applicable to SRv6 packets. HMAC TLV in SRH is used for making sure
        that the SRH fields like SIDs are not changed along the path. While
        the intra SRv6 domain is trustworthy, so HMAC will be processed at the
        ingress nodes only, and could be ignore at the other nodes inside the
        trusted domain.</t>

        <t/>
      </section>
    </section>

    <section title="Security Considerations">
      <t>TBA</t>
    </section>

    <!-- End of section "Security Considerations" -->

    <section title=" Acknowledgements">
      <t>Manty thanks to Charles Perkins and Stefano Previdi's valuable
      comments.</t>
    </section>

    <!-- End of section "Acknowledgements" -->
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.5095'?>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.8402'
?>

      <?rfc include='reference.RFC.8754'
?>

      <?rfc include='reference.RFC.8200'?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.I-D.ietf-spring-segment-routing-policy"?>

      <?rfc include='reference.RFC.4301'?>

      <?rfc include='reference.RFC.4302'?>

      <?rfc include='reference.RFC.4303'?>

      <?rfc include='reference.RFC.4942'?>

      <?rfc include='reference.RFC.2104'?>

      <?rfc include='reference.RFC.7855'?>

      <?rfc include='reference.RFC.4443'?>

      <?rfc ?>

      <?rfc include='reference.RFC.8986'?>

      <?rfc ?>

      <!---->
    </references>
  </back>
</rfc>
