Securing an Internet Name Server



Similar documents
BIND 9 DNS Security. Enterprise Applications Division of the Systems and Network Analysis Center (SNAC) Information Assurance Directorate

Domain Name System Security

Copyright International Business Machines Corporation All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure

The Continuing Denial of Service Threat Posed by DNS Recursion (v2.0)

DNS and BIND. David White

I. Introduction - 1 -

Networking Domain Name System

DNS Service on Linux. Supawit Wannapila CCNA, RHCE

DNS and BIND Primer. Pete Nesbitt linux1.ca. April 2012

Automatic Configuration of Slave Nameservers (BIND only)

DNS Appliance Architecture: Domain Name System Best Practices

DNS. Computer Networks. Seminar 12

Use Domain Name System and IP Version 6

DNS Cache Poisoning Vulnerability Explanation and Remedies Viareggio, Italy October 2008

Domain Name Server. Training Division National Informatics Centre New Delhi

Networking Domain Name System

Internet Security [1] VU Engin Kirda

Security of IPv6 and DNSSEC for penetration testers

DNS + DHCP. Michael Tsai 2015/04/27

Networking Domain Name System

Managing DNS Server Properties

Creating a master/slave DNS server combination for your Grid Infrastructure

DNS. The Root Name Servers. DNS Hierarchy. Computer System Security and Management SMD139. Root name server. .se name server. .

Deploying & Configuring a DNS Server on OpenServer 6 or UnixWare 7. Kirk Farquhar

Configuring the BIND name server (named) Configuring the BIND resolver Constructing the name server database files

BEST PRACTICES FOR IMPROVING EXTERNAL DNS RESILIENCY AND PERFORMANCE

Zimbra :: The Leader in Open Source Collaboration. Administrator's PowerTip #3: June 21, 2007 Zimbra Forums - Zimbra wiki - Zimbra Blog

BIND 9 Administrator Reference Manual

How to set up the Integrated DNS Server for Inbound Load Balancing

Part 5 DNS Security. SAST01 An Introduction to Information Security Martin Hell Department of Electrical and Information Technology

Lecture 2 CS An example of a middleware service: DNS Domain Name System

DNS zone transfers from FreeIPA to non-freeipa slave servers

DOMAIN NAME SECURITY EXTENSIONS

Overview. Firewall Security. Perimeter Security Devices. Routers

KB Windows 2000 DNS Event Messages 1 Through 1614

Where is Hong Kong in the secure Internet infrastructure development. Warren Kwok, CISSP Internet Society Hong Kong 12 August 2011

2 HDE Controller X DNS Server Manual

The Domain Name System

Securing DNS Infrastructure Using DNSSEC

DNS security: poisoning, attacks and mitigation

How-to: DNS Enumeration

Computer Networks: DNS a2acks CS 1951e - Computer Systems Security: Principles and Prac>ce. Domain Name System

Overview of Network Security The need for network security Desirable security properties Common vulnerabilities Security policy designs

Red Hat system-config-bind BIND (Berkeley Internet Name Domain) DNS ( Domain Name System)

Lesson Plans Managing a Windows 2003 Network Infrastructure

How to Configure the Windows DNS Server

Configuring BIND DNS for Microsoft s Active Directory

Best Practices For Architecting DNS and DHCP Networks. No IP. No Network. No Business.

Response Policy Zones for the Domain Name System (DNS RPZ) By Paul Vixie, ISC (et.al.) 2010 World Tour

Lightweight DNS for Multipurpose and Multifunctional Devices

Domain Name System (DNS) RFC 1034 RFC

Cork Institute of Technology Master of Science in Computing in Education National Framework of Qualifications Level 9

DNS Best Practices. Mike Jager Network Startup Resource Center

1 hours, 30 minutes, 38 seconds Heavy scan. All scanned network resources. Copyright 2001, FTP access obtained

