IPsec Details 1 / 43. IPsec Details



Similar documents
APNIC elearning: IPSec Basics. Contact: esec03_v1.0

IP Security. Ola Flygt Växjö University, Sweden

Protocol Security Where?

Introduction to Security and PIX Firewall

Internet Protocol Security IPSec

CSCI 454/554 Computer and Network Security. Topic 8.1 IPsec

Security vulnerabilities in the Internet and possible solutions

Dr. Arjan Durresi. Baton Rouge, LA These slides are available at:

Security Protocols HTTPS/ DNSSEC TLS. Internet (IPSEC) Network (802.1x) Application (HTTP,DNS) Transport (TCP/UDP) Transport (TCP/UDP) Internet (IP)

Network Security Part II: Standards

Security in IPv6. Basic Security Requirements and Techniques. Confidentiality. Integrity

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

Lecture 17 - Network Security

21.4 Network Address Translation (NAT) NAT concept

Chapter 3. Network Domain Security

Chapter 5: Network Layer Security

Network Security. Lecture 3

Client Server Registration Protocol

Using IKEv2 on Juniper Networks Junos Pulse Secure Access Appliance

Vodafone MachineLink 3G. IPSec VPN Configuration Guide

Security Engineering Part III Network Security. Security Protocols (II): IPsec

IP SECURITY (IPSEC) PROTOCOLS

Authentication applications Kerberos X.509 Authentication services E mail security IP security Web security

Securing IP Networks with Implementation of IPv6

CS 494/594 Computer and Network Security

VPNs. Palo Alto Networks. PAN-OS Administrator s Guide Version 6.0. Copyright Palo Alto Networks

Príprava štúdia matematiky a informatiky na FMFI UK v anglickom jazyku

Network Security [2] Plain text Encryption algorithm Public and private key pair Cipher text Decryption algorithm. See next slide

The BANDIT Products in Virtual Private Networks

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

Secure Shell SSH provides support for secure remote login, secure file transfer, and secure TCP/IP and X11 forwarding. It can automatically encrypt,

INF3510 Information Security University of Oslo Spring Lecture 9 Communication Security. Audun Jøsang

Branch Office VPN Tunnels and Mobile VPN

Implementing and Managing Security for Network Communications

MINI-FAQ: OpenBSD 2.4 IPSEC VPN Configuration

CS 4803 Computer and Network Security

Chapter 10. Network Security

13 Virtual Private Networks 13.1 Point-to-Point Protocol (PPP) 13.2 Layer 2/3/4 VPNs 13.3 Multi-Protocol Label Switching 13.4 IPsec Transport Mode

Network Security. Marcus Bendtsen Institutionen för Datavetenskap (IDA) Avdelningen för Databas- och Informationsteknik (ADIT)

Computer and Network Security

Real-Time Communication Security: SSL/TLS. Guevara Noubir CSU610

VPN. VPN For BIPAC 741/743GE

Security Considerations for Intrinsic Monitoring within IPv6 Networks: Work in Progress

Chapter 49 IP Security (IPsec)

Internetwork Security

Secure Sockets Layer

: Network Security. Name of Staff: Anusha Linda Kostka Department : MSc SE/CT/IT

Chapter 17. Transport-Level Security

IPSEC: IKE. Markus Hidell Based on material by Vitaly Shmatikov, Univ. of Texas, and by the previous course teachers

7 Network Security. 7.1 Introduction 7.2 Improving the Security 7.3 Internet Security Framework. 7.5 Absolute Security?

Using IPSec in Windows 2000 and XP, Part 2

Chapter 4 Virtual Private Networking

CS 356 Lecture 27 Internet Security Protocols. Spring 2013

Insecure network services

IT Networks & Security CERT Luncheon Series: Cryptography

Computer and Network Security Exercise no. 4

Transport Layer Security Protocols

Protecting Internet Key Exchange (IKE) Implementations from Distributed Denial of Service Attacks

Chapter 8 Virtual Private Networking

Chapter 8. Cryptography Symmetric-Key Algorithms. Digital Signatures Management of Public Keys Communication Security Authentication Protocols

CCNA Security 1.1 Instructional Resource

Internet Key Exchange (IKE) EJ Jung

Appendix A: Configuring Firewalls for a VPN Server Running Windows Server 2003

Transport Level Security

Chapter 8 Security. IC322 Fall Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Communication Security for Applications

SonicOS Enhanced 3.2 IKE Version 2 Support

Security. Contents. S Wireless Personal, Local, Metropolitan, and Wide Area Networks 1

