NetSec-26062013-Day2
NetSec-26062013-Day2
NetSec-26062013-Day2
Workshop
Yogyakarta, Indonesia
25 – 27 June, 2013
Proudly Supported by:
Presenters
Champika Wijayatunga
Areas of interests:
Internet Resource Management, IPv6, DNS/DNSSEC, Network
Security
Contact: champika@apnic.net
Presenters
Wita Laksono
Areas of interests:
Internet Resource Management, IPv6
Contact: wita@apnic.net
DNS Security
Concept: Resolving process & Cache
Question: www.apnic.net A
www.apnic.net A ? root-server
Resolver Caching
192.168.5.10 forwarder www.apnic.net A ?
(recursive) gtld-server
Ask apnic server @ ns.apnic.net (+ glue)
192.168.5.10
apnic-server
BIND
Retrieving BIND
• HTTP, FTP
– Internet Systems Consortium
• http://www.isc.org
• Other packages
– OpenSSL
• Will be needed for DNSSEC
BIND
• Version 9
– Current version (9.9.2)
• Release
• Release Candidate (Betas)
• Snapshots (Alphas)
– Never Use Snapshots on production servers
• Getting BIND
– http://www.isc.org/software/bind/992/download/bind-992targz
Unpacking BIND9
• tar xvfz bind-9.9.2.tar.gz
– Uncompresses and creates directory
– bind-9.9.2
• What's in there?
– A lot of stuff (dig, libraries etc)
– ./configure (script)
– ./doc/arm/Bv9ARM.html
• Administrator's Reference Manual
• Good source!!!
Building BIND9
• Named
• dnssec-keygen
– Generate keys of various types
• dnssec-signzone
– Sign a zone
• dig
– Troubleshoot: Usage: dig +dnssec @…
• named-checkzone & named-checkconf
– syntax check for zonefiles and named.conf
13
Server/Named Configuration
14
Questions ?
Recursive Server
Overview
• Recursive Service
• Root server list
• localhost
• 0.0.127.in-addr.arpa
• named.conf
Recursive Server
• Used to lookup data by applications
• Needs to know how to reach top of DNS
• Also should stop some queries
– localhost, 127.0.0.1
• Files
– named.conf
– root.hints
– localhost zone
– 0.0.127.in-addr.arpa zone
Root server list
• List of the 13 root server records
• Where to get it
– ftp rs.internic.net
• anonymous login
• cd domain
• get one of these files (they are the same)
– db.cache
– named.root
– named.cache
What it looks like
; This file holds the information on root name servers needed to!
; initialize cache of Internet domain name servers (e.g. reference this file in the
"cache . <file>"!
; -OR- RS.INTERNIC.NET!
; last update: Feb 04, 2008 related version of root zone: 2008020400!
; formerly NS.INTERNIC.NET!
. 3600000 IN NS A.ROOT-SERVERS.NET.!
; operated by WIDE!
. 3600000 NS M.ROOT-SERVERS.NET.!
; End of File!
!
localhost
• Loopback name in operating systems
• Means 127.0.0.1
• Queries for this shouldn't use recursion
• So we will configure a file to define the localhost. zone
– Note the "."
localhost file
$TTL 86400
@ IN SOA localhost. root.localhost. (
1 ; serial
1800 ; refresh
900 ; retry
69120 ; expire
1080 ; negative cache ttl
)
NS localhost.
A 127.0.0.1
Reverse for localhost
• Since we want "localhost -> 127.0.0.1" we want to have
"127.0.0.1 -> localhost"
31
Reminder: DNS Resolving
Question:
www.apnic.net A
root-server
1" 2" www.apnic.net A ?
10" TTL
“192.168.5.10” 7"
apnic-server
DNS: Data Flow
Zone administrator
1"
4"
Zone file master Caching forwarder
2"
3" 5"
Dynamic
updates
slaves
resolver
DNS Vulnerabilities
Corrupting data" Impersonating master"
Cache impersonation"
Zone administrator
1"
4"
Zone file master Caching forwarder
2"
3" 5"
Dynamic
updates
slaves
resolver
Cache pollution by"
Data spoofing"
Unauthorized updates"
AXFR" AXFR"
Slave" Master"
KEY: KEY:
%sgs!f23fv! %sgs!f23fv!
Response: Zone"
SOA " SOA "
…" …"
SOA" SOA"
verification"
37
TSIG steps
1. Generate secret
2. Communicate secret
3. Configure servers
4. Test
38
TSIG - Names and Secrets
• TSIG name
– A name is given to the key, the name is what is transmitted in the
message (so receiver knows what key the sender used)
>ls
Ø Kns1-ns2.pcx.net.+157+15921.key
Ø Kns1-ns2.pcx.net.+157+15921.private
TSIG – Generating a Secret
• TSIG should never be put in zone files!!!
– might be confusing because it looks like RR:
45
TSIG Testing - TIME!
• TSIG is time sensitive - to stop replays
– Message protection expires in 5 minutes
– Make sure time is synchronized
– For testing, set the time
– In operations, (secure) NTP is needed
DNS Vulnerabilities
Corrupting data" Impersonating master"
Cache impersonation"
Zone administrator
1"
4"
Zone file master Caching forwarder
2"
3" 5"
Dynamic
updates
slaves
resolver
Cache pollution by"
Data spoofing"
Unauthorized updates"