RFC 5406
Guidelines for Specifying the Use of IPsec Version 2
RFC 5406: Guidelines for Specifying the Use of IPsec Version 2 ๐
Okay bestie, this one is BCP 146, a Best Current Practice from February 2009. It came from S. Bellovin at Columbia University and the Network Working Group. Best Current Practice means it's the community's official advice on how to do things, not a brand-new protocol. ๐ Let's get into it!
Status of This Memo โจ
This document is an Internet Best Current Practice for the Internet Community, and it's asking for discussion and suggestions for improvements. Distribution of this memo is unlimited. ๐ธ
Copyright Notice ๐ฆ
Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please read these carefully, because they describe your rights and restrictions for this document. ๐ง
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of that material outside the IETF Standards Process. So without a proper license from whoever controls the copyright in those materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process. The exceptions are formatting it for publication as an RFC or translating it into languages other than English. ๐
Abstract ๐
Security Considerations sections in lots of Internet Drafts basically say "just use IPsec." ngl that's sometimes correct, but a lot of the time it leaves users without real, interoperable security mechanisms. ๐ญ This memo gives some guidance on when IPsec Version 2 should and should not be specified.
1. Introduction โจ
Okay so, like, the Security Considerations sections of a bunch of Internet Drafts say "just use IPsec" ๐. Sometimes IPsec really is the right security answer, but you need more info to build interoperable security solutions. In some cases IPsec isn't available on the likely endpoints. If IPsec is unavailable to (and so unusable by) most of the users in a protocol environment, then specifying IPsec is basically saying "turn off security" for that whole community. ๐ Also, even when IPsec is available, the implementation might not give the right granularity of protection. And finally, if IPsec is available and appropriate, the document that requires it needs to spell out exactly how it's used. ๐
The goal here is to help protocol designers specify IPsec when it's the right security mechanism. The protocol spec is supposed to give realistic, interoperable security, so guidance on configuring the various IPsec databases, like the Security Policy Database (SPD), is often needed. ๐ฅ
This document covers how to specify the use of IPsec Version 2 [RFC2401], including ESPv2 (Encapsulating Security Payload version 2) [RFC2406], AHv2 (Authentication Header version 2) [RFC2402], and IKEv1 (Internet Key Exchange version 1) [RFC2409]. A separate document will cover the IPsec Version 3 suite [RFC4301] [RFC4302] [RFC4303] [RFC4306]. ๐ง
For more on security considerations (including IPsec), check out [RFC3552]. ๐
NOTE: A lot of the arguments below are about what current IPsec implementations can do. That stuff may change over time, so this advice is based on what the IETF knew when this was published. โฐ
2. WARNING โ ๏ธ
Designing security protocols is a subtle and difficult art, bestie. ๐ซถ The cautions here about specifying the use of IPsec should NOT be taken to mean that you should invent your own new security protocol for every new application. If IPsec is a bad choice, using another standardized, well-understood security protocol will almost always give the best results for both implementation and deployment. Security protocols are really hard to design. Rolling out a new one takes a ton of theoretical and practical work to confirm its security properties, and it'll cost both time and uncertainty. ๐ค
3. The Pieces of IPsec ๐งฉ
IPsec is made of a bunch of different pieces, and they can be used to provide confidentiality, integrity, and replay protection. Some of these can be configured manually, but generally a key management component is used. On top of that, the decision about whether and how to use IPsec is controlled by some kind of policy database. ๐
3.1. AH and ESP ๐ฆ
The Authentication Header (AH) [RFC2402] and the Encapsulating Security Payload (ESP) [RFC2406] are the over-the-wire security protocols. Both provide (optional) replay protection. ESP is typically used to provide confidentiality (encryption), integrity, and authentication for traffic. ESP can also provide integrity and authentication without confidentiality, which makes it a good alternative to AH in most cases where confidentiality isn't a required or desired service. And finally, ESP can be used for confidentiality alone, although this is not recommended [Bell96]. ๐
AH protects part of the preceding IP header, including the source and destination address. That's the difference in integrity protection between AH and ESP. However, if ESP is used in tunnel mode (see Section 3.2) and integrity/authentication is enabled, the IP header as seen by the source and destination hosts is completely protected anyway. ๐
AH can also protect IP options that need to be seen by intermediate routers but must be intact and authentic when they're delivered to the receiving system. Right now, using (and even existing) IP options like that is extremely rare. ๐ธ
If an application requires that kind of protection, and the information to be protected can't be inferred from the key management process, then AH must be used. (ESP is generally considered easier to implement, but basically all IPsec packages support both.) If confidentiality is required, ESP must be used. It's possible to use AH together with ESP, but that combo is rarely required. ๐
All variants of IPsec have problems with NAT boxes (see [RFC3715] for details), but AH is way more troublesome. ๐ In environments where the two endpoints are fairly likely to be separated by a NAT box, NAT traversal [RFC3948] should be mandated and AH should be avoided. This includes almost all services involving user-to-server traffic, as opposed to server-to-server traffic. (Note that [RFC3948] is for ESP only, and it can't be used for AH.) ๐ซ
3.2. Transport and Tunnel Mode ๐
AH and ESP can both be used in either transport mode or tunnel mode. In tunnel mode, the IPsec header is followed by an inner IP header. This is the normal setup for Virtual Private Networks (VPNs), and it's generally required whenever either end of the IPsec-protected path isn't the ultimate IP destination. For example, that happens when IPsec is implemented in a firewall, a router, etc. ๐
Transport mode is preferred for point-to-point communication, though tunnel mode can also be used for that purpose. โจ
3.3. Key Management ๐
Any cryptographic system needs key management, periodt. ๐ IPsec supports both manual and automatic key management schemes. Manual key management is easy, but it doesn't scale very well. Also, IPsec's replay protection mechanisms aren't available if manual key management is used. The need for automatic key exchange is discussed in more detail in [RFC4107]. ๐
The main automated key exchange mechanism for IPsec is the Internet Key Exchange (IKE) [RFC2409]. A newer, simpler version of IKE has been approved [RFC4306], but lots of existing systems still use IKEv1. This document doesn't discuss IKEv2 or IPsecv3. There's also a second mechanism, Kerberized Internet Negotiation of Keys (KINK) [RFC4430]. It uses Kerberos, of course, so it's only suitable if a Kerberos infrastructure is available, and that's the only condition under which it's suitable. ๐
If you decide to use IKE, you also have to specify the precise mode of operation. IKE can run in main mode or aggressive mode, and both support digital signatures, two different ways of using public key encryption, and shared secrets for authentication. ๐ง
Shared secret authentication is simpler, but it doesn't scale as well in many-to-many scenarios, since each endpoint has to share a unique secret with every peer it can communicate with. Still, using shared secrets in IKE is way better than manual keying. ๐ฅฐ
In most real-world situations where IKE's public key modes are used, locally issued certificates get used. The admin of the system or network issues certificates to all authorized users, and these certificates are only useful for IPsec. ๐
It's sometimes possible to use certificates [RFC5280] from an existing Public Key Infrastructure (PKI) with IKE, but in practice that's rare. Also, there isn't a global PKI covering most Internet endpoints, and there probably never will be. So designing a structure that assumes one is a mistake. Specifically, assuming an arbitrary node will have an "authentic" certificate, issued by a mutually trusted third party and vouching for that node's identity, is wrong. Again, that kind of PKI doesn't exist and probably won't. ๐ โโ๏ธ Public key IKE is generally a good idea, but it should almost always be used with locally issued certificates instead of certificates from an existing PKI. ๐
Keep in mind that public key schemes need a lot of computation. Protocol designers should think about whether those computations are feasible on the devices their clientele actually uses. Using certificates roughly doubles the number of large exponentiations that have to be performed, compared with the shared secret versions of IKE. ๐งฎ
Today, even low-powered devices can usually do enough computation to set up a limited number of security associations. Concentration points, like firewalls or VoIP servers, may need hardware assists, especially if lots of peers are expected to create security associations at about the same time. ๐
Using any automated key management mechanism can be tricky when you're trying to protect low-level protocols. For example, even though [RFC2461] specified using IPsec to protect IPv6 Neighbor Discovery, key management wasn't possible. Nodes couldn't use IKE because it required IP-level communication, and that isn't possible before Neighbor Discovery associations are set up. Major "chicken and egg" energy ๐๐ฅ ๐ญ
To be continued in part 2 of 3... don't go anywhere, bestie! ๐งโจ
3.4. Application Programming Interface (API) ๐
Okay so it's kinda a misnomer to call the API part of IPsec, bestie, because this piece is missing on loads of systems ๐ญ. Wherever APIs do exist, they aren't standardized. The problem is simple: there's no portable way (and often no way at all) for an app to request IPsec protection, or to tell if it was used for given inbound packets or connections. Rude ๐
There are additional problems, and they're giving a lot:
- Applications rarely have access to these APIs. Instead, IPsec is usually configured by a system or network administrator ๐
- Applications can't verify that IPsec services are being used underneath ๐
- Applications don't know the specific identities and properties of the protected channel that IPsec provides. Like, the IPsec key management mechanisms might know the identity and authorization of the peer, but the app can't use that info or link it to its own decisions, such as access to resources reserved for the entity with that identity. Main character problem ๐ค
Router- or firewall-based IPsec implementations are an even bigger mess ๐ซ since there's no standardized over-the-wire protocol for sending this info from outboard encryptors to hosts.
By contrast, higher-layer security services, like TLS, are able to provide the necessary control and assurance โจ๐
4. Availability of IPsec in Target Devices ๐
Okay, so IPsec is now widely implemented and available for current releases of most host operating systems ๐ฅณ, but it's way less available for embedded systems ๐ฅฒ. Few hubs, network address translators, etc., implement it, especially at the low end. It is generally inappropriate to rely on IPsec when many of the endpoints are in this category ๐ โโ๏ธ.
Even for host-to-host use, IPsec availability (and experience and ease of use) has generally been for VPNs ๐ฆ. Hosts that support IPsec for VPN use frequently don't support it on a point-to-point basis, especially via a stable, well-defined API or user interface.
Finally, few implementations support multiple layers of IPsec ๐ฉ. If a telecommuter is using IPsec in VPN mode to access an organizational network, he or she may not be able to employ a second level of IPsec to protect an application connection to a host within the organization. (We note that such support is, in fact, mandated by Case 4 of Section 4.5 of [RFC2401]. Nevertheless, it is not widely available.) The likelihood of such deployment scenarios should be taken into account when deciding whether or not to mandate IPsec ๐ง.
5. Endpoints ๐ง
[RFC2401] describes many different forms of endpoint identifier ๐๏ธ. These include source addresses (both IPv4 and IPv6), host names (possibly as embedded in X.500 certificates), and user IDs (again, possibly as embedded in a certificate). Not all forms of identifier are available on all implementations. In particular, user-granularity identification is not common, and this is especially a concern for multi-user systems, where it may not be possible to use different certificates to distinguish between traffic from two different users ๐ฌ.
Again, we note that the ability to provide fine-grained protection, such as keying each connection separately and with per-user credentials, was one of the original design goals of IPsec ๐. Nevertheless, only a few platforms support it. Indeed, some implementations don't even support using port numbers when deciding whether or not to apply IPsec protection ๐.
6. Selectors and the SPD ๐
Section 4.4 of [RFC2401] describes the Security Policy Database (SPD) and "selectors" used to decide what traffic should be protected by IPsec ๐. Choices include source and destination addresses (or address ranges), protocol numbers (i.e., 6 for TCP and 17 for UDP), and port numbers for TCP and UDP. Protocols whose protection requirements cannot be described in such terms are poorer candidates for IPsec. In particular, it becomes impossible to apply protection at any finer grain than "destination host" ๐.
Thus, traffic embedded in a Layer 2 Tunneling Protocol (L2TP) [RFC2661] session cannot be protected selectively by IPsec above the L2TP layer, because IPsec has no selectors defined that let it peer into the L2TP packet to find the TCP port numbers ๐ซ. Similarly, the Stream Control Transmission Protocol (SCTP) [RFC4960] did not exist when [RFC2401] was written. Thus, protecting individual SCTP applications on the basis of port number could not be done until a new document was written [RFC3554] that defined new selectors for IPsec, and implementations appeared ๐ธ.
Furthermore, in a world that runs to a large extent on dynamically assigned addresses, and often uses dynamically assigned port numbers as well, an all-or-nothing policy for VPNs can work well. Other policies, however, can be difficult to create in any usable form ๐ซถ.
The granularity of protection available may have side effects ๐. If certain traffic between a pair of machines is protected by IPsec, does the implementation permit other traffic to be unprotected or protected by different policies? Alternatively, if the implementation is only capable of protecting all traffic or none, does the device have sufficient CPU capacity to encrypt everything? Note that some low-end devices may have limited secure storage capacity for keys, etc. ๐
Implementation issues are also a concern here. As before, too many vendors have not implemented the full specification, and too many IPsec implementations are not capable of using port numbers in their selectors ๐ค. Protection of traffic between two hosts is thus on an all-or-nothing basis when these non-compliant implementations are employed.
7. Broadcast and Multicast ๐ฃ
Although the designers of IPsec tried to leave room for protection of multicast traffic, a complete design wasn't finished until much later ๐ฐ๏ธ. As such, many IPsec implementations don't support multicast. [RFC5374] describes extensions to IPsec to support it. Other relevant documents include [RFC3830], [RFC3547], and [RFC4535] ๐.
Because of the delay, protocol designers who use multicast should consider the availability of these extensions in target platforms of interest ๐ฏ.
8. Specifying IPsec ๐
Despite all of the caveats given above, it may still be appropriate to use IPsec in particular situations ๐คทโโ๏ธ. The range of choices means it's a must to define precisely how IPsec is to be used. Authors of standards documents that rely on IPsec must specify the following:
- a. What selectors should the initiator of the conversation (the client, in client-server architectures) use? What addresses, port numbers, etc., are to be used?
- b. What IPsec protocol is to be used: AH or ESP? What mode is to be employed: transport mode or tunnel mode?
- c. What form of key management is appropriate?
- d. What form of identification should be used? Choices include IP address, DNS name with or without a user name, and X.500 distinguished name.
- e. If the application server will switch user IDs (i.e., it is a login service of some sort) and user name identification is used, is a new security association negotiated that utilizes a user-granularity certificate? If so, when?
- f. What form of authentication should be used? Choices include pre-shared secrets and certificates.
- g. How are the participants authorized to perform the operations that they request? For instance, are all devices with a certificate from a particular source allowed to use any application with IPsec or access any resource? (This problem can appear with any security service, of course.)
- h. Which of the many variants of IKE must be supported? Main mode? Aggressive mode?
Note that there are two different versions of IKE: IKE and IKEv2. IKEv2 is simpler and cleaner, but is not yet widely available. You must specify which version of IKE you require.
- i. Is suitable IPsec support available in likely configurations of the products that would have to employ IPsec? ๐ฅบ
9. Example ๐
Let us now work through an example based on these guidelines ๐. We will use the Border Gateway Protocol (BGP) [RFC4271] to show how to evaluate and specify the use of IPsec for transmission security, rather than the mechanism described in [RFC2385]. Note carefully that we are not saying that IPsec is an appropriate choice here. Rather, we are demonstrating the necessary examination and specification process. Also note that the deeper security issues raised by BGP are not addressed by IPsec or any other transmission security mechanism; see [Kent00a] and [Kent00b] for more details.
Selectors BGP runs between manually configured pairs of hosts
on TCP port 179. The appropriate selector would be
the pair of BGP speakers, for that port only. Note
that the router's "loopback address" is almost
certainly the address to use.
Mode Transport mode would be the proper choice if IPsec
were used. The information being communicated is
generally not confidential, so encryption need not
be used. Either AH or ESP can be used; if ESP is
used, the sender's IP address would need to be
checked against the IP address asserted in the key
management exchange. (This check is mandated by
[RFC2401].) For the sake of interoperability,
either AH or ESP would need to be specified as
mandatory to implement.
Key Management To permit replay detection, an automated key
management system should be used, most likely IKE.
Again, the RFC author should pick one.
Security Policy Connections should be accepted only from the
designated peer. (Note that this restriction
applies only to BGP. If the router -- or any IPsec
host -- runs multiple services with different
security needs, each such service requires its own
security policy.)
Authentication Given the number of BGP-speaking routers used
internally by large ISPs, it is likely that shared
key mechanisms are inadequate. Consequently,
certificate-based IKE must be supported. However,
shared secret mode is reasonable on peering links or
(perhaps) on links between ISPs and customers.
Whatever scheme is used, it must tie back to a
source IP address or Autonomous System (AS) number
in some fashion, since other BGP policies are
expressed in these terms. If certificates are used,
would they use IP addresses or AS numbers? Which?
Availability For this scenario, availability is the crucial
question. Do likely BGP speakers -- both backbone
routers and access routers -- support the profile of
IPsec described above? Will use of IPsec, with its
attendant expensive cryptographic operations, raise
the issue of new denial-of-service attacks? The
working group and the IESG must make these
determinations before deciding to use IPsec to
protect BGP.
10. Security Considerations ๐
Okay bestie, this is the serious part, so listen up ๐ . IPsec gives you transmission security and simple access control, and that's it. ngl, that's the whole deal. There are a bunch of other dimensions to protocol security that this memo doesn't cover, and the big one is availability ๐. Using IPsec doesn't really protect you from denial-of-service attacks. In some situations, i.e., on CPU-limited systems, it may actually contribute to those attacks ๐. And overall, how secure your protocol ends up being depends heavily on how accurate the analysis was that led you to pick IPsec in the first place. So do your homework, periodt ๐โจ.
11. Acknowledgments ๐ซถ
Huge thanks to Ran Atkinson, Lakshminath Dondeti, Barbara Fraser, Paul Hoffman, Russ Housley, Stephen Kent, Eric Fleischman, assorted members of the IESG, and a plethora of others ๐. They all made a bunch of really useful suggestions, and the doc is better because of them ๐ธ.
12. References ๐
12.1. Normative References ๐
[RFC2401] Kent, S. and R. Atkinson, "Security Architecture for the
Internet Protocol", RFC 2401, November 1998.
[RFC2402] Kent, S. and R. Atkinson, "IP Authentication Header",
RFC 2402, November 1998.
[RFC2406] Kent, S. and R. Atkinson, "IP Encapsulating Security
Payload (ESP)", RFC 2406, November 1998.
[RFC2409] Harkins, D. and D. Carrel, "The Internet Key Exchange
(IKE)", RFC 2409, November 1998.
[RFC3554] Bellovin, S., Ioannidis, J., Keromytis, A., and R.
Stewart, "On the Use of Stream Control Transmission
Protocol (SCTP) with IPsec", RFC 3554, July 2003.
[RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M.
Stenberg, "UDP Encapsulation of IPsec ESP Packets",
RFC 3948, January 2005.
[RFC4107] Bellovin, S. and R. Housley, "Guidelines for Cryptographic
Key Management", BCP 107, RFC 4107, June 2005.
[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
Housley, R., and W. Polk, "Internet X.509 Public Key
Infrastructure Certificate and Certificate Revocation List
(CRL) Profile", RFC 5280, May 2008.
[RFC5374] Weis, B., Gross, G., and D. Ignjatic, "Multicast
Extensions to the Security Architecture for the Internet
Protocol", RFC 5374, November 2008.
12.2. Informative References ๐
[Bell96] Bellovin, S., "Problem Areas for the IP Security
Protocols", Proc. Sixth Usenix Security Symposium, pp.
205-214, 1996.
[Kent00a] Kent, S., Lynn, C., and K. Seo, "Secure Border Gateway
Protocol (Secure-BGP)", IEEE Journal on Selected Areas in
Communications, 18:4, pp. 582-592, 2000.
[Kent00b] Kent, S., Lynn, C., Mikkelson, J., and K. Seo, "Secure
Border Gateway Protocol (Secure-BGP) -- Real World
Performance and Deployment Issues", Proc. Network and
Distributed System Security Symposium (NDSS), 2000.
[RFC2385] Heffernan, A., "Protection of BGP Sessions via the TCP MD5
Signature Option", RFC 2385, August 1998.
[RFC2461] Narten, T., Nordmark, E., and W. Simpson, "Neighbor
Discovery for IP Version 6 (IPv6)", RFC 2461,
December 1998.
[RFC2661] Townsley, W., Valencia, A., Rubens, A., Pall, G., Zorn,
G., and B. Palter, "Layer Two Tunneling Protocol "L2TP"",
RFC 2661, August 1999.
[RFC3547] Baugher, M., Weis, B., Hardjono, T., and H. Harney, "The
Group Domain of Interpretation", RFC 3547, July 2003.
[RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC
Text on Security Considerations", BCP 72, RFC 3552,
July 2003.
[RFC3715] Aboba, B. and W. Dixon, "IPsec-Network Address Translation
(NAT) Compatibility Requirements", RFC 3715, March 2004.
[RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K.
Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830,
August 2004.
[RFC4271] Rekhter, Y., Li, T., and S. Hares, "A Border Gateway
Protocol 4 (BGP-4)", RFC 4271, January 2006.
[RFC4301] Kent, S. and K. Seo, "Security Architecture for the
Internet Protocol", RFC 4301, December 2005.
[RFC4302] Kent, S., "IP Authentication Header", RFC 4302,
December 2005.
[RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)",
RFC 4303, December 2005.
[RFC4306] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol",
RFC 4306, December 2005.
[RFC4430] Sakane, S., Kamada, K., Thomas, M., and J. Vilhuber,
"Kerberized Internet Negotiation of Keys (KINK)",
RFC 4430, March 2006.
[RFC4535] Harney, H., Meth, U., Colegrove, A., and G. Gross,
"GSAKMP: Group Secure Association Key Management
Protocol", RFC 4535, June 2006.
[RFC4960] Stewart, R., "Stream Control Transmission Protocol",
RFC 4960, September 2007.
Author's Address ๐
Steven M. Bellovin
Columbia University
1214 Amsterdam Avenue
MC 0401
New York, NY 10027
US
Phone: +1 212 939 7149
EMail: bellovin@acm.org
๐ฆ where this page comes from
- ietf: rfc5406 2009-02
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms