Domain Name System Operations | P. Vixie |
Internet-Draft | Farsight Security, Inc. |
Intended status: Informational | V. Schryver |
Expires: April 14, 2017 | Rhyolite Software |
October 11, 2016 |
Response Policy Zones
draft-vixie-dns-rpz-00
This document describes a method for expressing DNS response policy inside a specially constructed DNS zone, and for processing the contents of such response policy zones (RPZ) inside recursive name servers. These "DNS Firewalls" are widely used in fighting Internet crime and abuse.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 14, 2017.
Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
This document may not be modified, and derivative works of it may not be created, except to format it for publication as an RFC or to translate it into languages other than English.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
This document describes DNS Firewalls or a method of expressing DNS [RFC1034] policy information inside specially constructed DNS zones, allowing DNS reputation data producers and subscribers to cooperate in the application of policies to real time DNS responses. Using this policy information, DNS resolution for low-reputation DNS data can be made to deliberately fail or to return local data such as an alias to a "walled garden". A full description of the expressible policies is given in Section 2.
Configuration examples using ISC BIND Version 9 (BIND9) [ISC-ARM] are given, because work to add RPZ to that platform was started in 2009. The RPZ specification itself is free to implement and free to use in operation, and so we expect other recursive DNS implementations to also implement DNS Firewalls as described by the RPZ specification.
A DNS Response Policy Zone (RPZ) is a DNS zone. As such its contents can be transferred between servers DNS in whole (AXFR) [RFC5936] or incrementally as changes occur (IXFR) [RFC1995], authenticated and protected by TSIG transaction signatures [RFC2845], and expedited by real time change notifications (NOTIFY) [RFC1996], all subject to familiar DNS access controls. An RPZ need not support query access since query access is never required. It is the zone transfer of RPZ content from producers to subscribers which effectively publishes the policy data, and it is the subscriber's server configuration which promotes RPZ payload data into DNS control plane data.
To be a valid DNS zone, an RPZ is required to have an SOA record and at least one NS record at its apex. The SOA record is real, with a serial number used for NOTIFY and IXFR and timers used for AXFR and IXFR. The MNAME field or domain name of the primary source of the zone and the RNAME field or mailbox of the person responsible for the zone are often used by RPZ providers to label their policy zones.
Because query access is never required, an RPZ's apex NS record will never be used and no parent delegation is required. The zone name of the NS record need not be a unique fully qualified domain name. By convention, a single NS record having the deliberately bogus value "LOCALHOST" is used as a placeholder. The zone's name can be fully qualified to show the identity of its producer or maintainer.
Like any DNS zone, an RPZ consists of RRsets or sets of resource records (RRs) with a common owner name and type. The owner names or left hand sides of RRsets other than the SOA and NS express policy triggers or characteristics of DNS response that require action. The action enjoined by a policy trigger is encoded in the rdata or right hand sides of the records.
All POLICY described here are from RPZ Format 1 unless otherwise noted. Policy triggers from a higher format number than a recursive name server's implementation level are expected to be invisible to that implementation. Policy actions from a higher format number are likely to be misinterpreted as CNAME local data by older implementations.
An RPZ resource record can specify any of five different results or actions.
$ORIGIN RPZ.EXAMPLE.ORG. ok.domain.com CNAME rpz-passthru.
$ORIGIN RPZ.EXAMPLE.ORG. domain.com CNAME . *.domain.com CNAME .
$ORIGIN RPZ.EXAMPLE.ORG. example.com CNAME rpz-drop.
All five types of RPZ triggers are encoded by RRset owner names in an RPZ.
Three of the types of triggers are based on target data (RDATA). Those policies are conceptually applied after recursion, so that the recursive DNS resolver's cache contains either nothing or "truth" even if this truth is hidden by current policy. If the policy changes, the original data is available for processing under the changed policy. The other types of policy trigger are independent of cache contents or recursion results.
$ORIGIN RPZ.EXAMPLE.ORG. DOMAIN.COM CNAME . *.DOMAIN.COM CNAME .
$ORIGIN RPZ.EXAMPLE.ORG. 24.0.1.168.192.rpz-ip CNAME . 32.2.1.168.192.rpz-ip CNAME rpz-passthru.
$ORIGIN RPZ.EXAMPLE.ORG. 48.zz.2.2001.rpz-ip CNAME *. 128.3.zz.2.2001.rpz-ip CNAME rpz-passthru.
$ORIGIN RPZ.EXAMPLE.ORG. 48.zz.2.2001.rpz-client-ip CNAME *. 128.3.zz.2.2001.rpz-client-ip CNAME rpz-passthru.
$ORIGIN RPZ.EXAMPLE.ORG. NS.DOMAIN.COM.rpz-nsdname CNAME .
RPZs must be primary or secondary zones at subscriber recursive resolvers. They can only be searched in a recursive server's own storage, because additional network transactions for DNS resolvers are extremely undesirable.
By default, policies are applied only on DNS requests that ask for recursion (RD=1) and which either do not request DNSSEC metadata (DO=0) or for which no DNSSEC metadata exists.
Policies are checked at each stage of resolving a domain name defined by a CNAME or DNAME record, stopping at the first CNAME in the chain with an applicable policy. CNAME targets in a CNAME chain are checked as if they were query names.
If a policy trigger results in a modified answer, then that modified answer will include in its "authority" section the SOA RR of the DNS RPZ whose policy was used to generate the modified answer. This SOA RR will tell both the fully qualified name of the DNS RPZ and the serial number of the policy data which was connected to the DNS control plane at the time the answer was modified.
Response policy zones are loaded in the usual way. For primary zones this may mean loading the contents of a local file into memory, or connecting to a database. For secondary zones this means transferring the zone from the primary server using zone transfer such as IXFR [RFC1995] or AXFR [RFC5936]. It is strongly recommended that all secondary zone transfer relationships be protected with transaction signatures (DNS TSIG) and that real time change notification be enabled using the DNS NOTIFY protocol [RFC1996].
DNS resolvers often have limited or no notion of a DNS zone. They sometimes have special local zones, but generally have no implementations of IXFR, AXFR, or NOTIFY. Therefore, an external module or daemon that maintains local copies of policy zones can be useful.
To connect the name server's control plane to the DNS RPZ data plane, an ordered list of RPZs should be supplied. For each DNS RPZ in this list, it should be possible to specify an overriding policy action to be used for any policy triggers found in that RPZ. These override policies should include NXDOMAIN, NODATA, PASSTHRU, GIVEN, and CNAME. GIVEN just explicitly reaffirms the default which is to respect all policy actions found in this DNS RPZ. CNAME is an instance of "local data" which probably points to a walled garden service.
It is possible for more than one policy trigger among the various DNS RPZs connected to the name server's control plane to match a given DNS query or DNS response. The precedence rules for multiple matches are as follows:
By default, when a QNAME or client IP address policy is triggered and the trigger is of such high precedence that it dominates all other possible triggers (e.g. it is in the first configured policy zone), the resolver continues to check and fill its cache by recursion as if it did not already know the answer. This denies operators of authority servers for listed domains data about whether they are listed.
A DNS RPZ producer should make every effort to ensure that incremental zone transfer (IXFR [RFC1995]) rather than full zone transfer (AXFR [RFC5936]) is used to move new policy data toward subscribers. Also, real time zone change notifications (DNS NOTIFY [RFC1996] should be enabled and tested. DNS RPZ subscribers are "stealth slaves" as described in RFC 1996, and each such server must be explicitly denoted in the master server's configuration. Because DNS NOTIFY is a lazy protocol, it may be necessary to explicitly trigger the master server's "notify" logic after each update to the DNS RPZ. These operational guidelines are to limit policy data latency, since minimal latency is critical to both prevention of crime and abuse, and to withdrawal of erroneous or outdated policy.
In the data feed for disreputable domains, each addition or deletion or expiration can be handled using DNS UPDATE [RFC2136] to trigger normal DNS NOTIFY and subsequent DNS IXFR activity which can keep the subscribing servers well synchronized to the master RPZ. Alternatively, on some primary name servers (such as ISC BIND) it is possible to generate an entirely new primary RPZ file and have the server compute the differences between each new version and its predecessor. In ISC BIND this option is called "ixfr-from-differences" and is known to be performant even for million-rule DNS RPZ's with significant churn on a minute by minute basis.
It is good operational practice to include test records in each DNS RPZ to help that DNS RPZ's subscribers verify that response policy rewriting is working. For example, a DNS RPZ might include a QNAME policy record for BAD.EXAMPLE.COM and an IP policy record for 127.0.0.2. A subscriber can verify the correctness of their installation by querying for BAD.EXAMPLE.COM which does not exist in real DNS. If an answer is received it will be from the DNS RPZ. That answer will contain an SOA RR denoting the fully qualified name of the DNS RPZ itself.
RPZ was previously described in a technical note from Internet Systems Consortium [ISC-RPZ]. A more up to date description was in chapter 6 of the "BIND 9 Administrator Reference Manual" [ISC-ARM].
RPZ was designed by Paul Vixie and Vernon Schryver in 2009. The initial implementation and first patch adding it to BIND was written by Vernon Schryver in late 2009. Patches for various versions of BIND9 including 9.4, 9.6, and 9.7 were distributed from FTP servers at redbarn.org and rhyolite.com 2010.
If all RPZ triggers and actions had been foreseen at the start in 2009, they would probably have been encoded differently. Instead RPZ grew incrementally, and upward compatibility required continuing support of the original encodings.
Today, with a number of commercial RPZ providers with many users and no functional problems with the encodings, any lack of aesthetic appeal is balanced by the ever increasing weight of the installed base. For example, it is impossible to replace the original QNAME trigger encoding NXDOMAIN and NODATA policy action encodings with encodings that involve rpz‑* psuedo-TLDs at RPZ providers without breaking the many existing RPZ subscriber installations. The original, deprecated [Format 1] PASSTHRU encoding of a CNAME pointing to the trigger qname might still be in use in local, private policy zones, and so it is still recognized by RPZ subscriber implementations.
The initial RPZ idea was only to deny the existence of objectionable domain names, and so there were only QNAME triggers and NXDOMAIN actions. Given that single kind of trigger, encoding it as the owner name of a policy record was clearly best. A CNAME pointing to the root domain (.) is a legal and valid but not generally useful record, and so that was the encoding for the NXDOMAIN action. The encoding of the NODATA action as "CNAME *." followed similar reasoning. Requests for more kinds of triggers and actions required a more general scheme, and so they are encoded as CNAMES with targets in bogus TLDs owner names with DNS labels that start with "rpz_".
No actions are required from IANA as result of the publication of this document.
RPZ is a mechanism for providing "untruthful" DNS results from recursive servers. However, RPZ does not increase the intrinsic DNS vulnerabilites at recursive servers to falsifying DNS data. RPZ merely formalizes and facilitates modifying DNS data on its way from DNS authority servers to clients. Moreover, DNSSEC (see RFC 4033 [RFC4033] and RFC 4034 [RFC4034]) prevents changes to DNS data by RPZ.
By default, DNS resolvers using RPZ do not modify DNS results when DNSSEC signatures are available and requested by the DNS client. When the common "BREAK-DNSSEC" configuration setting is used, RPZ using resolvers ignore DNSSEC. The result of "BREAK-DNSSEC" at DNS clients using DNSSEC is functionally similar to an RPZ NXDOMAIN policy action; the DNS client is blocked from malefactor domains.
The policy zones might be considered sensitive, because they contain information about malefactors. Like other DNS zones in most situations, RPZs are transferred from sources to subscribers as cleartext vulnerable to observation. However, TSIG transaction signatures [RFC2845] SHOULD be used to authenticate and protect RPZ contents from modification.
Recursive servers using RPZ are often configured to complete recursion even if a policy trigger provides a rewritten answer without needing recursion. This impedes malefactors observing requests from their own authority servers from inferring whether RPZ is in use and whether their RRs are listed. "qname-wait-recurse" is a common configuration switch that controls this behavior.
bad.domain.com CNAME walled-garden.example.net. *.bad.domain.com CNAME walled-garden.example.net.
bad.domain.com CNAME . *.bad.domain.com CNAME .
bad.domain.com MX 0 wgmail.example.net. bad.domain.com A 192.168.6.66 *.bad.domain.com MX 0 wgmail.example.net. *.bad.domain.com A 192.168.6.66
$ORIGIN rpz.example.com. $TTL 1H @ SOA LOCALHOST. named-mgr.example.com. ( 1 1h 15m 30d 2h) NS LOCALHOST. ; QNAME policy records. ; There are no periods (.) after the relative owner names. nxdomain.domain.com CNAME . ; NXDOMAIN policy nodata.domain.com CNAME *. ; NODATA policy ; redirect to walled garden bad.domain.com A 10.0.0.1 AAAA 2001:2::1 ; do not rewrite OK.DOMAIN.COM (so, PASSTHRU) ok.domain.com CNAME rpz-passthru. bzone.domain.com CNAME garden.example.com. ; redirect X.BZONE.DOMAIN.COM to ; X.BZONE.DOMAIN.COM.GARDEN.EXAMPLE.COM *.bzone.domain.com CNAME *.garden.example.com. ; rewrite all answers for 127/8 except 127.0.0.1 8.0.0.0.127.rpz-ip CNAME . 32.1.0.0.127.rpz-ip CNAME rpz-passthru. ; rewrite to NXDOMAIN all responses; for domains for which ; NS.DOMAIN.COM is an authoritative DNS server or a server ; for a parent) or that have an authoritative server ; in 2001:2::/48 ns.domain.com.rpz-nsdname CNAME . 48.zz.2.2001.rpz-nsip CNAME .
An existing data feed capable of producing an RHSBL can be trivially used to generate a DNS RPZ. If the desired policy is to alias targeted domains to a local walled garden, then for each domain name, generate the following records, one for the name itself and perhaps also one for its sub-domains:
If it is desirable to return NXDOMAIN for each domain (and its sub-domains in this example), try this:
If there are specific walled gardens for mail versus everything else:
An extended example follows: