cs 356 – lecture 6 using cryptographic tools to secure the domain name system...

18
CS 356 – Lecture 6 Using Cryptographic Tools to Secure the Domain Name System (DNS) Fall 2013 Friday, September 13, 13

Upload: others

Post on 01-Mar-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

CS 356 – Lecture 6Using Cryptographic Tools to

Secure the Domain Name System (DNS)

Fall 2013

Friday, September 13, 13

7

Overview• Background Motivation

– Network Infrastructure Security

– DNS and DNS Vulnerabilities

• The DNS Security Extensions

– Authentication of DNS Responses

– Learning DNS Public Keys

– Authenticated Denial of Existence

• Critical Failures and Lessons Learned

Friday, September 13, 13

8

l Virtually every application

uses the Domain Name System

(DNS).

l DNS database maps:

n Name to IP address

www.darpa.mil = 128.9.176.20

n And many other mappings

(mail servers, IPv6, reverse…)

l Data organized as tree

structure.

n Each zone is authoritative

for its local data.

•Root

•edu •mil •ru

•darpa•isi •mil•af

•nge •andrews

The Domain Name System

Friday, September 13, 13

9

DNS Query and Response

•Caching DNS Server

•End-user

•www.darpa.mil A?

•www.darpa.mil A 128.9.128.127

•Root DNS Server

•Actually www.darpa.mil = 192.5.18.195. But how would you determine this?

•mil DNS Server

•darpa.mil DNS Server

Friday, September 13, 13

10

DNS Vulnerabilities• Original DNS design focused on data availability

– DNS zone data is replicated at multiple servers.

– A DNS zone works as long as one server is available.

• DDoS attacks against the root must take out 13 root servers.

• But the DNS design included no authentication.

– Any DNS response is generally believed.

– No attempt to distinguish valid data from invalid.

• Just one false root server could disrupt the entire DNS.

Friday, September 13, 13

11

A Simple DNS Attack

•Caching DNS Server

•Lixia’s Laptop

•www.darpa.mil A?

•www.darpa.mil A 128.9.128.127

•Root DNS Server

•mil DNS Server

•darpa.mil DNS Server

•Dan’s Laptop

•Easy to observe UDP DNS query sent to well known server on well known port.

•www.darpa.mil A 192.5.18.19

•First response wins. Second response is silently dropped on the floor.

Friday, September 13, 13

12

A More Complex Attack

•ns.attacker.com

•CSU Caching Server

•Remote attacker

•Query www.attacker.com

•Response www.attacker.com A 128.9.128.127• attacker.com NS ns.attacker.com• attacker.com NS www.google.com• ns.attacker.com A 128.9.128.2• www.google.com A 128.9.128.127•

• Laptop

•Query www.google.com

•www.google.com•= 128.9.128.127

Friday, September 13, 13

13

The Problem in a Nutshell

• Resolver can not distinguish between

valid and invalid data in a response.

• Idea is to add source authentication

– Verify the data received in a response is equal to

the data entered by the zone administrator.

– Must work across caches and views.

– Must maintain a working DNS for old clients.

Friday, September 13, 13

Dan Kaminsky

9

Friday, September 13, 13

The Kaminsky “summer of fear”

• The Kaminsky attack:– replied with 1.example.com,

2.example.com, 3.example.com over and over until it got accepted.

10

Friday, September 13, 13

14

DNS Security Extensions

•Cryptography is like magic fairy dust,•we just sprinkle it on our protocols and its makes everything secure

•- IEEE Security and Privacy Magazine, Jan 2003

Friday, September 13, 13

15

Secure DNS Query and Response

•Caching DNS Server

•End-user

•www.darpa.mil

• www.darpa.mil = 192.5.18.195•Plus (RSA) signature by the darpa.mil private key

•Attacker can not forge this answer without the darpa.mil private key.

•Authoritative DNS Servers

Friday, September 13, 13

16

Authentication of DNS Responses

• Each zone signs its data using a private key.

– Recommend signing done offline in advance

• Query for a particular record returns:

– The requested resource record set.

– A signature (SIG) of the requested resource record set.

• Resolver authenticates response using public key.

– Public key is pre-configured or learned via a sequence

of key records in the DNS heirarchy.

Friday, September 13, 13

17

Learning DNS Public Keys

• Public key is required to verify signature– RRSIG record identified the key name and key tag.

– If you are pre-configured with key, then done.• UCLA resolver is configured with the ucla.edu key

• Typical resolver does not have all the public keys.– Configure root key and perhaps some local keys

– Query zone for the desired public

– Query returns DNSKEY record and a signature from the parent zone.

Friday, September 13, 13

18

Example DNSSEC Records

darpa.mil. 81020 IN DNSKEY 256 3 1 ( Base64 encoding of pub key )darpa.mil. 81020 IN RRSIG DNSKEY 1 3 86400 20040226023910 ( 20040127023910 569 mil. • Base 64 encoding of signature )

name TTL class DNSKEY FLAGS PROTOCOL Algorithm public key

Note the darpa.mil DNSKEY is signed by the mil private key•(We later show why this doesn’t work)

name TTL class RRSIG type_covered Algorithm labels TTL expiration ( inception dates key_tag key_name signature )

www.darpa.mil. 82310 IN A 192.5.18.195www.darpa.mil. 82310 IN RRSIG A 1 4 86400 20040226023910 ( 20040127023910 468 darpa.mil. Base 64 encoding of signature )

Friday, September 13, 13

19

Authenticated Denial of Existence• What if the requested record doesn’t exist?

– Query for foo.isi.edu returns “No such name”– How do you authenticate this?

• Must meet a variety of operational constraints– Some zones refuse to store any keying

information online.– Some zones don’t trust (all) of their secondary

servers.• Can’t control which server a resolver contacts.

– Some zones don’t have compuational resources to sign on the fly

– Can’t predict user would ask for “foo.isi.edu”

Friday, September 13, 13

20

NSEC Records

•Caching DNS Server

•End-user

•foo.isi.edu. ?

• foo.isi.edu. does not exist• a.isi.edu NSEC g.isi.edu.• a.isi.edu RRSIG NSEC ….

•Authoritative DNS Servers

•Solution:• sign “next name after a.isi.edu. is g.isi.edu.”

Friday, September 13, 13

What’s Next• Read Chapter 1, 2, 3, and 4

– Chap 1: Focus on big picture and recurring concepts– Chap 2: Identify cryptographic tools and properties– Chap 3: How can you authenticate a user?– Chap 4: Access Control

• Homework Posted on Course Website – Due Tuesday

• Project 1 Posted on Course Website• Next Lecture Topics From Chapter 4

– Access Control

Friday, September 13, 13