HTG XROADS NETWORKS. Network Appliance How To Guide: EdgeDNS. How To Guide

FAQ (Frequently Asked Questions)

Using Webmin and Bind9 to Setup DNS Sever on Linux

Payment Card Industry (PCI) Data Security Standard

dnsperf DNS Performance Tool Manual

USING TRANSACTION SIGNATURES (TSIG) FOR SECURE DNS SERVER COMMUNICATION

Local DNS Attack Lab. 1 Lab Overview. 2 Lab Environment. SEED Labs Local DNS Attack Lab 1

The basic groups of components are described below. Fig X- 1 shows the relationship between components on a network.

DNSSEC - SECURE DNS FOR GOVERNMENT. Whitepaper

IPV6 SERVICES DEPLOYMENT

Computer Networks: Domain Name System

Managing Name Resolution

Yahoo Attack. Is DDoS a Real Problem?

DNSSEC: A Vision. Anil Sagar. Additional Director Indian Computer Emergency Response Team (CERT-In)

INTEGRATING VITALQIP WITH MICROSOFT WINDOWS NETWORKING/ ACTIVE DIRECTORY

Introduction to DNS and Application Issues related to DNS. Kirk Farquhar

Module 2. Configuring and Troubleshooting DNS. Contents:

Using the Domain Name System for System Break-ins

Firewalls 1 / 43. Firewalls

Client Server Registration Protocol

Security perimeter white paper. Configuring a security perimeter around JEP(S) with IIS SMTP

netkit lab load balancer dns 1.2 Massimo Rimondini Version Author(s)

Internet-Praktikum I Lab 3: DNS

Building a Linux IPv6 DNS Server

HTG XROADS NETWORKS. Network Appliance How To Guide: DNS Delegation. How To Guide

Services: DNS domain name system

Domain Name System (DNS) Fundamentals

5 Configuring a DNS Infrastructure

Building Nameserver Clusters with Free Software

Firewall Server 7.2. Release Notes. What's New in Firewall Server 7.2

BASIC FIREWALL SERVICES

Enterprise Architecture Office Resource Document Design Note - Domain Name System (DNS)

How To Guide Edge Network Appliance How To Guide:

Basic Configuration. Key Operator Tools older products. Program/Change LDAP Server (page 3 of keyop tools) Use LDAP Server must be ON to work

Application Firewalls

Lesson 13: DNS Security. Javier Osuna GMV Head of Security and Process Consulting Division

Solaris Networking Guide. Stewart Watkiss. Volume. New User To Technical Expert Solaris Bookshelf. This document is currently under construction

The Domain Name System from a security point of view

Guide to DDoS Attacks December 2014 Authored by: Lee Myers, SOC Analyst

Transcription:

Securing an Internet Name Server Cricket Liu cricket@verisign.com

Securing an Internet Name Server Name servers exposed to the Internet are subject to a wide variety of attacks: Attacks against the name server code Denial of service attacks Spoofing attacks, which try to induce your name server to cache false resource records You should make every effort to protect these name servers from these attacks

Run a New Version of Your Name Server While running the newest version doesn t guarantee your name server s security, it minimizes the possibility of attack Virtually all older name servers have widely known vulnerabilities The newest versions of BIND are: 9.1.0 (recommended) 8.2.3 4.9.8 (deprecated) For a matrix of vulnerabilities and which versions they exist in, see: http://www.isc.org/products/bind/bind-security.html

Name Server Availability BIND 9.1.0: ftp://ftp.isc.org/isc/bind9/9.1.0/bind-9.1.0.tar.gz 8.2.3: ftp://ftp.isc.org/isc/bind/src/cur/bind-8/bind-src.tar.gz 4.9.8: ftp://ftp.isc.org/isc/bind/src/4.9.8/bind-4.9.8-rel.tar.gz

