InternetDraftEngineering Task Force K. GrewalD. Durham M. Long Network Working GroupInternet-Draft Intel Corporationdraft-grewal-ipsec-traffic-visibility-00.txtIntendedStatus:status: Standards Track G. Montenegro Expires:JuneDecember 25, 2008JanuaryMicrosoft Corporation June 23, 2008 XESP for Trafficvisibility using IPsec ESP NULL encryptionVisibility draft-grewal-ipsec-traffic-visibility-01 Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79.This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026 [i].Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. 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." The list of current Internet-Drafts can be accessed athttp://www.ietf.org/ietf/1id-abstracts.txthttp://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.Copyright Notice Copyright (C) The IETF Trust (2008).This Internet-Draft will expire on December 25, 2008. Abstract This document describesleveraging UDPan ESP encapsulation for IPsec,using ESP NULL encryption in order for intermediaryallowing intermediate devices to ascertain if ESP-NULL is being employed and hence inspect the IPsecpackets.packets for network monitoring and access control functions. Currently in the IPsec standard, there is no way to differentiate between ESP encryption and ESP NULL encryption by simply examining a packet.Conventions used in this document The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC-2119 [ii]. Table of Contents 1. Introduction...................................................2 1.1 Applicability Statement....................................3 2. UDP Encapsulation of IPsec ESP.................................3 2.1 Extension Header...........................................4 2.2 Tunnel and Transport mode of considerations................5 2.3 Port conflicts.............................................5 3. IANA Considerations............................................6 4. Formal Syntax..................................................6 5. Security Considerations........................................6 6. References.....................................................6 7. Acknowledgements...............................................7 Author's Addresses.............................................7 Full Copyright Statement.......................................81. IntroductionThe RFCs for leveragingUse of ESP within IPsecdescribes[RFC4303] specifies how ESP packet encapsulation is performed.Other RFCs describe howIt also specifies that ESP canbe leveraged usinguse NULLencryption,encryption [RFC2410] while preserving data integrity and authenticity.However, theThe exact encapsulationemployedandthealgorithms employed are negotiated out-of-bandusing the Internet- Key-Exchange (IKE) protocol. Once the packet is formattedusing, for example, IKE [RFC2409] or IKEv2 [RFC4306] andsentbased onthe wire, it is infeasible to distinguish if encryption has been employed or is absent (ESP-NULL) by purely examining the packet. In the case of employing IPsec within thepolicy. Enterpriseenvironment, it is desirableenvironments typically employ numerous security policies (and tools forintermediate devices (suchenforcing them), asload balancers,related to access control, firewalls, network monitoring functions, deep packet inspection, Intrusion Detection/and Prevention Systems(IDS/IPS))(IDS and IPS), scanning and detection of viruses and worms, etc. In order tohave accessenforce these policies, network tools and intermediate devices require visibility into packets, ranging from simple packet header inspection to deeper payload examination. Network security protocols which encrypt the data in transit prevent these network tools from performing the aforementioned functions. When employing IPsec withineach packetan enterprise environment, it is desirable to employ ESP instead of AH [RFC4302], as AH does not work in NAT environments. Furthermore, in order to preserveexisting criticalthe above networkservices.monitoring functions, it is desirable to use ESP-NULL. In a mixed modeenvironment, whereenvironment some packets containing sensitive datamayemploy a given encryption cipher suite, while other packetsare employing ESP-NULL, theemploy ESP-NULL. For an intermediatedevices is unabledevice todiscernunambiguously distinguish which packets are leveraging ESP-NULL,hence inhibiting further analysisthey would require knowledge of all the policies being employed for each protected session. This is clearly not practical. Heuristic-based methods can be employed to parse the packets, but these can be very expensive, containing numerous rules based onthat packet.each different protocol and payload. Even then, the parsing may not be robust in cases where fields within a given encrypted packet happen to resemble the fields for a given protocol or heuristic rule. Thisdocument describesis even more problematic when different length Initialization Vectors (IVs), Integrity Check Values (ICVs) and padding are used for different security associations, making it difficult to determine the start and end of the payload data, let alone attempting any further parsing. Furthermore, storage, lookup and cross-checking amechanism leveraging UDP-encapsulationset ofIPsec ESPcomprehensive rules against every packet adds cost to hardware implementations and degrades performance. In cases where the packetsusingmay be encrypted, it is also wasteful to check against heuristics-based rules, when afixed destination port, allowingsimple exception policy (e.g., allow, drop or redirect) can be employed to handle the encrypted packets. Because of the non-deterministic nature of heuristics-based rules for disambiguating between encrypted and non- encrypted data, an alternative method for enabling intermediatedevicedevices to function in encrypted data environments needs to be defined. Enterprise environments typically use both stateful and stateless packet inspection mechanisms. The previous considerations weigh particularly heavy on stateless mechanisms such as router ACLs and NetFlow exporters. This document defines a mechanism to prove additional information in relevant IPsec packets so intermediate devices can efficiently differentiate between encrypteddataESP packets and ESP packets with NULLencrypted dataencryption. The document is consistent with the operation of ESP in NAT environments [RFC3947]. The design principles forESP. 1.1this protocol are the following: o Allow easy identification and parsing of integrity-only IPsec traffic o Leverage the existing hardware IPsec parsing engines as much as possible to minimize additional hardware design costs o Minimize the packet overhead in the common case 1.1. Requirements Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. 1.2. Applicability Statement The document is applicable only toIPsecthe Extended ESPonlyheader defined below, and does not describe any changes toIPsec AH. 2. UDP Encapsulation of IPseceither ESPUDP encapsulation of IPsec[RFC4303] nor AH [RFC4302]. 2. Extended ESPpackets(XESP) Header format The proposal isdefinedto define an Extended ESP protocol number, which provides additional attributes inRFC 3948each packet. The value of the new protocol is TBD andtakesthefollowing basic format.format of the new encapsulation is defined below. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Source PortNext Header | HdrLen | TrailerLen | Flags | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Security Parameters Index (SPI) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IV (variable) | ~ ~ |Destination Port| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Data | ~ ~ | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | TFC Padding * (optional, variable) | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Padding (variable) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Padding (0-255 bytes) |PAD Length |ChecksumNext Header | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |ESP header [RFC2406]Integrity Check Value-ICV (variable) | ~ ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+According to RFC 3948,XESP Header Figure 1 Where: Next Header: next protocol header (encrypted in ESP trailer, but in thesource / destination port values are asclear in header), providing easy access to a HW parser to extract thesame as used by IKE. We extendupper layer protocol. Note: For security concerns, this value may optionally be set toinclude a discrete destination port (value TBD)zero, in whichidentifiescase theUDP/ESP payload as accessible for intermediate devices. The source UDP port mustnext header can beas used by IKE and does not changeextracted from theabove specification. Having a reserved, unique destination port to identifyESP trailer. HdrLen: includes thepayload as decipherable by intermediate devices provides flexibility in adding an additional, uniquenew headerfollowing the UDP+ full ESP headerwhich allows+ theintermediate deviceIV (if present). It is an offset toparsethepacket according to additional hints on howbeginning of the Payload Data. TrailerLen: Offset from the end of the packethas been encoded. Thisincluding the ICV, pad length, and any padding. It isneeded to pass information within eachan offset from the end of the packetonto thealgorithm employed forlast byte of thedata authenticity and hence any IV requirementspayload data. Flags 2 bits: Version 1 bit: IntegrityOnly: Payload Data is not encrypted (ESP-NULL). 5 bits: reserved forthat particular algorithm. As different algorithmsfuture use. These MUST be set to zero per this specification, but usage mayhave differing IV requirements,be defined by other specifications. As can be seen, thisextension allows the intermediate device to take into account IV (/ICV) for a given algorithm and parseExtended ESP format simply extended theremaining data pertaining tostandard ESP header by theupper layer protocol.first 4 octets. 2.1. UDP Encapsulation Thisextension encoding issection describes afixed size and encodes information about the specific data authenticity algorithm usedmechanism for running thegivennew packet/ SA,format over theoffset toexisting UDP encapsulation of ESP as defined in RFC 3948. This allows leveraging theupper layer protocolexisting IKE negotiation of the UDP port for NAT-T discovery and usage [RFC3947], as well as preserving theupper layer protocol value. Diagrammatically, this mayexisting UDP ports for ESP (port 4500). With UDP encapsulation, the packet format can be depicted as follows. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |SourceSrc Port (4500) |DestinationDest Port (4500) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Length |Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+|Next| Protocol Identifier (value = 0x00000001) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header |offset |Reserved |Algo EncodingHdrLen | TrailerLen | Flags | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |ESP header [RFC2406]Security Parameters Index (SPI) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IV (variable) | ~ ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+The attributes in the extension header are described further below. 2.1 Extension| Payload Data | ~ ~ | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | TFC Padding * (optional, variable) | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Padding (0-255 bytes) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Padding (0-255 bytes) |PAD Length | Next HeaderThe extension header is exactly 32-bits, where| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Integrity Check Value-ICV (variable) | ~ ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ UDP-encapsulated XESP Header Figure 2 Where: Source/Destination port (4500) and checksum: describes thefirst 8-bits are usedUDP encapsulation header, per RFC3948. Protocol Identifier: new field toconvey the upper layer protocol being carried in the ESP payload. The valuedemultiplex between UDP encapsulation ofthis field is copied directly from the Next Header fieldIKE, UDP encapsulation oftheESPtrailer and can be used by the intermediate device to determine / parse the upper layer protocol without having to findper RFC 3948, andparse the ESP trailer. The second 8-bits are usedthis proposal. According toconvey the offsetRFC 3948, clause 2.2, a 4 octet value of zero (0) immediately following theupper layer protocol from the end of this extensionUDP header(described further below). The third 8 bits are reserved for future expansion and set to zero. The last 8-bits contain the Algorithm Encoding and carries information about the algorithm being used to compute the ICV. This extension is needed in order for the intermediate device to determineindicates a Non-ESP marker, whichauthentication algorithm is beingcan be usedfor generation of the ESP Integrity Check Value (ICV) and further parse the packettoextractassume that the dataportion. The sizefollowing that value is an IKE packet. Similarly, a value of non-zero indicates that theIV and ICV in the IPsecpacket isalgorithm dependent. In this document, we do not define explicit values for the Algorithm Encoding, but choose to reusean ESP packet and thesame values defined in various IPsec RFCs which describe how to negotiate a given algorithm using IKE. In this manner, this specification will4-octet value can befuture proofed for any new algorithm definitions. For example,treated as the ESP SPI. However, RFC4302, section 3.3.2 defines specific values for4303, clause 2.1 indicates that theintegrity algorithms, which are used within IKE. Thesevalues 1-255 are reservedfor IKE via IANA. Additional RFCs defining other (newer) algorithms build upon these definitionsanddefine new values for these algorithms. One example is RFC 4543, which describes usage of AES-GMAC within IPsec and hence defines the valuescannot be usedfor different AES key sizes in section 9. The algorithm encoding is also useful in determining the size of the ICV for a given algorithm in order to deterministically extract the upper layer payload. The offset is an 8-bit value, which defines the number of octets betweenas theend of this extension headerSPI. We leverage that knowledge andthe startuse a value of 1 to indicate that theupper layer protocol. This includes theUDP encapsulated ESPheader, any additional IPheader contains this new packet format fortunnel mode and also the size of the IV, which may be algorithm dependent. Having an explicit value for the offsetESP encapsulation. The remaining fields in the packetallows the intermediate device to directly parse past any algorithm dependent structures within the packet and reach the upper layer protocol header. The reserved 8-bits are used to pad this extension to a long word alignment. This should be set to 0 by the sender, but it is not mandatory forhave therecipient to validate this value. 2.2same meaning as per section 2.0 above. 2.2. Tunnel and Transport mode of considerations This extension is equally applicable for tunnel and transport mode where the ESP Next Header field is used to differentiate between these modes, as per the existing IPsec specifications.2.3 Port conflicts Another consideration is that a legacy client may choose the UDP port reserved for this specification as a random source port for a totally different protocol exchange. Although this should not happen if the client is choosing ports from the dynamic range specified by IANA, it is still possible and hence2.3. IKE Considerations In order to negotiate theresponsibility rests onnew format of ESP encapsulation via IKE, both sides of theintermediate devicesecurity channel need toensure it can differentiate betweenagree upon using thetwo cases. The intermediate devicenew packet format. This canensure that it is looking at ESP- NULL traffic that is UDP encapsulated in this formbe achieved byvalidating additional data elements followingproposing a new protocol ID within theUDP header.existing IKE proposal structure as defined by RFC 4306, clause 3.3.1. Theformat of the UDP extension described above can be validated. Ifexisting proposal substructure in thisis deemed insufficient, then as a processclause allows negotiation ofextracting the upper layer payload from the ESP encapsulated packet,ESP/AH (among others) by using different protocol Ids for these protocols. By using theESP trailer needs to be examined (this will be at a fixed placesame protocol substructure in thepacket, proceeding the ICV value)proposal payload and using a new value (TBD) for this encapsulation, the existing IKE negotiation can bevalidated accordingleverage with minimal changes toIPsec ESP trailer construction, which may include some padding octets.support negotiation of this encapsulation. Furthermore, because theintermediate device can now validate thatnegotiation is at theupper layerprotocolbegins after a fixed length following the UDP header (UDP extension + ESP header).level, other transforms remain valid for this new encapsulation and consistent with IKEv2 [RFC4306]. Additionally,if the upper layer protocol contains a checksum, the intermediate device can further validate the checksum to ensure that packet constructionNAT-T [RFC3948] isas expected. Validating these additional elements reduces the probability ofwholly compatible with this extended frame format and can be used as-is, without anyrandom payload for a UDP exchangemodifications, in environments wherethe source portNAT isthe same as this specification from being treated as an ESP encapsulated payload. These checks are not mandatory, but shouldpresent and needs to beperformedtaken into account. 3. Acknowledgements The authors would like tocateracknowledge the following people forthis exception case. The extent and number of additionaltheir feedback on updating thechecks performed are protocol dependent. 3.definitions in this document. David McGrew, Brian Weis, Philippe Joubert, Brian Swander, Yaron Sheffer, Men Long, David Durham, Prashant Dewan, Marc Millier among others. 4. IANA Considerations Reserving an appropriate value forthe UDP destination port in order to providethis encapsulationis TBD and can happen after further peer review of this document. 4. Formal Syntax The following syntax specification uses the augmented Backus-Naur Form (BNF)asdescribedwell as a new value for the protocol inRFC-2234 [iii]. Therethe IKE negotiation isno new syntax definedTBD bythis document.IANA. 5. Security Considerations As this document augments the existing ESP encapsulation format, UDP encapsulation definitions specified in RFC3948,3948 and IKE negotiation of the new encapsulation, the security observations made inthat documentthose documents also apply here. In addition, as this documentpromotesallows intermediate device visibility into IPsec ESP encapsulated frames for the purposes ofNetworknetwork monitoring functions, care should be taken not to send sensitive data over connections using definitions from thisdocument.document, based on network domain/administrative policy. A strong key agreement protocol, such as IKE, together with a strong policy engine should be used to in determining appropriate security policy for the given traffic streams and data over which it is being employed. 6. References[RFC2026] Bradner, S., "The Internet Standards Process -- Revision 3", BCP 9, RFC 2026, October 1996. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997 [RFC2234] Crocker, D. and Overell, P.(Editors), "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, Internet Mail Consortium and Demon Internet Ltd., November 1997 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980.6.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.[RFC2401] Kent,[RFC2410] Glenn, R. and S. Kent, "The NULL Encryption Algorithm andR. Atkinson, "Security Architecture for the Internet Protocol",Its Use With IPsec", RFC2401,2410, November 1998.[RFC2406][RFC4303] Kent,S. and R. Atkinson,S., "IP Encapsulating Security Payload (ESP)", RFC2406, November 1998.4303, December 2005. 6.2. Informative References [RFC2409] Harkins, D. and D. Carrel, "The Internet Key Exchange (IKE)", RFC 2409, November 1998. [RFC3947] Kivinen, T., Swander, B., Huttunen, A., and V. Volpe, "Negotiation of NAT-Traversal in the IKE", RFC 3947, January 2005.[RFC4543] McGrew & Viega, "GMAC in[RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M. Stenberg, "UDP Encapsulation of IPsec ESPand AH",Packets", RFC4543, May 2006.3948, January 2005. [RFC4302] Kent, S., "IP Authentication Header", RFC 4302, December 2005. [RFC4306] Kaufman,C.C., "Internet Key Exchange (IKEv2)Protocol ",Protocol", RFC 4306, December 2005.7. Acknowledgements Author'sAuthors' Addresses Ken Grewal Intel Corporation 2111 NE 25thAvenueAvenue, JF3-232 Hillsboro, OR 97124 USA Phone: Email: ken.grewal@intel.comDavid Durham IntelGabriel Montenegro Microsoft Corporation2111 NE 25th Avenue JF3-232 Hillsboro, OR 97124 USA Email: david.durham@intel.com Men Long Intel Corporation 2111 NE 25th Avenue JF3-232 Hillsboro, OR 97124One Microsoft Way Redmond, WA 98052 USA Phone: Email:men.long@intel.comgabriel.montenegro@microsoft.com Full Copyright Statement Copyright (C) The IETF Trust (2008). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNETSOCIETYSOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Intellectual Property The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.