In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1...

50
Virtual Private Network Present by Ali Fanian In the Name of Allah

Transcript of In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1...

Page 1: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Virtual Private Network

Present by

Ali Fanian

In the Name of Allah

Page 2: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Virtual Private Networks

Introduction

What security problems do VPNs solve ?

What security problems are not solved by VPNs ?

VPN Principles of operation: tunneling, encapsulation, encryption and authentication

VPN Technologies: Microsoft PPTP, L2TP and IPsec

Page 3: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

History and background of VPNs 1

Internet multi-site organisations operated private networks using leased lines. This approach was expensive and inflexible.

It became cheaper to use shared Internet than dedicated.

Virtual Private Network is a type of private network that uses public telecommunication, such as the Internet, instead of leased lines to communicate

VPNs enabled more flexible use of larger networks by removing network geography constraints from shared-insider LAN/Intranet associations and services.

With cryptography as part of a VPN, a travelling salesemancould communicate with head office at lower risk from spying competitors etc.

Page 4: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

What problems do VPNs solve ?

Avoiding costs of fixed lines.

Extending security context of LAN across sites, regardless of geography, including to mobile users.

Authentication: knowing who your users are.

Encryption: preventing monitoring of use of insecure client server applications at the network level.

Page 5: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

What security problems do VPNs not solve ?

Having a VPN which isn't secure and not knowing this is probably worse than having no VPN

Traffic analysis: monitoring of packet sizes, network usage times, endpoints of conversation etc.

VPNs can be used to pierce firewalls, by encapsulating traffic prohibited by organisation policy within a firewalled perimeter which the firewall can't inspect or control.

Page 6: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Tunneling

Typically a VPN consists of a set of point to point connections tunnelled over the Internet.

The routers carrying this traffic over the Internet see each P2P connection externally as a sequence of packets routed between endpoints.

Page 7: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Internet

VPN Tunnel

VPN Tunnel

VPNDevice

Backbone

Backbone

Office

Office

VPNDevice

VPNDevice

TelephoneLine

ISP

Employee’sHome

AccessServer

VPN Architecture

• VPN is transparent to the users, ISP, and

the Internet as a whole;

• It appears to be simply a stream of

packets moving across the Internet

leased circuits

Page 8: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Encapsulation

In order to achieve tunnelling, the packets including payloads, to and from addresses, port numbers and other standard protocol packet headers are encapsulated as the payload of packets as seen by the external routers carrying the connection.

Page 9: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Authentication

A digital signing scheme is typically used to enable verification of the VPN principals. Note that both the client and the server need to authenticate each other.

Message authentication codes, hashes or checksums are typically used to authenticate message contents.

Page 10: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Encryption

To protect the privacy of the connection from external snooping, the payload of the packets visible externally will be encrypted.

To enable routing over conventional networks, the packet headers of the encapsulating packets are not encrypted, but the packet headers of the encapsulated packets are encrypted along with their contents.

Page 11: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

VPN Topology: Types of VPNs

Remote access VPN

Site-to-Site VPN

Page 12: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

-12-

Types of VPNs Remote Access VPN

Provides access to internal corporate network over the Internet.

Reduces long distance, modem bank, and technical support costs.

Internet

Corporate

Site

Page 13: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

-13-

Types of VPNs Remote Access VPN

Site-to-Site VPN

Connects multiple offices over Internet

Reduces dependencies on frame relay and leased lines

Internet

Branch

Office

Corporate

Site

Page 14: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

-14-

Types of VPNs Remote Access VPN

Site-to-Site VPN

Extranet VPN Provides business

partners access to critical information (leads, sales tools, etc)

Reduces transaction and operational costs

Corporate

Site

Internet

Partner #1

Partner #2

Page 15: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

-15-

Types of VPNs Remote Access VPN

Site-to-Site VPN

Extranet VPN

Intranet VPN:

Links corporate headquarters, remote offices, and branch offices over a shared infrastructure using dedicated connections.

Internet

LAN

clients

Database

Server

LAN clients with

sensitive data

Page 16: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

VPN Topology: How it works Operates at layer 2 or 3 of OSI model

Layer 2 frame – Ethernet

Layer 3 packet – IP

Page 17: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

VPN Components: Protocols

IP Security (IPSec) Transport mode

Tunnel mode

Point-to-Point Tunneling Protocol (PPTP) Uses PPP (Point-to-Point Protocol)

Page 18: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

VPN Components: Protocols

Layer 2 Tunneling Protocol (L2TP) Exists at the data link layer of OSI

