Jump to content

IPsec

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Ken g6 (talk | contribs) at 22:21, 12 September 2013 (→‎Alleged NSA interference: copyedit). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Internet Protocol Security (IPsec) is a technology protocol suite for securing Internet Protocol (IP) communications by authenticating and/or encrypting each IP packet of a communication session. IPsec also 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 is an end-to-end security scheme operating in the Internet Layer of the Internet Protocol Suite. It 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]

Some other Internet security systems in widespread use, such as Secure Sockets Layer (SSL), Transport Layer Security (TLS) and Secure Shell (SSH), operate in the upper layers of the TCP/IP model. In the past, the use of TLS/SSL had to be designed into an application to protect application protocols. In contrast, since day one, applications did not need to be specifically designed to use IPsec. Hence, IPsec protects any application traffic across an IP network.

History

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

In July 1994, Wei Xu at Trusted Information Systems continued this research which was completed successfully on the BSDI platform after a few months. Wei quickly extended his development on to Sun OS, HP UX, and other UNIX systems. One of the challenges was slow performance of DES and Triple DES. The software encryption was unable to support a T1 speed under the Intel 80386 architecture. By exploring the Crypto cards from Germany, Wei Xu further developed an automated device driver, known as plug-and-play today. By achieving the throughput for more than a T1s, this work made the commercial product practically feasible, that was released as a part of the well-known Gauntlet firewall. In December 1994, it was the first time in production for securing some remote sites between east and west coastal states of the United States. [citation needed]

The IETF IP Security Protocol was developed starting in 1992 at the Naval Research Laboratory as part of a DARPA-sponsored research project, with openly published drafts by 1993.[2][3] 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. AH is derived in part from previous IETF standards work for authentication of the Simple Network Management Protocol (SNMP) version 2.

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.[4]

Security architecture

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

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.[8]
  • In IPv6, the AH protects the 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.[8]

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

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

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 3x(32-bit fixed-length AH fields) + 3x(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.[8]
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.[15][16][17] 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.[14]

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

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

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.[13][19][20] 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 tunnel 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 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

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).

Tunnel mode supports NAT traversal.

Cryptographic algorithms

Cryptographic algorithms defined for use with IPsec include:

  • HMAC-SHA1 for integrity protection and authenticity.
  • TripleDES-CBC for confidentiality
  • AES-CBC for confidentiality.

Refer to RFC 4835 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.[21]

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

Standards status

IPsec was developed in conjunction with IPv6 and was originally required in all standards-compliant implementations of IPv6 before RFC 6434 made it only a recommendation.[22] IPsec is also optional for IPv4 implementations but due to the slow deployment of IPv6, 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 working group is active at the IETF.[23][24]

Alleged NSA interference

As part of the Snowden leaks, it has been revealed that the US National Security Agency has 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.[25] There are allegations that IPsec was a targeted encryption system.

The OpenBSD IPsec stack was the first implementation which 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 alledged 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 does not express an official position on the validity of the claims, apart from the implicit endorsement from forwarding the email.[26] Note that this was published before the Snowden leaks.

John Gilmore, who followed the IPsec IETF standards committee and lead a group that tried to implement IPsec, has speculated that the NSA sabotaged the IPsec standard. From observation, Gilmore speculates that the NSA purposefully made the standard less secure than it could have been, and unnecessarily complicated and hard to deploy, with the goal of hampering the spread of strong crypto unbreakable to the NSA. Gilmore points out that NSA personel participated in the IPsec IETF standards committee.[27]

See also

