IPsec

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found.

Internet Protocol Security (IPsec) is a protocol suite for secure Internet Protocol (IP) communications by authenticating and encrypting each IP packet of a communication session. IPsec includes protocols for establishing mutual authentication between agents at the beginning of the session and negotiation of cryptographic keys to be used during the session. IPsec can be used in protecting data flows between a pair of hosts (host-to-host), between a pair of security gateways (network-to-network), or between a security gateway and a host (network-to-host).[1]

Internet Protocol security (IPsec) uses cryptographic security services to protect communications over Internet Protocol (IP) networks. IPsec supports network-level peer authentication, data origin authentication, data integrity, data confidentiality (encryption), and replay protection.

IPsec is an end-to-end security scheme operating in the Internet Layer of the Internet Protocol Suite, while some other Internet security systems in widespread use, such as Transport Layer Security (TLS) and Secure Shell (SSH), operate in the upper layers at the Application layer. Hence, only IPsec protects all application traffic over an IP network. Applications can be automatically secured by IPsec at the IP layer.

History

In December 1993, the Software IP Encryption protocol swIPe (protocol) was researched at Columbia University and AT&T Bell Labs by John Ioannidis and others.

Based on the funding from Clinton administration in hosting whitehouse.gov email (from June 1 of 1993 to January 20 of 1995) at Trusted Information Systems, Wei Xu started in July 1994 the research on IP Security, enhanced the IP protocols, developed the IPSec product on the BSDI platform, and quickly extended it on to Sun OS, HP UX, and other UNIX systems. Upon the success, Wei was facing another challenge by the slow performance of computing DES and Triple DES. The assembly software encryption was unable to support even a T1 speed under the Intel 80386 architecture. By exploring the Crypto cards from Germany, Wei further developed an automated device driver, known as plug-and-play today, in integrating with the hardware Crypto. After achieving the throughput much higher than a T1s, Wei Xu finally made the commercial product practically feasible, that was released as a part of the well-known Gauntlet firewall. In December 1994, it was deployed for the first time in production for securing some remote sites between east and west coastal states of the United States.

Another IP Encapsulating Security Payload (ESP)[2] was researched at the Naval Research Laboratory as part of a DARPA-sponsored research project, with openly published by IETF SIPP[3] Working Group drafted in December 1993 as a security extension for SIPP. This ESP was originally derived from the US Department of Defense SP3D protocol, rather than being derived from the ISO Network-Layer Security Protocol (NLSP). The SP3D protocol specification was published by NIST, but designed by the Secure Data Network System project of the US Department of Defense. The Security Authentication Header (AH) is derived partially from previous IETF standards work for authentication of the Simple Network Management Protocol (SNMP) version 2.

In 1995, The IPsec working group in the IETF was started to create an open freely available and vetted version of protocols that had been developed under NSA contract in the Secure Data Network System (SDNS) project. The SDNS project had defined a Security Protocol Layer 3 (SP3) that had been published by NIST and was also the basis of the ISO Network Layer Security Protocol (NLSP).[4] Key management for SP3 was provided by the Key Management Protocol (KMP) that provided a baseline of ideas for subsequent work in the IPsec committee.

IPsec is officially standardised by the Internet Engineering Task Force (IETF) in a series of Request for Comments documents addressing various components and extensions. It specifies the spelling of the protocol name to be IPsec.[5]

Security architecture

The IPsec suite is an open standard. IPsec uses the following protocols to perform various functions:[6][7]

Authentication Header

Authentication Header (AH) is a member of the IPsec protocol suite. AH guarantees connectionless integrity and data origin authentication of IP packets. Further, it can optionally protect against replay attacks by using the sliding window technique and discarding old packets (see below).

  • In IPv4, the AH protects the IP payload and all header fields of an IP datagram except for mutable fields (i.e. those that might be altered in transit), and also IP options such as the IP Security Option (RFC 1108). Mutable (and therefore unauthenticated) IPv4 header fields are DSCP/ToS, ECN, Flags, Fragment Offset, TTL and Header Checksum.[9]
  • In IPv6, the AH protects most of the IPv6 base header, AH itself, non-mutable extension headers after the AH, and the IP payload. Protection for the IPv6 header excludes the mutable fields: DSCP, ECN, Flow Label, and Hop Limit.[9]

AH operates directly on top of IP, using IP protocol number 51.[15]

The following AH packet diagram shows how an AH packet is constructed and interpreted:[8][9]

Authentication Header format
Offsets Octet16 0 1 2 3
Octet16 Bit10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 0 Next Header Payload Len Reserved
4 32 Security Parameters Index (SPI)
8 64 Sequence Number
C 96 Integrity Check Value (ICV)
Next Header (8 bits) 
Type of the next header, indicating what upper-layer protocol was protected. The value is taken from the list of IP protocol numbers.
Payload Len (8 bits) 
The length of this Authentication Header in 4-octet units, minus 2. For example, an AH value of 4 equals 3×(32-bit fixed-length AH fields) + 3×(32-bit ICV fields) − 2 and thus an AH value of 4 means 24 octets. Although the size is measured in 4-octet units, the length of this header needs to be a multiple of 8 octets if carried in an IPv6 packet. This restriction does not apply to an Authentication Header carried in an IPv4 packet.
Reserved (16 bits) 
Reserved for future use (all zeroes until then).
Security Parameters Index (32 bits) 
Arbitrary value which is used (together with the destination IP address) to identify the security association of the receiving party.
Sequence Number (32 bits) 
A monotonic strictly increasing sequence number (incremented by 1 for every packet sent) to prevent replay attacks. When replay detection is enabled, sequence numbers are never reused, because a new security association must be renegotiated before an attempt to increment the sequence number beyond its maximum value.[9]
Integrity Check Value (multiple of 32 bits) 
Variable length check value. It may contain padding to align the field to an 8-octet boundary for IPv6, or a 4-octet boundary for IPv4.

Encapsulating Security Payload

Encapsulating Security Payload (ESP) is a member of the IPsec protocol suite. In IPsec it provides origin authenticity, integrity and confidentiality protection of packets. ESP also supports encryption-only and authentication-only configurations, but using encryption without authentication is strongly discouraged because it is insecure.[16][17][18] Unlike Authentication Header (AH), ESP in transport mode does not provide integrity and authentication for the entire IP packet. However, in Tunnel Mode, where the entire original IP packet is encapsulated with a new packet header added, ESP protection is afforded to the whole inner IP packet (including the inner header) while the outer header (including any outer IPv4 options or IPv6 extension headers) remains unprotected. ESP operates directly on top of IP, using IP protocol number 50.[15]

The following ESP packet diagram shows how an ESP packet is constructed and interpreted:[1][19]

Encapsulating Security Payload format
Offsets Octet16 0 1 2 3
Octet16 Bit10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 0 Security Parameters Index (SPI)
4 32 Sequence Number
8 64 Payload data
   
  Padding (0-255 octets)  
  Pad Length Next Header
Integrity Check Value (ICV)
Security Parameters Index (32 bits) 
Arbitrary value used (together with the destination IP address) to identify the security association of the receiving party.
Sequence Number (32 bits) 
A monotonically increasing sequence number (incremented by 1 for every packet sent) to protect against replay attacks. There is a separate counter kept for every security association.
Payload data (variable) 
The protected contents of the original IP packet, including any data used to protect the contents (e.g. an Initialisation Vector for the cryptographic algorithm). The type of content that was protected is indicated by the Next Header field.
Padding (0-255 octets) 
Padding for encryption, to extend the payload data to a size that fits the encryption's cipher block size, and to align the next field.
Pad Length (8 bits) 
Size of the padding (in octets).
Next Header (8 bits) 
Type of the next header. The value is taken from the list of IP protocol numbers.
Integrity Check Value (multiple of 32 bits) 
Variable length check value. It may contain padding to align the field to an 8-octet boundary for IPv6, or a 4-octet boundary for IPv4.

Security association

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

The IP security architecture uses the concept of a security association as the basis for building security functions into IP. A security association is simply the bundle of algorithms and parameters (such as keys) that is being used to encrypt and authenticate a particular flow in one direction. Therefore, in normal bi-directional traffic, the flows are secured by a pair of security associations.

Security associations are established using the Internet Security Association and Key Management Protocol (ISAKMP). ISAKMP is implemented by manual configuration with pre-shared secrets, Internet Key Exchange (IKE and IKEv2), Kerberized Internet Negotiation of Keys (KINK), and the use of IPSECKEY DNS records.[14][20][21] RFC 5386 defines Better-Than-Nothing Security (BTNS) as an unauthenticated mode of IPsec using an extended IKE protocol.

In order to decide what protection is to be provided for an outgoing packet, IPsec uses the Security Parameter Index (SPI), an index to the security association database (SADB), along with the destination address in a packet header, which together uniquely identify a security association for that packet. A similar procedure is performed for an incoming packet, where IPsec gathers decryption and verification keys from the security association database.

For multicast, a security association is provided for the group, and is duplicated across all authorized receivers of the group. There may be more than one security association for a group, using different SPIs, thereby allowing multiple levels and sets of security within a group. Indeed, each sender can have multiple security associations, allowing authentication, since a receiver can only know that someone knowing the keys sent the data. Note that the relevant standard does not describe how the association is chosen and duplicated across the group; it is assumed that a responsible party will have made the choice.

Modes of operation

IPsec can be implemented in a host-to-host transport mode, as well as in a network tunneling mode.

Transport mode

In transport mode, only the payload of the IP packet is usually encrypted and/or authenticated. The routing is intact, since the IP header is neither modified nor encrypted; however, when the authentication header is used, the IP addresses cannot be translated, as this always will invalidate the hash value. The transport and application layers are always secured by hash, so they cannot be modified in any way (for example by translating the port numbers).

A means to encapsulate IPsec messages for NAT traversal has been defined by RFC documents describing the NAT-T mechanism.

Tunnel mode

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

In tunnel mode, the entire IP packet is encrypted and/or authenticated. It is then encapsulated into a new IP packet with a new IP header. Tunnel mode is used to create virtual private networks for network-to-network communications (e.g. between routers to link sites), host-to-network communications (e.g. remote user access) and host-to-host communications (e.g. private chat).[22]

Tunnel mode supports NAT traversal.

Cryptographic algorithms

Cryptographic algorithms defined for use with IPsec include:

  • HMAC-SHA1/SHA2 for integrity protection and authenticity.
  • TripleDES-CBC for confidentiality
  • AES-CBC for confidentiality.
  • AES-GCM providing confidentiality and authentication together efficiently.

Refer to RFC 7321 for details.

Software implementations

IPsec support is usually implemented in the kernel with key management and ISAKMP/IKE negotiation carried out from user space. The openly specified "PF_KEY Key Management API, Version 2" is often used to enable the application-space key management application to update the IPsec Security Associations stored within the kernel-space IPsec implementation.[23]

Existing IPsec implementations usually include ESP, AH, and IKE version 2. Existing IPsec implementations on UNIX-like operating systems, for example, Solaris or Linux, usually include PF_KEY version 2.

Standards status

IPsec was developed in conjunction with IPv6 and was originally required to be supported by all standards-compliant implementations of IPv6 before RFC 6434 made it only a recommendation.[24] IPsec is also optional for IPv4 implementations. IPsec is most commonly used to secure IPv4 traffic.

IPsec protocols were originally defined in RFC 1825 through RFC 1829, which were published in 1995. In 1998, these documents were superseded by RFC 2401 and RFC 2412 with a few incompatible engineering details, although they were conceptually identical. In addition, a mutual authentication and key exchange protocol Internet Key Exchange (IKE) was defined to create and manage security associations. In December 2005, new standards were defined in RFC 4301 and RFC 4309 which are largely a superset of the previous editions with a second version of the Internet Key Exchange standard IKEv2. These third-generation documents standardized the abbreviation of IPsec to uppercase “IP” and lowercase “sec”. “ESP” generally refers to RFC 4303, which is the most recent version of the specification.

