Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
IPsec
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Security architecture== The initial [[IPv4]] suite was developed with few security provisions. As a part of the IPv4 enhancement, IPsec is a [[layer 3]] [[OSI model]] or [[internet layer]] end-to-end security scheme. In contrast, while some other Internet security systems in widespread use operate above the [[network layer]], such as [[Transport Layer Security]] (TLS) that operates above the [[transport layer]] and [[Secure Shell]] (SSH) that operates at the [[application layer]], IPsec can automatically secure applications at the [[internet layer]]. IPsec is an [[open standard]] as a part of the IPv4 suite and uses the following [[Protocol (computing)|protocol]]s to perform various functions:{{Ref RFC|6071}}{{Ref RFC|4308}} * [[#Authentication Header|Authentication Header (AH)]] provides connectionless [[data integrity]] and [[data origin authentication]] for IP [[datagrams]] and provides protection against IP header modification attacks and [[replay attack]]s.{{Ref RFC|4302}} * [[#Encapsulating Security Payload|Encapsulating Security Payload (ESP)]] provides [[confidentiality]], connectionless data integrity, data origin [[authentication]], an anti-replay service (a form of partial sequence integrity), and limited traffic-flow confidentiality.{{Ref RFC|2406}} * [[Internet Security Association and Key Management Protocol]] (ISAKMP) provides a framework for authentication and key exchange,<ref name="rfc2409_sec1">The [[Internet Key Exchange]] (IKE), RFC 2409, ยง1 Abstract</ref> with actual authenticated keying material provided either by manual configuration with [[pre-shared key]]s, [[Internet Key Exchange]] (IKE and IKEv2), [[Kerberized Internet Negotiation of Keys]] (KINK), or IPSECKEY [[list of DNS record types|DNS records]].{{Ref RFC|2409}}{{Ref RFC|4306}}{{Ref RFC|4430}}{{Ref RFC|4025}} The purpose is to generate the [[#Security association|security associations (SA)]] with the bundle of algorithms and parameters necessary for AH and/or ESP operations. ===Authentication Header=== [[File:Ipsec-ah.svg|thumb|Usage of IPsec Authentication Header format in Tunnel and Transport modes]] The Security Authentication Header (AH) was developed at the [[US Naval Research Laboratory]] in the early 1990s and is derived in part from previous IETF standards' work for authentication of the [[Simple Network Management Protocol]] (SNMP) version 2. Authentication Header (AH) is a member of the IPsec protocol suite. AH ensures connectionless [[Data integrity|integrity]] by using a [[hash function]] and a secret shared key in the AH algorithm. AH also guarantees the data origin by [[authenticating]] IP [[Packet (information technology)|packet]]s. Optionally a sequence number can protect the IPsec packet's contents against [[replay attack]]s,<ref>{{Cite book|title= Carrier-Scale IP Networks: Designing and Operating Internet Networks|author =Peter Willis |publisher= IET|year=2001 |isbn= 9780852969823|page=270}}</ref>{{Ref RFC|4949}} using the [[sliding window]] technique and discarding old packets. * In [[IPv4]], AH prevents option-insertion attacks. In [[IPv6]], AH protects both against header insertion attacks and option insertion attacks. * 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.{{Ref RFC|1108}} Mutable (and therefore unauthenticated) IPv4 header fields are [[Differentiated services code point|DSCP]]/[[Type of service|ToS]], [[Explicit Congestion Notification|ECN]], Flags, [[IP fragmentation|Fragment]] [[Offset (computer science)|Offset]], [[Time to live|TTL]] and [[IPv4 header checksum|Header Checksum]].{{Ref RFC|4302}} * 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: [[Differentiated services code point|DSCP]], [[Explicit Congestion Notification|ECN]], Flow Label, and Hop Limit.{{Ref RFC|4302}} AH operates directly on top of IP, using [[List of IP protocol numbers|IP protocol number {{Mono|51}}]].<ref name="iana">{{cite web|url=https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml |title=Protocol Numbers |date=2010-05-27 |archive-url=https://web.archive.org/web/20100529122930/https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml |archive-date=2010-05-29 |work=IANA |url-status=dead }}</ref> The following AH packet diagram shows how an AH packet is constructed and interpreted:{{Ref RFC|4302}} {{APHD|start|title=Authentication Header format}} {{APHD|0|bits1=8|field1=Next Header|bits2=8|field2=Payload Len|bits3=16|field3=Reserved}} {{APHD|4|bits1=32|field1=Security Parameters Index}} {{APHD|8|bits1=32|field1=Sequence Number}} {{APHD|999|hoctets=12|hbits=96|bits1=64|field1=Integrity Check Value}} {{APHD|end}} ;{{APHD|def|name=Next Header|length=8 bits|text=Type of the next header, indicating what upper-layer protocol was protected. The value is taken from the [[list of IP protocol numbers]].}} ;{{APHD|def|name=Payload Len|length=8 bits|text=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.}} ;{{APHD|def|name=Reserved|length=16 bits|text=Reserved for future use (all zeroes until then).}} ;{{APHD|def|name=Security Parameters Index|length=32 bits|text=Arbitrary value which is used (together with the destination IP address) to identify the [[security association]] of the receiving party.}} ;{{APHD|def|name=<span id="sequence number">Sequence Number</span>|length=32 bits|text=A [[monotonic]] strictly increasing sequence number (incremented by 1 for every packet sent) to prevent [[replay attack]]s. 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.{{Ref RFC|4302}}}} ;{{APHD|def|name=Integrity Check Value|length=multiple of 32 bits|text=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=== [[File:Ipsec-esp-tunnel-and-transport.svg|thumb|Usage of IPsec Encapsulating Security Payload (ESP) in Tunnel and Transport modes]] The IP Encapsulating Security Payload (ESP)<ref>{{cite web | url = http://www.toad.com/gnu/draft-ietf-sip-esp-00.txt | title = SIPP Encapsulating Security Payload | publisher = IETF SIPP Working Group | year = 1993 | access-date = 2013-08-07 | archive-url = https://web.archive.org/web/20160909031941/http://www.toad.com/gnu/draft-ietf-sip-esp-00.txt | archive-date = 2016-09-09 | url-status = dead }}</ref> was developed at the [[Naval Research Laboratory]] starting in 1992 as part of a [[DARPA]]-sponsored research project, and was openly published by [[IETF]] SIPP<ref>{{cite web | url = http://tools.ietf.org/html/draft-ietf-sipp-spec-00 | title = Draft SIPP Specification | publisher = IETF | year = 1993 | page = 21| last1 = Deering | first1 = Steve E. }}</ref> Working Group drafted in December 1993 as a security extension for SIPP. This [[#Encapsulating Security Payload|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]] in the late 1980s, but designed by the Secure Data Network System project of the [[US Department of Defense]]. Encapsulating Security Payload (ESP) is a member of the IPsec protocol suite. It provides origin [[Information security#Authenticity|authenticity]] through source [[authentication]], [[data integrity]] through hash functions and [[confidentiality]] through [[encryption]] protection for IP [[Packet (information technology)|packet]]s. ESP also supports [[encryption]]-only and [[authentication]]-only configurations, but using encryption without authentication is strongly discouraged because it is insecure.<ref>{{cite conference | title=Problem Areas for the IP Security Protocols | book-title=Proceedings of the Sixth Usenix Unix Security Symposium | first=Steven M. | last=Bellovin | year=1996 | pages=1โ16 | place=San Jose, CA | url=https://www.cs.columbia.edu/~smb/papers/badesp.ps | access-date=2007-07-09|author-link=Steven M. Bellovin|format=[[PostScript]]}}</ref><ref>{{cite conference | title=Cryptography in theory and practice: The case of encryption in IPsec | book-title=Eurocrypt 2006, Lecture Notes in Computer Science Vol. 4004 | last1=Paterson|first1=Kenneth G.|last2=Yau|first2=Arnold K.L.|date=2006-04-24|pages=12โ29 | location=Berlin | url=http://eprint.iacr.org/2005/416 | access-date=2007-08-13|format=PDF}}</ref><ref>{{cite conference | title=Attacking the IPsec Standards in Encryption-only Configurations | book-title=IEEE Symposium on Security and Privacy, IEEE Computer Society |last1=Degabriele|first1=Jean Paul|last2=Paterson|first2=Kenneth G.|date=2007-08-09|format=PDF | pages=335โ349 | location=Oakland, CA | url=http://eprint.iacr.org/2007/125 | access-date=2007-08-13 }}</ref> Unlike [[Authentication Header|Authentication Header (AH)]], ESP in transport mode does not provide integrity and authentication for the entire [[IP packet (disambiguation)|IP packet]].<!--intentional link to disambig--> However, in [[Tunneling protocol|tunnel mode]], where the entire original IP packet is [[Information hiding|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.<ref name="iana" /> The following ESP packet diagram shows how an ESP packet is constructed and interpreted:{{Ref RFC|4303}} {{APHD|start|title=Encapsulating Security Payload format}} {{APHD|0|bits1=32|field1=Security Parameters Index}} {{APHD|4|bits1=32|field1=Sequence Number}} {{APHD|999|hoctets=8|hbits=64|bits1=64|border1=bottom|background1=mistyrose|field1=Payload Data}} {{APHD|999|bits1=8|border1=top|background1=mistyrose|field1={{nbsp}}|bits2=24|background2=linen|border2=bottom|field2={{nbsp}}}} {{APHD|999|bits1=32|border1=top-bottom|background1=linen|field1=(Padding)}} {{APHD|999|bits1=16|border1=top|background1=linen|field1={{nbsp}}|bits2=8|field2=Pad Length|bits3=8|field3=Next Header}} {{APHD|999|bits1=64|field1=Integrity Check Value{{break}}โฎ}} {{APHD|end}} ;{{APHD|def|name=Security Parameters Index|short=SPI|length=32 bits|text=Arbitrary value used (together with the destination IP address) to identify the [[security association]] of the receiving party.}} ;{{APHD|def|name=Sequence Number|length=32 bits|text=A [[monotonic]]ally increasing sequence number (incremented by 1 for every packet sent) to protect against [[replay attack]]s. There is a separate counter kept for every security association.}} ;{{APHD|def|name=Payload Data|length=variable|text=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.}} ;{{APHD|def|name=Padding|length=0-255 octets|text=Optional. Padding for encryption, to extend the payload data to a size that fits the encryption's [[Block cipher|cipher]] [[Block size (cryptography)|block size]], and to align the next field.}} ;{{APHD|def|name=Pad Length|length=8 bits|text=Size of the padding (in octets).}} ;{{APHD|def|name=Next Header|length=8 bits|text=Indicates the [[list of IP protocol numbers|protocol type]] of the ''Payload Data'',{{Ref RFC|4303|rsection=2.6}} like the value {{Mono|6}} for [[Transmission Control Protocol|TCP]]. As ESP is an encapsulation protocol, a value of {{Mono|4}} is also possible, indicating [[IP in IP]]. A value of {{Mono|41}} indicates [[IPv6]] encapsulated in [[IPv4]], e.g. [[6to4]]. The value {{Mono|59}} (meaning: ''No Next Header'') is used for dummy packets, which may be inserted in the stream, and which contents should be discarded.}} ;{{APHD|def|name=Integrity Check Value|short=ICV|length=variable|text=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=== {{main|Security association}} The IPsec protocols use a [[security association]], where the communicating parties establish shared security attributes such as [[algorithms]] and keys. As such, IPsec provides a range of options once it has been determined whether AH or ESP is used. Before exchanging data, the two hosts agree on which [[Symmetric-key algorithm|symmetric encryption algorithm]] is used to encrypt the IP packet, for example [[Advanced Encryption Standard|AES]] or [[ChaCha20]], and which hash function is used to ensure the integrity of the data, such as [[BLAKE2]] or [[SHA-2|SHA256]]. These parameters are agreed for the particular session, for which a lifetime must be agreed and a [[session key]].<ref>{{Cite book|title= Carrier-Scale IP Networks: Designing and Operating Internet Networks|author =Peter Willis |publisher= IET|year=2001 |isbn= 9780852969823|page=271}}</ref> The algorithm for authentication is also agreed before the data transfer takes place and IPsec supports a range of methods. Authentication is possible through [[pre-shared key]], where a [[symmetric key]] is already in the possession of both hosts, and the hosts send each other hashes of the shared key to prove that they are in possession of the same key. IPsec also supports [[public key encryption]], where each host has a public and a private key, they exchange their public keys and each host sends the other a [[Cryptographic nonce|nonce]] encrypted with the other host's public key. Alternatively if both hosts hold a [[public key certificate]] from a [[certificate authority]], this can be used for IPsec authentication.<ref>{{Cite book|title= Carrier-Scale IP Networks: Designing and Operating Internet Networks|author =Peter Willis |publisher= IET|year=2001 |isbn= 9780852969823|pages=272โ3}}</ref> The security associations of IPsec 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 [[list of DNS record types|DNS records]].{{Ref RFC|4025}}{{Ref RFC|2406|rsection=1}}{{Ref RFC|3129}} RFC 5386 defines Better-Than-Nothing Security (BTNS) as an unauthenticated mode of IPsec using an extended IKE protocol. C. Meadows, C. Cremers, and others have used [[Formal Methods|formal methods]] to identify various anomalies which exist in IKEv1 and also in IKEv2.<ref>{{cite book|author=C. Cremers|title=Key Exchange in IPsec Revisited: Formal Analysis of IKEv1 and IKEv2, ESORICS 2011|chapter=Key Exchange in IPsec Revisited: Formal Analysis of IKEv1 and IKEv2 |series=Lecture Notes in Computer Science|year=2011|volume=6879 |pages=315โ334|publisher=Springer|doi=10.1007/978-3-642-23822-2_18|hdl=20.500.11850/69608|isbn=9783642238222|s2cid=18222662 |chapter-url=https://link.springer.com/chapter/10.1007/978-3-642-23822-2_18}}</ref> 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 identifies 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 [[IP 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)