Lecture 7: Network Level Security – IPSec CS 336/536: Computer Network Security Fall 2013 Nitesh Saxena Adopted from previous lecture by Keith Ross, and.

Slides:



Advertisements
Similar presentations
IP Security have considered some application specific security mechanisms –eg. S/MIME, PGP, Kerberos, SSL/HTTPS however there are security concerns that.
Advertisements

CS470, A.SelcukIPsec – AH & ESP1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Internet Security CSCE 813 IPsec
IPSec: Authentication Header, Encapsulating Security Payload Protocols CSCI 5931 Web Security Edward Murphy.
IP Security. n Have a range of application specific security mechanisms u eg. S/MIME, PGP, Kerberos, SSL/HTTPS n However there are security concerns that.
Information System Security AABFS-Jordan Summer 2006 IP Security Supervisor :Dr. Lo'ai Ali Tawalbeh Done by: Wa’el Musa Hadi.
Cryptography and Network Security Chapter 16 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
Chapter 5 Network Security Protocols in Practice Part I
IPsec Internet Headquarters Branch Office SA R1 R2
IP SECURITY – Chapter 16 IP SECURITY – Chapter 16 Security Mechanisms: – S/MIME, PGP client/server - Kerberos web access - Secure Sockets Layer network.
Chapter 13 IPsec. IPsec (IP Security)  A collection of protocols used to create VPNs  A network layer security protocol providing cryptographic security.
ECE 454/CS 594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall.
1 Lecture 15: IPsec AH and ESP IPsec introduction: uses and modes IPsec concepts –security association –security policy database IPsec headers –authentication.
Henric Johnson1 Ola Flygt Växjö University, Sweden IP Security.
Henric Johnson1 Chapter 6 IP Security. Henric Johnson2 Outline Internetworking and Internet Protocols IP Security Overview IP Security Architecture Authentication.
IP Security. Overview In 1994, Internet Architecture Board (IAB) issued a report titled “Security in the Internet Architecture”. This report identified.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Crypto – chapter 16 - noack Introduction to network stcurity Chapter 16 - Stallings.
Cryptography and Network Security
1 Pertemuan 11 IPSec dan SSL Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
1 IPsec Youngjip Kim Objective Providing interoperable, high quality, cryptographically-based security for IPv4 and IPv6 Services  Access.
Chapter 6 IP Security. Outline Internetworking and Internet Protocols (Appendix 6A) IP Security Overview IP Security Architecture Authentication Header.
IP Security. IPSEC Objectives n Band-aid for IPv4 u Spoofing a problem u Not designed with security or authentication in mind n IP layer mechanism for.
IP Security: Security Across the Protocol Stack
Cosc 4765 SSL/TLS and VPN. SSL and TLS We can apply this generally, but also from a prospective of web services. Multi-layered: –S-http (secure http),
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
CSCE 715: Network Systems Security
SMUCSE 5349/49 IP Sec. SMUCSE 5349/7349 Basics Network-level: all IP datagrams covered Mandatory for next-generation IP (v6), optional for current-generation.
IPSec IPSec provides the capability to secure communications across a LAN, across private and public wide area networks (WANs) and across the Internet.
Security at different layers
8-1 Chapter 8 Security Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 part 4: Securing IP.
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
Karlstad University IP security Ge Zhang
Network Security David Lazăr.
IPsec Introduction 18.2 Security associations 18.3 Internet Security Association and Key Management Protocol (ISAKMP) 18.4 Internet Key Exchange.
IP Security.  In CERTs 2001 annual report it listed 52,000 security incidents  the most serious involving:  IP spoofing intruders creating packets.
IPSec ● IP Security ● Layer 3 security architecture ● Enables VPN ● Delivers authentication, integrity and secrecy ● Implemented in Linux, Cisco, Windows.
1 Virtual Private Networks (VPNs) and IP Security (IPSec) G53ACC Chris Greenhalgh.
IP Security: Security Across the Protocol Stack. IP Security There are some application specific security mechanisms –eg. S/MIME, PGP, Kerberos, SSL/HTTPS.
Chapter 8 IP Security MSc. NGUYEN CAO DAT Dr. TRAN VAN HOAI.
IP security Ge Zhang Packet-switched network is not Secure! The protocols were designed in the late 70s to early 80s –Very small network.
IPSec and TLS Lesson Introduction ●IPSec and the Internet key exchange protocol ●Transport layer security protocol.
1 Lecture 13 IPsec Internet Protocol Security CIS CIS 5357 Network Security.
Internet Security CSCE 813 IPsec. CSCE813 - Farkas2 TCP/IP Protocol Stack Application Layer Transport Layer Network Layer Data Link Layer.
Cryptography and Network Security (CS435) Part Thirteen (IP Security)
IPSec  general IP Security mechanisms  provides  authentication  confidentiality  key management  Applications include Secure connectivity over.
IPSec – IP Security Protocol By Archis Raje. What is IPSec IP Security – set of extensions developed by IETF to provide privacy and authentication to.
IPSec is a suite of protocols defined by the Internet Engineering Task Force (IETF) to provide security services at the network layer. standard protocol.
1 IPSec: An Overview Dr. Rocky K. C. Chang 4 February, 2002.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Network Layer Security Network Systems Security Mort Anvari.
K. Salah1 Security Protocols in the Internet IPSec.
8-1Network Security Virtual Private Networks (VPNs) motivation:  institutions often want private networks for security.  costly: separate routers, links,
@Yuan Xue CS 285 Network Security IP Security Yuan Xue Fall 2013.
第六章 IP 安全. Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
VIRTUAL PRIVATE NETWORKS Lab 8. 2 Virtual Private Networks (VPNs)  Institutions often want private networks for security.  Costly! Separate routers,
Lecture 9: Network Level Security – IPSec
VPNs & IPsec Dr. X Slides adopted by Prof. William Enck, NCSU.
UNIT 7- IP Security 1.IP SEC 2.IP Security Architecture
CSE 4905 IPsec.
Chapter 18 IP Security  IP Security (IPSec)
IPSec IPSec is communication security provided at the network layer.
CSE565: Computer Security Lecture 23 IP Security
Cryptography and Network Security
IP Security and VPN Most of the slides are derived from the slides (Chapter-8) by the authors of «Computer Networking: A Top Down Approach», and from the.
Slides have been taken from:
Virtual Private Networks (VPNs)
Virtual Private Networks (VPNs)
Presentation transcript:

Lecture 7: Network Level Security – IPSec CS 336/536: Computer Network Security Fall 2013 Nitesh Saxena Adopted from previous lecture by Keith Ross, and Tony Barnard

Course Admin Mid-Term Exam – Hope it went well – Will provide solution set soon – We are grading HW2 – Will provide solution set soon – We are grading 8/25/2015Lecture 7 - SSL/TLS2

Course Admin HW3 Posted – Covers SSL/TLS (lecture 7) – Due 11am on Nov 11 (Monday) – Lab exercise involves capturing SSL/TLS packets using Wireshark – Labs active this Friday, and next Friday 8/25/2015Lecture 7 - SSL/TLS3

Outline IPSec – Modes and Protocols – IKE Protocol Basics 8/25/2015Lecture 7 - SSL/TLS4

5 Relative Location of Security Facilities in the TCP/IP Protocol Stack IKE UDP Which Layer to Add Security to?

6 Security at different layers r Application layer: PGP r Transport layer: SSL r Network layer: IPsec r Link layer: WEP / i IPsec approach: IPsec TCP/UDP/ICMP HTTP/SMTP/IM IPsec can provide security between any pair of network-layer entities (eg, between two hosts, two routers, or a host and a router).

7 IP Security r IP datagrams have no inherent security m IP source address can be spoofed m Content of IP datagrams can be sniffed m Content of IP datagrams can be modified m IP datagrams can be replayed r IPSec is a method for protecting IP datagrams m Standardized by IETF: dozens of RFCs. m Only sender and receiver have to be IPsec compliant Rest of network can be regular IP

8 What is security at the network- layer? Between two network entities: r Sending entity encrypts/authenticates the payloads of datagrams. Payload could be: m TCP segment, UDP segment, ICMP message, OSPF (routing) message, and so on. r All data sent from one entity to the other would be hidden: m Web pages, , P2P file transfers, TCP SYN packets, and so on. r That is, “blanket coverage”.

9 Virtual Private Networks (VPNs) r Institutions often want private networks for security. m Costly! Separate routers, links, DNS infrastructure. r With a VPN, institution’s inter-office traffic is sent over public Internet instead. m But inter-office traffic is encrypted and/or authenticated before entering public Internet

10 IP header IPsec header Secure payload IP header IPsec header Secure payload IP header IPsec header Secure payload IP header payload IP header payload headquarters branch office salesperson in hotel Public Internet laptop w/ IPsec Router w/ IPv4 and IPsec Router w/ IPv4 and IPsec Virtual Private Network (VPN)