Since mid-2008, an IPsec Maintenance and Extensions (ipsecme) working group is active at the IETF.[25][26]

Alleged NSA interference

In 2013, as part of Snowden leaks, it was revealed that the US National Security Agency had been actively working to "Insert vulnerabilities into commercial encryption systems, IT systems, networks, and endpoint communications devices used by targets" as part of the Bullrun program.[27] There are allegations that IPsec was a targeted encryption system.[28]

The OpenBSD IPsec stack was the first implementation that was available under a permissive open-source license, and was therefore copied widely. In a letter which OpenBSD lead developer Theo de Raadt received on 11 Dec 2010 from Gregory Perry, it is alleged that Jason Wright and others, working for the FBI, inserted "a number of backdoors and side channel key leaking mechanisms" into the OpenBSD crypto code. In the forwarded email from 2010, Theo de Raadt did not at first express an official position on the validity of the claims, apart from the implicit endorsement from forwarding the email.[29] Jason Wright's response to the allegations: "Every urban legend is made more real by the inclusion of real names, dates, and times. Gregory Perry's email falls into this category. … I will state clearly that I did not add backdoors to the OpenBSD operating system or the OpenBSD crypto framework (OCF)."[30] Some days later, de Raadt commented that "I believe that NETSEC was probably contracted to write backdoors as alleged. … If those were written, I don't believe they made it into our tree."[31] This was published before the Snowden leaks.

An alternative explanation put forward by the authors of the Logjam attack suggests that the NSA compromised IPsec VPNs by undermining the Diffie-Hellman algorithm used in the key exchange. In their paper[32] they allege the NSA specially built a computing cluster to precompute multiplicative subgroups for specific primes and generators, such as for the second Oakley group defined in RFC 2409. As of May 2015, 90% of addressable IPsec VPNs supported the second Oakley group as part of IKE. If an organization were to precompute this group, they could derive the keys being exchanged and decrypt traffic without inserting any software backdoors.

Furthermore, IPsec VPNs using "Aggressive Mode" settings send a hash of the PSK in the clear. This can be and apparently is targeted by the NSA using offline dictionary attacks.[33][34][35]

IETF documentation

Standards Track

  • RFC 1829: The ESP DES-CBC Transform
  • RFC 2403: The Use of HMAC-MD5-96 within ESP and AH
  • RFC 2404: The Use of HMAC-SHA-1-96 within ESP and AH
  • RFC 2405: The ESP DES-CBC Cipher Algorithm With Explicit IV
  • RFC 2410: The NULL Encryption Algorithm and Its Use With IPsec
  • RFC 2451: The ESP CBC-Mode Cipher Algorithms
  • RFC 2857: The Use of HMAC-RIPEMD-160-96 within ESP and AH
  • RFC 3526: More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)
  • RFC 3602: The AES-CBC Cipher Algorithm and Its Use with IPsec
  • RFC 3686: Using Advanced Encryption Standard (AES) Counter Mode With IPsec Encapsulating Security Payload (ESP)
  • RFC 3947: Negotiation of NAT-Traversal in the IKE
  • RFC 3948: UDP Encapsulation of IPsec ESP Packets
  • RFC 4106: The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating Security Payload (ESP)
  • RFC 4301: Security Architecture for the Internet Protocol
  • RFC 4302: IP Authentication Header
  • RFC 4303: IP Encapsulating Security Payload
  • RFC 4304: Extended Sequence Number (ESN) Addendum to IPsec Domain of Interpretation (DOI) for Internet Security Association and Key Management Protocol (ISAKMP)
  • RFC 4307: Cryptographic Algorithms for Use in the Internet Key Exchange Version 2 (IKEv2)
  • RFC 4308: Cryptographic Suites for IPsec
  • RFC 4309: Using Advanced Encryption Standard (AES) CCM Mode with IPsec Encapsulating Security Payload (ESP)
  • RFC 4543: The Use of Galois Message Authentication Code (GMAC) in IPsec ESP and AH
  • RFC 4555: IKEv2 Mobility and Multihoming Protocol (MOBIKE)
  • RFC 4806: Online Certificate Status Protocol (OCSP) Extensions to IKEv2
  • RFC 4868: Using HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512 with IPsec
  • RFC 4945: The Internet IP Security PKI Profile of IKEv1/ISAKMP, IKEv2, and PKIX
  • RFC 5282: Using Authenticated Encryption Algorithms with the Encrypted Payload of the Internet Key Exchange version 2 (IKEv2) Protocol
  • RFC 5386: Better-Than-Nothing Security: An Unauthenticated Mode of IPsec
  • RFC 5529: Modes of Operation for Camellia for Use with IPsec
  • RFC 5685: Redirect Mechanism for the Internet Key Exchange Protocol Version 2 (IKEv2)
  • RFC 5723: Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption
  • RFC 5857: IKEv2 Extensions to Support Robust Header Compression over IPsec
  • RFC 5858: IPsec Extensions to Support Robust Header Compression over IPsec
  • RFC 7296: Internet Key Exchange Protocol Version 2 (IKEv2)
  • RFC 7321: Cryptographic Algorithm Implementation Requirements and Usage Guidance for Encapsulating Security Payload (ESP) and Authentication Header (AH)
  • RFC 7383: Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentation
  • RFC 7427: Signature Authentication in the Internet Key Exchange Version 2 (IKEv2)
  • RFC 7634: ChaCha20, Poly1305, and Their Use in the Internet Key Exchange Protocol (IKE) and IPsec

