dnssec in 6mins

79
Copyright © 2008 Internet Systems Consortium DNSSEC in 6 minutes • Update History Un-numbered - Initial Release 1.1 - Grammar Corrections, added version number 1.2 - Split into 2 parts 1.3 - Correction in dnssec-keygen, added update history 1.4 – Correction of DLV 1.5 – Cleanup of split and updates to udp53.org baseline version for Chinese translation

Upload: v-r

Post on 23-Mar-2016

220 views

Category:

Documents


0 download

DESCRIPTION

DNSSEC in 6 minutes provided by the Internet Systems Consortium 2008

TRANSCRIPT

Page 1: DNSSEC in 6mins

Copyright © 2008 Internet Systems Consortium

DNSSEC in 6 minutes

• Update HistoryUn-numbered - Initial Release

1.1 - Grammar Corrections, added version number

1.2 - Split into 2 parts

1.3 - Correction in dnssec­keygen, added update history

1.4 – Correction of DLV

1.5 – Cleanup of split and updates to udp53.org

baseline version for Chinese translation

Page 2: DNSSEC in 6mins

2Copyright © 2008 Internet Systems Consortium

Thanks to...

• Francis DuPont• Mark Andrews• Tim Brown• Håvard Eidnes• Bruce Esquibel• Carl Byington

• 孙国念 (SUN Guonian)

Page 3: DNSSEC in 6mins

Copyright © 2008 Internet Systems Consortium

DNSSEC in 6 minutes

Alan CleggSupport EngineerInternet Systems Consortium

[email protected]

Version 1.5

Page 4: DNSSEC in 6mins

4Copyright © 2008 Internet Systems Consortium

Understanding DNSSEC

Page 5: DNSSEC in 6mins

5Copyright © 2008 Internet Systems Consortium

Understanding DNSSEC

• DNSSEC enabled authoritative servers provide digital signatures across RRsets in addition to “standard” DNS data

• DNSSEC validating resolvers provide authenticated responses with proven integrity

Page 6: DNSSEC in 6mins

6Copyright © 2008 Internet Systems Consortium

Understanding DNSSEC

• Clients using validating resolvers get guaranteed “good” data for some value of “guaranteed”

• Data that does not validate provides a “SERVFAIL” response from the upstream resolver

Page 7: DNSSEC in 6mins

7Copyright © 2008 Internet Systems Consortium

Deploying DNSSEC

Page 8: DNSSEC in 6mins

8Copyright © 2008 Internet Systems Consortium

Deploying DNSSEC

• One-time activities:

Clarify authoritative server directory structure and zone file naming

Enable DNSSEC on authoritative servers

Enable DNSSEC on recursive servers

Page 9: DNSSEC in 6mins

9Copyright © 2008 Internet Systems Consortium

Deploying DNSSEC

• DNSSEC enable each zone Generate ZSK and KSK Include keys into zonefile Sign the zone Point named.conf at the signed zonefile Reload zone

Page 10: DNSSEC in 6mins

10Copyright © 2008 Internet Systems Consortium

Deploying DNSSEC

• Provide parent zone with DS records

• In the case of a DNSSEC unaware parent, provide DLV registry with DLV records

Page 11: DNSSEC in 6mins

11Copyright © 2008 Internet Systems Consortium

All of those steps...in detail!

Page 12: DNSSEC in 6mins

12Copyright © 2008 Internet Systems Consortium

Prepare directory structure

• Tools are available that make zone maintenance easy but they work best with a standardized directory structure

• Put all files for a zone into a single directory

Page 13: DNSSEC in 6mins

13Copyright © 2008 Internet Systems Consortium

Enable authoritative servers

options {  dnssec­enable yes;};

• Requires BIND to have been built on a system with OpenSSL libraries available

Page 14: DNSSEC in 6mins

14Copyright © 2008 Internet Systems Consortium

Enable recursive servers

options {  dnssec­enable yes;

    dnssec­validation yes;};

• Validation is done on the recursive, not authoritative servers.

Page 15: DNSSEC in 6mins

15Copyright © 2008 Internet Systems Consortium

Securing a Zone

• For each zone, two keys are created

1) Zone Signing Key – used to sign the data within the zone

2) Key Signing Key – used to sign the Zone signing key and to create the “Secure Entry Point” for the zone

Page 16: DNSSEC in 6mins

16Copyright © 2008 Internet Systems Consortium

Create the Keys

• Creating the ZSKdnssec­keygen ­a RSASHA1 ­b 1024­n ZONE zonename

Uses the RSASHA1 algorithm 1024 bits in length This is a DNSSEC ZONE key

Page 17: DNSSEC in 6mins

17Copyright © 2008 Internet Systems Consortium

Create the Keys

• Creating the ZSKdnssec­keygen ­a RSASHA1 ­b 1024­n ZONE zonename

• Creates 2 filesKzonename+<alg>+<fing>.keyKzonename+<alg>+<fing>.private .key is public portion of the key

.private is private portion of the key

Page 18: DNSSEC in 6mins

18Copyright © 2008 Internet Systems Consortium

Create the Keys

• Creating the KSK:dnssec­keygen ­a RSASHA1 ­b 4096­n ZONE ­f KSK zonename

Uses the RSASHA1 algorithm 4096 bits in length

This large key will need lots of entropy! This is a DNSSEC ZONE key Has the Secure Entry Point (KSK) bit set

Page 19: DNSSEC in 6mins

19Copyright © 2008 Internet Systems Consortium

Prepare the Zone

• Add the public portions of both KSK and ZSK to the zone to be signed

$INCLUDE in zonefile orcat Kzonename+*.key >> zonefile

Beware of only using one > !

Page 20: DNSSEC in 6mins

20Copyright © 2008 Internet Systems Consortium

Sign the Zone

• Add the RRSIG, NSEC and associated records to the zonednssec­signzone [­o zonename][­N INCREMENT] [­k KSKfile]zonefile [ZSKfile]

• zonename defaults to zonefile Name the file after the zone!

Page 21: DNSSEC in 6mins

21Copyright © 2008 Internet Systems Consortium

Sign the Zone

dnssec­signzone [­o zonename][­N INCREMENT] [­k KSKfile]zonefile [ZSKfile]

• ­N INCREMENT automatically increments the serial number during signing

Removes “human error factor”

Page 22: DNSSEC in 6mins

22Copyright © 2008 Internet Systems Consortium

Sign the Zone

dnssec­signzone [­o zonename][­N INCREMENT] [­k KSKfile]zonefile [ZSKfile]

• KSKfile defaults to Kzonefile*

with SEP bit set

• ZSKfile defaults to Kzonefile*

without SEP bit set

Page 23: DNSSEC in 6mins

23Copyright © 2008 Internet Systems Consortium

Sign the Zone

dnssec­signzone [­o zonename][­N INCREMENT] [­k KSKfile]zonefile [ZSKfile]

• Output file is zonefile.signed Sorted in alphabetical order RRSIG, NSEC & DNSKEY RRs included Much larger than before!

Page 24: DNSSEC in 6mins

24Copyright © 2008 Internet Systems Consortium

Update named.conf

Replacezone “zonename” {

  file “dir/zonefile”;

};

Withzone “zonename” {

  file “dir/zonefile.signed”;

};

Page 25: DNSSEC in 6mins

25Copyright © 2008 Internet Systems Consortium

Start serving signed zone

• Tell named to re-read the configuration

rndc reconfig

rndc flush

• You are now serving DNSSEC signed zones

Page 26: DNSSEC in 6mins

26Copyright © 2008 Internet Systems Consortium

Periodic Maintenance Issues

Page 27: DNSSEC in 6mins

27Copyright © 2008 Internet Systems Consortium

Periodic Zone Maintenance

• Signatures have lifespans “Born-on” date – 1 hour prior to running dnssec­signzone

Expiration date – 30 days after running dnssec­signzone

• Expired signatures lead to zones that will not validate!

Page 28: DNSSEC in 6mins

28Copyright © 2008 Internet Systems Consortium

Periodic Zone Maintenance

• Any time you modify a zone – or at least every 30 days (minus TTL) you must re-run dnssec­signzone

• If you don't1) Zone data will be stale2) Zone data will be GONE

Page 29: DNSSEC in 6mins

29Copyright © 2008 Internet Systems Consortium

Periodic Key Maintenance

• Keys need to be rotated No “expiration date”

• The longer a key is in public view, the more likely it is to be compromised

• Compromise (theft) of a key may lead to the need to “roll” a key over

Page 30: DNSSEC in 6mins

30Copyright © 2008 Internet Systems Consortium

Periodic Key Maintenance

• KSK should be rolled once a year• ZSK should be rolled every 3 months

• Procedure is more complex than this presentation will get into

• Automation exists now!

Page 31: DNSSEC in 6mins

31Copyright © 2008 Internet Systems Consortium

Real-World Example

Page 32: DNSSEC in 6mins

32Copyright © 2008 Internet Systems Consortium

Sample with real names

• zonename to sign is udp53.org

• zonefile name is udp53.org

• Directory containing zonefile is /zone/udp53.org

Full path to zonefile is:

/zone/udp53.org/udp53.org

Page 33: DNSSEC in 6mins

33Copyright © 2008 Internet Systems Consortium

Sample with real names

<add dnssec­enable to named.conf>cd /zone/udp53.org

dnssec­keygen ­a rsasha1 ­b 1024 ­n ZONEudp53.org

dnssec­keygen ­a rsasha1 ­b 4096 ­n ZONE­f KSK udp53.org

cat Kudp53*key >> udp53.org

dnssec­signzone ­N INCREMENT udp53.org

<change zone file entries to use .signed>

Page 34: DNSSEC in 6mins

34Copyright © 2008 Internet Systems Consortium

Sample with real names

• Initially, /zone/udp53.org contained ONLY the zonefile “udp53.org”

• When finished:2 ZSK files (.key and .private)

2 KSK files (.key and .private)

2 zonefiles (unsigned and .signed)

dsset­udp53.org file (DS RRs)

keyset­udp53.org file (DNSKEY RRs)

Page 35: DNSSEC in 6mins

35Copyright © 2008 Internet Systems Consortium

Sample with real names

• zonefile began with 71 lines 2,378 characters

• Ended with 665 lines 26,970 characters

Page 36: DNSSEC in 6mins

36Copyright © 2008 Internet Systems Consortium

Notify parent of DNSSEC

• Your parent zone must now insert a “DS” RR to create a chain-of-trust

• Procedures will differ between organizations, but this must be done securely will require use of dsset­ and/or keyset­ files

Page 37: DNSSEC in 6mins

37Copyright © 2008 Internet Systems Consortium

DNSSEC unaware parent

• Not all TLDs support DNSSEC Actually, VERY FEW TLDs currently

support DNSSEC

• Provide your DNSKEY to those that you wish to have validate your zone This must be done securely, not just

with “dig”

Page 38: DNSSEC in 6mins

38Copyright © 2008 Internet Systems Consortium

Trust Anchors

Page 39: DNSSEC in 6mins

39Copyright © 2008 Internet Systems Consortium

Trust Anchors

• To validate other zones, you must insert “trust anchors” for each zone apex below which you wish to validate

• The ultimate trust anchor would be a signed DNS root (“.”) with fully populated TLDs

Page 40: DNSSEC in 6mins

40Copyright © 2008 Internet Systems Consortium

Trust Anchors

• When the DNS root (“.”) is signed, there will only be one required trust anchor

• Even after the DNS root is signed, it is still possible and probably necessary to have additional trust anchors

Page 41: DNSSEC in 6mins

41Copyright © 2008 Internet Systems Consortium

Trust Anchors

• At this time (Summer 2008), the DNS root (“.”) isn't signed