Composed from PPTP and L2F (Layer 2 Forwarding)

Compulsory tunneling method

Page 19: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

-19-

Point-to-Point Tunneling Protocol (PPTP)

Layer 2 remote access VPN distributed with Windows product family Based on Point-to-Point Protocol (PPP)

Uses proprietary authentication and encryption

Limited user management and scalability

Internet

Remote PPTP Client

ISP Remote Access

Switch

PPTP RAS Server

Corporate Network

Page 20: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

PPP

Point-to-Point Protocol (PPP) PPP was created for dialing into a local RAS

server

But the site’s RAS may be far away

Long-distance calls are expensive

RAS

Long-Distance Call

Page 21: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

PPTP

Point-to-Point Tunneling Protocol (PPTP) We would like PPP to work over the Internet

to avoid long-distance telephone charges

But PPP is only a data link layer protocol

It is only good for transmission within a subnet (single network)

RAS

Page 22: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

PPTP

The Point-to-Point Tunneling Protocol (PPTP) makes this possible Created by Microsoft

Widely used

RAS

Access

Concentrator

Page 23: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

PPTP

PPTP Operation User dials into local PPTP access

concentrator host

User sends the access concentrator a PPP frame within an IP packet

RAS

Access

Concentrator

Packet

Page 24: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

PPTP

PPTP Operation Access concentrator places incoming IP

packet within another IP packet

Sends packet to the distant RAS

RAS

Access

Concentrator

Encapsulated Packet

Page 25: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

PPTP

PPTP Operation Distant RAS removes the original packet

Deals with the PPP frame within the packet

RAS

Page 26: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

PPTP PPTP Encapsulation

Access concentrator receives the original IP packet, which has the IP address of the access concentrator

Adds an enhanced general routing encapsulation (GRE) header for security

Adds a new IP header with the IP address of the RAS

Original IP PacketEnhanced

GRE Header

New

IP HeaderRAS

Access

Concentrator

Tunnel

Page 27: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

-27-

Page 28: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

-28-

Page 29: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

IPSec

General IP Security mechanisms

Provides authentication

confidentiality

key management

Applicable to use over LANs, across public & private WANs, & for the Internet

Page 30: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

IPSec Uses

Transparency

Page 31: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Benefits of IPSec

Is below transport layer, hence transparent to applications

Can be transparent to end users

Can provide security for individual users

Page 32: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Architecture & Concepts

Tunnel vs. Transport mode

Security association (SA) Security parameter index (SPI)

Security policy database (SPD)

SA database (SAD)

Authentication header (AH) Protocol

Encapsulating security payload (ESP) Protocol

Page 33: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

A B

Encrypted Tunnel

Gateway 1 Gateway 2

New IP

Header

AH or ESP

Header

TCP DataOrig IP

Header

Encrypted

Transport Mode vs. Tunnel Mode

Transport mode: host -> host

Tunnel mode: host->gateway or gateway-

>gateway

Page 34: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Transport Mode

ESP protects higher layer payload only

AH can protect IP headers as well as higher layer payload

IP

header

IP

options

IPSec

header

Higher

layer protocol

ESP

AH

Real IP

destination

Page 35: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Tunnel Mode

ESP applies only to the tunneled packet

AH can be applied to portions of the outer header

Outer IP

header

Inner IP

header

IPSec

header

Higher

layer protocol

ESP

AH

Real IP destinationDestination

IPSec

entity

Page 36: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

36

Security Association (SA)

حاويالگوريتم هاكليدهاي مورد نياز پروتكلAH ياESPزمان انقضاء كليدپنجره جلوگيري از حمله تكرارشماره آخرين بسته سالم دريافت شدهSPI مشخصات ترافيكي كهSAبراي آن توليد شده است شامل:

آدرس مبدا و مقصد بستهپروتكل اليه باالترپورت هاي پروتكل اليه باالتر

Page 37: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

37

Security Association (SA)

در يك جدول به نامSADنگاه داري مي گردد

انديسSA در جدول فوق توسطSPIمشخص مي شوداتصال يك طرفه از فرستنده به گيرنده

براي ارتباط دو طرفه، دوSAمورد نياز است

كليدها بايستي به نحوي مذاكره شودPre-shared key

IKE

Page 38: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

38

جلوگيري از حمله تكرار

SAاختصاص يك شمارنده با مقدار صفر به هر

فرستاده SAافزايش شمارنده به ازاي هر بسته جديد كه با اين

مي شود

Page 39: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

39