FortiOS Handbook IPsec VPN for FortiOS 5.0

Cisco Site-to-Site VPN Lab 3 / GRE over IPSec VPNs by Michael T. Durham

IPsec VPN Application Guide REV:

Network Security. Modes of Operation. Steven M. Bellovin February 3,

Cryptography and network security CNET4523

Application Note: Onsight Device VPN Configuration V1.1

IPsec Simplified. Peter J. Welcher. Introduction. Just a Very Wee Bit of Cryptology. First, a couple of personal and company news items:

3GPP TSG SA WG3 Security S Meeting S3#16 Sophia Antipolis, November, Abstract

Outline. INF3510 Information Security. Lecture 10: Communications Security. Communication Security Analogy. Network Security Concepts

Internet Security Architecture

Chapter 8 Network Security. Slides adapted from the book and Tomas Olovsson

Lecture 10: Communications Security

Lecture 5.1: IPsec Basics

True False questions (25 points + 5 points extra credit)

Chapter 7 Transport-Level Security

IPSec and SSL Virtual Private Networks

Viewing VPN Status, page 335. Configuring a Site-to-Site VPN, page 340. Configuring IPsec Remote Access, page 355

INTERNET SECURITY: FIREWALLS AND BEYOND. Mehernosh H. Amroli

Bit Chat: A Peer-to-Peer Instant Messenger

Building scalable IPSec infrastructure with MikroTik. IPSec, L2TP/IPSec, OSPF

Configuring a GB-OS Site-to-Site VPN to a Non-GTA Firewall

IPSec Network Security Commands

Configuring a Site-to-Site VPN Tunnel Between Cisco RV320 Gigabit Dual WAN VPN Router and Cisco (1900/2900/3900) Series Integrated Services Router

SonicOS 5.9 / / 6.2 Log Events Reference Guide with Enhanced Logging

[MS-SSTP]: Secure Socket Tunneling Protocol (SSTP) Intellectual Property Rights Notice for Open Specifications Documentation

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Lab Configure a PIX Firewall VPN

IPsec VPN Security between Aruba Remote Access Points and Mobility Controllers

NetScreen Concepts & Examples

Virtual Private Networks

Fireware How To VPN. Introduction. Is there anything I need to know before I start? Configuring a BOVPN Gateway

Laboratory Exercises V: IP Security Protocol (IPSec)

Transcription:

Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues 1 / 43

Header (AH) Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues Based on keyed cryptographic hash function. Covers AH header, payload and immutable portion of preceeding IP header. Not that useful today, compared to ESP with null authentication Usually used with HMAC-SHA1 or HMAC-MD5 HMAC output is frequently truncated Details: see RFC 4302 2 / 43

AH Layout Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues proto length reserved SPI Sequence Number digest (variable length) 3 / 43

Other AH Fields Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues Proto what transport protocol header is next (i.e., TCP, UDP, etc.) length length of AH header in 32-bit words, minus 2 Actually, length is implicit in the security association; putting it in the header permits context-free (and unkeyed) examination of the packet Sequence prevents replay attacks 4 / 43

Mutable Parts of the IP Header Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues Some parts of the IP header change in transit Obvious: TTL (and hence IP checksum) Fragmentation? You generally reassemble fragments before doing AH processing DSCP (previously known as ToS) IP options some change in flight (record route, source route); others do not. See RFC 4302 for details 5 / 43

What is an SPI? Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues SPI Security Parameter Index Identifies Security Association Each SA has its own keys, algorithms, policy rules On packet receipt, look up SA from SPI, dstaddr pair 6 / 43

What s an SA? Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues SA: Security Association Think of it as an IPsec connection All of the parameters needed for an IPsec session: crypto algorithms (AES, SHA1, etc.), modes of operation (CBC, HMAC, etc.), key lengths, traffic to be protected, etc. Both sides must agree on the SA for secure communications to work 7 / 43

Encapsulating Security Payload (ESP) Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues Carries encrypted packet. An SPI is used, as with AH. Preferred use of ESP is for AES in CBC mode with (truncated) HMAC-SHA1 for authentication IV, if used, is the first few bytes of data Older systems use 3DES, perhaps with HMAC-MD5 Details in RFC 4303 8 / 43

ESP Layout Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues SPI sequence number data data padding padding padlen payload digest digest digest digest Digest range 9 / 43

Padding Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues padlen says how many bytes of padding should be removed from the packet Primary purpose: handle CBC blocksize issue Secondary purpose: add random extra padding, to confuse traffic analysts (but it doesn t do a very good job of that) 10 / 43

