64
Security challenges in Security challenges in DNS DNS Philippe Camacho Department of Computer Science University of Chile Workshop on Formal Methods in Cryptography 27-30 april 2009 / Campinas - Brazil

Security of DNS

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Security of DNS

Security challenges in Security challenges in

DNSDNS

Philippe CamachoDepartment of Computer Science

University of Chile

Workshop on Formal Methods in Cryptography

27-30 april 2009 / Campinas - Brazil

Page 2: Security of DNS

Outline

� DNS

� DNSSEC� Basics

� Key Rollover� Problems and Limitations

� How to improve the Security of DNS?� Threshold Cryptography

� Identity Based Cryptography

Page 3: Security of DNS

DNSA (brief) history

� ARPANET in the 70’s� Small, friendly network of a few hundreds of hosts.

� A centralized HOSTS.TXT file was used to map hostnames to network adresses.

� This file was updated once or twice a week.

� BUT, with the growth of ARPANET this schemebecame unpracticable� Traffic Load

� Name Collision

� Consistency

Page 4: Security of DNS

DNSBasics

� Domain Name System (DNS)

� Maps IP adresses to human friendly computer hostnames

� www.google.com � 64.233.163.104

� But also manages other type of information such as the listof mail servers associated to a domain

� Distributed, Replicated, Fault Tolerant

� Developped by the IETF (Internet Engineering Task Force) at the beginning of 1980’s

Page 5: Security of DNS

DNSDomain Namespace

cl edu mil org

uchile

root

dcc

.cl DOMAIN

Domain contains information called

Resource Records (RR). For

example the IP address associated to

www.dcc.uchile.cl

Page 6: Security of DNS

DNSName servers and Zones

cl edu mil org

uchile

ingenieria dim

/

dcc

NAME SERVERof the

ZONE uchile.cl

Delegation

Page 7: Security of DNS

DNSName servers and Zones

cl edu com org

uchile

ingenieria dim

/

dcc

NAME SERVERof theZONE

uchile.cl+ dcc.uchile.cl

Delegation

Page 8: Security of DNS

DNSType of Resource Records (RR)

Mail exchange for the domainMX

Authoritative Name ServersNS

AliasesCNAME

Reverse address name mappingPTR

Host AddressesA

Page 9: Security of DNS

DNSResolvers and Name Resolution

� Clients that access name servers

www.google.com?

Resolver

My assigned

name server is200.1.123.4

64.233.163.104

Name

Space

Name server

200.1.123.4

Page 10: Security of DNS

DNSResolving Algorithms

� Iterative

www.dcc.uchile.cl ? 192.80.24.4

.cl ?

Resolver

/

.cl

.uchile.cl

.dcc.uchile.cl

200.

1.123

.4

.uchile.cl ?

200.89.70.3

dcc.uchile.cl ?

www.dcc.uchile.cl ?192.80.24.4

192.80.24.2

Name Server

Page 11: Security of DNS

DNSResolving Algorithms

� Recursive

www.google.com ?

Resolver

Name Server

ww

w.g

oogle.c

om?

64.233.163.147

64.233.1

63.147

www.google.com?

ww

w.g

oo

gle

.co

m?

www.google.com?

64.233.163.147

64.233.163.147

64.233.163.147

Page 12: Security of DNS

DNSCaching

� DNS uses cache to improve performance

� e.g: In the case of iterative resolving

� What is the IP for www.dcc.uchile.cl?

� I know the IP for the name server of the zoneuchile.cl.

� I can ask this server directly without starting from theroot.

� Time To Live (TTL)

� Tradeoff between consistency and efficiency

Page 13: Security of DNS

DNSAttacks

� Many attacks on the DNS (references)

� Man in the Middle

� Cache poisoning

� (Distributed) Denial of Service

� Major problem

� Lack of integrity / authenticity

� Consequences are HUGE� Phishing

� Defacements

� Internet is down

Page 14: Security of DNS

DNSAttacks

� Man in the Middle

www.bigcompany.com? (1)

1.2.3.4

192.5.6.99 (True IP)

(3) (Too late)

(2) (Evil arrivesfirst)

Page 15: Security of DNS

DNSAttacks

� Cache Poisoning (AlterNIC 1997)

www.somesite.com? (1

)

www.somesite.com? (2)

200.3.4.5

