ipsec - unical

30
IPSEC Lezione del 06/06/2016 Ing. Amilcare Francesco Santamaria University of Calabria 1

Upload: others

Post on 17-Feb-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IPsec - Unical

IPSECLezione del 06/06/2016

Ing. Amilcare Francesco Santamaria

University of Calabria

1

Page 2: IPsec - Unical

OUTLINE

What about Ipsec , a brief analysis

IPSec Architecture

Internet Key Exchange (IKE)

IPSec Policy

2

Page 3: IPsec - Unical

IP NETWORK AND SECURITY

IP protocol was designed in the late 70s to early 80s Very small network

All hosts are known!

So are the users!

Therefore, security was not an issue

3

Page 4: IPsec - Unical

SECURITY ISSUES IN IP

source spoofing

replay packets

no data integrity or confidentiality

4

• DOS attacks• Replay attacks• Spying• and more…

Fundamental Issue: Networks are not (and will never be) fully secure

Page 5: IPsec - Unical

MAIN GOALS TO REACH…

to verify sources of IP packets authentication

to prevent replaying of old packets

to protect integrity and/or confidentiality of packets data Integrity/Data Encryption

5

Page 6: IPsec - Unical

OUTLINE

What about Ipsec , a briefly analysis

IPSec Architecture

Internet Key Exchange (IKE)

IPsec Policy

6

Page 7: IPsec - Unical

SECURITY TO DIFFERENT LEVEL

Application Layer

Transport Layer

Network Layer

Data Link Layer

PGP, Kerberos, SSH, etc.

Transport Layer Security (TLS)

IP Security

Hardware encryption

Page 8: IPsec - Unical

IPSEC ARCHITECTURE

8

ESP

AH

IKE

IPSec Security PolicyEncapsulating SecurityPayload

Authentication Header

The Internet Key Exchange

Page 9: IPsec - Unical

IPSEC SECURITY SERVICES

Connectionless integrity Assurance that received traffic has not been

modified. Integrity includes anti-reply defenses.

Data origin authentication

Assurance that traffic is sent by legitimate party or parties.

Confidentiality (encryption)

Assurance that user’s traffic is not examined by non-authorized parties.

Access control

Prevention of unauthorized use of a resource.

Page 10: IPsec - Unical

IPSEC ARCHITECTURE

Three different cases where IPSec is used to offer security Host-to-host (E2E) (Transport Mode)

Host to gateway (Transport Mode);

Gateway to Gateway (Tunnel Mode);

Therefore, IPSec works with two kind of modalities in two: Transport mode (for end-to-end)

Tunnel mode (for VPN)

10

Page 11: IPsec - Unical

IPSEC ARCHITECTURE SUMMARY

11

Tunnel Mode

GTW GTW

Transport Mode

IP Header

TCPHeader

IPSecHeader

Data

protected

New IP Header

TCPHeader

IPSecHeader

DataOriginal IP Header

protected

Page 12: IPsec - Unical

IPSEC AND PACKET PROTECTION

Transport Mode: protect the upper layer protocolsIP

HeaderTCP

HeaderDataOriginal IP

Datagram

Transport Mode protected packet

Tunnel Mode: protect the entire IP payload

Tunnel Mode protected packet

IP Header

TCPHeader

IPSecHeader

Data

protected

New IP Header

TCPHeader

IPSecHeader

DataOriginal IP Header

protected

Page 13: IPsec - Unical

TUNNEL MODE

Host-to-Network, Network-to-Network

ProtectedData

IPSec

IP Layer

SG

Internet

Transport Layer

Application Layer

IP Layer

Host B

ProtectedData

IPSec

IP Layer

SG

Transport Layer

Application Layer

IP Layer

Host A

SG = Security Gateway

Page 14: IPsec - Unical

TRANSPORT MODE

Transport Layer

Application Layer

Host-to-Host

Transport Layer

Application Layer

IP Layer

Data Link Layer

IPSec

Host B

IP Layer

Data Link Layer

IPSec

Host A

Page 15: IPsec - Unical

VARIOUS PACKETS

15

IP header

IP header

IP header

TCP header

TCP header

TCP header

data

data

data

IPSec header

IPSec header IP header

Original

Transportmode

Tunnelmode

Page 16: IPsec - Unical

IPSEC – RELATED PROTOCOLS

A collection of protocols (RFC 2401) Authentication Header (AH)

RFC 2402

Encapsulating Security Payload (ESP)