Using ESP Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues Can be used with null authentication or null encryption With null encryption, provides authentication only Easier to implement than AH Note: you should virtually always use authentication with ESP Similarly, sequence numbers should be used whenever possible 11 / 43

IPsec and Firewalls Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues Encryption is not authentication or authorization Access controls may need to be applied to encrypted traffic, depending on the source. The source IP address is only authenticated if it is somehow bound to the certificate. Encrypted traffic can use a different firewall; however, co-ordination of policies may be needed. 12 / 43

IPsec and the DNS Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues IPsec often relies on the DNS. Users specify hostnames. IPsec operates at the IP layer, where IP addresses are used. An attacker could try to subvert the mapping. DNSSEC may not meet some organizational security standards. DNSSEC which isn t deployed yet, either uses its own certificates, not X.509. 13 / 43

Implementation Issues Header (AH) AH Layout Other AH Fields Mutable Parts of the IP Header What is an SPI? What s an SA? Encapsulating Security Payload (ESP) ESP Layout Padding Using ESP IPsec and Firewalls IPsec and the DNS Implementation Issues How do applications request cryptographic protection? How do they verify its existence? How do adminstrators mandate cryptography between host or network pairs? We need to resolve authorization issues. 14 / 43

Why Key Management? Static Keys Replay Protection SA Management Other Issues 15 / 43

Why? Why Key Management? Static Keys Replay Protection SA Management Other Issues Where do IPsec keys come from? Could we use static keys? What are the other requirements for key management? 16 / 43

Static Keys Why Key Management? Static Keys Replay Protection SA Management Other Issues In theory, static keys can be used; in practice, they have several disadvantages Primary disadvantage: they almost certainly will not be random enough (If they re passwords, attackers can launch a password guessing attack) History (and theory) suggest that it s a bad idea to encrypt too much plaintext with a single key You can t use replay protection with static keys 17 / 43

Replay Protection Why Key Management? Static Keys Replay Protection SA Management Other Issues The first packet transmitted on an SA must be numbered 1 Any time a machine reboots and loses knowledge of its sequence number status, it will restart from 1 Besides, 2 32 packets isn t that many; it will wrap around at some point Replays can be used to attack confidentiality 18 / 43

SA Management Why Key Management? Static Keys Replay Protection SA Management Other Issues We spoke of the SADB How does it get populated? We must negotiate it! 19 / 43

Other Issues Why Key Management? Static Keys Replay Protection SA Management Other Issues SA lifetime Dead peer detection SA tear-down Algorithm negotiation Other negotiations 20 / 43

IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE 21 / 43

IKE IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE Very complex protocol Does a lot, probably too much We ll just skim the surface, and we ll discuss IKEv2, which is simpler I ll be simplifying it, too... 22 / 43

Basic Philosophy IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE Two parties, Initiator and Responder First set up a control SA (known in IKEv1 as a Phase 1 SA) Use the control SA to create child SAs (known as Phase 2 SAs) Actual IPsec data is protected via child SAs Other control traffic can use the control SA 23 / 43

Initial Exchange IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE (Each message includes a random SPI, to distinguish between different IKE sessions.) Negotiate cryptographic algorithms Do a Diffie-Hellman exchange I R : SA i 1, KE i, N i R I : SA r 1, KE r, N r, [Certreq] SA Crypto algorithm proposals and answer KE Diffie-Hellman exponential N Nonce (random number) Certreq List of trust anchors (CAs) 24 / 43

IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE I has proposed several algorithms; R has accepted one of each category The two sides have a Diffie-Hellman shared secret. The Diffie-Hellman shared secret is combined with the two nonces to produce seed keying material. Any message M protected by keying material derived from this will be written M Different keys are used in each direction I knows what CAs R trusts Neither side knows the other s identity yet 25 / 43

IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE I R : ID i, SA i 2, TS i, TS r, [Cert], Auth R I : ID r, SA r 2, TS i, TS r, Auth Both sides send their own identities, the SA data for subsequent exchanges, traffic selectors, and an authenticator. The authenticator is either an HMAC or a digital signature of the message (including the SPI) concatenated with the current sender s identity and the other party s nonce. There are various other optional payloads for certificates, CAs, etc. 26 / 43

IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE Both sides know the other s identity Both sides have authenticated the other Both sides have shared seed key material I has proposed a traffic selector; R has accepted a possibly-narrower one 27 / 43

