15. IPsec and VPN

IP security: framework for ensuring secure communications over IP networks; similar security services as TLS, but running at a lower level of the protocol stack.

VPNs: extending a private network across a public network.

IP Layer Security

TLS runs at the transport layer; IPsec runs at the network layer. Hence, it allows protection for any higher levels, including TCP and UDP.

Provides encryption, authentication and key management algorithms.

Standardized in 2005 with RFC 4301-4305; commonly used to provide VPNs.

Security services:

Architectures

Gateway-to-Gateway Architecture:

Host-to-Gateway Architecture:

Host-to-Host Architecture:

Protocols

Encapsulating security payload (ESP): provides confidentiality, authentication, integrity and reply protection.

Authentication header (AH) (depreciated): authentication, integrity and reply protection, but NOT confidentiality.

Internet key exchange (IKE): negotiation, creation and management of session keys in security associations (SAs).

IPsec Connection Setup

With the IKEv2 protocol (RFC 7296, 2014):

Security Associations (SA)

Runs after connection setup allows keys to be established.

SAs contain information needed to support an IPsec connection.

It may include:

SAs tells the endpoint how it should process inbound IPsec packets and/or generate outbound packets.

SAs are unidirectional: there is one SA for each direction.

Cryptographic Suites

Cryptographic suites in IPsec are:

Modes of Operation

ESH and AH can run in two different modes:

Transport Mode ESP

ESP components:

----------------------------------------------------------
| IP header | ESP header | Data | ESP trailer | ESP Auth |
-------------------------|--------------------|-----------
                         |     encrypted      |
            |         authenticated           |

Outbound packet processing:

Tunnel Mode ESP
--------------------------------------------------------------------------
| New IP header | ESP header | IP header | Data | ESP trailer | ESP Auth |
--------------------------------------------------------------|-----------
                             |           encrypted            |
                |                authenticated                |

Outbound packet processing:

Security

Virtual Private Networks

Secure channel over insecure connection.

Types:

Internet VPN: Branch Office Interconnect

Enterprise | Firewall | Internet | Firewall | Branch |
                    <---- VPN ----->

Extranet VPN: Supplier Network

Enterprise | Firewall | Internet | Firewall | Supplier Clients |
                    <---------- VPN --------->

Remote Access

ISPs can provide VPN services across the un-trusted internet.