Experimental RFCs

  • RFC 4478: Repeated Authentication in Internet Key Exchange (IKEv2) Protocol

Informational RFCs

  • RFC 2367: PF_KEY Interface
  • RFC 2412: The OAKLEY Key Determination Protocol
  • RFC 3706: A Traffic-Based Method of Detecting Dead Internet Key Exchange (IKE) Peers
  • RFC 3715: IPsec-Network Address Translation (NAT) Compatibility Requirements
  • RFC 4621: Design of the IKEv2 Mobility and Multihoming (MOBIKE) Protocol
  • RFC 4809: Requirements for an IPsec Certificate Management Profile
  • RFC 5387: Problem and Applicability Statement for Better-Than-Nothing Security (BTNS)
  • RFC 5856: Integration of Robust Header Compression over IPsec Security Associations
  • RFC 5930: Using Advanced Encryption Standard Counter Mode (AES-CTR) with the Internet Key Exchange version 02 (IKEv2) Protocol
  • RFC 6027: IPsec Cluster Problem Statement
  • RFC 6071: IPsec and IKE Document Roadmap
  • RFC 6379: Suite B Cryptographic Suites for IPsec
  • RFC 6380: Suite B Profile for Internet Protocol Security (IPsec)
  • RFC 6467: Secure Password Framework for Internet Key Exchange Version 2 (IKEv2)

Best Current Practice RFCs

  • RFC 5406: Guidelines for Specifying the Use of IPsec Version 2

Obsolete/Historic RFCs

  • RFC 1825: Security Architecture for the Internet Protocol (obsoleted by RFC 2401)
  • RFC 1826: IP Authentication Header (obsoleted by RFC 2402)
  • RFC 1827: IP Encapsulating Security Payload (ESP) (obsoleted by RFC 2406)
  • RFC 1828: IP Authentication using Keyed MD5 (historic)
  • RFC 2401: Security Architecture for the Internet Protocol (IPsec overview) (obsoleted by RFC 4301)
  • RFC 2406: IP Encapsulating Security Payload (ESP) (obsoleted by RFC 4303 and RFC 4305)
  • RFC 2407: The Internet IP Security Domain of Interpretation for ISAKMP (obsoleted by RFC 4306)
  • RFC 2409: The Internet Key Exchange (obsoleted by RFC 4306)
  • RFC 4305: Cryptographic Algorithm Implementation Requirements for Encapsulating Security Payload (ESP) and Authentication Header (AH) (obsoleted by RFC 4835)
  • RFC 4306: Internet Key Exchange (IKEv2) Protocol (obsoleted by RFC 5996)
  • RFC 4718: IKEv2 Clarifications and Implementation Guidelines (obsoleted by RFC 7296)
  • RFC 4835: Cryptographic Algorithm Implementation Requirements for Encapsulating Security Payload (ESP) and Authentication Header (AH) (obsoleted by RFC 7321)
  • RFC 5996: Internet Key Exchange Protocol Version 2 (IKEv2) (obsoleted by RFC 7296)

