Download presentation
Presentation is loading. Please wait.
Published byHerbert Weaver Modified over 8 years ago
1
Chapter 8 Network Security Thanks and enjoy! JFK/KWR All material copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
2
Chapter 8 roadmap 8.1 What is network security? 8.2 Principles of cryptography 8.3 Message integrity 8.4 Securing e-mail 8.5 Securing TCP connections: SSL 8.6 Network layer security: IPsec 8.7 Securing wireless LANs 8.8 Operational security: firewalls and IDS
3
3 What is confidentiality at the network-layer? Between two network entities: r Sending entity encrypts the payloads of datagrams. Payload could be: m TCP segment, UDP segment, ICMP message, OSPF message, and so on. r All data sent from one entity to the other would be hidden: m Web pages, e-mail, P2P file transfers, TCP SYN packets, and so on. r That is, “blanket coverage”.
4
4 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 before entering public Internet
5
5 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)
6
6 IPsec services r Data integrity r Origin authentication r Replay attack prevention r Confidentiality r Two protocols providing different service models: m AH (Authentication Header) m ESP (Encapsulation Security Payload)
7
7 IPsec Transport Mode r IPsec datagram emitted and received by end-system. r Protects upper level protocols IPsec
8
8 IPsec – tunneling mode (1) r End routers are IPsec aware. Hosts need not be. r Being more appropriate for VPN r More widely deployed than the transport mode IPsec
9
9 IPsec – tunneling mode (2) r Also tunneling mode. IPsec
10
Two protocols r Authentication Header (AH) protocol m provides source authentication & data integrity but not confidentiality r Encapsulation Security Protocol (ESP) m provides source authentication,data integrity, and confidentiality m more widely used than AH 10
11
11 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
12
12 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?
13
13 193.68.2.23 200.168.1.100 172.16.1/24 172.16.2/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 (200.168.1.100) r destination interface of the SA (193.68.2.23) 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
14
14 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.
15
15 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 #
16
16 What happens? 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 ESP trl ESP auth encrypted “enchilada” authenticated padding pad length next header SPI Seq #
17
17 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.
18
18 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 #
19
19 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
20
20 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; m it should be converted to an Ipsec datagram? m which SA should be used to construct the IPSec datagram? r Info in the SAD indicates “how” to do it.
21
Summary: IPsec services 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? 21
22
22 Internet Key Exchange r 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 … r Such manually keying is impractical for large VPN with, say, hundreds of sales people. r Instead use IPsec IKE (Internet Key Exchange)
23
23 IKE Phases r IKE has two phases m Phase 1: Establish bi-directional IKE SA Note: IKE SA different from IPsec SA Keys are establish for encryption and authentication for the IKE SA (Diffie-Hellman) Master secret key is established to compute IPSec SA keys in phase 2 m Phase 2: used to securely negotiate the IPsec pair of SAs both sides reveal their identity (over the secured IKE SA channel)
24
24 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
25
Chapter 8 roadmap 8.1 What is network security? 8.2 Principles of cryptography 8.3 Message integrity 8.4 Securing e-mail 8.5 Securing TCP connections: SSL 8.6 Network layer security: IPsec 8.7 Securing wireless LANs 8.8 Operational security: firewalls and IDS
26
26 WEP Design Goals r Symmetric key crypto m Confidentiality m Station authorization m Data integrity r Self synchronizing: each packet separately encrypted m Given encrypted packet and key, can decrypt; can continue to decrypt packets when preceding packet was lost m Unlike Cipher Block Chaining (CBC) in block ciphers r Efficient m Can be implemented in hardware or software r WEP does not specify a key management algorithm
27
27 Review: Symmetric Stream Ciphers r Combine each byte of keystream with byte of plaintext to get ciphertext r m(i) = ith unit of message r ks(i) = ith unit of keystream r c(i) = ith unit of ciphertext r c(i) = ks(i) m(i) ( = exclusive or) r m(i) = ks(i) c(i) r WEP uses RC4 keystream generator key keystream
28
28 Stream cipher and packet independence r Recall design goal: each packet separately encrypted r If for frame n+1, use keystream from where we left off for frame n, then each frame is not separately encrypted m Need to know where we left off for packet n r WEP approach: initialize keystream with key + new IV for each packet: keystream generator Key+IV packet keystream packet
29
29 WEP encryption (1) r Sender calculates Integrity Check Value (ICV) over data m four-byte hash/CRC for data integrity r Each side has 104-bit shared key r Sender creates 24-bit initialization vector (IV), appends to key: gives 128-bit key r Sender also appends keyID (in 8-bit field) r 128-bit key inputted into pseudo random number generator to get keystream r data in frame + ICV is encrypted with RC4: m Bytes of keystream are XORed with bytes of data & ICV m IV & keyID are appended to encrypted data to create payload m Payload inserted into 802.11 frame encrypted dataICVIV MAC payload Key ID
30
30 WEP encryption (2) New IV for each frame
31
31 WEP decryption overview r Receiver extracts IV r Inputs IV and shared secret key into pseudo random generator, gets keystream r XORs keystream with encrypted data to decrypt data + ICV r Verifies integrity of data with ICV m Note that message integrity approach used here is different from the MAC (message authentication code) and signatures. encrypted dataICVIV MAC payload Key ID
32
32 End-point authentication w/ nonce Nonce: number (R) used only once –in-a-lifetime How: to prove Alice “live”, Bob sends Alice nonce, R. Alice must return R, encrypted with shared secret key “I am Alice” R K (R) A-B Alice is live, and only Alice knows key to encrypt nonce, so it must be Alice!
33
33 WEP Authentication AP authentication request nonce (128 bytes) nonce encrypted shared key success if decrypted value equals nonce Not all APs do it, even if WEP is being used. AP indicates if authentication is necessary in beacon frame. Done before association.
34
Breaking 802.11 WEP encryption security hole: r 24-bit IV, one IV per frame, -> IV’s eventually reused r IV transmitted in plaintext -> IV reuse detected r attack: m Trudy causes Alice to encrypt known plaintext d 1 d 2 d 3 d 4 … m Trudy sees: c i = d i XOR k i IV m Trudy knows c i d i, so can compute k i IV m Trudy knows encrypting key sequence k 1 IV k 2 IV k 3 IV … m Next time IV is used, Trudy can decrypt!
35
802.11i: improved security r numerous (stronger) forms of encryption possible r provides key distribution r uses authentication server separate from access point
36
AP: access point AS: Authentication server wired network STA: client station 1 Discovery of security capabilities 3 STA and AS mutually authenticate, together generate Master Key (MK). AP servers as “pass through” 2 3 STA derives Pairwise Master Key (PMK) AS derives same PMK, sends to AP 4 STA, AP use PMK to derive Temporal Key (TK) used for message encryption, integrity 802.11i: four phases of operation
37
wired network EAP TLS EAP EAP over LAN (EAPoL) IEEE 802.11 RADIUS UDP/IP EAP: extensible authentication protocol r EAP: end-end client (mobile) to authentication server protocol m EAP-TLS authentication scheme is often used, uses public key techniques r EAP sent over separate “links” m mobile-to-AP (EAP over LAN) m AP to authentication server (RADIUS over UDP)
38
Chapter 8 roadmap 8.1 What is network security? 8.2 Principles of cryptography 8.3 Message integrity 8.4 Securing e-mail 8.5 Securing TCP connections: SSL 8.6 Network layer security: IPsec 8.7 Securing wireless LANs 8.8 Operational security: firewalls and IDS
39
Firewalls isolates organization’s internal net from larger Internet, allowing some packets to pass, blocking others. firewall administered network public Internet firewall
40
Firewalls: Why prevent denial of service attacks: m SYN flooding: attacker establishes many bogus TCP connections, no resources left for “real” connections prevent illegal modification/access of internal data. m e.g., attacker replaces CIA’s homepage with something else allow only authorized access to inside network (set of authenticated users/hosts) three types of firewalls: m stateless packet filters (=traditional packet filters) m stateful packet filters m application gateways
41
Stateless packet filtering r internal network connected to Internet via router firewall r router filters packet-by-packet, decision to forward/drop packet based on: m source IP address, destination IP address m TCP/UDP source and destination port numbers m ICMP message type m TCP SYN and ACK bits Should arriving packet be allowed in? Departing packet let out?
42
Stateless packet filtering: example r example 1: block incoming and outgoing datagrams with IP protocol field = 17 and with either source or dest port = 23. m all incoming, outgoing UDP flows and telnet connections are blocked. r example 2: Block inbound TCP segments with ACK=0. m prevents external clients from making TCP connections with internal clients, but allows internal clients to connect to outside.
43
Policy Firewall Setting No outside Web access. Drop all outgoing packets to any IP address, port 80 No incoming TCP connections, except those for institution’s public Web server only. Drop all incoming TCP SYN packets to any IP except 130.207.244.203, port 80 Prevent Web-radios from eating up the available bandwidth. Drop all incoming UDP packets - except DNS and router broadcasts. Prevent your network from being used for a smurf DoS attack. Drop all ICMP packets going to a “broadcast” address (eg 130.207.255.255). Prevent your network from being tracerouted Drop all outgoing ICMP TTL expired traffic Stateless packet filtering: more examples
44
action source address dest address protocol source port dest port flag bit allow222.22/16 outside of 222.22/16 TCP> 102380 any allowoutside of 222.22/16 TCP80> 1023ACK allow222.22/16 outside of 222.22/16 UDP> 102353--- allowoutside of 222.22/16 UDP53> 1023---- denyall Access Control Lists r ACL: table of rules, applied top to bottom to incoming packets: (action, condition) pairs
45
Stateful packet filtering r stateless packet filter: heavy handed tool m admits packets that “make no sense,” e.g., dest port = 80, ACK bit set, even though no TCP connection established: action source address dest address protocol source port dest port flag bit allowoutside of 222.22/16 TCP80> 1023ACK r stateful packet filter: track status of every TCP connection m track connection setup (SYN), teardown (FIN): can determine whether incoming, outgoing packets “makes sense” m timeout inactive connections at firewall: no longer admit packets
46
action source address dest address proto source port dest port flag bit check conxion allow222.22/16 outside of 222.22/16 TCP> 102380 any allowoutside of 222.22/16 TCP80> 1023ACK x allow222.22/16 outside of 222.22/16 UDP> 102353--- allowoutside of 222.22/16 UDP53> 1023---- x denyall Stateful packet filtering r ACL augmented to indicate need to check connection state table before admitting packet
47
Application gateways r filters packets on application data as well as on IP/TCP/UDP fields. r example: allow select internal users to telnet outside. host-to-gateway telnet session gateway-to-remote host telnet session application gateway router and filter 1. require all telnet users to telnet through gateway. 2. for authorized users, gateway sets up telnet connection to dest host. Gateway relays data between 2 connections 3. router filter blocks all telnet connections not originating from gateway.
48
Limitations of firewalls and gateways r IP spoofing: router can’t know if data “really” comes from claimed source r if multiple app’s. need special treatment, each has own app. gateway. r client software must know how to contact gateway. m e.g., must set IP address of proxy in Web browser r filters often use all or nothing policy for UDP. r tradeoff: degree of communication with outside world, level of security r many highly protected sites still suffer from attacks.
49
Intrusion detection systems r packet filtering: m operates on TCP/IP headers only m no correlation check among sessions r IDS: intrusion detection system m deep packet inspection: look at packet contents (e.g., check character strings in packet against database of known virus, attack strings) m examine correlation among multiple packets port scanning network mapping DoS attack
50
Web server FTP server DNS server application gateway Internet demilitarized zone internal network firewall IDS sensors Intrusion detection systems r multiple IDSs: different types of checking at different locations
51
8: Network Security Network Security (summary) Basic techniques…... m cryptography (symmetric and public) m message integrity m end-point authentication …. used in many different security scenarios m secure email m secure transport (SSL) m IP sec m 802.11 Operational Security: firewalls and IDS
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.