internet security 1 ( intsi1)

26
Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 1 Internet Security 1 (IntSi1) Prof. Dr. Andreas Steffen Institute for Internet Technologies and Applications (ITA) 13.6 Internet Key Exchange IKE

Upload: armen

Post on 24-Feb-2016

51 views

Category:

Documents


0 download

DESCRIPTION

Internet Security 1 ( IntSi1). 13.6 Internet Key Exchange IKE. Prof. Dr. Andreas Steffen Institute for Internet Technologies and Applications (ITA). IPsec – Automatic Key Management The Internet Key Exchange (IKE). Security Association (SA) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 1

Internet Security 1 (IntSi1)

Prof. Dr. Andreas Steffen

Institute for Internet Technologies and Applications (ITA)

13.6 Internet Key Exchange

IKE

Page 2: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 2

IPsec – Automatic Key ManagementThe Internet Key Exchange (IKE)

• Security Association (SA)• A Security Association is a contract established between two

IPsec endpoints (hosts or security gateways).• Negotiation of parameters to be used for the IPsec

connection.• ISAKMP SA (IKEv1) or IKE SA (IKEv2) protects the IKE

negotiation.• Separate IPsec SA required for each subnet or single host.• Separate IPsec SA required for inbound and outbound

connection.• IPsec SAs are assigned a unique Security Parameters Index

(SPI)and are maintained in a database.

• Negotiated Parameters • Authentication Mechanism (IKEv1 only, pre-shared key or

public key)• Encryption algorithm, Hash algorithm, PRF• Key exchange using Diffie-Hellman groups• Key lifetimes (IKEv1 only) for the ISAKMP and IPsec SAs.

Page 3: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 3

Internet Key Exchange – IKEv1 Main Mode

IKEHeader

DH KeyExchange Nr4

3IKEHeader

DH KeyExchange Ni

IKEHeader

ISAKMP SAProposal 1

IKEHeader

ISAKMP SAResponse2

5IKEHeader

encrypted

IDi Certi Sigi encryptedIKE

Header6 IDr Certr Sigr

• IKEv1 Quick Mode – another three messages to negotiate traffic selectors

ResponderInitiator UDP/500

Page 4: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 4

IKE Main Mode using Pre-Shared Keys

• Pre-shared key● is worked into Hash● is part of the IKE session key

IKEHeader

DH KeyExchange Nr4

3IKEHeader

DH KeyExchange Ni

IKEHeader

ISAKMP SAProposal 1

IKEHeader

ISAKMP SAResponse2

5IKEHeader

encrypted

IDi Hashi encryptedIKE

Header6 IDr Hashr

ResponderInitiator UDP/500

Page 5: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 5

IKE Aggressive Mode using PreShared Keys

• Unencrypted IKE Aggressive Mode messages carrying cleartext IDs can be easily sniffed by a passive attacker.

• Pre-Shared Key is worked into Hashr , together with other known parameters, so that an off-line cracking attack becomes possible.

ResponderInitiator

3Hashi

IKEHeader

ISAKMP SAProposal 1DH Key

Exchange Ni IDi

IKEHeader

ISAKMP SAResponse2 DH Key

Exchange Nr IDr Hashr

UDP/500

Page 6: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 6

Man-in-the-Middle Attack possiblewith IKE Aggressive Mode and XAUTH

VPN GatewayWLAN

Access Point

Attacker

Man-in-the-Middle

Wireless LAN User

VPN Client

Username:Password:

bodo

aznHu4Um

XAUTH

• With IKE Aggressive Mode, useOne-Time Password scheme (e.g. SecureID).

1

Group Password

2

bodoaznHu4Um

XAUTHGroup Password

Page 7: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 7

ISAKMP and IPsec Security Associations

09:00 #1 ISAKMP SA [email protected]

10:50 #6 IPsec SA

11:00 #7 IPsec SA

11:40 #8 ISAKMP SA

9 10 11 12

09:00 #2 IPsec SA rightsubnet=10.1.1.0/22

09:10 #3 IPsec SA rightsubnet=10.1.9.0/24

#4 IPsec SA09:50 rightsubnet=10.1.1.0/22

10:05 #5 IPsec SA rightsubnet=10.1.9.0/24

ikelifetime=3h keylife=1h

Page 8: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 8

IKE Phase 2 – Quick ModeEstablish or Renew an IPsec SA

• Negotiation of IPsec Parameters • Phase 2 Quick Mode establishes an IPsec SA using the secure

channel created by the phase 1 ISAKMP SA.• The specific configuration parameters for the IPsec

connection are negotiated (AH, ESP, authentication / encryption methods and parameters).

• Quick Mode can be used to renew IPSec SAs about to expire.• ESP/AH Key Derivation

• The ESP encryption and ESP/AH authentication keys for the IPsec SAs are derived from the Phase 1 Diffie-Hellman secret.

• Optional Perfect Forward Secrecy• If perfect forward secrecy is required, each consecutive

Quick Mode will do a fresh Diffie-Hellmann key-exchange.

Page 9: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 9

• Motivation for a new IKE RFC• IKEv1 is spread over three documents (RFCs 2407, 2408, and

2409)• Too many messages (6 in Main Mode plus 3 in Quick Mode)• Too many variants (AH/ESP, transport/tunnel, authentication

modes)• Too complex – therefore potentially insecure (Bruce Schneier)• Cookies not required when not under DoS attack• New features: NAT-T, Dead Peer Detection, etc.

• IKEv2 Protocol• IPsec SA can be established with 2 request/response pairs• Additional Child SAs require one request/response pair, each• EAP authentication modes supported (e.g. One-Time-

Passwords),replaces proprietary XAUTH

• New IKE configuration payload replaces proprietary Mode Config

• IKEv2 is not backwards compatible with IKEv1 !!!

The New Standard - IKEv2RFC 4306 (Dec. 2005) / RFC 5996 (Sep. 2010)

Page 10: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 10

IKEv2 – Authentication and first Child SA

• IKE_SA_INIT exchange pair

• IKE_AUTH exchange pair

IKEHeader 1SA1i KEi Ni

2 IKEHeader SA1r KEr Nr

3IKEHeader

encrypted

IDi Certi

Authi

IDr

SA2i TSi TSr

4

encrypted

IKEHeader IDr Certr Authr

SA2r TSi TSr

ResponderInitiator UDP/500

Page 11: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 11

Cookie Mechanism against DoS Attacks

IKEHeader 1SA1i KEi Ni

2 IKEHeader N(COOKIE)

ResponderInitiator UDP/500

4 IKEHeader SA1r KEr Nr

IKEHeader 3N(COOKIE)

SA1i KEi Ni

# strongswan.confcharon { dos_protection = yes cookie_threshold = 10 block_threshold = 5 }

Page 12: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 12

IKEv2 – Additional Child SAs

1IKEHeader

encrypted

N SAi Ni

KEi TSi TSr

2 IKEHeader

encrypted

SAr Nr

KEr TSi TSr

ResponderInitiator UDP/500

• CREATE_CHILD_SA exchange pair

• Rekeying IKE_SA: { SAi, Ni, KEi }• Rekeying CHILD_SA: { N(REKEY_SA), SAi, Ni, [KEi], TSi,

TSr }• Reauthentication: Start with IKE_SA from scratch

Page 13: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 13

IKEv2 Remote Access Scenario

#ipsec.conf for roadwarrior carol

conn home keyexchange=ikev2 left=%defaultroute leftsourceip=%config leftcert=carolCert.pem [email protected] leftfirewall=yes right=192.168.0.1 [email protected] rightsubnet=10.1.0.0/16 auto=start

#ipsec.secrets for roadwarrior carol

: RSA carolKey.pem "nH5ZQEWtku0RJEZ6"

#ipsec.secrets for gateway moon

: RSA moonKey.pem

#ipsec.conf for gateway moon

config setup plutostart=no #IKEv1 not needed

conn rw keyexchange=ikev2 left=%any

leftsubnet=10.1.0.0/24 leftcert=moonCert.pem [email protected] leftfirewall=yes right=%any rightsourceip=10.3.0.0/24 auto=add

Page 14: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 14

Internet Security 1 (IntSi1)

13.7 VPN Applications

Page 15: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 15

Virtual Private Networks

Internet

HeadQuarters Subsidiary

„Road Warrior“

VPN TunnelVPN Tunnel

VPN Gateway11.22.33.44

VPN Gateway55.66.77.88

VPN Client

10.1.0.0/16

10.2.0.0/16

10.3.0.210.1.0.5 10.2.0.3

55.66.x.x

Page 16: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 16

• Road Warrior sign on to their home network via IKE with varying IP addresses assigned dynamically by the local ISP.

The „Road Warrior“ Remote Access Case

InternetHome

Network IPsec Tunnel

VPN Gateway11.22.33.44

10.1.0.0/16 Road Warrior

55.66.x.xDynamic IP

Virtual IP10.3.0.2

• Authentication is usually based on RSA public keys and X.509 certificates issued by the home network.

• Virtual IP assigned statically or dynamically by the home network. Remote hosts thus become part of an extruded net.

Page 17: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 17

Windows 7 Agile VPN Client

• Gateway certificate must containhost name [or IP address] and the serverAuth extendedKeyUsage flag.

Page 18: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 18

strongSwan Applet for the Linux Desktop

• D-Bus based communication between NetworkManager and strongSwan daemon.

• If a CA root certificate is specified then the hostname [or IP address] of the VPN gateway must be contained as a subjectAltName in the received gateway certificate.

Page 19: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 19

strongSwan in a Mixed VPN Environment

Corporate Network

strongSwan

Linux Client

Windows 7Agile VPN

Client

LinuxFreeRadius

Server

Windows Active

Directory Server

Internet

High-AvailabilitystrongSwan

VPN Gateway

strongswan.hsr.ch

Page 20: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 20

Internet Security 1 (IntSi1)

13.8 VPN Features

Page 21: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 21

• IKEv1 - XAUTH (eXtended AUTHentication)• Proprietary extension used by many vendors (Cisco,

Checkpoint, etc.)• Based on expired draft-beaulieu-ike-xauth-02.txt

• IKEv2 - EAP (Extensible Authentication Protocol)• EAP-AKA, EAP-SIM, EAP-MSCHAPv2, EAP-MD5, EAP-GTC, EAP-

TLS, etc.• VPN client triggers EAP by omitting AUTH payload• VPN gateway must send public key AUTH payload first!

• VPN gateway relays authentication messages to and from AAA server (RADIUS, DIAMETER or LDAP)

Extended Authentication

VPN Gateway

AAA ServerIKEmessages

VPN Client

Page 22: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 22

• IKEv1 – Mode Config Payload• Proprietary extension used by many vendors (Cisco,

Checkpoint, etc.)• Based on expired draft draft-dukes-ike-mode-cfg-02.txt

• IKEv2 – Configuration Paiload• has official CP payload

• VPN gateway fetches configuration attributes from AAA server• Virtual IPv4 or IPv6 address• Internal DNS and WINS servers• Proprietary attributes (Cisco Unity, Microsoft, 3GPP, etc.)

Configuration Payload

IKEmessages

VPN Client

AAA Server

Page 23: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 23

IPsec Passthrough (Transparent IPsec Connection)

• ADSL and Cable routers use Network Address Translation (NAT) to connect one or several hosts sitting behind the router access to the Internet.

• IPsec passthrough forwards ESP und IKE packets to a preconfigured host behind the NAT router.

• Drawback: Each router model is configured differently, causing exorbitant costs supporting individual users.

