910 likes | 1.6k Views
IPSEC VPN. What is a VPN?. VPN is a tunnel data is encrypted and then encapsulated by a VPN gateway VPN protects the data from being understood (confidentiality) against spoofing the sender or the recipients’ identity (authentication). VPN architectures network to network
E N D
What is a VPN? • VPN is a tunnel • data is encrypted and then encapsulated by a VPN gateway • VPN protects • the data from being understood (confidentiality) • against spoofing the sender or the recipients’ identity (authentication). • VPN architectures • network to network • host to network • host to host
IPSec Operating Modes • IPSec Transport Mode • Protects the payload only • No encapsulation • Original IP header preserved • Host to host • Host must be aware of IPSec • Provides End-to-end protection • From host to host • Not just in transit
IPSec Operating Modes • IPSec Tunnel Mode • Encrypts entire message (headers + payload) • The IPSec gateway encrypts and encapsulates • Adds new headers to send the encrypted packet to the end-point IPSec router • Could be host-host, host-gateway or gateway-gateway • Transparent to hosts • Protects IP address/header
IPSEC Modes and Architectures • Transport Mode • Host-Host • Tunnel Mode • Gateway-Gateway • Host-Gateway • Host-Host
IPSEC SA – Security Association • Like a connection • Uniquely ID'ed by • Security Parameters Index (SPI) • Local Id number identifies SA • IP Destination Address • Note, one way • Security Protocol • AH or ESP
IPSEC SA – Security Association • Parameters • Lifetime • Protocol information • Authentication and Encryption algorithms • Mode • Anti-replay window • How out of sequence can messages be • ...
Two Kinds of SA in IPSEC • ISAKMP SA • (Internet Security Association and Key Management Protocol) • Used during initial key negotiation • Two way • IPSEC SA • Negotiated using IKE/ISAKMP • Used by IPSEC during operation
IPSec Protocols • IPSec is a standard: mandatory in IPv6 and can be used with IPV4 too • IPSec is transparent to the users • Three main protocols • Internet Key Exchange (IKE): initial negotiation to agree upon the encryption mechanism • Authentication Header (AH): security header inserted in the IP packet to determine if the packet is altered and to authenticate the sender • OR • Encapsulation Security Payload (ESP): to encrypt payload and the header of the original IP packet
IPSEC Modes, Architectures and Protocols • Transport Mode • Host-Host • AH • ESP • Tunnel Mode • ESP • Gateway-Gateway • Host-Gateway • Host-Host
IKE -- Internet Key Exchange • Establishes connection • Does authentication • Does key exchange • Creates and negotiates SA • Recreation of keys • Uses UDP 500 • Uses ISAKMP • Uses Diffie-Hellman
IKE Protocol • Two Phases • Phase 1 • 1. Authentication: • Pre-shared secret (password) – manually distributed (not recommended), • X509 Digital Certificate – same CA or PKI. • EAP including radius servers • RSA/DSA Public/Private keys (depricated) • 2. Encrypted ISAKMP SA for phase 2
IKE Protocol • Phase 2: • Creating IPSEC SA's • One for each direction • Generate keys to use for encryption • IPSEC SA parameters • Protocol • ESP, AH • Authentication: • MD5, SHA-1 • Encryption: • 3DES, AES,RC5,IDEA,CAST,Blowfish
IKE Perfect Forward Security • Phase II: • Periodically renegotiates parameters • Every 8 hours, say • So too much cyphertext isn't generated from same keys • Uses secret key from phase 1 DH • With perfect forward security: • DH repeated each renegotiation
AH Protocol • Offers authentication and integrity (not confidentiality) • Connectionless • IP protocol 51 • Adds additional header with signature called integrity check value (ICV) based on IP address to ensure the identity of the sender: • <IP Header><SPI><SEQ><Authentication Info><IP Payload> • Receiver re-calculates the (ICV) and compares
ESP Protocol • Offers full confidentiality – encrypting the IP payload • IP protocol 50 • Transport mode: adds header and trailers as follows: • <IP Header> <SPI><SEQ><IP Pkt Encr.><Trailer> • Trailer includes ICV • Tunnel mode: encrypts the entire packet including IP header and adds • new IP header, ESP header and trailer
IPSec Security Policy • Gateway has an IPSec policy server. • Configuration is stored in security policy database (SPD) • Policy specifies whether encryption will be required • IPSec policy is written for outbound traffic. Inbound traffic is matched against a policy mirror image.
IPSec Security Association (SA) • Before SA is negotiated, the IPSec partner must be configured in the security policy database (SPD) • The SA is stored in a database (SAD) indexed by security parameter index (SPI) which is included in every IPSec packet header • Bi-directional Agreement • Policy based (e.g., algorithm is selected based on security level and performance overhead)
IPSec Security Policy Data Base • Each SPD entry defined by selectors: • Protocol • Local IP • Local port • Remote IP • Remote port • Specifies action • DISCARD • PROTECT:ESP • BYPASS
IPSEC SPD Outbound • Search SPD for matching rule • If PROTECT • Find SA in SAD that matches policy • Process according to SA • If no SA, invoke IKE to create SA • If DISCARD • Drop packet • IF BYPASS • Forward unchanged
IPSec and NAT Integration • If traffic is NATed closer to the Internet • AH is incompatible with NAT • (1) put NAT before VPN, or • (2) bypass using integrated VPN+NAT device
IPSec and NAT Integration • ESP transport mode also incompatible with NAT • NAT changes the IP address which implies that the TCP Checksum must be changed (TCP checksum is calculated based on IP headers too). • But TCP checksum in encrypted and can not be modified • receiver will calculate wrong checksum
IPSec and NAT Integration • ESP tunnel would work with NAT but not if NAT changes ports • TCP/UDP ports are inaccessible when headers are encrypted, so no problem but • when it communicates using IKE the source UDP port must be 500 • NAT might replace it • Newer implementations (StrongsWAN) have NAT traversal
IPSec Pros • Advantages • Hides the identity of your network • Provides secure channel: authentication, confidentiality and integrity • Connects sites (e.g., branch offices) with a cost-effective secure network compared with leased lines • Allows user to work from home and mobile hosts
IPSec Cons • Disadvantages • Complex policy management • Require tunnels through firewall sometimes • Incompatible with NAT depending on the architecture • Tunnelled traffic is undetected by IDS • VPN gateways might be compromised which leads to uncovering protected data
Test Next Week • In lecture period • Multiple choice • Lecture and labs
Sample Questions • Which of the following is not a property of a good hash function • Compression • Ease of computation • Two-way • Collision resistance
Sample Questions • Which of the following is not a property of a good hash function • Two-way
Sample Questions • Keyed hash functions provide • Authentication and confidentiality • Integrity protection and non-repudiation • Integrity protection and confidentiality • Authentication and integrity protection
Sample Questions • Keyed hash functions provide • Authentication and integrity protection
Sample Questions • HMAC algorithms are based on • A public key hash algorithm • A symmetric key cypher • A public key cypher • An un-keyed hash algorithm
Sample Questions • HMAC algorithms are based on • An un-keyed hash algorithm
Sample Questions • The cryptographic strength of SHA-512 is • 224 • 128 • 256 • 512
Sample Questions • The cryptographic strength of SHA-512 is • 256