(4) Too late again…

1.2.3.4

(3) Evil’s

faster

www.somesite.com? (5)(6) (From cache)

1.2.3.4

Page 16: Security of DNS

DNSAttacks

� (Distributed) Denial of Service

� Such as every internet service, DNS is exposed to (D)DoS

� However the specificity of the protocol allows

amplification attacks

� (D)DoS is really hard to avoid

� As we shall see DNSSEC do not pretend to solve this

problem and could possibly make it worse…

Page 17: Security of DNS

DNSAttacks

� A new attack [Kaminsky 08]

� Presented at Black Hat 2008

� Previous attack only allows to forge only one (url,ip)mapping.

� Kaminsky’s attack is far more devastating� Allows to control a whole domain (.cl)

� This is scary…� Many certificate authorities validate a user’s certificate by

sending an email… So in this case even SSL is useless!

Page 18: Security of DNS

DNSAttacks

� The Attack [Kaminsky 08] (basic idea)

1.2.3.4

.cl ?

Resolver

/

.cl

.uchile.cl

.dcc.uchile.cl

200.

1.123

.4 (T

oo late

)

.uchile.cl ?

1.2.3.2

dcc.uchile.cl ?

www.dcc.uchile.cl ?1.2.3.4

1.2.3.3

www.doesnotexist.cl

1.2.3.1 (First)

www.dcc.uchile.cl ?

Page 19: Security of DNS

DNSSECBasics

� What it is for?

� Authenticate data exchanged between theparticipants of the protocol

� What it is NOT for?

� Guarantee privacy (except for NSEC3)

� Ensure availability

Page 20: Security of DNS

DNSSEC Basics

� Core RFCs that describe DNSSEC� DNS Security Introduction and Requirements (4033)

� Resource Records for the DNS Security Extensions (4034)

� Protocol Modifications for the DNS Security Extensions (4035)

� Another important RFC� DNSSEC Operational Practices (4641)

� Web

� http://www.dnssec.net

Page 21: Security of DNS

DNSSEC Basics

cl edu mil org

uchile

ingenieria dim

/

dcc

• Every zone signs the public

key of its children

• The public key of the root is

preinstalled in nameserver.

• Every message (resourcerecord) is signed by its

author.

Page 22: Security of DNS

DNSSECResolution & Verification

� Iterative

www.dcc.uchile.cl ? 192.80.24.4

.cl ?

Resolver

/

.cl

.uchile.cl

.dcc.uchile.cl

200.

1.123

.4

.uchile.cl ?

200.89.70.3

dcc.uchile.cl ?

www.dcc.uchile.cl ?192.80.24.4

192.80.24.2

Name Server NS1

NS1

/

.cl

uchile.cl

dcc.uchile.cl

Page 23: Security of DNS

DNSSECResolution & Verification

� Recursive

www.google.com ?

Resolver

Name Server NS1

ww

w.g

oogle.c

om?

64.233.163.147

64.233.1

63.147

www.google.com?

ww

w.g

oo

gle

.co

m?

www.google.com?

64.233.163.147

64.233.163.147

64.233.163.147

NS1

NS2

NS2

NS3

NS4

NS5

NS3

NS4

NS5

Page 24: Security of DNS

DNSSECOperational Practices

� Time

� Assumption: global clock.

� Every signed information has a

limited lifetime.

� This also applies to keys.

Page 25: Security of DNS

DNSSECOperational Practices

� Two types of Keys

� Zone Signing Keys (ZSK)

� Are used to sign all the information

of the zone

� Key Signing Keys (KSK)

� Are used to sign the ZSK

� ZSK are used to sign the KSK of thechild

Parent

Child

KSK

signs

ZSK

ZSK

KSK

signs

Page 26: Security of DNS

DNSSECOperational Practices

� Motivation of the use of KSK/ZSK

� No parent/child interaction is required when ZSKs are

updated.

� The KSK can be made stronger.

� KSK is only used to sign a set of keys. It can be stored in a

safer place.

� KSK have longer effectivity period.

Page 27: Security of DNS

DNSSECOperational Practices

� KEY ROLLOVER

� It is necesarry to change the keys

from time to time

� As to make cryptanalysis harder

=> Scheduled Rollover

� Private keys may be stolen or cracked

=> Unscheduled Rollover

Page 28: Security of DNS

