Chapter 9 - IP Security
Class: CSCE-465-63860
IP Security Overview
- RFC 1636
- "Security in the Internet Architecture"
- Issued in 1994 by the Internet Architecture Board (IAB)
- Identifies key areas for security mechanisms
- Need to secure the network infrastructure from unauthorized monitoring and control of network traffic
- Need to secure end-user-to-end-user traffic using authentication and encryption mechanisms
- IAB included authentication and encryption as necessary security features in the next generation IP (IPv6)
- The IPsec specification now exists as a set of Internet standards
Applications of IPSec
- IPsec provides the capability to secure communications across a LAN, private and public WANs, and the Internet
Examples include:
-
Secure branch office connectivity over the Internet
-
Secure remote access over the Internet
-
Establishing extranet and intranet connectivity with partners
-
Enhancing electronic commerce security
-
Principal feature of IPsec is that it can encrypt and/or authenticate all traffic at the IP level
- Thus, all distributed applications (remote logon, client/server, e-mail, file transfer, Web access) can be secured
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image.png)
Benefits of IPSec
- Some of the benefits of IPsec:
- When IPsec is implemented in a firewall or router, it provides strong security that can be applied to all traffic crossing the perimeter
- Traffic within a company or workgroup does not incur the overhead of security-related processing
- IPsec in a firewall is resistant to bypass if all traffic from the outside must use IPsec and the firewall is the only means of entrance from the Internet into the organization
- IPsec is below the transport layer (TCP, UDP) and so is transparent to applications
- There is no need to change software on a user or server system when IPsec is implemented in the firewall or router
- IPsec can be transparent to end users
- There is no need to train users on security mechanisms,
- issue keying material on a per-user basis, or revoke keying material when users leave the organization
- IPsec can provide security for individual users if needed
- This is useful for offsite workers and for setting up a secure virtual subnetwork within an organization for sensitive applications
- When IPsec is implemented in a firewall or router, it provides strong security that can be applied to all traffic crossing the perimeter
IPsec Documents
- Architecture
- Covers the general concepts, security requirements, definitions, and mechanisms defining IPsec technology
- The current specification is RFC4301, Security Architecture for the Internet Protocol
- Authentication Header (AH)
- An extension header to provide message authentication
- The current specification is RFC 4302, IP Authentication Header
- Encapsulating Security Payload (ESP)
- Consists of an encapsulating header and trailer used to provide encryption or combined encryption/authentication
- The current specification is RFC 4303, IP Encapsulating Security Payload (ESP)
- Internet Key Exchange (IKE
- A collection of documents describing the key management schemes for use with IPsec
- The main specification is RFC 7296, Internet Key Exchange (IKEv2) Protocol, but there are a number of related RFC
- Cryptographic algorithms
- This category encompasses a large set of documents that define and describe cryptographic algorithms for encryption, message authentication, pseudorandom functions (PRFs), and cryptographic key exchange
- Other
- There are a variety of other IPsec-related RFCs, including those dealing with security policy and management information base (MIB) content
IPsec Services
- IPsec provides security services at the IP layer by enabling a system to:
- Select required security protocols
- Determine the algorithm(s) to use for the service(s)
- Put in place any cryptographic keys required to provide the requested services
- RFC 4301 lists the following services:
- Access control
- Connectionless integrity
- Data origin authentication
- Rejection of replayed packets (a form of partial sequence integrity)
- Confidentiality (encryption)
- Limited traffic flow confidentiality
Table 9.1 - Tunnel Mode and Transport Mode Functionality
| Transport Mode SA | Tunnel Mode SA | |
|---|---|---|
| AH | Authenticates IP payload and selected portions of IP header and IPv6 extension headers (Not recommended - deprecated). | Authenticates entire inner IP packet (inner header plus IP payload) plus selected portions of outer IP header and outer IPv6 extension headers. |
| ESP | Encrypts IP payload and any IPv6 extension headers following the ESP header. | Encrypts entire inner IP packet. |
| ESP with Authentication | Encrypts IP payload and any IPv6 extension headers following the ESP header. Authenticates IP payload but not IP header. | Encrypts enture inner IP packet. Authenticates inner IP packet. |
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-1.png)
Security Association (SA)
- A one-way logical connection between a sender and a receiver that affords security services to the traffic carried on it
- In any IP packet, the SA is uniquely identified by the Destination Address in the IPv4 or IPv6 header and the SPI in the enclosed extension header (AH or ESP)
- Uniquely identified by three parameters:
- Security protocol identifier
- Indicates whether the association is an AH or ESP security association
- IP Destination Address
- Address of the destination endpoint of the SA, which may be an end-user system or a network system such as a firewall or route
- Security Parameters Index (SPI)
- A 32-bit unsigned integer assigned to this SA and having local significance only
- Security protocol identifier
Security Association Database (SAD)
- Defines the parameters associated with each SA
- Security parameter index (SPI)
- Sequence number counter
- Sequence counter overflow
- Anti-replay window
- ESP (/AH) information
- Lifetime of this security association
- IPsec protocol mode (tunnel/transport)
- Path MTU
- IP destination address
Security Policy Database (SPD)
- The means by which IP traffic is related to specific SAs
- Contains entries, each of which defines a subset of IP traffic and points to an SA for that traffic
- In more complex environments, there may be multiple entries that potentially relate to a single SA or multiple SAs associated with a single SPD entry
- Each SPD entry is defined by a set of IP and upper-layer protocol field values called selectors
- These are used to filter outgoing traffic in order to map it into a particular SA
SPD Entries
- The following selectors determine an SPD entry:
- Remote IP address
- This may be a single IP address, an enumerated list or range of addresses, or a wildcard (mask) address
- The latter two are required to support more than one destination system sharing the same SA Local IP address
- Local IP address
- This may be a single IP address, an enumerated list or range of addresses, or a wildcard (mask) address
- The latter two are required to support more than one source system sharing the same SA
- Next layer protocol
- The IP protocol header includes a field that designates the protocol operating over IP (wildcard possible)
- Name
- A user identifier from the operating system
- Not a field in the IP or upper-layer headers but is available if IPsec is running on the same operating system as the user
- Local and remote ports
- These may be individual TCP or UDP port values, an enumerated list of ports, or a wildcard port
- Remote IP address
Table 9.2 Host SPD Example:
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-2.png)
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-3.png)
Prevention of Replay Attacks
- When SA is established, sender initializes 32-bit counter to 0, increments by 1 for each packet
- If wraps around 2^32 - 1, new SA must be established
- Recipient maintains a sliding window (size 64-8192 packets)
- If a packet with high sequence number is received, do not advance window until packet is authenticated
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-4.png)
Virtual Private Networks (VPN)
- ESP is often used to implement a VPN
- Packets go from internal network to a gateway with IP headers for address in another network
- Entire packet hidden by encryption (tunnel mode)
- Including original headers so destination addresses are hidden (tunnel mode)
- Receiving gateway decrypts packet and forwards original IP packet to receiving address in the network that it protects
- This is known as a VPN tunnel
- Secure communication between parts of the same organization over public untrusted Internet
Combining Security Associations
- Security association bundle
- Refers to a sequence of SAs through which traffic must be processed to provide a desired set of IPsec services
- The SAs in a bundle may terminate at different endpoints or at the same endpoint
- May be combined into bundles in two ways
- Transport adjacency
- Refers to applying more than one transport mode security protocol to the same IP packet without invoking tunneling
- This approach allows for only one level of combination
- Iterated tunneling
- Refers to the application of multiple layers of tunnel mode security protocols effected through IP tunneling This approach allows for multiple levels of nesting
- Transport adjacency
Secure Key Establishment
- Goal: generate and agree on a session key using some public initial information
- What properties are needed?
- Authentication (know identity of other party)
- Secrecy (generated key not known to any others)
- Forward secrecy (compromise of one session key does not compromise keys used for older sessions)
- Prevent reuse of old key material
- Prevent denial of service attacks
- Protect identities from eavesdroppers
- Protect integrity
Key Management in IPSec
- Manual key management
- Keys and parameters of crypto algorithms exchanged offline (e.g., by phone), security associations established by hand
- Pre-shared symmetric keys
- New session key derived for each session by hashing pre-shared key with session-specific nonces
- Standard symmetric-key authentication and encryption
- Automated online key establishment
- Internet Key Exchange (IKE) protocol
- Use Diffie-Hellman to derive shared symmetric key
ISAKMP/OAKLEY
- The default automated key management protocol of IPsec (also called IKE = Internet Key Exchange, RFC 7296)
- Consists of:
- Oakley Key Determination Protocol, RFC 2407
- A key exchange protocol based on the Diffie-Hellman algorithm but providing added security
- Generic in that it does not dictate specific formats
- Internet Security Association and Key Management Protocol (ISAKMP), RFC 2408
- Provides a framework for Internet key management and provides the specific protocol support, including formats, for negotiation of security attributes
- Consists of a set of message types that enable the use of a variety of key exchange algorithm
- Oakley Key Determination Protocol, RFC 2407
IKE Genealogy
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-5.png)
Features of IKE Key Determination
Algorithm is characterized by five important features:
- It employs a mechanism known as cookies to thwart clogging attacks (recipient to make useless work)
- It enables the two parties to negotiate a group; this, in essence, specifies the global parameters of the Diffie-Hellman key exchange
- It uses nonces to ensure against replay attacks
- It enables the exchange of Diffie-Hellman public key values
- It authenticates the Diffie-Hellman exchange to thwart man-in-the- middle-attacks
IKE Overview
- Goal: create security association between 2 hosts
- Shared encryption and authentication keys, agreement on crypto algorithms
- Two phases: 1st phase establishes security association (IKE-SA) for the 2nd phase
- Always by authenticated Diffie-Hellman (expensive)
- 2nd phase uses IKE-SA to create actual security association (child-SA) to be used by AH and ESP
- Use keys derived in the 1st phase to avoid DH exchange
- Can be executed cheaply in “quick” mode
- To create a fresh key, hash old DH value with new nonces
IKEv2: Phase One:
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-6.png)
IKEv2: Phase Two (Create Child-SA):
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-7.png)
IKE Payload Types
/CSCE-465-63860/Lecture/09%20-%20Applications%20VI/Visual%20Aids/image-8.png)
Cryptographic Suites for IPSec
https://wiki.strongswan.org/projects/strongswan/wiki/IKEv2CipherSuites
NIST SP on IPSec
- Guide to IPsec VPNs – SP 800-77 revision 1
- https://csrc.nist.gov/pubs/sp/800/77/r1/final
- Recommends IKEv2 and IPsec-v3
- Recommends not less than AES128
- Recommends not less than HMAC-SHA-256 (or HMAC-SHA-3 if available)
OpenVPN Alternative
- Open source client & server for VPN
- Based on OpenSSL lib (SSL/TLS)
- Encryption and authentication
- HMAC for integrity
- Using UDP or TCP for implementation
- Runs as a user application
- Secured IP datagram as payload
- Perhaps some critical security issues!
Summary
- IP security overview
- Applications of IPsec
- Benefits of IPsec
- Routing applications
- IPsec documents
- IPsec services
- Transport and tunnel modes
- IP security policy
- Security associations
- Security association database
- Security policy database
- IP traffic processing
- Cryptographic suites
- Encapsulating security payload
- ESP format
- Encryption and authentication algorithms
- Padding
- Anti-replay service
- Transport and tunnel modes
- Combining security associations
- Authentication plus confidentiality
- Basic combinations of security associations
- Internet key exchange
- Key determination protocol
- Header and payload formats