Eliminate Single Points of Failure To combat denial of service attacks and prevent accidental service outages, eliminate single points of failure in your DNS infrastructure Don t put all of your name servers on a single subnet Don t put all of your name servers behind a single router Don t put all of your name servers behind a single leased line Arrange to have someone run an offsite slave name server for you

Filter Traffic to Your Name Server If the hosts that run your name servers don t do anything else, filter out all unnecessary traffic to those name servers Everything but traffic from the Internet to UDP and TCP to port 53

Restrict Zone Transfers Restricting zone transfers prevents Others from taxing your name server s resources Hackers from listing the contents of your zones To identify targets Mail servers Name servers To gain host demographic information How many hosts you have What makes and models you have What their names are (valuable if you name them after people or projects)

Restricting Zone Transfers with BIND 4 With BIND 4.9.x, use the xfrnets directive: xfrnets 206.168.119.178&255.255.255.255 This controls which name servers can transfer any zones from this name server

Restricting Zone Transfers with BIND 8 With BIND 8 or 9, use the allow-transfer substatement: options { allow-transfer { 206.168.119.178; or, specific to a zone: zone verisign.com { type master; file db.verisign.com ; allow-transfer { 206.168.119.178;

Notes on Restricting Zone Transfers Remember to restrict zone transfers from slave name servers, not just the primary master It s just as easy to transfer a zone from a slave as it is from the primary master nslookup s ls command and dig s axfr option are implemented as zone transfers 10

Authenticate Zone Transfers with TSIG With BIND 8.2 and later name servers, you can use transaction signatures, or TSIG, to cryptographically authenticate and verify zone data This requires that you configure a key on your primary master name server and slave name servers and instruct the name servers to use the key to sign communication with the other name servers 11

Configuring TSIG with BIND 8.2 and Later Primary master name server s named.conf: key huskymo-tornado. { algorithm hmac-md5; secret mzimnouyqpmnwsdzrx2enw== ; zone verisign.com { type master; file db.verisign.com ; allow-transfer { key huskymo-tornado; This tells the name server to expect zone transfer requests from the name server at 206.168.119.178 to be signed with the TSIG key huskymo-tornado. 12

Configuring TSIG with BIND 8.2+ Slave name server s named.conf: key huskymo-tornado. { algorithm hmac-md5; secret mzimnouyqpmnwsdzrx2enw== ; server 208.8.5.250 { transfer-format many-answers; keys { huskymo-tornado.; zone verisign.com { type slave; file bak.verisign.com ; allow-transfer { none; 13

Notes on Using TSIG Remember that TSIG requires time synchronization between the name servers involved The name of the key, not just the secret, must match on the servers 14

Restrict Dynamic Updates Dynamic updates are both useful and dangerous An authorized updater can delete all the records from a zone and add in completely different records If you use dynamic update at all, restrict it as much as possible To individual addresses To a list of TSIG keys If you use addresses for authentication, make sure you have strong anti-spoofing mechanisms in place On your border router or On your bastion host 15

Restricting Dynamic Updates with BIND BIND 8 and 9 understand dynamic updates BIND 8 and 9 won t accept dynamic updates to a zone by default You must add an access list to enable dynamic updates Use the allow-update substatement: zone verisign.com { type master; file db.verisign.com ; allow-update { localhost; key verisign-update-key.; 16

Restricting Dynamic Updates with BIND If you re only updating records attached to one domain name, you can create a new zone that contains just that name For example, if you re just updating the address of www.verisign.com: (in db.verisign.com, delegating the new zone) www.verisign.com. IN NS ns1.verisign.com. IN NS ns2.verisign.com. 17

Restricting Dynamic Updates with BIND In named.conf on the primary master name server for www.verisign.com: zone www.verisign.com { type master; file db.www.verisign.com ; allow-update { key www.verisign.com; At worst, a malicious updater could change the address of www.verisign.com or add subdomains of www.verisign.com, but couldn t update the verisign.com zone 18

Restricting Dynamic Updates with BIND With BIND 9, you can use the new update-policy substatement to restrict which domain names in a zone can be updated, and by which TSIG keys For example: zone verisign.com { type master; file db.verisign.com ; update-policy { grant www.verisign.com self www.verisign.com A; This lets the TSIG key www.verisign.com update only the domain name www.verisign.com s address records. 19

Protect Against Spoofing Accepting recursive queries from the Internet makes your name servers vulnerable to spoofing attacks Hackers can query your name server for information in zones under their control This forces your name server to query their evil name servers, which may spit back bogus data To deal with this, you can Turn off recursion, if possible Restrict the addresses the name server will respond to queries from Restrict the addresses the name server will respond to recursive queries from 20

A Sample DNS Spoofing Attack alternic.net name server alternic.net name server Query for address of www.alternic.net Reply, including bogus additional data target name server cache Data saved to cache 21

A Sample DNS Spoofing Attack resolver Recursive query for www.alternic.net s A RR alternic.net name server alternic.net name server Query for address of www.alternic.net Reply, including bogus additional data target name server cache Data saved to cache 22

Turning Off Recursion Disabling recursion puts your name servers into a passive mode, telling them never to send queries on behalf of other name servers or resolvers A non-recursive name server is very difficult to spoof, since it doesn t send queries, and hence doesn t cache any data You can t disable recursion on a name server if any legitimate resolvers query it, or if other name servers use it as a forwarder If you can t disable recursion, restrict the queries the name server will accept, shown later 23

Turning Off Glue Fetching Normally a name server returning NS records for which it does not have A records will attempt to retrieve them This is called glue fetching A potential source of a spoofed response Turning off glue fetching prevents this lookup The name server will never generate any queries And will not build up a cache 24

Turning Off Recursion and Glue Fetching With BIND With BIND 4.9, use the options directive: options no-recursion options no-fetch-glue With BIND 8, use the options statement: options { recursion no; fetch-glue no; BIND 9 s syntax is the same as BIND 8 s, but BIND 9 doesn t fetch glue 25

Restrict Queries If you can t turn off recursion, restrict the queries that your name servers accept to: The addresses they should come from The zones they should ask about On most name servers Queries for records in authoritative zones can come from anywhere, because the zones are delegated to the name server Queries for records outside of authoritative zones should only come from internal addresses 26

Restricting Queries with BIND Unfortunately, only BIND 8 and 9 (i.e., not BIND 4) will let you establish such finegrained access Use the allow-query substatement: acl internal { 206.168.119.176/29; options { directory /var/named ; allow-query { internal; zone verisign.com { type master; file db.verisign.com ; allow-query { any; 27

Restrict Recursive Queries BIND 8.2.1 and later allow you to restrict the IP addresses you accept recursive queries from Queriers from other IP addresses will have their recursive queries processed as non-recursive Use the allow-recursion substatement: acl internal { 206.168.119.178/29; options { directory /var/named ; allow-recursion { internal; zone verisign.com { type master; file db.verisign.com ; 28

Restrict Recursive Queries with BIND 9 BIND 9 name servers let you create multiple views Clients may see different views based on their IP addresses One view has recursion on One view has recursion off For example: view internal { match-clients { 206.168.119.176/29; recursion yes; view external { match-clients { any; recursion no; 29 zone verisign.com { type master; file db.verisign.com ;

More Protection Against Spoofing On a BIND 8 name server that queries name servers on the Internet, use use-id-pool to randomize message IDs and make spoofing harder options { directory /var/named ; use-id-pool yes; All BIND 9 name servers use an ID pool 30

Run Your Name Server as a User Other Than Root To ensure that a vulnerability in BIND doesn t give a hacker root access to your host, run named as a user besides root Make sure this user can read your named.conf and zone data files And, if you use dynamic update for some zones, can write those zone data files Make sure this user can write to named s PID file To tell named to change users to the user named, for example, start it with: # named u named 31

Run Your Name Server chroot()d To ensure that a vulnerability in BIND doesn t give a hacker access to your host s entire filesystem, run your name server chroot()d, or confined to a particular directory You ll need copies of important libraries and system files in that directory For more information, see: Chapter 10 of DNS and BIND http://www.linuxdoc.org/howto/chroot-bind-howto.html http://www.etherboy.com/dns/chrootdns.html 32

Example Configurations Here are some example configurations showing you how to put it all together 33

Example Configurations A BIND 8 or 9 name server, primary master for a zone, supporting no resolvers, not used as a forwarder: acl slaves { 207.69.231.3; 209.86.147.1; options { directory /var/named ; recursion no; fetch-glue no; // for BIND 8 only allow-query { any; // the default zone verisign.com { type master; file db.verisign.com ; allow-transfer { slaves; This configuration allows anyone to query this name server, but treats all queries as non-recursive 34

Example Configurations A BIND 8 or 9 name server, primary master for a zone, that supports one or more resolvers: acl internal { 206.168.119/24; acl slaves { 207.69.231.3; 209.86.147.1; options { directory /var/named ; recursion yes; // the default allow-query { internal; use-id-pool yes; // for BIND 8 only zone verisign.com { type master; file db.verisign.com ; allow-transfer { slaves; allow-query { any; 35

Example Configurations A BIND 8.2.1+ or 9 name server, slave for a zone, that s used as a forwarder: acl internal { 206.168.119/24; options { directory /var/named ; recursion yes; // the default allow-recursion { internal; use-id-pool yes; // for BIND 8 only zone verisign.com { type slave; masters { 207.69.231.2; file bak.verisign.com ; allow-query { any; // the default allow-transfer { none; 36

Example Configurations A BIND 8 or 9 caching-only name server: acl internal { 206.168.119/24; options { directory /var/named ; recursion yes; // the default use-id-pool yes; // for BIND 8 only allow-query { internal; zone. { type hint; file db.cache ; 37

Split-Service Service Name Servers Consider creating two kinds of name server, each optimized for a particular function: Advertising name servers: Authoritative for zones to advertise to the Internet Listed in parent zones NS records Queried only by other name servers Non-recursive Resolving name servers: (May be) authoritative for internal zones Queried only by known resolvers (or forwarding name servers) Answer recursive queries from trusted sources 38

An advertising name server: Split-Service Service Name Server Configs acl slaves { 207.69.231.3; 209.86.147.1; options { directory /var/named ; recursion no; fetch-glue no; // for BIND 8 only allow-query { any; // the default zone verisign.com { type master; file db.verisign.com ; allow-transfer { slaves; 39

Split-Service Service Name Server Configs A resolving name server: acl internal { 192.168.0/24; options { directory /var/named ; recursion yes; // the default use-id-pool yes; // for BIND 8 only allow-query { internal; zone. { type hint; file db.cache ; zone verisign.com { type slave; masters { 207.69.231.2; file bak.verisign.com ; allow-transfer { internal; 40

Follow Relevant Newsgroups and Mailing Lists (Unfortunately) New vulnerabilities are found in name servers all the time (Fortunately) These vulnerabilities are usually patched quickly If you follow the relevant newsgroups and mailing lists closely, you ll find out about the vulnerabilities and any necessary reconfiguration or patches quickly 41

Newsgroups and Mailing Lists Relevant to BIND comp.protocols.dns.bind (and bind-users@isc.org, its mailing list equivalent; join by sending mail to bind-users-request@isc.org) comp.protocols.tcp-ip.domains The CERT mailing list (join by sending mail to cert-advisory-request@cert.org) Your UNIX vendor s security announcement mailing list 42

For More Information To learn more about how VeriSign can provide your company with a secure, outsourced DNS solution, please visit our web site at www.verisign-grs.com 43