براي برقراري ارتباط بين دو طرف الزم است كه يكSA بين

.طرفين ايجاد شود

برقراري و تجديد اينSA ها مي تواند بصورت دستي يا

.انجام گرددخودكار

به عهده در اينترنت( بصورت خودكار)پروتكلي كه اين وظيفه را

مي باشدIKEدارد

(IKE)پروتكل مبادله كليد اينترنت

Page 40: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

40

معرفيIKE

براي مبادله امن IPSecپيش فرض •كليددهاي فراهم كردن يك ارتباط امن بين طرفين باتوافق بر روي كلي•

جلسه

IPSecپروتكل اصلي براي ايجاد و ابقاء •

SA

يددار متكي به مكانيزمهاي رمز كليد عمومي و توابع درهم كل•

(IKE)پروتكل مبادله كليد اينترنت

Page 41: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

41

روشهاي احراز اصالت

روشهاي احراز اصالت درIKE

( Preshared Key)روش كليد از پيش مشترك-1

(Public Key Signature) روش امضاي كليد عمومي-2

(Public Key Encryption) روش رمزكليد عمومي-3

Public Key Encryption)روش رمزكليد عمومي اصالح شده-4

Revised)

Page 42: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

42

(SPD)پايگاه سياست هاي امنيتي

SPDده در يك جدول كه توسط راهبر سيستم تعريف ش.است قرار دارد

ركوردهاي آن براي هر بسته وارد شده و در حال خروج:سياست امنيتي را مشخص مي كند

حفاظت(Apply)

عبور بدون حفاظت(Bypass)

دور انداختن(Reject)

Page 43: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

43

(SPD)پايگاه سياست هاي امنيتي

هر ركورد حاويرد آنها مشخصات بسته هايي است كه بايد سياست خاصي در مو

: پارامترهاي انتخاب سياست عبارتند از. اعمال شودمشخصات آدرس مبدا و مقصد بسته

Range

Subnet

مشخصات پروتكل اليه باالترTCP,UDP,..

در صورتTCP ياUDPبودن، مشخصات پورتها

Page 44: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

44

(SPD)پايگاه سياست هاي امنيتي

هر ركورد حاوي سياست امنيتي

Apply

Reject

Bypass

و در صورتApply مشتمل بر:طرف مقابل در برقراري ارتباط

پروتكلAH ياESPيا هردوالگوريتم هاي قابل قبول براي احراز اصالت و رمزنگاري

طول مدت قابل قبول برايSA(SA Life Time)

Page 45: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

45

IPSecمعماري

IPsec module 1 IPsec module 2

SPD

SADSAD

SPD

IKE IKE

Inbound

OutboundSA

Inbound

Outbound

Page 46: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

46

Outbound Process

Check SPDS against Outboun SPD

Drop packet

Reject

Forward

Forward packet

Drop packet and log

No SPD re

cord F

ound

Is SPD record SA valid

Awake IKE

Drop Packet

Make new IPHDR & fill up SPI field

& Sequence number

yes

AH or ESP

ICV Computation & Padding

Forward new packet

AH

encryption required ?

ESP

Encrypt packet

Authentication required ?

ICV Computation

Forward new packet

yes

No

Yes

NO

Outbound process

Page 47: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Is it for IPSec?

If so, which policy

entry to select?

SPD

(Policy)

SA

Database

IP Packet

Outbound packet (on A)

A B

SPI &

IPSec

Packet

Send to B

Determine the SA

and its SPI

IPSec processing

Outbound Processing

Page 48: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

Use SPI to

index the SAD

SA Database

Original IP Packet

SPI & Packet

Inbound packet (on B) A B

From A

Inbound Processing

SPD

(Policy)

Was packet properly

secured?

“un-process”

Page 49: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

49

How They Fit Together

SPD

SADBSA-2

SPI

SPI

SA-1

Page 50: In the Name of Allah Virtual Private Network - fanian.iut.ac.ir · History and background of VPNs 1 Internet multi-site organisations operated private networks using leased lines.

50

SPD and SADB Example

From To Protocol Port Policy

A B Any Any AH[HMAC-MD5]

Tunnel Mode

Transport Mode

AC

B

A’s SPD

From To Protocol SPI SA Record

A B AH 12 HMAC-MD5 keyA’s SADB

D

From To Protocol Port Policy Tunnel Dest

Any Any ESP[3DES] D C’s SPD

From To Protocol SPI SA Record

ESP 14 3DES keyC’s SADB

Asub Bsub

Asub Bsub