11 IPsec services r Integrity r Authentication r Replay attack prevention r Confidentiality r Two modes: m Transport and Tunnel r Two protocols providing different service models: m AH – Authentication Header m ESP – Encrypted Security Payload

12 IPSec Modes: Transport and Tunnel Modes r Transport Mode provides protection primarily for upper-layer protocols – that is, for the IP datagram payload. m Transport mode is typically used in end-to-end communication between two hosts. r Tunnel Mode extends protection to the entire datagram, by encapsulating it in a new “outer” datagram. m Tunnel mode is typically used in communication between two routers (must be used if a router is involved).

13 IPsec Transport Mode r IPsec datagram emitted and received by end-system. r Protects upper level protocols IPsec

14 IPsec – tunneling mode (1) r End routers are IPsec aware. Hosts need not be. IPsec

15 IPsec – tunneling mode (2) r Also tunneling mode. IPsec

IPSec protocols r Authentication Header (AH) protocol m provides source authentication & integrity but not confidentiality r Encapsulation Security Protocol (ESP) m provides source authentication, integrity, and confidentiality m more widely used than AH 16

17 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

18 Security associations (SAs) r Before sending data, a virtual connection is established from sending entity to receiving entity. r Called “security association (SA)” m SAs are simplex: for only one direction r Both sending and receiving entites maintain state information about the SA m Recall that TCP endpoints also maintain state information. m IP is connectionless; IPsec is connection-oriented! r How many SAs in VPN w/ headquarters, branch office, and n traveling salesperson?

19 Tunnel Mode and Transport Mode Functionality

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

21 ESP in tunnel mode VPN ESP in tunnel mode over the VPN also conceals the fact that Alice is talking to Bob Alice Bob

22 Original datagram ESP in transport mode ESP in tunnel mode Protocol = 6 Protocol = 50 Next = 6 Next = 4 Scope of ESP encryption and authentication ESP authentication does not extend to the IP header

/ /24 SA Internet Headquarters Branch Office R1 R2 Example SA from R1 to R2 R1 stores for SA r 32-bit identifier for SA: Security Parameter Index (SPI) r the origin interface of the SA ( ) r destination interface of the SA ( ) r type of encryption to be used (for example, 3DES with CBC) r encryption key r type of integrity check (for example, HMAC with with MD5) r authentication key

24 Security Association Database (SAD) r Endpoint holds state of its SAs in a SAD, where it can locate them during processing. r With n salespersons, 2 + 2n SAs in R1’s SAD r When sending IPsec datagram, R1 accesses SAD to determine how to process datagram. r When IPsec datagram arrives to R2, R2 examines SPI in IPsec datagram, indexes SAD with SPI, and processes datagram accordingly.

25 IPsec datagram Focus for now on tunnel mode with ESP new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth encrypted “enchilada” authenticated padding pad length next header SPI Seq #

26 What happens? / /24 SA Internet Headquarters Branch Office R1 R2 new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth encrypted “enchilada” authenticated padding pad length next header SPI Seq #

27 R1 converts original datagram into IPsec datagram r Appends to back of original datagram (which includes original header fields!) an “ESP trailer” field. r Encrypts result using algorithm & key specified by SA. r Appends to front of this encrypted quantity the “ESP header, creating “enchilada”. r Creates authentication MAC over the whole enchilada, using algorithm and key specified in SA; r Appends MAC to back of enchilada, forming payload; r Creates brand new IP header, with all the classic IPv4 header fields, which it appends before payload.

28 Inside the enchilada: r ESP trailer: Padding for block ciphers r ESP header: m SPI, so receiving entity knows what to do m Sequence number, to thwart replay attacks r MAC in ESP auth field is created with shared secret key new IP header ESP hdr original IP hdr Original IP datagram payload ESP trl ESP auth encrypted “enchilada” authenticated padding pad length next header SPI Seq #

29 IPsec sequence numbers r For new SA, sender initializes seq. # to 0 r Each time datagram is sent on SA: m Sender increments seq # counter m Places value in seq # field r Goal: m Prevent attacker from sniffing and replaying a packet Receipt of duplicate, authenticated IP packets may disrupt service r Method: m Destination checks for duplicates m But doesn’t keep track of ALL received packets; instead uses a window