RFC 2406

Internet Key Exchange (IKE)

RFC 2409

IP Payload Compression (IPcomp)

RFC 3137

16

Page 17: IPsec - Unical

AUTHENTICATION HEADER (AH)

Provides source authentication Protects against source spoofing

Provides data integrity

Protects against replay attacks Use monotonically increasing sequence numbers

Protects against denial of service attacks

NO protection for confidentiality!

17

Page 18: IPsec - Unical

AH DETAILS

Use 32-bit monotonically increasing sequence number to avoid replay attacks

Use cryptographically strong hash algorithms to protect data integrity (96-bit) Use symmetric key cryptography

HMAC-SHA-96, HMAC-MD5-96

18

Page 19: IPsec - Unical

AH PACKET DETAILS

19

Authentication Data

Sequence Number

Security Parameters Index (SPI)

Nextheader

Payloadlength

Reserved

Old IP header (only in Tunnel mode)

TCP header

New IP header

Authenticated

Data

EncapsulatedTCP or IP packet

Hash of everythingelse

Page 20: IPsec - Unical

ENCAPSULATING SECURITY PAYLOAD (ESP)

Provides all that AH offers, and

in addition provides data confidentiality Uses symmetric key encryption

The difference between ESP and the Authentication Header (AH) protocol is that ESP provides encryption, while both protocols provide authentication, integrity checking, and replay protection. With ESP, both communicating systems use a shared key for encrypting and decrypting the data they exchange.

If you decide to use both encryption and authentication, then the responding system first authenticates the packet and then, if the first step succeeds, the system proceeds with decryption. This type of configuration reduces processing overhead, as well as reduces your vulnerability to denial-of-service attacks.

20

Page 21: IPsec - Unical

ESP DETAILS

Same as AH: Use 32-bit sequence number to counter replaying attacks

Use integrity check algorithms

Only in ESP: Data confidentiality:

Uses symmetric key encryption algorithms to encrypt packets

ESP uses a symmetric key that both communicating parties use to encrypt and decrypt the data they exchange. The sender and the receiver must agree on the key before secure communication takes place between them. VPN uses Data Encryption Standard (DES), triple-DES (3DES), RC5, RC4, or Advanced Encryption Standard (AES) for encryption

21

Page 22: IPsec - Unical

ESP PACKET DETAILS

22

Authentication Data

Sequence Number

Security Parameters Index (SPI)

Nextheader

Payloadlength

Reserved

TCP header

Authenticated

IP header

Initialization vector

Data

Pad Pad length Next

Encrypted TCP packet

Page 23: IPsec - Unical

OUTLINE

Why IPsec?

IPsec Architecture

Internet Key Exchange (IKE)

IPsec Policy

23

Page 24: IPsec - Unical

INTERNET KEY EXCHANGE (IKE)

Exchange and negotiate security policies

Establish security sessions Identified as Security Associations

Key exchange

Key management

Can be used outside IPsec as well

24

Page 25: IPsec - Unical

IPSEC/IKE ACRONYMS

Security Association (SA) Collection of attribute associated with a connection

Is asymmetric! One SA for inbound traffic, another SA for outbound traffic

Similar to ciphersuites in SSL

Security Association Database (SADB) A database of SAs

25

Page 26: IPsec - Unical

IPSEC/IKE ACRONYMS

Security Parameter Index (SPI) A unique index for each entry in the SADB

Identifies the SA associated with a packet

Security Policy Database (SPD) Store policies used to establish SAs

26

Page 27: IPsec - Unical

HOW THEY FIT TOGETHER

27

WAN

SPD

SADBSA-2

SPI

SPI

SA-1

SPI : Security Parameter Index =>Header AH e ESP

Page 28: IPsec - Unical

SPD AND SADB EXAMPLE

From To Protocol Port Policy

A B Any Any AH[HMAC-MD5]

28

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

Page 29: IPsec - Unical

HOW IT WORKS

IKE operates in two phases Phase 1: negotiate and establish an auxiliary end-to-end

secure channel Used by subsequent phase 2 negotiations

Only established once between two end points!

Phase 2: negotiate and establish custom secure channels Occurs multiple times

Both phases use Diffie-Hellman key exchange to establish a shared key

29

Page 30: IPsec - Unical

IKE PHASE 1

Goal: to establish a secure channel between two end points This channel provides basic security features:

Source authentication

Data integrity and data confidentiality

Protection against replay attacks

30