DNSSECOperational Practices

� Where can a keyrollover

occur?

Parent

Child

Resolver

/

Name Server

Get NEW PK

Publish NEW public key

Warn thatNEW PK is available

Page 29: Security of DNS

DNSSECOperational Practices

� Scheduled Key Rollover

� How do name servers/resolvers know this new public key?

� Pre-Publish Key Rollover

� Double Signature Rollover

� ZSK Rollover

� No interaction needed

� KSK Rollover

� Interaction needed between child and parent

Page 30: Security of DNS

DNSSECOperational Practices

� ZSK Prepublish Rollover

ZSK1ZSK1ZSK1

{ZONE_DATA}ZSK2{ZONE_DATA}ZSK2{ZONE_DATA}ZSK1{ZONE_DATA}ZSK1

{ZSK2}KSK{ZSK2}KSK{ZSK2}KSK

{ZSK1}KSK{ZSK1}KSK{ZSK1}KSK

ZSK2ZSK2ZSK2

KSKKSKKSKKSK

DNSKEY

Removal

New SignaturesNew DNSKEYinitial

Page 31: Security of DNS

DNSSECOperational Practices

� ZSK Prepublish Rollover

ZSK1ZSK1ZSK1

{ZONE_DATA}ZSK2{ZONE_DATA}ZSK2{ZONE_DATA}ZSK1{ZONE_DATA}ZSK1

{ZSK2}KSK{ZSK2}KSK{ZSK2}KSK

{ZSK1}KSK{ZSK1}KSK{ZSK1}KSK

ZSK2ZSK2ZSK2

KSKKSKKSKKSK

DNSKEY

Removal

New SignaturesNew DNSKEYinitial

Page 32: Security of DNS

DNSSECOperational Practices

� ZSK Prepublish Rollover

ZSK1ZSK1ZSK1

{ZONE_DATA}ZSK2{ZONE_DATA}ZSK2{ZONE_DATA}ZSK1{ZONE_DATA}ZSK1

{ZSK2}KSK{ZSK2}KSK{ZSK2}KSK

{ZSK1}KSK{ZSK1}KSK{ZSK1}KSK

ZSK2ZSK2ZSK2

KSKKSKKSKKSK

DNSKEY

Removal

New SignaturesNew DNSKEYinitial

Page 33: Security of DNS

DNSSECOperational Practices

� ZSK Prepublish Rollover

ZSK1ZSK1ZSK1

{ZONE_DATA}ZSK2{ZONE_DATA}ZSK2{ZONE_DATA}ZSK1{ZONE_DATA}ZSK1

{ZSK2}KSK{ZSK2}KSK{ZSK2}KSK

{ZSK1}KSK{ZSK1}KSK{ZSK1}KSK

ZSK2ZSK2ZSK2

KSKKSKKSKKSK

DNSKEY

Removal

New SignaturesNew DNSKEYinitial

Page 34: Security of DNS

DNSSECOperational Practices

� ZSK Double Signature Rollover

{ZONE_DATA}ZSK1{ZONE_DATA}ZSK1

ZSK1ZSK1

{ZONE_DATA}ZSK2{ZONE_DATA}ZSK2

{ZSK2}KSK{ZSK2}KSK

{ZSK1}KSK{ZSK1}KSK

ZSK2ZSK2

KSKKSKKSK

DNSKEY RemovalNew DNSKEYinitial

Page 35: Security of DNS

DNSSECOperational Practices

� ZSK Double Signature Rollover

{ZONE_DATA}ZSK1{ZONE_DATA}ZSK1

ZSK1ZSK1

{ZONE_DATA}ZSK2{ZONE_DATA}ZSK2

{ZSK2}KSK{ZSK2}KSK

{ZSK1}KSK{ZSK1}KSK

ZSK2ZSK2

KSKKSKKSK

DNSKEY RemovalNew DNSKEYinitial

Page 36: Security of DNS

DNSSECOperational Practices

� ZSK Double Signature Rollover

{ZONE_DATA}ZSK1{ZONE_DATA}ZSK1

ZSK1ZSK1

{ZONE_DATA}ZSK2{ZONE_DATA}ZSK2

{ZSK2}KSK{ZSK2}KSK

{ZSK1}KSK{ZSK1}KSK

ZSK2ZSK2

KSKKSKKSK