References

  1. ^ a b c Kent, S.; Atkinson, R. (1998). IP Encapsulating Security Payload (ESP). IETF. doi:10.17487/RFC2406. RFC 2406. {{citation}}: Unknown parameter |month= ignored (help)
  2. ^ "Draft SIPP Specification". IETF. 1993. p. 21.
  3. ^ "SIPP Encapsulating Security Payload". IETF SIPP Working Group. 1993.
  4. ^ "RFC4301: Security Architecture for the Internet Protocol". Network Working Group of the IETF. December 2005. p. 4. The spelling "IPsec" is preferred and used throughout this and all related IPsec standards. All other capitalizations of IPsec [...] are deprecated.
  5. ^ Thayer, R.; Doraswamy, N.; Glenn, R. (1998). IP Security Document Roadmap. IETF. doi:10.17487/RFC2411. RFC 2411. {{citation}}: Unknown parameter |month= ignored (help)
  6. ^ Hoffman, P. (2005). Cryptographic Suites for IPsec. IETF. doi:10.17487/RFC4308. RFC 4308. {{citation}}: Unknown parameter |month= ignored (help)
  7. ^ a b Kent, S.; Atkinson, R. (1998). IP Authentication Header. IETF. doi:10.17487/RFC2402. RFC 2402. {{citation}}: Unknown parameter |month= ignored (help)
  8. ^ a b c d e Kent, S. (2005). IP Authentication Header. IETF. doi:10.17487/RFC4302. RFC 4302. {{citation}}: Unknown parameter |month= ignored (help)
  9. ^ The Internet Key Exchange (IKE), RFC 2409, §1 Abstract
  10. ^ Harkins, D.; Carrel, D. (1998). The Internet Key Exchange (IKE). IETF. doi:10.17487/RFC2409. RFC 2409. {{citation}}: Unknown parameter |month= ignored (help)
  11. ^ Kaufman, C. (ed.). IKE Version 2. IETF. doi:10.17487/RFC4306. RFC 4306.
  12. ^ Sakane, S.; Kamada, K.; Thomas, M.; Vilhuber, J. (1998). Kerberized Internet Negotiation of Keys (KINK). IETF. doi:10.17487/RFC4430. RFC 4430. {{citation}}: Unknown parameter |month= ignored (help)
  13. ^ a b Richardson, M. (2005). A Method for Storing IPsec Keying Material in DNS. IETF. doi:10.17487/RFC4025. RFC 4025. {{citation}}: Unknown parameter |month= ignored (help)
  14. ^ a b "Protocol Numbers". IANA. IANA. 2010-05-27. Archived from the original on 2010-07-27.
  15. ^ Bellovin, Steven M. (1996). "Problem Areas for the IP Security Protocols" (PostScript). Proceedings of the Sixth Usenix Unix Security Symposium. San Jose, CA. pp. 1–16. Retrieved 2007-07-09. {{cite conference}}: Unknown parameter |booktitle= ignored (|book-title= suggested) (help)
  16. ^ Paterson, Kenneth G.; Yau, Arnold K.L. (2006-04-24). "Cryptography in theory and practice: The case of encryption in IPsec" (PDF). Eurocrypt 2006, Lecture Notes in Computer Science Vol. 4004. Berlin. pp. 12–29. Retrieved 2007-08-13. {{cite conference}}: Unknown parameter |booktitle= ignored (|book-title= suggested) (help)
  17. ^ Degabriele, Jean Paul; Paterson, Kenneth G. (2007-08-09). "Attacking the IPsec Standards in Encryption-only Configurations" (PDF). IEEE Symposium on Security and Privacy, IEEE Computer Society. Oakland, CA. pp. 335–349. Retrieved 2007-08-13. {{cite conference}}: Unknown parameter |booktitle= ignored (|book-title= suggested) (help)
  18. ^ Kent, S. (2005). IP Encapsulating Security Payload (ESP). IETF. doi:10.17487/RFC4303. RFC 4303. {{citation}}: Unknown parameter |month= ignored (help)
  19. ^ RFC 2406, §1, page 2
  20. ^ RFC 3129
  21. ^ RFC 2367, PF_KEYv2 Key Management API, Dan McDonald, Bao Phan, & Craig Metz (July 1998)
  22. ^ RFC 6434, "IPv6 Node Requirements", E. Jankiewicz, J. Loughney, T. Narten (December 2011)
  23. ^ ipsecme charter
  24. ^ ipsecme status
  25. ^ "Secret Documents Reveal N.S.A. Campaign Against Encryption". New York Times.
  26. ^ Theo de Raadt. "Allegations regarding OpenBSD IPSEC".
  27. ^ John Gilmore. "Re: [Cryptography] Opening Discussion: Speculation on "BULLRUN"".

Standards Track RFCs

  • 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 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 4835: Cryptographic Algorithm Implementation Requirements for Encapsulating Security Payload (ESP) and Authentication Header (AH)
  • RFC 4945: The Internet IP Security PKI Profile of IKEv1/ISAKMP, IKEv2, and PKIX
  • RFC 5996: Internet Key Exchange Protocol Version 2 (IKEv2)

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 6071: IPsec and IKE Document Roadmap

Obsolete RFCs

  • RFC 2401: Security Architecture for the Internet Protocol (IPsec overview) Obsolete by RFC 4301
  • RFC 2409: The Internet Key Exchange
  • RFC 4306: Internet Key Exchange (IKEv2) Protocol (obsoleted by RFC 5996)
  • RFC 4718: IKEv2 Clarifications and Implementation Guidelines (obsoleted by RFC 5996)