Internet-Draft | Data for Filtered DNS | October 2021 |
Wing, et al. | Expires 16 April 2022 | [Page] |
DNS filtering is widely deployed for network security, but filtered DNS responses lack information for the end user to understand the reason for the filtering. Existing mechanisms to provide detail to end users cause harm especially if the blocked DNS response is to an HTTPS website.¶
This document defines a mechanism to explain the reason for the DNS filtering and provides HTTPS URIs to get more detail. This information can be parsed by the client and displayed, logged, or used for other purposes.¶
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 https://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 16 April 2022.¶
Copyright (c) 2021 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 (https://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.¶
DNS filters are deployed for a variety of reasons including endpoint security, parental filtering, and filtering required by law enforcement. Network-based security solutions such as firewalls and Intrusion Prevention Systems (IPS) rely upon network traffic inspection to implement perimeter-based security policies and operate by filtering DNS responses. In a home, DNS filtering is used for the same reasons as above and additionally for parental control. Internet Service Providers typically block access to some DNS domains due to a requirement imposed by an external entity (e.g., law enforcement agency) also performed using DNS-based content filtering.¶
Users of DNS services which perform filtering may wish to receive more information about such filtering to resolve problems with the filter -- for example to contact the administrator to whitelist a domain that was erroneously filtered or to understand the reason a particular domain was filtered. With that information, the user can choose another network, open a trouble ticket with the DNS administrator to resolve erroneous filtering, log the information, or other uses.¶
DNS responses can be filtered by sending a bogus (also called, "forged") A or AAAA response, NXDOMAIN error or empty answer, or an extended DNS error (EDE) code defined in [RFC8914]. Each of these methods have advantages and disadvantages that are discussed below:¶
The DNS response is forged to provide a list of IP addresses that points to an HTTP(S) server alerting the end user about the reason for blocking access to the requested domain (e.g., malware). When an HTTP(S) enabled domain name is blocked, the network security device (e.g., CPE, firewall) presents a block page instead of the HTTP response from the content provider hosting that domain. If an HTTP enabled domain name is blocked, the network security device intercepts the HTTP request and returns a block page over HTTP. If an HTTPS enabled domain is blocked, the block page is also served over HTTPS. In order to return a block page over HTTPS, man in the middle (MITM) is enabled on endpoints by generating a local root certificate and an accompanying (local) public/private key pair. The local root certificate is installed on the endpoint while the network security device(s) stores a copy of the private key. During the TLS handshake, the network security device modifies the certificate provided by the server and (re)signs it using the private key from the local root certificate.¶
However, configuring the local root certificate on endpoints is not a viable option in several deployments like home networks, schools, Small Office/Home Office (SOHO), and Small/ Medium Enterprise (SME). In these cases, the typical behavior is that the forged DNS response directs the user towards a server hosted to display the block page which breaks the TLS connection. For web-browsing this then results in an HTTPS certificate error message indicating that a secure connection could not be established, which gives no information to the end-user about the reason for the error. The typical errors are "The security certificate presented by this website was not issued by a trusted certificate authority" (Internet Explorer/Edge"), "The site's security certificate is not trusted" (Chrome), "This Connection is Untrusted" (Firefox), "Safari can't verify the identity of the website..." (Safari on MacOS)".¶
For both DNS filtering mechanisms described above, the DNS server can return extended error codes Blocked, Censored, Filtered, or Forged Answer defined in Section 4 of [RFC8914]. However, these codes only explain that filtering occurred but lack detail for the user to diagnose erroneous filtering.¶
No matter which type of response is generated (forged IP address(es), NXDOMAIN or empty answer, even with an extended error code), the user who triggered the DNS query has little chance to understand which entity filtered the query, how to report a mistake in the filter, or why the entity filtered it at all. This document describes a mechanism to provide such detail.¶
One of the other benefits of this approach is to eliminate the need to "spoof" block pages for HTTPS resources. This is achieved since clients implementing this approach would be able to display a meaningful error message, and would not need to connect to such a block page. This approach thus avoids the need to install a local root certificate authority on those IT-managed devices.¶
This document describes a protocol containing parsable data in a new EDNS(0) [RFC6891] option code.¶
Clients indicate their support of this specification in their DNS query so the DNS server can tailor its DNS response accordingly. The information returned in a DNS response allows combinations of headless devices (i.e., those lacking a display or other means to communicate with a human), operating systems, and web browsers to be informed of the filtering. This information returned can be logged and/or displayed to the user, as appropriate for the user interface capabilities of the client hardware and software.¶
This document does not recomment DNS filtering, but provides a mechanism for better transparency to explain to the users why some DNS queries are filtered.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119][RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document uses terms defined in DNS Terminology [RFC8499].¶
"Requestor" refers to the side that sends a request. "Responder" refers to an authoritative, recursive resolver or other DNS component that responds to questions. Other terminology is used here as defined in the RFCs cited by this document.¶
"Encrypted DNS" refers to any encrypted scheme to convey DNS messages, for example, DNS-over-HTTPS [RFC8484], DNS-over-TLS [RFC7858], or DNS-over-QUIC [I-D.ietf-dprive-dnsoquic].¶
This document defines a new EDNS(0) [RFC6891] option code (OPT) to include JSON providing information in the DNS response describing filtering that occurred for this query, defined in Figure 1.¶
The value of this EDNS(0) option code (OPT) is TBA-BY-IANA.¶
The description of the fields is as follows:¶
STRUCTURED-ERROR-JSON contains the following JSON names:¶
To reduce packet overhead the generated JSON SHOULD be as short as possible: short domain names, concise text in the values for the "j" and "o" names, and minified JSON (that is, without spaces or line breaks between JSON elements).¶
The JSON data can be parsed to display to the user, logged, or otherwise used to assist the end-user or IT staff with troubleshooting and diagnosing the cause of the DNS filtering.¶
When generating a DNS query, the client MUST include the Structured Error EDNS(0) option when encrypted DNS is used so the DNS server knows that the client is compliant with this specification.¶
When the DNS server filters its DNS response to an A or AAAA record query, the DNS response MAY contain an empty answer, NXDOMAIN, or a forged A or AAAA response, as desired by the DNS server. In addition, if the query contained the Structured Error EDNS(0) option, the DNS server MAY return more detail in the STRUCTURED-ERROR-JSON, as described below.¶
Over time a domain name might be filtered, then not filtered, then filtered again. Additionally, the user might take minutes or even days before investigating a filtered DNS query. Thus the complaint URI is RECOMMENDED to include sufficient detail to determine the filtering state when the DNS filtering occurred. If and how this is encoded into the complaint URI is an implementation decision.¶
On receipt of the DNS response, the following actions are performed specific to Structured Error EDNS(0) option, in no particular order:¶
An example showing the nameserver at 'ns.example.net' that filtered a DNS "A" record query for 'example.org' is shown in Figure 2.¶
In Figure 3 the same content is shown with minified JSON (no whitespace, no blank lines) with '\' line wrapping per [RFC8792].¶
Upon receipt, the two partial URIs ("c" and "r") are expanded to become fully-formed URIs. The class, type, and name are pulled from the DNS response (that matches the associated query) so that the fully-formed "c" URI becomes "https://ns.example.net?time=1621902483&type=a&name=example.org" and the "r" URI becomes "https://ns.example.net?country=atlantis&type=a&name=example.org".¶
Security considerations in Section 6 of [RFC8914] apply to this document.¶
To minimize impact of active on-path attacks on the DNS channel, the client validates the response as described in Section 5.3.¶
If the browser visits either of the URIs in the response ("c" or "r"), the browser SHOULD reduce the attack surface of the client by using an isolated environment precautions such as clearly labeling the page as untrusted or prevent user interaction with the page. Such isolation should prevent transmitting cookies, block JavaScript, block auto-fill of credentials or personal information, and be isolated from the user's normal environment.¶
When displaying the free-form text of "o" and "j", the browser SHOULD NOT make any of those elements into actionable (clickable) links.¶
Although the "d" value is validated, an attacker who is able to inject the Structured Error EDNS(0) option so that a DNS proxy or DNS forwarder, unaware of the option, will forward it and pass the validation checks described in Section 5.3. This means the other JSON fields can be controlled by the attacker. The "j" and "o" fields are, perhaps, the most interesting for an attacker to modify for nefarious purposes, because the "d" field has to match the encrypted DNS server's name and the expanded URIs from the "c" and "r" will point at the DNS resolver not under the attacker's control.¶
This document requests IANA assign a DNS EDNS0 Option Code (OPT) value in the Expert Review range named "Structured DNS Error".¶
This document requests IANA to register the "application/json+structured-dns-error" media type in the "Media Types" registry [IANA-MediaTypes]. This registration follows the procedures specified in [RFC6838]:¶
Type name: application Subtype name: json+structured-dns-error Required parameters: N/A Optional parameters: N/A Encoding considerations: as defined in Section NN of [RFCXXXX]. Security considerations: See Section NNN of [RFCXXXX]. Interoperability considerations: N/A Published specification: [RFCXXXX] Applications that use this media type: Section NNNN of [RFCXXXX]. Fragment identifier considerations: N/A Additional information: N/A Person & email address to contact for further information: IETF, iesg@ietf.org Intended usage: COMMON Restrictions on usage: none Author: See Authors' Addresses section. Change controller: IESG Provisional registration? No¶
This section is to be removed before publishing as an RFC.¶