DNSKEY RemovalNew DNSKEYinitial

Page 37: Security of DNS

DNSSECOperational Practices

� Pros and Cons

� Prepublish Key Rollover� + Does not involve signing all the zone data twice.

� - Process requires 4 steps.

� Double Signature� + Process requires 3 steps.

� - The number of signatures in the zone doubles. Prohibitive for big zones.

Page 38: Security of DNS

DNSSECOperational Practices

� KSK Rollover

� Same idea

� Now the data to sign are (zone signing) keys

� However

� Double Signature Rollover seems better as the data signed

is only a set of key

� The child needs to warn the parent securely that the keys

have changed.

� The way to do this is left to the DNSSEC administrators.

Page 39: Security of DNS

DNSSECOperational Practices

� Unscheduled Key Rollover

� PANIC!

� “An authenticated out-of-band and secure

notify mechanism to contact parent is neededin this case.” (RFC 4641)

Page 40: Security of DNS

DNSSECOperational Practices

� Unscheduled Key Rollover� Keep the chain of trust intact

� Resign with the compromised key the new set of keys with a very

short lifetime, then make a rollover

� Problem: DOMAIN DISPUTE

� The adversary controls the compromised key, so he can also make a

keyrollover…

� At the end who should we believe?

� Break the chain of trust

� Say to the clients that there is a problem

� Fix the problem

� Interact with the clients to distribute the new public key

� Problem: DNSSEC is down for a while

Page 41: Security of DNS

NSEC 3

� DNSSEC � not only provides an authenticated mapping between IP

and domains

� but also provides proofs of non existence (membership)

� e.g: Q: www.doesnotexist.com ? A: this domain does not exist

� For efficiency� As to avoid signing dynamically the response the

consecutive pair of domains ordered in alphabetic orderare signed. All proofs are precomputed.

� [a.com, c.com], [c.com, e.com], [e.com,g.com], [g.com,z.com]

� hello.com does not exist � g.com < hello.com < z.com

Page 42: Security of DNS

NSEC 3

� Problem: Zone Walking

� An attacker can collect all the domains of a zone, by asking for domain that lies inside of every

succesive intervals.

� Is that a problem? After all the information is

public…

� Yes but in some case knowing all the domain

names for a given level can be a usefulinformation to build an attack for example.

Page 43: Security of DNS

NSEC 3

� Solution

� Applying a hash function H to the domain namesas to hide the information of the domain and still

be able get nonmembership proofs.

� a.com c.com e.com g.com z.com

H(hello.com)

H(c.com) H(a.com) H(z.com) H(g.com) H(e.com)

Page 44: Security of DNS

DNSSECProblems and Limitations

� First proposal 1999 (RFC 2535) butstill no current implementation at root level 2009

� Only a few of the Top Level Domains(.com, .org, countries…) run DNSSEC

� Chile is working hard at this moment to implement it!

� Why?

� Who signs the root?

� Practical Experiences (Netherlands,…) have been painful

� DNSSEC is complex

� People may not see the immediate benefit

� …

Page 45: Security of DNS

DNSSECProblems and Limitations

� DNSSEC is a “Non End to End” Protocol

End to End Protocol: SSH

Non End to End Protocol: DNSSEC

The end user does NOT know whether the chain of

trust has been broken!

Page 46: Security of DNS

DNSSECProblems and Limitations

� How to set the public keys life-time?

� Too big => gives more time to the Adversary

� Too short => inefficient

� Need to rollover key very often

Page 47: Security of DNS

DNSSECProblems and Limitations

� How to detect (automaticaly) that a private key has been stolen?

� Users generally don’t notice they have been victim of a phishing attack.

� Defacement

� When obtained by DNS cache poisoning, the owner of thewebsite is not aware of it.

� So in practice can we really detect thata key has been compromised?

Page 48: Security of DNS

DNSSECProblems and Limitations

� Key Rollover/Revocation Problem

� There is no real satisfactory solution for Key Revocation

� Key Rollver is complex

� Lack of specification

� No precise procedure in case of key compromise.

� How does the child warn its parent?

Page 49: Security of DNS

How to improve the Security ofDNS?

� There is no definition for the Adversary

� What can or cannot do the adversary

� Steal private keys?

� Only forge some signatures?

� Intercept any packet?

� Control a DNS Name Server?

