Lecture 9: Network Level Security IPSec

Similar documents
COSC4377. Chapter 8 roadmap

Chapter 5: Network Layer Security

CSCE 715: Network Systems Security

CSC 4900 Computer Networks: Security Protocols (2)

IPSec. Overview. Overview. Levente Buttyán

Computer Networks II

Cryptography and Network Security Chapter 16. Fourth Edition by William Stallings

CIS 6930/4930 Computer and Network Security. Topic 8.1 IPsec

IP Security IK2218/EP2120

Chapter 8 Security. Computer Networking: A Top Down Approach. Andrei Gurtov. 7 th edition Jim Kurose, Keith Ross Pearson/Addison Wesley April 2016

IP Security. Have a range of application specific security mechanisms

The IPsec protocols. Overview

Internet security and privacy

The Internet community has developed application-specific security mechanisms in a number of application areas, including electronic mail (S/MIME,

IPSec. Slides by Vitaly Shmatikov UT Austin. slide 1

Chapter 6. IP Security. Dr. BHARGAVI H. GOSWAMI Department of Computer Science Christ University

Protocols, Technologies and Standards Secure network protocols for the OSI stack P2.1 WLAN Security WPA, WPA2, IEEE i, IEEE 802.1X P2.

CSC 6575: Internet Security Fall 2017

IP Security Part 1 04/02/06. Hofstra University Network Security Course, CSC290A

Cryptography and Network Security. Sixth Edition by William Stallings

Chapter 6/8. IP Security

INTERNET PROTOCOL SECURITY (IPSEC) GUIDE.

Lecture 13 Page 1. Lecture 13 Page 3

IPsec (AH, ESP), IKE. Guevara Noubir CSG254: Network Security

Computer Security 3e. Dieter Gollmann. Security.di.unimi.it/sicurezza1415/ Chapter 16: 1

Network Security: IPsec. Tuomas Aura

Chapter 8 Network Security

IP Security. Cunsheng Ding HKUST, Kong Kong, China

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

Lecture 6.2: Protocols - Authentication and Key Exchange II. CS 436/636/736 Spring Nitesh Saxena. Course Admin

Chapter 8 Network Security. Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.

VPN and IPsec. Network Administration Using Linux. Virtual Private Network and IPSec 04/2009

Chapter 8 Security. Computer Networking: A Top Down Approach

CONTENTS. vii. Chapter 1 TCP/IP Overview 1. Chapter 2 Symmetric-Key Cryptography 33. Acknowledgements

Network Encryption 3 4/20/17

Lecture 12 Page 1. Lecture 12 Page 3

IP Security Discussion Raise with IPv6. Security Architecture for IP (IPsec) Which Layer for Security? Agenda. L97 - IPsec.

Transport Level Security

Lecture 33. Firewalls. Firewall Locations in the Network. Castle and Moat Analogy. Firewall Types. Firewall: Illustration. Security April 15, 2005

Lehrstuhl für Netzarchitekturen und Netzdienste Fakultät für Informatik Technische Universität München. ilab. Lab 8 SSL/TLS and IPSec

INFS 766 Internet Security Protocols. Lectures 7 and 8 IPSEC. Prof. Ravi Sandhu IPSEC ROADMAP

Internet Security. - IPSec, SSL/TLS, SRTP - 29th. Oct Lee, Choongho

CSE509: (Intro to) Systems Security

L13. Reviews. Rocky K. C. Chang, April 10, 2015

HW/Lab 4: IPSec and Wireless Security. CS 336/536: Computer Network Security DUE 11 am on 12/01/2014 (Monday)

Lecture 5: Protocols - Authentication and Key Exchange* CS 392/6813: Computer Security Fall Nitesh Saxena

Chapter 32 Security in the Internet: IPSec, SSL/TLS, PGP,

IPsec and SSL/TLS. Applied Cryptography. Andreas Hülsing (Slides mostly by Ruben Niederhagen) Dec. 1st, /43

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

Int ernet w orking. Internet Security. Literature: Forouzan: TCP/IP Protocol Suite : Ch 28

Firewalls, Tunnels, and Network Intrusion Detection

Chapter 8 Network Security

Introduction to IPsec. Charlie Kaufman

Virtual Private Network

Virtual Private Networks (VPN)

Chapter 11 The IPSec Security Architecture for the Internet Protocol

Network Security: IPsec. Tuomas Aura T Network security Aalto University, Nov-Dec 2014

Network Security IN2101

Lecture 10: Communications Security

The IPSec Security Architecture for the Internet Protocol

Chapter 8 Network Security

Network Security (NetSec) IN2101 WS 16/17

Introduction. INF3510 Information Security. Lecture 10: Communications Security. Outline. Network Security Concepts. University of Oslo Spring 2018

Protocol Architecture (2) Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

CIS 6930/4930 Computer and Network Security. Topic 8.2 Internet Key Management

Network Security - ISA 656 IPsec IPsec Key Management (IKE)

CIS 6930/4930 Computer and Network Security. Final exam review

Numerics I N D E X. 3DES (Triple Data Encryption Standard), 48

Computer Security 3e. Dieter Gollmann. Security.di.unimi.it/sicurezza1516/ Chapter 16: 1

Junos Security. Chapter 8: IPsec VPNs Juniper Networks, Inc. All rights reserved. Worldwide Education Services

Secure channel, VPN and IPsec. stole some slides from Merike Kaeo

VPNs and VPN Technologies

Cryptography and Network Security

Network Security Chapter 8

Sample excerpt. Virtual Private Networks. Contents

Information Security & Privacy

VPN, IPsec and TLS. stole slides from Merike Kaeo apricot2017 1

Configuration of an IPSec VPN Server on RV130 and RV130W

IBM i Version 7.2. Security Virtual Private Networking IBM

CS 356 Internet Security Protocols. Fall 2013

The Internet Security Protocol, IPsec, incorporates security for network transmission

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

Service Managed Gateway TM. Configuring IPSec VPN

CS Computer Networks 1: Authentication

Outline. Key Management. Security Principles. Security Principles (Cont d) Escrow Foilage Protection

Set Up a Remote Access Tunnel (Client to Gateway) for VPN Clients on RV016, RV042, RV042G and RV082 VPN Routers

8. Network Layer Contents

Outline. Key Management. CSCI 454/554 Computer and Network Security. Key Management

CSCI 454/554 Computer and Network Security. Topic 8.2 Internet Key Management

IP Security II. Overview

AIT 682: Network and Systems Security

Outline. 0 Topic 4.1: Securing Real-Time Communications 0 Topic 4.2: Transport Layer Security 0 Topic 4.3: IPsec and IKE

Chapter 8. Network Security. Cryptography. Need for Security. An Introduction to Cryptography 10/7/2010

Table of Contents 1 IKE 1-1

CSC 8560 Computer Networks: Security Protocols

EEC-682/782 Computer Networks I

CSC/ECE 574 Computer and Network Security. Outline. Key Management. Key Management. Internet Key Management. Why do we need Internet key management

Outline. CSC/ECE 574 Computer and Network Security. Key Management. Security Principles. Security Principles (Cont d) Internet Key Management

Configuring Security for VPNs with IPsec

IPSec VPN Setup with IKE Preshared Key and Manual Key on WRVS4400N Router

Transcription:

Lecture 9: Network Level Security IPSec CS 336/536: Computer Network Security Fall 2015 Nitesh Saxena Adopted from previous lecture by Keith Ross, and Tony Barnard HW3 being graded Course Admin HW4 will be posted soon Covers IPSec (lecture 9) and Wireless Security (lecture 10) Due 11am on Dec 07 (Monday) Lab exercise involves capturing WiFi packets using Wireshark Labs active this Friday 11/18/2015 Lecture 11: Privacy 2 1

Final Exam: Course Admin 7-9:30pm on Dec 9 (Wednesday), in classroom Cumulative Focus more on Post Mid-Term Material (65%) Our last lecture on Dec 2 we will do exam review then No class next week Fall/Thanksgiving break! 11/18/2015 Lecture 11: Privacy 3 Outline IPSec Modes and Protocols IKE Protocol Basics 11/18/2015 Lecture 7 - SSL/TLS 4 2

Which Layer to Add Security to? IKE UDP Relative Location of Security Facilities in the TCP/IP Protocol Stack 5 Security at different layers Application layer: PGP Transport layer: SSL Network layer: IPsec Link layer: WEP / 802.11i IPsec approach: HTTP/SMTP/IM TCP/UDP/ICMP IPsec IPsec can provide security between any pair of network-layer entities (eg, between two hosts, two routers, or a host and a router). 6 3

IP Security IP datagrams have no inherent security IP source address can be spoofed Content of IP datagrams can be sniffed Content of IP datagrams can be modified IP datagrams can be replayed IPSec is a method for protecting IP datagrams Standardized by IETF: dozens of RFCs. Only sender and receiver have to be IPsec compliant Rest of network can be regular IP 7 What is security at the networklayer? Between two network entities: Sending entity encrypts/authenticates the payloads of datagrams. Payload could be: TCP segment, UDP segment, ICMP message, OSPF (routing) message, and so on. All data sent from one entity to the other would be hidden/authenticated: Web pages, e-mail, P2P file transfers, TCP SYN packets, and so on. That is, blanket coverage. 8 4

Virtual Private Networks (VPNs) Institutions often want private networks for security. Costly! Separate routers, links, DNS infrastructure. With a VPN, institution s inter-office traffic is sent over public Internet instead. But inter-office traffic is encrypted and/or authenticated before entering public Internet 9 Virtual Private Network (VPN) Public Internet IP header IPsec header Secure payload laptop w/ IPsec salesperson in hotel Router w/ IPv4 and IPsec Router w/ IPv4 and IPsec headquarters branch office 10 5

IPsec services Integrity Authentication Replay attack prevention Confidentiality Two modes: Transport and Tunnel Two protocols providing different service models: AH Authentication Header ESP Encapsulating Security Payload 11 IPSec Modes: Transport and Tunnel Modes Transport Mode provides protection primarily for upper-layer protocols that is, for the IP datagram payload. Transport mode is typically used in end-to-end communication between two hosts. Tunnel Mode extends protection to the entire datagram, by encapsulating it in a new outer datagram. Tunnel mode is typically used in communication between two routers (must be used if a router is involved). 12 6

IPsec Transport Mode IPsec IPsec IPsec datagram emitted and received by end-system. Protects upper level protocols 13 IPsec tunneling mode (1) IPsec IPsec End routers are IPsec aware. Hosts need not be. 14 7

IPsec tunneling mode (2) IPsec IPsec Also tunneling mode. 15 IPSec protocols Authentication Header (AH) protocol provides source authentication & integrity but not confidentiality Encapsulation Security Protocol (ESP) provides source authentication, integrity, and confidentiality more widely used than AH 16 8

Four combinations are possible! Host mode with AH Host mode with ESP Tunnel mode with AH Tunnel mode with ESP Most common and most important 17 Security associations (SAs) Before sending data, a virtual connection is established from sending entity to receiving entity. Called security association (SA) SAs are simplex: for only one direction Both sending and receiving entites maintain state information about the SA Recall that TCP endpoints also maintain state information. IP is connectionless; IPsec is connection-oriented! How many SAs in VPN w/ headquarters, branch office, and n traveling salesperson? 18 9

Tunnel Mode and Transport Mode Functionality 19 ESP in transport mode Alice End-to-end encryption Bob ESP in transport mode conceals what Alice is saying to Bob, but not that Alice and Bob are communicating. 20 10

ESP in tunnel mode Alice VPN Bob ESP in tunnel mode over the VPN also conceals the fact that Alice is talking to Bob 21 Scope of ESP encryption and authentication Original datagram ESP authentication does not extend to the IP header Protocol = 6 ESP in transport mode Protocol = 50 Next = 6 ESP in tunnel mode Protocol = 50 Next = 4 22 11

Example SA from R1 to R2 Headquarters Internet Branch Office 200.168.1.100 SA 193.68.2.23 172.16.1/24 R1 R2 172.16.2/24 R1 stores for SA 32-bit identifier for SA: Security Parameter Index (SPI) the origin interface of the SA (200.168.1.100) destination interface of the SA (193.68.2.23) type of encryption to be used (for example, 3DES with CBC) encryption key type of integrity check (for example, HMAC with with MD5) authentication key 23 Security Association Database (SAD) Endpoint holds state of its SAs in a SAD, where it can locate them during processing. With n salespersons, 2 + 2n SAs in R1 s SAD When sending IPsec datagram, R1 accesses SAD to determine how to process datagram. When IPsec datagram arrives to R2, R2 examines SPI in IPsec datagram, indexes SAD with SPI, and processes datagram accordingly. 24 12

IPsec datagram Focus for now on tunnel mode with ESP enchilada authenticated encrypted new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth SPI Seq # padding pad length next header 25 What happens? Headquarters Internet Branch Office 200.168.1.100 SA 193.68.2.23 172.16.1/24 R1 R2 172.16.2/24 enchilada authenticated encrypted new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth SPI Seq # padding pad length next header 26 13

R1 converts original datagram into IPsec datagram Appends to back of original datagram (which includes original header fields!) an ESP trailer field. Encrypts result using algorithm & key specified by SA. Appends to front of this encrypted quantity the ESP header, creating enchilada. Creates authentication MAC over the whole enchilada, using algorithm and key specified in SA; Appends MAC to back of enchilada, forming payload; Creates brand new IP header, with all the classic IPv4 header fields, which it appends before payload. 27 Inside the enchilada: enchilada authenticated encrypted new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth SPI Seq # padding pad length next header ESP trailer: Padding for block ciphers ESP header: SPI, so receiving entity knows what to do Sequence number, to thwart replay attacks MAC in ESP auth field is created with shared secret key 28 14

IPsec sequence numbers For new SA, sender initializes seq. # to 0 Each time datagram is sent on SA: Sender increments seq # counter Places value in seq # field Goal: Prevent attacker from replaying a packet Receipt of duplicate, authenticated IP packets may disrupt service Method: Destination checks for duplicates But doesn t keep track of ALL received packets; instead uses a window 29 Algorithm at receiver N is highest sequence # rcvd. Default W=64 1. If rcvd packet falls in window, packet is new, and MAC is valid slot in window marked 2. If rcvd packet is to right of window, MAC is valid window advanced & right-most slot marked 3. If rcvd packet is left of window, or already marked, or MAC not valid packet is discarded 30 15

Security Policy Database (SPD) Policy: For a given datagram, sending entity needs to know if it should use IPsec. Needs also to know which SA to use May use: source and destination IP address; protocol number. Info in SPD indicates what to do with arriving datagram; Info in the SAD indicates how to do it. 31 Focus on an outbound IP datagram crossing the boundary between an intranet and the Internet. How is it decided what security processes are applied to this datagram? This is a policy decision by administration. The decision for each category of traffic is entered into a Security Policy Database. The menu of available processes is collected into a Security Association Database. Adopt 2-step process - entries in the Security Policy Database point to entries in the Security Association Database. 32 16

Linux example: ESP in tunnel mode Headquarters Internet Branch Office 200.168.1.100 SA 193.68.2.23 172.16.1/24 R1 R2 172.16.2/24 In each host, create config file: /etc/setkey.conf Execute setkey command in both hosts, which reads the setkey.conf file setkey f /etc/setkey.conf Creates SAD and SPD databases 33 setkey.conf for R1 # Flush the SAD and SPD flush; spdflush; # SAs encrypt w/ 192 bit keys & auth w/ 128 bit keys ESP protocol SPI 2 SAs added to SAD Add 200.168.1.100 193.68.2.23 esp 0x201 -m tunnel -E 3des-cbc 0x7aeaca3f87d060a12f4a4487d5a5c3355920fae69a96c831 -A hmac-md5 0xc0291ff014dccdd03874d9e8e4cdf3e6; Add 193.68.2.23 200.168.1.100 esp 0x301 -m tunnel -E 3des-cbc 0xf6ddb555acfd9d77b03ea3843f2653255afe8eb5573965df -A hmac-md5 0x96358c90783bbfa3d7b196ceabe0536b; # Security policies apply to all packets 2 policies added to SPD spdadd 172.16.1.0/24 172.16.2.0/24 any -P out ipsec esp/tunnel/ 200.168.1.100-193.68.2.23 /require; spdadd 172.16.2.0/24 172.16.1.0/24 any -P in ipsec esp/tunnel/ 193.68.2.23-200.168.1.100 /require; 34 17

Another Example: AH in Transport Mode between R1 and R2 # Flush the SAD and SPD flush; spdflush; 2 SAs added to SAD 2 policies added to SPD # AH SAs using 128 bit long keys Add 200.168.1.100 193.68.2.23 ah 0x200 -A hmac-md5 0xc0291ff014dccdd03874d9e8e4cdf3e6; Add 193.68.2.23 200.168.1.100 ah 0x300 -A hmac-md5 0x96358c90783bbfa3d7b196ceabe0536b; # Security policies Spdadd 200.168.1.100 193.68.2.23 any -P out ipsec ah/transport//require; Spdadd 193.68.2.23 200.168.1.100 any -P in ipsec ah/transport//require; 35 Possible encryption algorithms DES 3DES AES RC5 IDEA 3-IDEA CAST Blowfish. 36 18

IPsec Security Suppose Trudy sits somewhere between R1 and R2. She doesn t know the keys. Will Trudy be able to see contents of original datagram? How about source, dest IP address, transport protocol, application port? Flip bits without detection? Masquerade as R1 using R1 s IP address? Replay a datagram? 37 Internet Key Exchange In previous examples, we manually established IPsec SAs in IPsec endpoints: Example SA SPI: 12345 Source IP: 200.168.1.100 Dest IP: 193.68.2.23 Protocol: ESP Encryption algorithm: 3DES-cbc HMAC algorithm: MD5 Encryption key: 0x7aeaca HMAC key:0xc0291f Such manually keying is impractical for large VPN with, say, hundreds of sales people. Instead use IPsec IKE (Internet Key Exchange) 38 19

IKE: PSK and PKI Authentication (proof who you are) with either pre-shared secret (PSK) or with PKI (pubic/private keys and certificates). With PSK, both sides start with secret: then run IKE to authenticate each other and to generate IPsec SAs (one in each direction), including encryption and authentication keys With PKI, both sides start with public/private key pair and certificate. run IKE to authenticate each other and obtain IPsec SAs (one in each direction). Similar with handshake in SSL. 39 Summary of relationship between SPD, IKE, and SAD: Note that SA must first be established between the two IKEs 40 20

Note that BYPASS IPsec is a possible policy for nonsensitive traffic that requires no security processing. 41 PROTOCOL = 50 or 51 42 21

Before a pair of security gateways can exchange user data protected by IPsec, they must complete a preliminary handshake, the Internet Key Exchange. During the handshake they establish algorithms, keys that will be used, and authenticate each other. IKE itself has two phases: phase 1: a secure channel, the IKE Security Association pair is set up between the two security gateways phase 2: the two gateways use this channel to negotiate safely one or more IPsec SA pairs that will be used to protect transfer of user data between the two intranets Both phases must be complete before user data can flow 43 First we must establish a secure channel between the two security gateways the IKE SA Then the SPD tells IKE what SAs are needed for user traffic. IKE negotiates the user SAs and enters them in the SAD. 44 22

IKE Phases IKE has two phases Phase 1: Establish bi-directional IKE SA Note: IKE SA different from IPsec SA Also called ISAKMP security association Phase 2: ISAKMP is used to securely negotiate the IPsec pair of SAs Phase 1 has two modes: aggressive mode and main mode Aggressive mode uses fewer messages Main mode provides identity protection and is more flexible 45 Diffie-Hellman (DH) Key Exchange 1. A B: K a = g a mod p 2. B A: K b = g b mod p Given (g, g a ) hard to compute a Discrete Logarithm Assumption 3. A outputs K ab = K b a 4. B outputs K ba = K a b Note K ab = K ba = g ab mod p 46 23

Security of DH key exchange No authentication of either party Secure only against a passive adversary Under the computational Diffie-Hellman assumption Given (g, g a,g b ), hard to compute g ab Not secure against an active attacker Man-in-the-middle attack 47 Authenticated DH Key Exchange 1. A B: K a = g a mod p 2. B A: Cert b, K b = g b mod p Sig SKb (K b, K a ) 3. A B: Cert a, Sig SKa (K a,k b ) 4. A outputs K ab = K b a 5. B outputs K ba = K a b 48 24

IKE phase 1: The Identity Protection Exchange consists of 6 messages: Messages (1) and (2): Peers negotiate algorithms to be used for establishment of the secure channel between security gateways Messages (3) and (4) generate the keys to be used Messages (5) and (6) authenticate the peers. 49 IKE Phase 2 We could go through the six-message exchange again, selecting algorithms, producing totally new keys and checking authentication. Instead, use Quick Mode, which takes just three messages. Quick Mode accepts the choice of algorithms made in phase1. It also accepts the DH key generated in phase 1, but hashes it to make new keys ( new keys from old ) End of Handshake. IKE and IPSec Security Associations established. We can proceed to transmit user data. 50 25

Summary of IPsec IKE message exchange for algorithms, secret keys, SPI numbers Either the AH or the ESP protocol (or both) The AH protocol provides integrity and source authentication The ESP protocol (with AH) additionally provides encryption IPsec peers can be two end systems, two routers/firewalls, or a router/firewall and an end system 51 Further Reading Stallings Chapter 9 52 26