ESP and IKE from a single VPN client

10.3.0.2 UDP/500 55.66.x.x UDP/500

10.3.0.2 ESP 55.66.x.x ESP

11.22.33.44 UDP/500

11.22.33.44 ESP

Page 24: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 24

NAT-Traversal (UDP encapsulation of ESP packets)

• NAT-Traversal is used if several VPN clients want to set up secure tunnels through a common router doing NAT.

• Typical Applications: WLAN hotspots, hotels, conferences,mobility via GSM/GPRS.

• NAT-Traversal facilitates remote access e.g. working at home.

ESP and IKE from several VPN clients

10.3.0.3 UDP/4500 55.66.x.x UDP/1026

10.3.0.2 UDP/4500 55.66.x.x UDP/1025

11.22.33.44 UDP/4500

11.22.33.44 UDP/4500

Page 25: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 25

ESP-in-UDP Encapsulation (RFC 3948)

Src Port (4500) Dst Port (4500)Length ChecksumSecurity Parameters Index

UDP Header

ESP Header

Src Port (4500) Dst Port (4500)Length Checksum

0x00IKE Header

UDP Header

IKE HeaderNon-ESP Marker0x00 0x00 0x00

Src Port (4500) Dst Port (4500)Length Checksum

0xFF

UDP Header

Keepalive Payload

• NAT-Keepalive Packet Format

• IKE Header Format for Port 4500

• UDP-Encapsulated ESP Header Format

Page 26: Internet  Security 1  ( IntSi1)

Andreas Steffen, 7.12.2011, 13.6-IKE.pptx 26

IKEv2 Dead Peer Detection

#ipsec.conf for roadwarrior carolconn %default dpddelay=60 dpdaction=restart

#ipsec.conf for gateway moonconn %default dpddelay=60 dpdaction=clear

Oct 24 11:45:10 13[IKE] CHILD_SA home{1} established with SPIs c50810d9_i c8485f4a_o Oct 24 11:46:10 16[NET] received packet: from 192.168.0.1[500] to 192.168.0.100[500] Oct 24 11:46:10 16[ENC] parsed INFORMATIONAL request 0 [ ] Oct 24 11:46:10 16[ENC] generating INFORMATIONAL response 0 [ ] Oct 24 11:46:10 16[NET] sending packet: from 192.168.0.100[500] to 192.168.0.1[500] Oct 24 11:47:09 09[IKE] sending DPD request Oct 24 11:47:09 09[ENC] generating INFORMATIONAL request 2 [ ] Oct 24 11:47:09 09[NET] sending packet: from 192.168.0.100[500] to 192.168.0.1[500] Oct 24 11:47:13 03[IKE] retransmit 1 of request with message ID 2 Oct 24 11:47:13 03[NET] sending packet: from 192.168.0.100[500] to 192.168.0.1[500] Oct 24 11:47:20 11[IKE] retransmit 2 of request with message ID 2 Oct 24 11:47:20 11[NET] sending packet: from 192.168.0.100[500] to 192.168.0.1[500] Oct 24 11:47:33 08[IKE] retransmit 3 of request with message ID 2 Oct 24 11:47:33 08[NET] sending packet: from 192.168.0.100[500] to 192.168.0.1[500] Oct 24 11:47:56 12[IKE] retransmit 4 of request with message ID 2 Oct 24 11:47:56 12[NET] sending packet: from 192.168.0.100[500] to 192.168.0.1[500] Oct 24 11:48:38 14[IKE] retransmit 5 of request with message ID 2 Oct 24 11:48:38 14[NET] sending packet: from 192.168.0.100[500] to 192.168.0.1[500] Oct 24 11:49:54 16[IKE] giving up after 5 retransmits Oct 24 11:49:54 16[IKE] restarting CHILD_SA home Oct 24 11:49:54 16[IKE] initiating IKE_SA home[2] to 192.168.0.1