Traffic Selectors IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE A traffic selector is a list of IP addresses and port numbers that are to be protected by the SA TS i specifies source addresses and ports; TS r specifies destination addresses and ports I proposes a certain range of traffic it wishes to protect R may agree to a narrower range This lets I possibly a laptop have a simple, protect everything configuration; the central gateway can narrow the scope of protection if desired 28 / 43

Child SAs IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE The control SA can now be used to create child SAs for actual user traffic I R : SA, N i, [KE i ], [TS i, TS r ] R I : SA, N r, [KE r ], [TS i, TS r ] Send new nonces for use in calculating keying material. For greater forward secrecy, send an optional new Diffie-Hellman exponential. Optionally negotiate new traffic selectors 29 / 43

Rekeying IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE Any SA can be rekeyed To rekey an SA, send a Rekey message with an SA identifier, new nonces, and perhaps new Diffie-Hellman exponentials Omit traffic selectors 30 / 43

SA Lifetime IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE SAs do not have negotiated lifetimes When either side thinks an SA has been around for long enough, it negotiates a new SA Net effect: SA lifetime is the shorter of the two sides preferences After the new one is set up, delete the old SA 31 / 43

Other Control Messages IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE IKE ping see if the other side is still alive Delete SA Obtain a remote IP address Check version information Error messages 32 / 43

Timeouts IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE IKE runs over UDP Each side must therefore implement its own timers and retranmissions It s reasonable to keep a cache of recently-received and -transmitted messages when a duplicate request arrives, retransmit the cached copy 33 / 43

Denial of Service IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE What if an attacker attempts to exhaust R s CPU time or memory? CPU time: force it to calculate many D-H exponentials Memory: create initial SAs; don t authenticate them 34 / 43

IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE To prevent CPU time attacks, it s permissible to reuse D-H exponentials for a short while (though it hurts perfect forward secrecy) To prevent memory attacks, watch for too many incomplete SAs When these start to occur, reject new requests and send a cookie instead These are stateless, cryptographically sealed messages bound to the sender s IP address Require that such a cookie be returned with the actual first message Guards against spoofed IP address attacks 35 / 43

Using IKE IKE Basic Philosophy Initial Exchange Traffic Selectors Child SAs Rekeying SA Lifetime Other Control Messages Timeouts Denial of Service Using IKE A host is configured with an initial protection SPD When a packet is to be sent that matches the SPD, IPsec searches for an existing SA If there is none, a request is sent to the local IKE daemon The IKE daemon attempts to create an SA, and updates the SAD (On some systems, this may result in updating the SPD) The packet is then transmitted 36 / 43

Attacks! Splicing Attack Using a Separate SA? Probable Plaintext Attacks 37 / 43

Attacks! I keep talking about subtle attacks Let s look at some old ones... Attacks! Splicing Attack Using a Separate SA? Probable Plaintext Attacks 38 / 43

Splicing Attack Attacks! Splicing Attack Using a Separate SA? Probable Plaintext Attacks Suppose that (a) ESP is being used with no authentication, (b) no sequence numbers, and (c) the good guy and the bad guy can send traffic on the same SA The bad guy intercepts a good guy s packet, sends a UDP packet with checksums turned off, and intercepts it, too The attacker then uses CBC splicing to replace the end of the UDP packet with the good guy s packet, and reinjects it The receiving IPsec sees this packet, decrypts it, and passes it to the bad guy s UDP listener 39 / 43

Attacks! Splicing Attack Using a Separate SA? Probable Plaintext Attacks Use ESP authentication Use ESP sequence numbers, to prevent reinjection of the UDP packet (though there are other variants that make that less useful) Use a separate SA for each connection 40 / 43

Using a Separate SA? Attacks! Splicing Attack Using a Separate SA? Probable Plaintext Attacks If you use separate SAs for each connection, it makes life easier for traffic analysts It can also aid cryptanalysts 41 / 43

Probable Plaintext Attacks Attacks! Splicing Attack Using a Separate SA? Probable Plaintext Attacks How does a cryptanalyst know if a guess at the key was correct? What should the packet look like? Compare certain fields from two packets for the same connection they should match Source and destination IP address must match exactly Probabilistically, most bits of counters (such as TCP sequence numbers) will match: if you add 512 to a 32-bit number, probability is.97 that the high-order 18 bits remain unchanged, and the low-order 9 bits are always unchanged Other fields can be matched as well 42 / 43

Attacks! Splicing Attack Using a Separate SA? Probable Plaintext Attacks Not easy! Try avoiding per-connection SAs Don t use ciphers that are weak enough that this is a useful attack... 43 / 43