� Create a Zone / Domain?

� Injection attack in Registrars Databases

� …

Page 50: Security of DNS

How to improve the Security ofDNS?

� Use of Threshold Cryptography[Cachin, Samar 04]

� What is Threshold Cryptography (very short)?

� N participants

� T participants can jointly sign

� T-1 participant cannot do anything

� =>Adversary must control T servers to perform an attack

N=4

T=2 participants required to sign

Page 51: Security of DNS

How to improve the Security ofDNS?

� Use of Threshold Cryptography[Cachin, Samar 04]

� Concrete proposal

� They use standard RSA signature

� Need to change the server implementation but not the client

� Benchmark

� Stealing private key is harder

� It can be effective against internal attacks.

� However

� If the servers that hold the share have got the same configuration, a samevulnerability can be enough to compromise all the servers.

� More Complex

Page 52: Security of DNS

How to improve the Security ofDNS?

� Identity Based Cryptography [Chan 03]

� Master Thesis work.

� Analyzes the possibilty to use IBC to improve the

security of DNS instead of using standard publickey cryptography.

� Original approach to solve this problem.

Page 53: Security of DNS

IBC

� Idea

� A Trusted Authority (TA) generates (SK,PK) anddistributes securely the private keys to everyparticipant.

� Then the TA publishes a public key PK

� The public key of every participant can be computed from PK and a public information� Email, Name, Passport Number, Biometric data

Page 54: Security of DNS

DNS with IBC

� [Shamir, 84]

First introduction of the concept.

� [Boneh,Franklin 01]

First efficient scheme for IBC using bilinear maps.

� Many other works, this is a very active field.

Page 55: Security of DNS

IBC

� Advantages

� No need to store public keys

� No need to sign/verify public keys

� No need to manage certificates

Page 56: Security of DNS

DNS with IBC

� Problem: Key Escrow

� The TA knows (generates) all the private keys ofusers.

� Is that really a problem?

� ANSWER� NO: in our setting, a parent can always create new

children with their respective private keys.

Page 57: Security of DNS

DNS with IBC

� Key Rollover

� Add timestamp to the identity

� dcc.uchile.cl || 28-4-2009::29-4-2009

� Key Revocation

� Still hard

� We could use a database of revocated keys but wewould loose the good properties of IBC…

Page 58: Security of DNS

DNS with IBC

� Problem of scalability

� A single authority has to generate all the privatekeys. This is not reasonable in the case of DNS.

� Solution

� Use of Hierchical Identity Based Cryptography

� The private key generation can be delegated tosubauthorities [Gentry, Silverberg 02]

Page 59: Security of DNS

DNS with HIBC

dcc

ID4

uchileclroot

ID3ID2ID1

ID2:cl edu mil org

ID3:uchile

ingenieria

ID1: root

ID4:dcc

Page 60: Security of DNS

DNS with HIBC

� How to sign?

dcc

ID4

192.4.5.7

ID5

uchileclroot

ID3ID2ID1

PKA

Verification process

(1) R random

(2) C = Encrypt(PKB,R)

(3) R’ = Decrypt(SKB,C)

(4) R = R’ ?

SKB = {192.4.5.7}SKA

SKA

PKB

Page 61: Security of DNS

DNS with HIBC

� Efficiency

� The size of a signature grows linearly in the

depth of the hierarchy.

� So we do not win to much (even we may loose) compared to the classical DNSSEC verification

procedure.

Page 62: Security of DNS

DNS with HIBC

� So at the end, is HIBC useful?

� HIBC has attractive properties

� No need to manage public key/certificates

� Simplifies the scheduled key rollover

� However some problems remain unsolved

� Key revocation (unscheduled key rollover)

� Verification time proportional to the depth of the domain nametree.

� Not clear that how to adapt the Recursive Resolving Algorithm

� In practice developping standards for pairings and HIBC takestime.

Page 63: Security of DNS

Conclusion

� DNS is essential for Internet

� DNS is not secure and this is a big problem

� DNSSEC adds integrity/authenticity to DNS

� DNSSEC raises some practical problems

� Key Rollover

� All or Nothing security / Not Point to Point

� Administrative problem: who signs the root?

� But DNSSEC is to the date the only concrete proposal to makeDNS more secure. Can we do better?

Page 64: Security of DNS

have.you.got.any.question