Virtual Private Networks
MPLS
IPsec
SSL/TLS
Ahmed Mehaoua
Professeur
Universit de Paris 5
mea@mathmea@math-info.univinfo.univ-paris5.fr
Plan
I. les VPN : d
dfinitions
II.
II. Les VPN MPLS
III.
III. Les VPN IPsec
IV.
IV. Les VPN SSL/TLS
Ahmed Mehaoua - 2
Architectures VPN
Communication layers Security protocols
Application layer
ssh, S/MIME, PGP, SRTP
Transport layer
SSL, TLS, WTLS
Network layer
IPsec
Data Link layer
PPTP, L2TP
Physical layer
Scrambling, Hopping,
Quantum Communications
MPLS
Ahmed Mehaoua - 3
VIII. Application de IPsec : les VPN
Ahmed Mehaoua - 4
Extranet VPN : IPsec to MPLS to VLAN
Branch
Office
Local or
DirectDial ISP
Access/
Peering PoPs
MPLS Core
Leased Line/
Frame Relay/ATM/
DSL Dedicated
IOS
Access
MPLS
PE
MPLS
Internet
MPLS VPNs
Cable/DSL/
ISDN ISP
VLANs
Bi-directional
IPsec Session
Remote Users/
Telecommuters
Cisco VPN client software is tunnel
source for access VPNs and branchoffice; router originates site-to-site
tunnel with VPN concentrator
Cisco router terminates
IPsec tunnels and maps
sessions into MPLS
VPNs
IPsec or TLS VPN Session
MPLS VPNs
IP
Corporate
Intranet
VLANs
IP
Ahmed Mehaoua - 5
Typologie des technologies VPN
VPN de niveau 2
VPNVPN-IP avec MPLS
VPNVPN-IP avec IPSEC
VPNVPN-SSL
Ahmed Mehaoua - 6
MPLS : multiprotocole ?
Multi-Protocole Label Switching
Optique
Ahmed Mehaoua - 7
VPN MPLS
Avantages: Une bonne partie des avantages de MPLS reposent sur son support
du routage explicite :
1. Ingnierie de trafic (rpartition du trafic/charge entre plusieurs chemins)
2. Qualit de service (pr-dimensionnement des chemins)
3. Intgration de diffrentes infrastructures de commutation de bout en bout via les
labels MPLS
4. Indpendant des protocoles de routage IP (inter et intra AS) (transparence pour
les clients)
5. Externernalisation du rseau priv virtuel (VPN) : recentrage des entreprises sur
leur cur de march et de comptence; et bnficier des nouvelles technologies
rseaux;
Applications : Les VPN IP sont considrs comme l'application de choix pour
MPLS. Grce ce dernier, les oprateurs peuvent garantir une qualit de service
de bout en bout sur leurs rseaux IP. Le trafic manant d'un RPV pourra tre
tiquet et inject dans les rseaux des oprateurs et des fournisseurs d'accs
Internet (FAI), et se voir attribuer une qualit de service indpendante des autres
flux transitant sur ces rseaux.
Ahmed Mehaoua - 8
Evolution du Routage IP
- Vers la Commutation IP Paquet dappel
Paquets suivants
Transport
IP
IP
IP
Sonet
ATM
FR
IP
ATM
Transport
IP
Frame
Relay
Frame Relay
Ahmed Mehaoua - 9
Fonctions dun Routeur IP
Route
Table
Chaque
Paquets IP
entrant
Cache
Forwarding
Tasks
Routage
Access
Control
List
Security
Task
FireWall
Queuing
Priority
Accounting
Data
Queuing
Task
Accounting
Task
Gestion
Paquets
Administration
Paquets IP
sortant
Ahmed Mehaoua - 10
Evolution du Routage IP
- Vers la Commutation IP Route
Table
Premier
Paquet IP
Paquets IP
suivants
Forwarding
Task
Cache
Switching
Table
Access
List
Queuing
Priority
Accounting
Data
Security
Task
Queuing
Task
Accounting
Task
Flow
Specifications
Data Export
Statistics
Switching
Task
Ahmed Mehaoua - 11
Routage IP intra-AS
Protocole RIP
Ahmed Mehaoua - 12
LABEL SWITCHING
In
Address
Label Prefix
Out Out
Iface Label
In
Address
Label Prefix
Out Out
Iface Label
128.89
128.89
171.69
171.69
9
7
...
...
...
...
...
...
...
...
171.69
1
1
128.89.25.4
Data
0
128.89.25.4
128.89
Data
128.89.25.4
128.89.25.4
Data
Data
Ahmed Mehaoua - 13
LABEL SWITCHING
Ahmed Mehaoua - 14
MPLS : Oprations
1a. Protocole de routage existant (e.g. OSPF, IGRP)
dtermine la meilleure route dans le domaine MPLS
4. Les routeurs de sortie
(LER) suppriment les labels
et remettent les paquets au
destinataire
1b. Le Label Distribution Protocol (LDP)
Initialise les labels dans les routeurs du chemin
2. Le routeur dentre (LER) reoit les
paquets IP et excute les fonctions de
niveau 3 puis insre les labels
3. Les routeurs/commutateurs
internes (LSR) transferent les
paquets labeliss en utilisant la
commutation de label
Ahmed Mehaoua - 15
MPLS : Terminologie
z LDP: Label Distribution Protocol
z LSP: Label Switched Path
z FEC: Forwarding Equivalence Class
z LSR: Label Switching Router
z LER: Label Edge Router
z MPLS-shim : en-tte MPLS
Ahmed Mehaoua - 16
Codification des Labels
FEC : Forward Equivalent Class
Label de taille fixe 4 octets (32 bits) :
1.
2.
3.
4.
Label (20 bits) : valeur du label
CoS (3 bits): classe de service du paquet (exp: champs ToS dans IP)
S (Stack Indicator) : indique le bas de la pile. Il est mit un 1 pour le
dernier label dans la pile et a 0 pour tous les autres labels.
TTL (8 bits): dure de vie du paquet (pour viter les boucles).
Ahmed Mehaoua - 17
LABEL SWITCHING
ATM Cell Header
GFC
VPI
VCI
PTI CLP HEC
DATA
Label
Ver
IPv6 Flow Label Field
T.Class
Flow Label
Label
PPP Header : Optic
PPP Header
Label
Layer 3 Header
LAN MAC Tag header : Ethernet
Layer 2 Header +
Label
Layer 3 Header
Ahmed Mehaoua - 18
Typologie des technologies VPN
VPN de niveau 2
VPNVPN-IP avec MPLS
VPNVPN-IP avec IPSEC
VPNVPN-SSL
Ahmed Mehaoua - 19
VIII. Application de IPsec : les VPN
Access
Access
IPsec to Core VPN
IPsec tunnel
IPsec tunnel
MPLS
CPE
MPLS PE
MPLS PE CPE
mapping
IPsec
IP
IPsec over Core
VPN
mapping
MPLS VPN
IPsec
IP
IPsec tunnel
MPLS
CPE
IP
MPLS PE
IPsec
MPLS PE CPE
MPLS VPN
IPsec
IP
Ahmed Mehaoua - 20
10
Easy VPN Remote/Server
HUB site with static known IP address, client have dynamic addresses
addresses
Single User
IOS
Router
With
Unity
Client
Cisco Unity VPN Clients
Gateway options:
Cisco VPN 30xx
Cisco IOS 12.2(8)T
PIX 6.0
PIX501
uBR900
Home Office
IOS
Router
With
Unity
Client
Ca
ble
DSL
Internet
HQ
800
Small Office
IOS
Router
With
Unity
Client
T1
=IPsec tunnel
Advantages:
Home Office
VPN3002
1700
IOS
Router
Unity is the common language
within Cisco VPN environment
Policy push applies to CPE
routers as well.
Ahmed Mehaoua - 21
Les offres commerciales de VPN
pour l'entreprise
Les grands acteurs en France et en Europe aujourd'hui:
Level 3
France Telecom (Oleane
(Oleane VPN)
Easynet
Qwest
Global Crossing
Ahmed Mehaoua - 22
11
VPN IP- Offre en France Il existent 10 offrent de rseaux privs virtuel IP en France (01rseaux/Sept. 2002)
Cable & Wireless
Cegetel/Infonet
Colt
FT/Global One
KPNQwest
Maiaah
QoS Networks
LDcom/Siris
Worldcom
(IPsec, aucune classe, 50 PoP nat, 49 PoP int.)
(MPLS, 3 classes: Std, Data, Tps rel, 160, 55 pays)
(IPsec, 4, 13, via offre IP Corporate)
(MPLS, 3, 60, 140)
(IPSec, 5 classes, 30, 300)
(MPLS, 5, 7, via rseaux tiers)
(IPSec, 5 classes, 1, 9)
(MPLS, 4 classes, 77, 0)
(MPLS)
Ahmed Mehaoua - 23
Critre des choix d'un fournisseur de VPN
La bande passante propos
propose
La qualit
qualit de service n
ngoci
gocie (SLA)
Gamme d'options d'acc
d'acc s en boucles locales
Assistance
Ahmed Mehaoua - 24
12
Scurisation des
communications IP
Pour scuriser les changes ayant lieu sur un rseau TCP/IP, il
existe plusieurs approches :
- niveau applicatif (PGP)
- niveau transport (protocoles TLS/SSL, SSH)
- niveau physique (botiers chiffrant).
IPsec vise scuriser les changes au niveau de la couche rseau.
rseau.
IPsec veut dire IP Security Protocols : ensemble de mcanismes de
scurit commun IPv4 et IPv6.
Ahmed Mehaoua - 25
IPSec : le standard
Norme prvue pour IPv6
Adapte IPv4, vu la lenteur de dploiement IPv6 et
les besoins forts des entreprises
Srie de RFC : 2401, 2402, 2406, 2408
Trs nombreuses pages !!
Ahmed Mehaoua - 26
13
Les services IPsec
Services de s
scurit
curits offerts par IPsec :
- Authentification des extr
extrmit
mits
- Confidentialit
Confidentialit des donn
donnes chang
changes
- Authenticit
Authenticit des donn
donnes
- Int
Intgrit
grit des donn
donnes chang
changes
- Protection contre les coutes et analyses de trafic
- Protection contre le rejeu
2 modes d
dexploitation dIPsec :
- Transport : Prot
Protge juste les donn
donnes transport
transportes (LAN)
- Tunnel : Prot
Protge en plus l'enl'en-tte IP (VPN)
IPsec permet :
La mise en place de VPN
Scuriser les acc
accs distants (Utilisation nomade)
Protection d
dun serveur sensible
Ahmed Mehaoua - 27
Composants dIPsec
Protocoles de scurit :
Authentication Header (AH)
Encapsulation Security Payload (ESP)
Protocole d'change de clefs :
Internet Key Exchange (IKE)
Bases de donnes internes :
Security Policy Database (SPD)
Security Association Database (SAD)
Ahmed Mehaoua - 28
14
I. Normalisation d'IPsec par lIETF
RFC 2401
RFC 2402
RFC 2406
Security
Architecture for
the Internet
Protocol
IP
Authentication
Header
S. Kent,
R.
Atkinson
Novembre
1998
STANDARD
IP
Encapsulating
Security
Payload (ESP)
Ahmed Mehaoua - 29
Quel protocole pour quel service
de scurit ?
Ahmed Mehaoua - 30
15
II. Modes dIPsec
mode transport
- insertion transparente entre TCP et IP
- pas de masquage d
dadresse
- facilit
de
mise
en
uvre
facilit
scurise de bout en bout les changes entre deux utilisateurs.
mode tunnel
- insertion apr
aprs IP
- encapsulation des datagrammes IP dans d'autres datagrammes IP
- masquage d
dadresse
scurise lien par lien les segments de r
rseau.
utilis
utilis quand au moins une des deux extr
extrmit
mits d
dIPsec se
comporte comme une passerelle
Ahmed Mehaoua - 31
IPsec : Mode Transport
Ahmed Mehaoua - 32
16
Transport Mode Encapsulation
Ahmed Mehaoua - 33
IPsec : Mode Tunnel
Ahmed Mehaoua - 34
17
Tunnel Mode Encapsulation
Ahmed Mehaoua - 35
III.
III. Protocole de s
scurit
curit AH
AH = Authentication Header : 1er protocole et aussi le plus simple
dfinit dans le RFC 2402
Garantit :
- l'authentification.
- lunicit
unicit (anti(anti-rejeu)
rejeu)
- l'int
l'intgrit
grit
! Pas de confidentialit
confidentialit !
=> les donn
donnes sont seulement sign
signes mais pas chiffr
chiffres
support des algorithmes MD5 (128 bits) et SHASHA-1
Ahmed Mehaoua - 36
18
IPSec protocols AH protocol
AH - Authentication Header
Defined in RFC 1826
Integrity: Yes,
Yes, including IP header
Authentication: Yes
NonNon-repudiation: Depends on cryptography algorithm.
Encryption: No
Replay Protection: Yes
Transport Packet layout
IP Header AH Header
Payload (TCP, UDP, etc)
Tunnel Packet layout
IP Header AH Header IP Header
Payload (TCP. UDP,etc)
Ahmed Mehaoua - 37
III.
III. Protocole de s
scurit
curit AH
Ahmed Mehaoua - 38
19
IV.
IV. Protocole de s
scurit
curit ESP
ESP = Encapsulating Security Payload
dfinit dans le RFC 2406
Seules les donn
donnes sont prot
protges (pas de protection enen-tte)
Garantit:
- l'authentification.
- lunicit
unicit (anti(anti-rejeu)
rejeu)
- l'int
l'intgrit
grit
- la confidentialit
confidentialit
Ahmed Mehaoua - 39
IPSec protocols ESP protocol
ESP Encapsulating Security Payload
Defined in RFC 1827
Integrity: Yes
Authentication: Depends on cryptography algorithm.
NonNon-repudiation: No
Encryption: Yes
Replay Protection: Yes
Transport Packet layout
IP Header ESP Header
Payload (TCP, UDP, etc)
Tunnel Packet layout
IP Header ESP Header IP Header
Unencrypted
Payload (TCP. UDP,etc)
Encrypted
Ahmed Mehaoua - 40
20
IV.
IV. Protocole de s
scurit
curit ESP
Ahmed Mehaoua - 41
V. Fonctionnement SA, SAD, SPD
n SA : Security Association
Association
Les Associations de scurit (SA) dfinissent les paramtres des
divers mcanismes utiliss pour la scurisation des flux sur le rseau
priv virtuel
A chaque SA correspond un bloc de donnes identifi par un index et
contenant les informations correspondantes
Plus prcisment, chaque association est identifie de manire unique
unique
l'aide d'un triplet compos de :
- le SPI (Security
(Security Parameter Index)
Index) : index de la SA dfini par le rcepteur
- l'adresse de destination des paquets
- l'identifiant du protocole de scurit (AH ou ESP)
Ahmed Mehaoua - 42
21
V. Fonctionnement SA, SAD, SPD
n SA : Security Association
Association (suite)
Les informations chang
changes sont :
- index de la SA appel
appel SPI (pour Security Parameter Index)
- un num
numro de s
squence, indicateur utilis
utilis pour le service d'antid'anti-rejeu
- une fentre d'antid'anti-rejeu : compteur 32 bits
- dpassement de s
squence
- param
tres
d'authentification
(algorithmes et cl
param
cls)
- param
tres
de
chiffrement
(idem)
param
- temps de vie de la SA
- mode du protocole IPsec (tunnel ou transport)
Attention : un SA est Unidirectionnelle:
Unidirectionnelle: prot
protger les deux sens d'une
communication classique requiert deux associations.
associations.
Ahmed Mehaoua - 43
SA : exemple
Destination : 192.78.42.76
Protocole : ESP
index : 10314
Mode : tunnel
algorithme de chiffr : AES
cl de chiffrement : 0xEB3167C....
algorithme d'authent : SHA1
cl d'authentification : 0xC372F4....
politique associe : #23
date d'expiration : 061120 15:30:00
Ahmed Mehaoua - 44
22
V. Fonctionnement SA, SAD, SPD
o SAD : Security Association Database
- base de donn
donnes des SA pour la gestion des associations de s
scurit
curit
actives
- consult
consulte pour savoir quels m
mcanismes il faut appliquer chaque
paquet re
reu ou mettre.
p SPD : Security Policy Database
- base de donn
donnes des politiques de s
scurit
curit (SPD).
- Pour savoir comment appliquer les m
mcanismes sur les paquets
Ahmed Mehaoua - 45
V. Fonctionnement SA, SAD, SPD
Ahmed Mehaoua - 46
23
V. Fonctionnement SA, SAD, SPD
Exemple 1 : trafic sortant
1) IPsec re
reoit des donn
donnes envoyer
2) Consultation de la base de donn
donnes SPD (quel traitement pour ces donn
donnes ?)
3) M
Mcanismes de s
scurit
curit pour ce trafic ?
4) Oui rcup
cupration des caract
caractristiques requises pour la SA et consultation de la
base SAD
5) SA existe ?
6) Oui utilis
utilise pour traiter le trafic en question
Non appel IKE pour tablir une nouvelle SA
Ahmed Mehaoua - 47
V. Fonctionnement SA, SAD, SPD
Exemple 2 : trafic entrant
1) R
Rception paquet
2) Examen l'enl'en-tte: services IPsec appliqu
appliqus ?
3) Oui rfrences de la SA ? consultation de la SAD
4) D
Dchiffrement
5) Consultation de la SPD : SA du paquet correspond bien celle
requise par les politiques de s
scurit
curit ?
Ahmed Mehaoua - 48
24
VI.
VI. Gestion, distribution des clefs IKE / ISAKMP
Problmatique : afin dchanger des donnes de faon scurise, il est
ncessaire de se mettre daccord sur les paramtres utiliser, et
notamment dchanger les clefs de session
Il faut 2 paires de cls (AH et ESP) : soit 2 par direction.
1er solution : configuration manuelle des quipements
(unique mthode propose dans la premire version dIPSec)
2eme solution : gestion dynamique des paramtres au moyen dun
protocole scuris adapt
systme automatique pour la creation la demande des cls pour les SA
Plusieurs solutions : SKIP, Prothuris,
Prothuris, Oakley, SKEME and ISAKMP IKE
IKE est un protocole orient connexion utilis par les quipements
quipements IPsec pour
changer et grer les associations de scurit travers lInternet
lInternet :
Echange de clefs laide de protocoles cryptographiques
Fournit une authentification des entits
Permet un tablissement de SA travers un rseau non scuris
Ahmed Mehaoua - 49
VI.
VI. Gestion, distribution des clefs IKE / ISAKMP
n IKE : Internet Key Exchange : Qu
Quest ce que cest ?
IKE est un ensemble de protocoles et de m
mcanismes assurant
une gestion s
scuris
curise et dynamique des param
paramtres de s
scurit
curit
utilis
utiliss dans IPSec
IKE = change de cl
cls d'authentification + gestion des SA
RFC 2409
Deux mani
manires d'
d'changer des clefs :
- clefs pr
pr-partag
partages
- certificats X.509
Ahmed Mehaoua - 50
25
VI.
VI. Gestion, distribution des clefs IKE / ISAKMP
n IKE : Internet Key Exchange
Ahmed Mehaoua - 51
VII.
VII. Faiblesses d'IPsec
d'IPsec
Limitations dues la gestion manuelle des clefs
- AH et ESP s'appuient sur des num
numros de s
squence initialis
initialiss 0
lors de la cr
cration d'une SA et incr
incrment
ments lors de l'envoi de chaque
datagramme.
- Num
Numros de s
squence sont stock
stocks dans un entier de 32 bits 4
milliards
- Pass
Pass cette limite, n
ncessit
cessit de cr
crer une nouvelle SA et donc une
nouvelle clef.
- Possibilit
Possibilit de d
dsactivation des num
numros apr
aprs la limite.
Broadcast et multicast
Probl
Problme de performance et impossibilit
impossibilit de r
rsolution par
laugmentation de la puissance.
Ahmed Mehaoua - 52
26
VII.
VII. Faiblesses d'IPsec
d'IPsec (2)
Firewalls
Le filtrage de datagrammes IPsec est d
dlicat pour deux raisons :
- les RFCs ne pr
prcisent pas si, sur un syst
systme remplissant
simultan
simultanment les fonctions de passerelle de s
scurit
curit et de firewall,
firewall,
le d
dcodage de l'IPsec
l'IPsec doit avoir lieu avant ou apr
aprs l'application des
rgles de firewalling ;
-il n'est pas possible au code de firewalling de lire certaines donn
donnes,
par exemple des num
numros de port, dans des donn
donnes chiffr
chiffres, ou
transmises dans un format qu'il ne conna
connat pas.
NATs
Th
Thoriquement, aucune translation d'adresse ne devrait affecter un
datagramme IPsec,
IPsec, car ce type d'op
d'opration modifie le contenu des
datagrammes, ce qui est incompatible avec les m
mcanismes de
protection de l'int
l'intgrit
grit des donn
donnes d'IPsec
d'IPsec..
Ahmed Mehaoua - 53
- Partie 3 VPN IP scuris avec IPsec -
VII.
VII. Faiblesses d'IPsec
d'IPsec (suite 3)
Non support de protocoles r
rseaux autres qu'IP
IPsec est un protocole qui ne pr
prvoit que le convoyage s
scuris
curis de
datagrammes IP
Ceci n'est pas suffisant, car d'autres standards comme IPX et
NetBIOS sont utilis
utiliss sur un grand nombre de r
rseaux. Il existe
cependant une solution ce probl
problme : encapsuler les donn
donnes
prot
protger dans du PPP, luilui-mme transport
transport par IPsec.
IPsec. Le rle de PPP
est en effet de permettre la transmission de diff
diffrents protocoles auaudessus d'un lien existant.
Ahmed Mehaoua - 54
- Partie 3 VPN IP scuris avec IPsec -
27
Conclusion: IPSec-IKE-SA
IPsec ensemble de protocoles et mcanismes pour le chiffrement
de paquets IP
SASA->traitement mettre en oeuvre sur un paquet IP quand il faut
lui appliquer IPSec
IKEIKE->gestionnaire de SA
IPSecIPSec->utilisateur de SA
Ahmed Mehaoua - 55
Typologie des technologies VPN
VPN de niveau 2
VPNVPN-IP avec MPLS
VPNVPN-IP avec IPSEC
VPNVPN-SSL
Ahmed Mehaoua - 56
28
Technologies VPN
Communication layers Security protocols
Application layer
ssh, S/MIME, PGP
Transport layer
SSL, TLS, WTLS
Network layer
IPsec
Data Link layer
PPTP, L2TP
Physical layer
Scrambling, Hopping,
Quantum Communications
MPLS
Ahmed Mehaoua - 57
Agenda
Introduction
Motivation, evolution, standardization
Applications
SSL Protocol
SSL phases and services
Sessions and connections
SSL protocols and layers
SSL Handshake protocol
SSL Record protocol / layer
SSL solutions and products
Conclusion
Ahmed Mehaoua - 58
29
Scurisation des changes
Pour scuriser les changes ayant lieu sur le rseau
Internet, il existe plusieurs approches :
- niveau applicatif (PGP)
- niveau rseau (protocole IPsec)
IPsec)
- niveau physique (botiers chiffrant).
TLS/SSL vise scuriser les changes au niveau de la
couche Transport.
Transport.
Application typique : scurisation des transactions Web
Ahmed Mehaoua - 59
Transport Layer Security
Advantages
Does not require enhancement to each application
NAT friendly
Firewall Friendly
Disadvantages
Embedded in the application stack (some mis-implementation)
Protocol specific --> need to duplicated for each transport
protocol
Need to maintain context for connection (not currently
implemented for UDP)
Doesnt protect IP adresses & headers
Ahmed Mehaoua - 60
30
Security-Sensitive Web
Applications
Online banking
Online purchases, auctions, payments
Restricted website access
Software download
Web-based Email
Requirements
Authentication: Of server, of client, or (usually) of both
Integrity: Of requests, of responses, etc.
Confidentiality: Of data transfers
Availability: No Denial of Service
Some minor applications : SSL VPN (end-to-end)
Main tool: SSL / TLS protocol
Ahmed Mehaoua - 61
IPsec et larchitecture TCP/IP
TLS
Physique
SSL
Cuivre, Fibre Optique, Ondes Radio, ...
Ahmed Mehaoua - 62
31
Transport Layer Security
Protocols
Connectionless and connection-oriented transport layer
service:
Security Protocol 4 (SP4) NSA, NIST
Transport Layer Security (TLSP) ISO
Connection-oriented transport layer service:
Encrypted Session Manager (ESM) AT&T Bell Labs.
Secure Socket Layer (SSL) Netscape Communications
Transport Layer Security (TLS) IETF TLS WG
Most popular transport layer security protocols
Ahmed Mehaoua - 63
SSL/TLS Evolution
No client auth;
weak encryption;
Man-in-the-midle
attack
Microsofts
improved SSLv2:
security (e.g. strong
exportable auth.),
performance (flows)
PCT
(1995)
Microsofts
improved SSLv3:
support for UDP,
and shared-secret
authentication
STLP
(1996)
WAP
WTLS
(1990-)
Not released
SSLv2
(1994)
SSLv3
(1995)
SSLv1
(1994)
Substantial redesign;
add client authentication,
support for DH
DSS : Digital Signature Standard (Public
(Public--key)
key)
DH : DiffieDiffie-Hellman
TLS 1.0
(1997-1999)
RFC 2246
TLS 1.1
(2001-?)
SSLv3 but incompatible:
improved key expansion
and MAC, support 3DES
and DH for key exchange
Ahmed Mehaoua - 64
32
SSL/TLS in a Nutshell
SSL & TLS provide a `secure
`secure TCP tunnel from client to server`:
server`:
Message Confidentiality
Message and connection integrity
Authentication of server, optionally also of client
Implemented in almost all web clients, servers
Many implementations, libraries, e.g. OpenOpen-SSL
SSL: Secure Socket Layer
Version 3 designed by Netscape Corp.
Original goal and main use: secure credit card number
SSL (& TLS) operate on top of `standard` Sockets API
TLS: Transport Layer Security
Version 1.0 RFC 2246
IETF standard version of SSL
We usually say just SSL but refer to both
Ahmed Mehaoua - 65
SSL/TLS : Applications and ports
Protocol
Normal
Port
Secured
Protocol
HTTP
80
HTTPS
NTP
119
Encrypted
Port
RFC
443
2818
563
LDAP
389
SLDAP
636
2830
FTP-DATA
20
SFTP
989
draft
FTPcontrol
21
SFTP
990
draft
TELNET
23
SSH
22
4251
IMAP
143
SIMAP
993
2595
IRC
194
994
2813
POP3
110
SPOP3
995
2595
SMTP
25
SMTP-TLS
465 (25)
2487
Ahmed Mehaoua - 66
33
SSL-based current solutions
OpenSSL : www.openssl.org
a robust,
robust, commercialcommercial-grade,
grade, fullfull-featured,
featured, and Open Source toolkit implementing the
Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols
Win32 SSL API
JavaSSL : www.bpsinfo.com/javassl/
A Java package which uses JNI to provide an SSLSocket class
ApacheApache-SSL : http://www.apachehttp://www.apache-ssl.org/
OpenSSH : www.openssh.com/
www.openssh.com/
A port of the OpenSSLOpenSSL-based SSH package
Mocana Security Suite : www.mocana.com
sNFS : www.quick.com.au/ftp/pub/sjg/help/sNFS.html
Software suite including (SSL, SSH, IPsec,
IPsec, IKE, Radius, )
An SSLSSL-based NFS variant
OpenVPN : www.openvpn.org
Ahmed Mehaoua - 67
SSL/TLS principles
Client / Server
Provide 4 security services :
Authentication of server
Confidentiality of exchanged data
Integrity of exchanged data
Optional : authentication of client (if client has a certificate)
Combining various security mechanisms :
Asymmetric Ciphering : authentication (RSA)
Certificate : to validate public key of the server
Symmetric Ciphering : Confidentiality of data transmission
Hach function : integrity of data (MD(MD-5, SHASHA-1)
Ahmed Mehaoua - 68
34
Principe de fonctionnement de SSL:
Exemple du paiement en ligne
Le client, connect au site
marchand scuris par SSL, clique
sur un lien hypertexte dclenchant
une requte de formulaire scuris
et la cration d'une cl prive que
le client va conserver, et d'une cl
publique qui sera expdie au
serveur marchand
s
de SSL
n
r
tio s pa
a
s
ri tion
cu
S nsac
tra
Le serveur marchand cre
une clef de session en
cryptant un message
alatoire l'aide de la clef
publique, puis l'envoie au
client
A rception, le client crypte la clef de session
l'aide de la clef prive, puis l'envoie au
serveur marchand, qui va la dcrypter
l'aide de la cl publique afin de vrifier
l'authenticit du message, donc de
l'acheteur
Le reste des transactions peut alors se faire l'aide de la clef
clef de session,
connue des deux cts et inconnue des autres entits du rseau
Ahmed Mehaoua - 69
Exemple de Certificat X509
Ahmed Mehaoua - 70
35
Web Security with SSL/TLS (simplified)
Domain Name
System (DNS)
2. Domain
(bank.com)
1. URL/Link
Certificate
Authority (CA)
https://bank.com
3. IP (67.22.5.2)
6. Display:
-- Page
-- URL
-- Padlock
e.g. VeriSign
cert=SignCA(pk, domain)
4. SSL/TLS: Establish key using pk
4a. Hello
4c. Epk(key)
4b. pk, cert
www.bank.com
5. SSL/TLS: Protect using key
5a. HTTP Get (www.bank.com)
5b. Web (login) page
5c. HTTP Post (userid/pw)
(Web
Server, at
67.22.5.2,
Port 443)
Ahmed Mehaoua - 71
SSL Architecture
1.
2.
page 72
36
SSL Architecture (suite)
SSL is built in two layers:
SSL Handshake Layer used for managing SSL exchanges (cipher suite
negotiation, session key generation, etc.)
SSL Record Layer used to secure communication between client and
server with the established session keys
Handshake layer
Application
Record layer
Ahmed Mehaoua - 73
SSL Main Protocols
SSL Record Protocol
Layered on top of a connectionconnection-oriented and reliable transport layer
service
Provides message origin authentication, data confidentiality, and
and
data integrity
Handshake Protocol
Used to mutually authenticate client and server and
exchange session key
Ahmed Mehaoua - 74
37
SSL Sub-Protocols
Layered on top of the SSL Record Protocol
Provides support for SSL session and connection establishment
Alert Protocol
Used to transmit alerts via SSL Record Protocol
Alert message: (alert level, alert description)
ChangeCipherSpec Protocol
Used to change cipher specifications
Can be changed at the end of the handshake or later
Application Protocol
Used to directly pass application data to the SSL Record Protocol
Protocol
Ahmed Mehaoua - 75
SSL Operation Phases
Client uses SSL API to open connection
TCP Connection Phase
Handshake Phase (SSL Handshake Protocol)
Negotiate (agree on) algorithms, methods
Authenticate server and optionally client
Establish keys
Establish connection (keys and optionally Initialization Vector)
Data transfer Phase (SSL Record Protocol)
SSL Secure Teardown Phase
Server
Syn
+Ack
SSL
Handsake
Data Transfer
SSL Record
Protocol
SSL
Fin
Teardown +Ack
Client
Ahmed Mehaoua - 76
38
SSL Record Protocol
page 77
SSL Record Protocol (suite)
message fragmentation and compression
16KB in a fragment
LossLess compression (1 KB is OK)
confidentiality
using symmetric encryption with a shared secret key defined by Handshake
Handshake
Protocol
IDEA, RC2RC2-40, DESDES-40, DES, 3DES, Fortezza, RC4RC4-40, RC4RC4-128, AES
message is compressed before encryption (optional)
message integrity
using a MAC with shared secret key
Using SHA-1 or MD5
Non replay
Use counter (64 bits) to prevent replay in SSL session
page 78
39
SSL Alert Protocol
SSL Alert Protocol signals state changes and indicates errors
SSL Alert is invoked by:
Handshake protocol in case of problem
Record protocol e.g. if MAC is not valid
Application to close connection (close_notify)
Connections should be closed with close_notify to allow detection
detection of
truncation attacks (dropping last messages)
Notice:
Notice: close_notify is normal, not a failure alert!
The alerts are carried in an Alert Record
Ahmed Mehaoua - 79
SSL Alert Protocol (2)
Use twotwo-byte message to convey SSLSSL-related alerts to peer entity
First byte is severity level
warning(1) or fatal(2)
Second byte is specific alert
Always fatal: unexpected_message, bad_record_mac,
decompression_failure, handshake_failure, illegal_parameter
Other alerts: close_notify, no_certificate, bad_certificate,
unsupported_certificate, certificate_revoked, certificate_expired,
certificate_expired,
certificate_unknown
Compressed and encrypted like all SSL data
Ahmed Mehaoua - 80
40
SSL Handshake Protocol
Allow server and client to agree
agree on cipher suite (algorithms and options):
authenticate server (madatory
(madatory))
Authenticate client (option)
negotiate encryption algorithms (symmetric or asymmetric)
negotiate Signature & MAC algorithms
negotiate cryptographic keys to be used
Send certificate(s)
certificate(s)
SSL Message compression
Comprise a series of messages in 4 phases
Establish Security Capabilities
Server Authentication and Key Exchange
Client Authentication and Key Exchange
Finish
Ahmed Mehaoua - 81
SSL Handshake Protocol Phases
Client
Server
Client
hello
te
certifica
hange
ey_exc
Server_k
est
qu
re
e_
at
Certific
one
_d
lo
el
Server_h
certific
ate
Client_
key_ex
chang
e
Certific
ate_ve
rify
Chang
e_ciphe
r_spec
finished
r_Spec
_ciphe
Change
d
finishe
Phase 1 Establish parameters
Negotiation of the session ID, key exchange algorithm, MAC algorithm,
algorithm,
encryption algorithm, and exchange of initial random numbers
ello
server h
Phase 2 Server authentication (optional: server keykeyexchange)
Server may send its certificate and key exchange message, and it may
request the client to send a certificate. Server signals end of hello phase.
Phase 3 Client keykey-exchange (optional: client
authentication)
Client sends certificate if requested and may send an explicit certificate
certificate
verification message. Client always sends its key exchange message.
message.
Phase 4 Finish: validation and begin using exchanged
keys
Change cipher spec and finish handshake
Ahmed Mehaoua - 82
41
Phase 1 Establish Parameters
Client
Server
Client
Client_hello message
hello
Version (highest available)
A timestamp and random string called
clientHello.random
ello
server h
te
certifica
nge
_excha
ey
_k
er
Serv
est
qu
re
ate_
Certific
e
ello_don
Server_h
Session identifier (used for existing
connections)
Cipher-suite a list of supported cryptographic
algorithms
Compression method
Client_random, server_random
certific
ate
Client_
key_ex
chang
e
Certific
ate_ve
rify
From TLS 1.1: Extensions
Chang
e_ciphe
r_spec
finished
server_hello : same fields
r_Spec
_ciphe
Change
finished
Ahmed Mehaoua - 83
Phase 1 Establish Parameters (suite)
Client
Server
Client
hello
ello
server h
hange
ey_exc
Server_k
est
qu
re
e_
at
Certific
one
_d
lo
el
Server_h
certific
ate
Client_
key_ex
chang
e
Certific
ate_ve
rify
Chang
CipherCipher-suite elements:
KeyKey-exchange method (e.g. RSA)
Encryption algorithm (e.g. DES or RC4)
MAC (message authentication code) algorithm
(e.g. SHASHA-1 or MD5)
te
certifica
Server chooses one ciphercipher-suite from those sent by
client
e_ciphe
r_spec
finished
r_Spec
_ciphe
Change
d
finishe
Ahmed Mehaoua - 84
42
Phase 2 Server Authentication
Client
Server
Client
hello
ello
server h
te
certifica
hange
ey_exc
Server_k
est
qu
re
ate_
Certific
e
on
_d
lo
el
Server_h
Optional Server_key_exchange message
It sends one or a chain of X.509 certificates
Used in Diffie-Hellman key exchange
Not used in RSA key exchange
certific
ate
Client_
key_ex
chang
e
Certific
ate_ve
rify
Chang
Phase 2 Server Authentication and (optional) Server
Key-Exchange
Server sends its certificate
Optional certificate_request message: for client
authentication
server_hello_done
e_ciphe
r_spec
finished
r_Spec
_ciphe
Change
finished
Ahmed Mehaoua - 85
Phase 3 Client Key-Exchange
Client
Server
Client
hello
ello
server h
te
certifica
hange
ey_exc
Server_k
est
qu
re
e_
at
Certific
one
_d
lo
el
Server_h
certific
ate
Client_
key_ex
chang
e
Certific
ate_ve
rify
Chang
Phase 3 Client Key-Exchange and (optional) Client
Authentication
The client verifies the servers certificate and sends its
side of the key exchange
In Diffie-Hellman: the D-H key share
In RSA: encryption of random string
If client authentication used (rarely): client sends
certificate (but most clients dont have certificates)
e_ciphe
r_spec
finished
r_Spec
_ciphe
Change
d
finishe
Ahmed Mehaoua - 86
43
Phase 4 Finish
Client
Server
Client
hello
ello
server h
te
certifica
hange
ey_exc
Server_k
est
qu
re
ate_
Certific
e
on
_d
lo
el
Server_h
certific
ate
Client_
key_ex
chang
e
Certific
ate_ve
rify
Chang
Client and server send change_cipher_spec
messages
Results in use of new cipher-suite (as
negotiated in the hello phase)
Client and server send finished messages
Messages are HMAC on all the handshake
messages using master_secret as the key
The MAC is computed twice once with MD5
and once with SHA1
e_ciphe
r_spec
finished
r_Spec
_ciphe
Change
finished
Ahmed Mehaoua - 87
SSL Connection State Variables
Master Secret (shared key)
Server and client sequence numbers
Server_random,
Server_random, client_random:
client_random: 32 bytes
Unique to each connection
Unique to each connection, selected by server and client
Cryptographic keys,
keys, Initialization Vectors (IV)
Derived from Master Secret using a PseudoPseudo-Random
Function (PRF)
What
Whats a PRF and how we use it?
Ahmed Mehaoua - 88
44
A Pseudo-Random Function
An efficient function using secret key
TLS
TLSs PRF is based on MD5 and SHASHA-1 (later
(later)
That cannot be distinguished from random
x
RandomFunction(x)
x
PRFk(x)
Ahmed Mehaoua - 89
SSL Key Derivation
The master key is used to derive the following
six keys and values:
Client MAC key
Server MAC key
Client encryption key
Server encryption key
Client Init Vector (for CBC encryption)
Server Init Vector (for CBC encryption)
Separate client and server keys are used
So successful attack against server does not
compromise client, and vice versa
Ahmed Mehaoua - 90
45
Deriving Connection Keys, IVs
Key_Block = PRF master_secret (key expansion|| Server_random ||
Client_random)
Split Key_Block to ClientMACKey, serverMACKey,
ClientEncryptKey,(using fixed order)
Server_random
master_secret
Client_random
PRF details differ
btw TLS and SSL3
PRF
Key_Block
MAC keys
Encrypt keys
IVs
Ahmed Mehaoua - 91
Summary: Trust & Security with SSL
Confidentiality & authenticity of messages
Server (site) authentication:
Customer needs to identify site (bank, etc.)
Client authentication:
Bank needs to identify account holder
Company needs to identify employee
Content provider needs to identify subscriber
NonNon-repudiation:
Proof of making/receiving order/transaction
Prevent/resolve dispute, identify corruption
Denial of service
Good in
SSL/TLS
Done,
but
Not in SSL
Ahmed Mehaoua - 92
46
Conclusion
SSL / TLS is the most widely deployed security protocol, standard
standard
Easy to implement, deploy and use; widely available
Flexible, supports many scenarios and policies
Mature cryptographic design
But SSL is not always the best tool
Use IPIP-Sec e.g. for antianti-clogging, broader protection, multicast
Use application security, e.g. s/mime, for nonnon-repudiation, storestoreandand-forward communication (not online)
Beware of spoofing
Many browsers allow hardhard-toto-detect spoofing
Many users will not detect simple spoofing (similar URL)
Ahmed Mehaoua - 93
47