See also

References

  1. 1.0 1.1 1.2 Kent, S.; Atkinson, R. (November 1998). IP Encapsulating Security Payload (ESP). IETF. RFC 2406. https://tools.ietf.org/html/rfc2406. 
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. http://www.toad.com/gnu/netcrypt.html
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Thayer, R.; Doraswamy, N.; Glenn, R. (November 1998). IP Security Document Roadmap. IETF. RFC 2411. https://tools.ietf.org/html/rfc2411. 
  7. Hoffman, P. (December 2005). Cryptographic Suites for IPsec. IETF. RFC 4308. https://tools.ietf.org/html/rfc4308. 
  8. 8.0 8.1 Kent, S.; Atkinson, R. (November 1998). IP Authentication Header. IETF. RFC 2402. https://tools.ietf.org/html/rfc2402. 
  9. 9.0 9.1 9.2 9.3 9.4 Kent, S. (December 2005). IP Authentication Header. IETF. RFC 4302. https://tools.ietf.org/html/rfc4302. 
  10. The Internet Key Exchange (IKE), RFC 2409, §1 Abstract
  11. Harkins, D.; Carrel, D. (November 1998). The Internet Key Exchange (IKE). IETF. RFC 2409. https://tools.ietf.org/html/rfc2409. 
  12. Kaufman, C., ed. IKE Version 2. IETF. RFC 4306. https://tools.ietf.org/html/rfc4306. 
  13. Sakane, S.; Kamada, K.; Thomas, M.; Vilhuber, J. (November 1998). Kerberized Internet Negotiation of Keys (KINK). IETF. RFC 4430. https://tools.ietf.org/html/rfc4430. 
  14. 14.0 14.1 Richardson, M. (February 2005). A Method for Storing IPsec Keying Material in DNS. IETF. RFC 4025. https://tools.ietf.org/html/rfc4025. 
  15. 15.0 15.1 Lua error in package.lua at line 80: module 'strict' not found.
  16. Lua error in package.lua at line 80: module 'strict' not found.
  17. Lua error in package.lua at line 80: module 'strict' not found.
  18. Lua error in package.lua at line 80: module 'strict' not found.
  19. Kent, S. (December 2005). IP Encapsulating Security Payload (ESP). IETF. RFC 4303. https://tools.ietf.org/html/rfc4303. 
  20. RFC 2406, §1, page 2
  21. RFC 3129
  22. William, S., & Stallings, W. (2006). Cryptography and Network Security, 4/E. Pearson Education India. p. 492-493
  23. RFC 2367, PF_KEYv2 Key Management API, Dan McDonald, Bao Phan, & Craig Metz (July 1998)
  24. RFC 6434, "IPv6 Node Requirements", E. Jankiewicz, J. Loughney, T. Narten (December 2011)
  25. Lua error in package.lua at line 80: module 'strict' not found.
  26. Lua error in package.lua at line 80: module 'strict' not found.
  27. Lua error in package.lua at line 80: module 'strict' not found.
  28. Lua error in package.lua at line 80: module 'strict' not found.
  29. Lua error in package.lua at line 80: module 'strict' not found.
  30. Lua error in package.lua at line 80: module 'strict' not found.
  31. Lua error in package.lua at line 80: module 'strict' not found.
  32. Lua error in package.lua at line 80: module 'strict' not found.
  33. https://weakdh.org/imperfect-forward-secrecy-ccs15.pdf
  34. http://crypto.stackexchange.com/questions/27404/what-are-the-problems-of-ikev1-aggressive-mode-compared-to-ikev1-main-mode-or-i
  35. https://nohats.ca/wordpress/blog/2014/12/29/dont-stop-using-ipsec-just-yet/

External links