• Individual trust-anchors are required• Trust anchors must be obtained by

trusted means• DNS is not one of those means,

HOWEVER...

Page 42: DNSSEC in 6mins

42Copyright © 2008 Internet Systems Consortium

Trust Anchors

dig udp53.org DNSKEY

udp53.org. 14400 IN  DNSKEY 256 3 5 BE[...]/V1

udp53.org. 14400 IN DNSKEY 257 3 5 BE[...]1ylot7

• Doing the “dig” provides something that can be verified via other means (web, phone, printed media, etc.)

Page 43: DNSSEC in 6mins

43Copyright © 2008 Internet Systems Consortium

Trust Anchors

• named.conf will need to contain:

trusted­keys {

  “udp53.org.” 257 3 5 “BE[...]1ylot7”;

  “isc.org.” 257 3 5 “BEAAAAO[...]ZCqoif”;

};

• An entry for EVERY zone apex below which you wish to validate

Page 44: DNSSEC in 6mins

44Copyright © 2008 Internet Systems Consortium

Trust Anchors

• Individual trust anchors do not scale well

• To help solve this problem, ISC created the DLV “Domain Lookaside Validation” RR and registry concept

Page 45: DNSSEC in 6mins

45Copyright © 2008 Internet Systems Consortium

Domain Lookaside Validation

Page 46: DNSSEC in 6mins

46Copyright © 2008 Internet Systems Consortium

DLV

• When validating, a resolver looks in the parent zone for a DS record for the zone being validated

• If it does not exist, a query for a DLV record in the DLV registry zone is made

• If successful, the DLV RR is used as the DS for the given zone

Page 47: DNSSEC in 6mins

47Copyright © 2008 Internet Systems Consortium

DLV Example

• udp53.org is signed

• The owner of udp53.org has registered with ISC's DLV Registry

• A DNSSEC query is made for the A RR for the label www.udp53.org

• No DS record is found in .org for the udp53.org zone

Page 48: DNSSEC in 6mins

48Copyright © 2008 Internet Systems Consortium

DLV Example

• A non-DLV enabled recursor will not be able to do validation at this point

• A DLV enabled recursor will look for udp53.org.dlv.isc.org. DLV RR

• That DLV RR will then be used as the DS for the udp53.org. zone

Page 49: DNSSEC in 6mins

49Copyright © 2008 Internet Systems Consortium

Enabling DLV

• Use of DLV to validate is done on the recursive server

A trust anchor must be created for the DLV registry

dnssec­lookaside must be linked to the DLV trust anchor

Page 50: DNSSEC in 6mins

50Copyright © 2008 Internet Systems Consortium

Enabling DLV

• named.conf:

trusted­keys {  dlv.isc.org. 257 3 5 “BEA[...]uDB”;};options {  dnssec­lookaside "."  trust­anchor dlv.isc.org.; 

};

Page 51: DNSSEC in 6mins

51Copyright © 2008 Internet Systems Consortium

Generating DLV RRs

• When signing a zone for a DLV registrar, add the “­l” (ell) switch to dnssec­signzone:a

dnssec­signzone [­o zonename][­N INCREMENT] ­l dlvzone[­k KSKfile] zonefile [ZSKfile]a

• dlvzone will be registrar dependent

Page 52: DNSSEC in 6mins

52Copyright © 2008 Internet Systems Consortium

Generating DLV RRs

• Based on the previous example:

dnssec­signzone ­N INCREMENT­l dlv.isc.org. udp53.org

• At this point, the file dlvkey­udp53.org will be created and ready to send to the ISC DLV administrator

Page 53: DNSSEC in 6mins

53Copyright © 2008 Internet Systems Consortium

Registering with DLV

• Contact the DLV registrar for instructions on how to prove ownership of zone and validity of DLV RR

• Insertion of your DLV RR into the DLV registry must be done in a trusted manner

Page 54: DNSSEC in 6mins

54Copyright © 2008 Internet Systems Consortium

ISC's DLV registry

http://www.isc.org/ops/dlv/