30 Algorithm at receiver 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 N is highest sequence # rcvd. Default W=64

31 Security Policy Database (SPD) r Policy: For a given datagram, sending entity needs to know if it should use IPsec. r Needs also to know which SA to use m May use: source and destination IP address; protocol number. r Info in SPD indicates “what” to do with arriving datagram; r Info in the SAD indicates “how” to do it.

32 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.

33 Linux example: ESP in tunnel mode 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 / /24 SA Internet Headquarters Branch Office R1 R2

34 # Flush the SAD and SPD flush; spdflush; # SAs encrypt w/ 192 bit keys & auth w/ 128 bit keys Add esp 0x201 -m tunnel -E 3des-cbc 0x7aeaca3f87d060a12f4a4487d5a5c fae69a96c831 -A hmac-md5 0xc0291ff014dccdd03874d9e8e4cdf3e6; Add esp 0x301 -m tunnel -E 3des-cbc 0xf6ddb555acfd9d77b03ea3843f afe8eb df -A hmac-md5 0x96358c90783bbfa3d7b196ceabe0536b; # Security policies spdadd / /24 any -P out ipsec esp/tunnel/ /require; spdadd / /24 any -P in ipsec esp/tunnel/ /require; setkey.conf for R1 2 SAs added to SAD SPI ESP protocol 2 policies added to SPD apply to all packets

35 # Flush the SAD and SPD flush; spdflush; # AH SAs using 128 bit long keys Add ah 0x200 -A hmac-md5 0xc0291ff014dccdd03874d9e8e4cdf3e6; Add ah 0x300 -A hmac-md5 0x96358c90783bbfa3d7b196ceabe0536b; # Security policies Spdadd any -P out ipsec ah/transport//require; Spdadd any -P in ipsec ah/transport//require; Another Example: AH in Transport Mode between R1 and R2 2 SAs added to SAD 2 policies added to SPD

36 Possible encryption algorithms r DES r 3DES r AES r RC5 r IDEA r 3-IDEA r CAST r Blowfish r ….

IPsec Security r Suppose Trudy sits somewhere between R1 and R2. She doesn’t know the keys. m Will Trudy be able to see contents of original datagram? How about source, dest IP address, transport protocol, application port? m Flip bits without detection? m Masquerade as R1 using R1’s IP address? m Replay a datagram? 37

38 Internet Key Exchange r In previous examples, we manually established IPsec SAs in IPsec endpoints: Example SA SPI: Source IP: Dest IP: Protocol: ESP Encryption algorithm: 3DES-cbc HMAC algorithm: MD5 Encryption key: 0x7aeaca… HMAC key: 0xc0291f … r Such manually keying is impractical for large VPN with, say, hundreds of sales people. r Instead use IPsec IKE (Internet Key Exchange)

39 IKE: PSK and PKI r Authentication (proof who you are) with either m pre-shared secret (PSK) or m with PKI (pubic/private keys and certificates). r With PSK, both sides start with secret: m then run IKE to authenticate each other and to generate IPsec SAs (one in each direction), including encryption and authentication keys r With PKI, both sides start with public/private key pair and certificate. m run IKE to authenticate each other and obtain IPsec SAs (one in each direction). m Similar with handshake in SSL.

40 Summary of relationship between SPD, IKE, and SAD: Note that SA must first be established between the two IKEs

41 Note that BYPASS IPsec is a possible policy for non- sensitive traffic that requires no security processing.

42 PROTOCOL = 50 or 51

43 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

44 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.

45 IKE Phases r IKE has two phases m Phase 1: Establish bi-directional IKE SA Note: IKE SA different from IPsec SA Also called ISAKMP security association m Phase 2: ISAKMP is used to securely negotiate the IPsec pair of SAs r Phase 1 has two modes: aggressive mode and main mode m Aggressive mode uses fewer messages m Main mode provides identity protection and is more flexible

Diffie-Hellman (DH) Key Exchange 1. A  B: K a = g a mod p 2. B  A:K b = g b mod p 3. A outputs K ab = K b a 4. B outputs K ba = K a b r Note K ab = K ba = g ab mod p 46 Given (g, g a ) hard to compute a – Discrete Logarithm Assumption

Security of DH key exchange r No authentication of either party r Secure only against a passive adversary m Under the computational Diffie-Hellman assumption Given (g, g a,g b ), hard to compute g ab r Not secure against an active attacker m 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

49 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.

50 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.

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

Further Reading r Stallings Chapter 9 52