Security at different layers

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

Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 4.2: IPsec.
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.
Lecture 24 Secure Communications CPE 401 / 601 Computer Network Systems Slides are modified from Jim Kurose & Keith Ross.
Cryptography and Network Security Chapter 16 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
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.
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.
K. Salah1 Security Protocols in the Internet IPSec.
Summer Workshop on Cyber Security Computer Networks Security (Part 2) Dr. Hamed Mohsenian-Rad University of California at Riverside and Texas Tech University.
Lecture 7: Network Level Security – IPSec CS 336/536: Computer Network Security Fall 2013 Nitesh Saxena Adopted from previous lecture by Keith Ross, and.
Lecture 23 Network Security (cont) CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger slides are modified from Jim Kurose,
Secure connections.
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),
IP Security Lawrence Taub IPSEC IP security — security built into the IP layer Provides host-to-host (or router-to-router) encryption and.
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.
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
Chapter 8 Network Security Thanks and enjoy! JFK/KWR All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking:
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.
1 CMPT 471 Networking II Authentication and Encryption © Janice Regan,
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.
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.
Real Security Protocols 1. Securing 2. Securing TCP connections: SSL 3. Network layer security: IPsec 4. Securing wireless LANs Computer Networking:
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
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.
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:

Security at different layers Link layer: WEP / 802.11i Application layer: PGP Transport layer: SSL Network layer: IPsec 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).

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

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

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 before entering public Internet

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

IPsec services Data integrity Origin authentication Replay attack prevention Confidentiality Two protocols providing different service models: AH ESP

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

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

IPsec – tunneling mode (2) Also tunneling mode.

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

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

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?

Example SA from R1 to R2 R1 stores for SA 193.68.2.23 200.168.1.100 172.16.1/24 172.16.2/24 SA Internet Headquarters Branch Office R1 R2 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

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.

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

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

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.

Inside the enchilada: ESP trailer: Padding for block ciphers new IP header ESP hdr original IP hdr Original IP datagram payload trl auth encrypted “enchilada” authenticated padding pad length next header SPI Seq # 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

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 sniffing and 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

Algorithm at receiver N is highest sequence # rcvd. Default W=64 If rcvd packet falls in window, packet is new, and MAC checks ➜ slot in window marked If rcvd packet is to right of window, MAC checks ➜ window advanced & right-most slot marked If rcvd packet is left of window, or already marked, or fails MAC check ➜ packet is discarded

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.

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

setkey.conf for R1 ESP protocol SPI 2 SAs added to SAD # Flush the SAD and SPD flush; spdflush; # SAs encrypt w/ 192 bit keys & auth w/ 128 bit keys 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 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; ESP protocol SPI 2 SAs added to SAD apply to all packets 2 policies added to SPD

Another Example: AH in Transport Mode between R1 and R2 # Flush the SAD and SPD flush; spdflush; # 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 2 SAs added to SAD 2 policies added to SPD

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

IPsec services 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?

IPsec vs. SSL SSL is in application; IPsec in OS IPsec protects all apps SSL is susceptible to a DoS attack: Attacker inserts bogus TCP segment into packet stream: with correct TCP checksum and seq #s TCP acks segment and sends segment’s payload up to SSL. SSL will discard since integrity check is bogus Real segment arrives: TCP rejects since it has the wrong seq # SSL never gets real segment SSL closes connection since it can’t provide lossless byte stream service What happens if an attacker inserts a bogus IPsec datagram? IPsec at receiver drops datagram since integrity check is bogus; not marked as arrived in seq # window Real segment arrives, passes integrity check and passed up to TCP – no problem!

Lab Topology Will need to work with another group m1 m1 m2 m2 m3 m3 subnet A subnet B Will need to work with another group But each group hands in a separate report

Lab: Use ESP protocol throughout Part 1: manual keying Setup IPsec between your group’s m1 and m3 using transport mode Part 2: manual keying Setup IPsec between m2 and partner’s m2 using tunnel mode Send traffic between m1 and partner’s m1 Part 3: manual keying Setup IPsec between m1 and partner’s m1 using transport mode

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)

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.

Linux example PSK (1) In each host, create 3 files: IPsec 172.16.1/24 172.16.2/24 In each host, create 3 files: racoon.conf setkey.conf psk.txt Execute racoon command in both hosts, which generates SAs

Linux example PSK (2) psk.txt racoon.conf setkey.conf Holds the preshared secret; access is protected racoon.conf Indicates IKE “mode” Cryptography preferences for phase 1 and phase 2 setkey.conf security policies section (similar with manual keying) But no security association block (since SAs established with IKE)

Linux example: certificates Use open SSL to generate public/private key pair and certificate in both hosts racoon.conf file Provides path to certificate IKE “mode” Whether correspondent’s certificate needs to be validated Cryptography algorithms for two IKE phases setkey.conf Similar for PSK No psk.txt file!

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

IKE lab Part 4: Part 5: IKE with PSK Transport mode IKE with certificates Tunnel mode

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