Page 55: DNSSEC in 6mins

55Copyright © 2008 Internet Systems Consortium

Questions?

Comments?

Page 56: DNSSEC in 6mins

56Copyright © 2008 Internet Systems Consortium

No! No, no, not 6!

I said 7

Nobody's comin' up with 6

Who deploys DNSSEC in 6

minutes?

Page 57: DNSSEC in 6mins

57Copyright © 2008 Internet Systems Consortium

Testing and Debugging DNSSEC

Page 58: DNSSEC in 6mins

58Copyright © 2008 Internet Systems Consortium

Testing DNSSEC

• Now that you are distributing DNSSEC signed RRsets, is it working?

• Mark Andrews stated that DNSSEC can be debugged using only “dig” and “date”

• Here's how!

Page 59: DNSSEC in 6mins

59Copyright © 2008 Internet Systems Consortium

digging DNSSEC

• A query asked for valid data from any recursor will provide the RRset in response

• A query asked for non-signed data from any recursor will provide the RRset in response

Page 60: DNSSEC in 6mins

60Copyright © 2008 Internet Systems Consortium

digging DNSSEC

• A query asked of a validating recursor for modified or invalid data will return SERVFAIL

• Applications (and users) will see this as domains that “vanish”

• A header bit (CD) will allow invalid data to be passed anyway

Page 61: DNSSEC in 6mins

61Copyright © 2008 Internet Systems Consortium

dig output – no DNSSEC

dig www.udp53.org a

;; [..] status: NOERROR;; flags: qr rd ra;

• Good answer; Response, Recursion Desired, Recursion Available

Page 62: DNSSEC in 6mins

62Copyright © 2008 Internet Systems Consortium

dig output – no DNSSEC

dig www.udp53.org a

;; [..] status: NOERROR;; flags: qr rd ra;

• From a validating recursor, this is guaranteed good data

Page 63: DNSSEC in 6mins

63Copyright © 2008 Internet Systems Consortium

dig output – no DNSSEC

dig www.udp53.org a

;; [..] status: NOERROR;; flags: qr rd ra;

• But how do you know that your recursor is doing validation?

Page 64: DNSSEC in 6mins

64Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +dnssec www.udp53.org a

;; [..] status: NOERROR;; flags: qr rd ra ad

• As before, but this time, Authenticated!

Page 65: DNSSEC in 6mins

65Copyright © 2008 Internet Systems Consortium

digging DNSSEC

• To return AD set, the validating recursor must have a trust anchor that can be tracked back to (via DS RRs)

• If the chain of trust does not lead to a trust anchor, AD will not be set but RRSIG RRs will still be returned

Page 66: DNSSEC in 6mins

66Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +dnssec www.udp53.org a

www.udp53.org. 3600 IN A 192.168.154.2

www.udp53.org. 3600 IN RRSIG A 5 3 3600 20080627122225 20080617122225 46704 udp53.org. XEkXkv9MCRiGbxO9T0dkNY+3y5EZRB6s6YOk0pFAVUL/y8VDeJphc8yb K6E/YLvraItdGvIvpy4P1OuIY09BGQ==

• If AD is set, recursor tracked back to a trust anchor, if not, we still have data that we can validate ourselves

Page 67: DNSSEC in 6mins

67Copyright © 2008 Internet Systems Consortium

digging DNSSEC

• If we know that we are talking to a validating recursor, and we get SERVFAIL, it may be non-validating signed data

• If so, setting the “CD” bit in the query will cause the recursor to send the “bad” data anyway

Page 68: DNSSEC in 6mins

68Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +dnssec +cd www.udp53.org a

www.udp53.org. 3600 IN A 192.168.154.2

www.udp53.org. 3600 IN RRSIG A 5 3 3600 20080627122225 20080617122225 46704 udp53.org. XXXXXXXXXX

• Invalid RRSIG (XXXXXXXXXXXXXXXXXXXX), but with +cd, we get a response anyway

Page 69: DNSSEC in 6mins

69Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +dnssec +cd www.udp53.org a

www.udp53.org. 3600 IN A 192.168.154.2

www.udp53.org. 3600 IN RRSIG A 5 3 3600 20030627122225 20030617122225 46704 udp53.org. XEkXkv9MCRiGbxO9T0dkNY+3y5EZRB6s6YOk0pFAVUL/y8VDeJphc8yb K6E/YLvraItdGvIvpy4P1OuIY09BGQ==

• Dates in signature show that it has expired

• Compare with “date”

Page 70: DNSSEC in 6mins

70Copyright © 2008 Internet Systems Consortium

digging DNSSEC

• Note that it is easy to check the date on the signatures

• It's much harder (humanly impossible?) to find an error in the key itself

• The previous example is extremely contrived (XXX?)

Page 71: DNSSEC in 6mins

71Copyright © 2008 Internet Systems Consortium

digging DNSSEC

• Another problem that can occur is a missing hash or key DS in parent DNSKEY in current zone

• Not hard to determine this fault either!

Page 72: DNSSEC in 6mins

72Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +dnssec +cd www.udp53.org

www.udp53.org. 3600 IN A 192.168.154.2

www.udp53.org. 3600 IN RRSIG A 5 3 3600 20080627122225 20080617122225 46704 udp53.org. XEkXkv9MCRiGbxO9T0dkNY+3y5EZRB6s6YOk0pFAVUL/y8VDeJphc8yb K6E/YLvraItdGvIvpy4P1OuIY09BGQ==

• This signature was created with key 46704

Page 73: DNSSEC in 6mins

73Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +cd +multi udp53.org dnskey

udp53.org.  14400 IN DNSKEY  256 3 5 (        BEAAAAO2oQi7U9m9i495S/XoAk+j8QxxnBHon6fa7nlN        7xoqrSr/xzy3+IerFS1KgJz1gJGbTsGV0WI1/bvAzIEK        Uh+p ) ; key id = 46704

• DNSKEY in zone exists

• If not, it won't validate!

Page 74: DNSSEC in 6mins

74Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +cd +multi udp53.org dnskey

udp53.org.  14400 IN DNSKEY 256 3 5 (B[...]p ) ; key id = 46704

udp53.org. 14400 IN DNSKEY 257 3 5 (B[...]J ) ; key id = 64249

• ZSK DNSKEY in zone exists

• Associated KSK is 64249

Page 75: DNSSEC in 6mins

75Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +norec @gTLD udp53.org ds

;; ­>>HEADER<<­ opcode: QUERY, status: NOERROR, id: 29385

;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 2

• DS does not exist in parent

• If we don't do DLV, this is why it won't authenticate

Page 76: DNSSEC in 6mins

76Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig +norec @gTLD udp53.org ds

;; ­>>HEADER<<­ opcode: QUERY, status: NOERROR, id: 29385

;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 2

• Server will still return “non-AD” DNSSEC data

• Because there is no chain-of-trust to a trust-anchor

Page 77: DNSSEC in 6mins

77Copyright © 2008 Internet Systems Consortium

dig output – DNSSEC

dig udp53.org.dlv.isc.org dlv

udp53.org.dlv.isc.org. 3257 IN DLV 64249 5 2 (59C58FD329F1C33628C92FC4B763EF9ADB833804D60D18D439AB04F6302C20FD )

udp53.org.dlv.isc.org. 3257 IN DLV 64249 5 1 (D5D722703D848E85D85E8A8442AF47512B385418 )

• KSK 64249 DLV does exist in ISC's registry, providing DS for zone

Page 78: DNSSEC in 6mins

78Copyright © 2008 Internet Systems Consortium

digging DNSSEC

• Trust anchor for dlv.isc.org

• DLV entry for udp53.org.dlv.isc.org

• KSK for udp53.org

• ZSK for udp53.org

• Signature for www.udp53.org

• AD bit set!

Page 79: DNSSEC in 6mins

79Copyright © 2008 Internet Systems Consortium

Questions?

Comments?