48
CSE543 - Introduction to Computer and Network Security Page CSE543 Computer and Network Security Module: Network Security Professor Trent Jaeger 1 1

CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

  • Upload
    others

  • View
    10

  • Download
    1

Embed Size (px)

Citation preview

Page 1: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

CSE543 Computer and Network Security

Module: Network Security

Professor Trent Jaeger

1

1

Page 2: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Communication Security• Want to establish a secure channel to remote hosts

over an untrusted network‣ Users - when logging in to a remote host‣ Applications - when communicating across network‣ Hosts - when logically part of the same network

• The protection service must …‣ Authenticate the end-points (each other)‣ Negotiate what security is necessary (and how achieved)‣ Establish a secure channel (e.g., key distribution/agreement)‣ Process the traffic between the end points

• Also known as communications security.2

2

Page 3: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Users’ Communications Security• Login to a host over an untrusted network‣ Using unauthenticated login - telnet, rsh - up to this point

• Problems‣ How does user authenticate host?‣ How does host authenticate user?

3

3

Page 4: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH• Secure communication protocol…‣ Between user’s client and remote machine (server) ‣ Used to implement remote login‣ Runs on any transport layer (TCP/IP)

• Setup‣ Authentication agent on client • To produce and process messages on behalf of the

user‣ SSH Server• To handle user logins to that host• Forward X and TCP communications

• Remote machine use approximates local machine4

4

Page 5: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH Protocol• How to authenticate server-user and user-server?

• Users lack public keys• But, servers may hold login passwords of users

5

5

Page 6: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH Protocol• How to authenticate server-user and user-server?

• Users lack public keys• But, servers may hold login passwords of users

• How to establish a secure channel?• Between the client and server• For remote processing of commands

6

6

Page 7: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH Protocol• (1) Client opens connection to server• (2) Server responds with its host key and server key

• Public keys identifying server and enabling communication• (3) Client generates random number and encrypts

with host and server keys• (4) Server extracts random number (key) and can use

• Server is authenticated• (5) Server authenticates user

• Password and RSA authentication• (6) Preparatory phase

• To setup TCP/IP, X11 forwarding, etc.• (7) Interactive session phase

7

7

Page 8: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH Protocol• How to authenticate server-user and user-server?

• Users lack public keys• But, servers may hold login passwords of users

• Answer:

8

8

Page 9: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH Protocol• How to authenticate server-user and user-server?

• Users lack public keys• But, servers may hold login passwords of users

• Answer: Server public keys (host and server) and user passwords

• How are we sure that these are the legitimate public keys for the server?

9

9

Page 10: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH Protocol• How to authenticate server-user and user-server?

• Users lack public keys• But, servers may hold login passwords of users

• How to establish a secure channel?• Between the client and server• For remote processing of commands

• Answer:

10

10

Page 11: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSH Protocol• How to authenticate server-user and user-server?

• Users lack public keys• But, servers may hold login passwords of users

• How to establish a secure channel?• Between the client and server• For remote processing of commands

• Answer: Client chooses key

• How does client know what kind of key to pick?

11

11

Page 12: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

SSHv2 Protocol• A number of improvements were made to the

SSHv2 protocol (see Section 5)• Stronger use of crypto - better algorithms• Performance - 1.5 round trips on average• Prevent eavesdropping - encrypt all SSH

traffic• Prevent IP spoofing - always validates server

identity• Prevent hijacking - integrity checking using

HMAC• Not backwards compatible with SSHv1

12

12

Page 13: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Application Comm Security• Applications may want to construct secure

communication channels transparently to users• How can they do that?

13

13

Page 14: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

Application (Web) Security: SSL• Secure socket Layer (SSL/TLS) • Used to authenticate servers‣ Uses certificates, “root” CAs

• Can authenticate clients• Inclusive security protocol• Security at the socket layer‣ Transport Layer Security (TLS)‣ Provides• authentication• confidentiality• integrity

TCP

IP

SSL

HTTP

14

14

Page 15: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

Client Server

15

15-1

Page 16: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)

Client Server

15

15-2

Page 17: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

Client Server

15

15-3

Page 18: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

(3) Server Certificate

Client Server

15

15-4

Page 19: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

(3) Server Certificate

Client Server

15

15-5

Page 20: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

(3) Server Certificate(4) ClientKeyRequest

Client Server

15

15-6

Page 21: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

(3) Server Certificate(4) ClientKeyRequest(5) ChangeCipherSuiteClient Server

15

15-7

Page 22: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

(3) Server Certificate(4) ClientKeyRequest(5) ChangeCipherSuite(6) ChangeCipherSuite

Client Server

15

15-8

Page 23: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

(3) Server Certificate(4) ClientKeyRequest(5) ChangeCipherSuite(6) ChangeCipherSuite

(7) Finished

Client Server

15

15-9

Page 24: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Handshake

(1) Client Hello (algorithms,…)(2) Server Hello (alg. selection,…)

(3) Server Certificate(4) ClientKeyRequest(5) ChangeCipherSuite(6) ChangeCipherSuite

(7) Finished(8) Finished

Client Server

15

15-10

Page 25: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

Simplified Protocol DetailParticipants: Alice/A (client) and Bob/B (server)

Crypto Elements : Random R, Certificate C, k+i Public Key (of i)

Crypto Functions : Hash functionH(x), EncryptionE(k, d), DecryptionD(k, d),Keyed MAC HMAC(k, d)

1. Alice! Bob RA

2. Bob! Alice RB , CB

Alice pick pre-master secret SAlice calculate master secretK = H(S, RA, RB)

3. Alice! Bob E(k+B , S), HMAC(K,0 CLNT 0 + [#1,#2])

Bob recover pre-master secret S = D(k�B , E(k+B , S))

Bob calculate master secretK = H(S, RA, RB)

4. Bob! Alice HMAC(K,0 SRV R0 + [#1,#2])

Note: Alice and Bob : IV Keys, Encryption Keys, and Integrity Keys 6 keys,where

each key ki = gi(K, RA, RB), and gi is key generator function.

1

16

16

Page 26: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CMPSC443 - Introduction to Computer and Network Security Page

SSL Tradeoffs• Pros‣ Server authentication*‣ GUI clues for users‣ Built into every browser‣ Easy to configure on the server‣ Protocol has been analyzed like crazy

• Cons‣ Users don’t check certificates‣ Too easy to obtain certificates‣ Too many roots in the browsers‣ Some settings are terrible

17

17

Page 27: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

IPsec (not IPSec!)• Host-level protection service‣ IP-layer security (below TCP/UDP)‣ De-facto standard for host level security‣ Developed by the IETF (over many years)‣ Available in most operating systems/devices• E.g., XP, Vista, OS X, Linux, BSD*, …

‣ Implements a wide range of protocols and cryptographic algorithms

• Selectively provides ….‣ Confidentiality, integrity, authenticity, replay protection, DOS

protection

18

18

Page 28: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

IPsec and the IP protocol stack• IPsec puts the two main

protocols in between IP and the other protocols‣ AH - authentication header‣ ESP - encapsulating security

payload

• Other functions provided by external protocols and architectures

SMTPFTP

TCPHTTP

ESPAH

IP

UDP

19

19

Page 29: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Modes of operation• Transport : the payload is encrypted and the non-

mutable fields are integrity verified (via MAC)

• Tunnel : each packet is completely encapsulated (encrypted) in an outer IP packet ‣ Hides not only data, but some routing information

20

Header Payload Header Payload

encrypted

MACed

Header

Header Payload Header Payload

encryptedMACed

20

Page 30: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

21

21-1

Page 31: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

21

21-2

Page 32: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

21

21-3

Page 33: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-4

Page 34: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-5

Page 35: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-6

Page 36: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-7

Page 37: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-8

Page 38: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-9

Page 39: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-10

Page 40: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Tunneling• “IP over IP”‣ Network-level packets are encapsulated ‣ Allows traffic to evade firewalls

IP layer…

IP layer…

21

21-11

Page 41: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Authentication Header (AH)• Authenticity and integrity‣ via HMAC‣ over IP headers and data

• Advantage: the authenticity of data and IP header information is protected‣ it gets a little complicated with mutable fields, which are

supposed to be altered by network as packet traverses the network

‣ some fields are immutable, and are protected

• Confidentiality of data is not preserved• Replay protection via AH sequence numbers‣ note that this replicates some features of TCP (good?)

22

22

Page 42: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Authentication Header (AH)• Modifications to the packet format

23

IP Header AH HeaderMAC Payload

AH Packet

EncryptedAuthenticated

IP Header Payload

23

Page 43: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Encapsulating Security Payload (ESP)

• Confidentiality, authenticity and integrity‣ via encryption and HMAC‣ over IP payload (data)

• Advantage: the security manipulations are done solely on user data‣ TCP packet is fully secured‣ simplifies processing

• Use “null” encryption to get authenticity/integrity only• Note that the TCP ports are hidden when encrypted‣ good: better security, less is known about traffic‣ bad: impossible for FW to filter/traffic based on port

24

24

Page 44: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Encapsulating Security Payload (ESP)

• Modifications to packet format

25

IP Header ESP Header Payload ESP Trailer MAC

ESP Packet

EncryptedAuthenticated

IP Header Payload

25

Page 45: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Practical Issues and Limitations• IPsec implementations‣ Large footprint• resource poor devices are in trouble• New standards to simplify (e.g, JFK, IKE2)

‣ Slow to adopt new technologies‣ Configuration is really complicated/obscure

• Issues‣ IPsec tries to be “everything for everybody at all times” • Massive, complicated, and unwieldy

‣ Policy infrastructure has not emerged ‣ Large-scale management tools are limited (e.g., CISCO)‣ Often not used securely (common pre-shared keys)

26

26

Page 46: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Network Isolation: VPNs• Idea: I want to create a collection of hosts that operate

in a coordinated way‣ E.g., a virtual security perimeter over physical network‣ Hosts work as if they are isolated from malicious hosts

• Solution: Virtual Private Networks‣ Create virtual network topology over physical network‣ Use communications security protocol suites to secure

virtual links “tunneling”‣ Manage networks as if they are physically separate‣ Hosts can route traffic to regular networks (split-tunneling)

27

27

Page 47: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

VPN Example: RW/Telecommuter

Internet

LAN

(network edge)

Physical LinkLogical Link (IPsec)

28

28

Page 48: CSE543 Computer and Network Security Module: Network …trj1/cse543-f18/slides/cse543-network-protocols.pdfCSE543 - Introduction to Computer and Network Security Page SSH • Secure

CSE543 - Introduction to Computer and Network Security Page

Virtual LANs (VLANs)• VPNs built with hardware‣ Physically wire VPN via soft

configuration of a switch crossbar‣ No encryption – none needed‣ “wire based isolation”‣ Many switches support VLANs‣ Allows networks to be

reorganized without rewiring

• Example usage: two departments in same hallway‣ Each office is associated with

department‣ Configuring the network switch

gives physical isolation‣ Note: often used to ensure QoS

29

A B C D E

A

B

C

D

E

VLAN 1: A,BVLAN 2: C,D,E

29