]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doc: update doh/doh2 documentation
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 27 Aug 2020 13:01:00 +0000 (15:01 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 13 Oct 2020 10:55:31 +0000 (12:55 +0200)
daemon/bindings/net_server.rst
daemon/bindings/net_tlssrv.rst
doc/config-network.rst
doc/modules-http-doh.rst [deleted symlink]
modules/http/README.doh.rst [deleted file]
modules/http/README.rst

index 2ef58354e41ca313cbdf40f8cf2817735ba00b16..ce847a32fb52c5e590a54b29c487123186444e6f 100644 (file)
@@ -13,10 +13,11 @@ First you need to decide what service should be available on given IP address
   :header: "Protocol/service", "net.listen *kind*"
 
   "DNS (unencrypted UDP+TCP, :rfc:`1034`)","``dns``"
-  ":ref:`DNS-over-TLS (DoT) <tls-server-config>`","``tls``"
-  ":ref:`mod-http-doh`","``doh``"
+  ":ref:`dns-over-tls`","``tls``"
+  ":ref:`dns-over-https`","``doh2``"
   ":ref:`Web management <mod-http-built-in-services>`","``webmgmt``"
   ":ref:`Control socket <control-sockets>`","``control``"
+  ":ref:`mod-http-doh`","``doh``"
 
 .. note:: By default, **unencrypted DNS and DNS-over-TLS** are configured to **listen
    on localhost**.
@@ -37,8 +38,8 @@ First you need to decide what service should be available on given IP address
   :header: "**Network protocol**", "**Configuration command**"
 
   "DNS (UDP+TCP, :rfc:`1034`)","``net.listen('192.0.2.123', 53)``"
-  ":ref:`DNS-over-TLS (DoT) <tls-server-config>`","``net.listen('192.0.2.123', 853, { kind = 'tls' })``"
-  ":ref:`mod-http-doh`","``net.listen('192.0.2.123', 443, { kind = 'doh' })``"
+  ":ref:`dns-over-tls`","``net.listen('192.0.2.123', 853, { kind = 'tls' })``"
+  ":ref:`dns-over-https`","``net.listen('192.0.2.123', 443, { kind = 'doh2' })``"
   ":ref:`Web management <mod-http-built-in-services>`","``net.listen('192.0.2.123', 8453, { kind = 'webmgmt' })``"
   ":ref:`Control socket <control-sockets>`","``net.listen('/tmp/kres.control', nil, { kind = 'control' })``"
 
@@ -52,13 +53,10 @@ Examples:
        net.listen(net.eth0, 853, { kind = 'tls' })
        net.listen('192.0.2.1', 53, { freebind = true })
        net.listen({'127.0.0.1', '::1'}, 53, { kind = 'dns' })
-       net.listen('::', 443, { kind = 'doh' }) -- see http module
+       net.listen('::', 443, { kind = 'doh2' })
        net.listen('::', 8453, { kind = 'webmgmt' }) -- see http module
        net.listen('/tmp/kresd-socket', nil, { kind = 'webmgmt' }) -- http module supports AF_UNIX
 
-.. warning:: Make sure you read section :ref:`mod-http-doh` before exposing
-             the DNS-over-HTTP protocol to outside.
-
 .. warning:: On machines with multiple IP addresses avoid listening on wildcards
         ``0.0.0.0`` or ``::``. Knot Resolver could answer from different IP
         addresses if the network address ranges overlap,
index 382ac0f64caf28b788e811e90d9dcb6904b25e19..ea8afcf5f13a35f7b0024ffffb56b30fb12ff142 100644 (file)
@@ -2,9 +2,8 @@
 
 .. _tls-server-config:
 
-DNS-over-TLS server (DoT)
--------------------------
-DoT encrypts DNS traffic with Transport Security Layer protocol and thus protects DNS traffic from certain types of attacks.
+DoT and DoH (encrypted DNS)
+---------------------------
 
 .. warning::
 
@@ -14,17 +13,70 @@ DoT encrypts DNS traffic with Transport Security Layer protocol and thus protect
    See `slides <https://irtf.org/anrw/2019/slides-anrw19-final44.pdf>`_
    or `the article itself <https://dl.acm.org/authorize?N687437>`_.
 
-DNS-over-TLS server (:rfc:`7858`) is enabled by default on localhost.
-Information how to configure listening on specific IP addresses is in previous sections:
+DoT and DoH encrypt DNS traffic with Transport Layer Security (TLS) protocol
+and thus protects DNS traffic from certain types of attacks.
+
+.. _dns-over-tls:
+
+DNS-over-TLS (DoT)
+^^^^^^^^^^^^^^^^^^
+
+DNS-over-TLS server (:rfc:`7858`) can be configured using ``tls`` kind in
+:func:`net.listen()`.  It is enabled on localhost by default.
+
+For certificate configuration, refer to :ref:`dot-doh-config-options`.
+
+.. _dns-over-https:
+
+DNS-over-HTTPS (DoH)
+^^^^^^^^^^^^^^^^^^^^
+
+.. note:: Knot Resolver currently offers two DoH implementations. It is
+   recommended to use this new implementation, which is more reliable, scalable
+   and has fewer dependencies. Make sure to use ``doh2`` kind in
+   :func:`net.listen()` to select this implementation.
+
+.. warning:: Independent information about political controversies around the
+   DoH deployment by default can be found in blog posts `DNS Privacy at IETF
+   104 <http://www.potaroo.net/ispcol/2019-04/angst.html>`_ and `More DOH
+   <http://www.potaroo.net/ispcol/2019-04/moredoh.html>`_ by Geoff Huston and
+   `Centralised DoH is bad for Privacy, in 2019 and beyond
+   <https://labs.ripe.net/Members/bert_hubert/centralised-doh-is-bad-for-privacy-in-2019-and-beyond>`_
+   by Bert Hubert.
+
+DNS-over-HTTPS server (:rfc:`8484`) can be configured using ``doh2`` kind in
 :func:`net.listen()`.
 
-By default a self-signed certificate is generated. For serious deployments
+This implementation supports HTTP/2 (:rfc:`7540`). Queries can be sent to the
+``/dns-query`` endpoint, e.g.:
+
+.. code-block:: bash
+
+       $ kdig @127.0.0.1 +https www.knot-resolver.cz AAAA
+
+**Only TLS version 1.3 (or higher) is supported with DNS-over-HTTPS.** The
+additional considerations for TLS 1.2 required by HTTP/2 are not implemented
+(:rfc:`7540#section-9.2`).
+
+.. warning:: Take care when configuring your server to listen on well known
+   HTTPS port. If an unrelated HTTPS service is running on the same port with
+   REUSEPORT enabled, you will end up with both services malfunctioning.
+
+.. _dot-doh-config-options:
+
+Configuration options
+^^^^^^^^^^^^^^^^^^^^^
+
+.. note:: These settings affect both DNS-over-TLS and DNS-over-HTTPS (except
+   the legacy implementation).
+
+A self-signed certificate is generated by default. For serious deployments
 it is strongly recommended to configure your own TLS certificates signed
 by a trusted CA. This is done using function :c:func:`net.tls()`.
 
 .. function:: net.tls([cert_path], [key_path])
 
-   Get/set path to a server TLS certificate and private key for DNS/TLS.
+   Get/set path to a server TLS certificate and private key for DoT and DoH.
 
    Example output:
 
@@ -34,16 +86,6 @@ by a trusted CA. This is done using function :c:func:`net.tls()`.
       > net.tls()  -- print configured paths
       ("/etc/knot-resolver/server-cert.pem", "/etc/knot-resolver/server-key.pem")
 
-.. function:: net.tls_padding([true | false])
-
-   Get/set EDNS(0) padding of answers to queries that arrive over TLS
-   transport.  If set to `true` (the default), it will use a sensible
-   default padding scheme, as implemented by libknot if available at
-   compile time.  If set to a numeric value >= 2 it will pad the
-   answers to nearest *padding* boundary, e.g. if set to `64`, the
-   answer will have size of a multiple of 64 (64, 128, 192, ...).  If
-   set to `false` (or a number < 2), it will disable padding entirely.
-
 .. function:: net.tls_sticket_secret([string with pre-shared secret])
 
    Set secret for TLS session resumption via tickets, by :rfc:`5077`.
@@ -72,3 +114,14 @@ by a trusted CA. This is done using function :c:func:`net.tls()`.
 
    The same as :func:`net.tls_sticket_secret`,
    except the secret is read from a (binary) file.
+
+.. function:: net.tls_padding([true | false])
+
+   Get/set EDNS(0) padding of answers to queries that arrive over TLS
+   transport.  If set to `true` (the default), it will use a sensible
+   default padding scheme, as implemented by libknot if available at
+   compile time.  If set to a numeric value >= 2 it will pad the
+   answers to nearest *padding* boundary, e.g. if set to `64`, the
+   answer will have size of a multiple of 64 (64, 128, 192, ...).  If
+   set to `false` (or a number < 2), it will disable padding entirely.
+
index 1d3142f567e6eeffe5421f7ad086f3bf712fe6d6..2faac0e36d67302e3a6c28914ad2661af372504a 100644 (file)
@@ -43,7 +43,6 @@ Server (communication with clients)
    daemon-bindings-net_server
    daemon-bindings-net_tlssrv
    modules-http
-   modules-http-doh
 
 Client (retrieving answers from servers)
 ========================================
diff --git a/doc/modules-http-doh.rst b/doc/modules-http-doh.rst
deleted file mode 120000 (symlink)
index 317d0e1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../modules/http/README.doh.rst
\ No newline at end of file
diff --git a/modules/http/README.doh.rst b/modules/http/README.doh.rst
deleted file mode 100644 (file)
index 279d0db..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-.. SPDX-License-Identifier: GPL-3.0-or-later
-
-.. _mod-http-doh:
-
-DNS-over-HTTP (DoH)
-===================
-
-.. warning::
-
-  * DoH support was added in version 4.0.0 and is subject to change.
-  * DoH implementation in Knot Resolver is intended for experimentation
-    only as there is insufficient experience with the module
-    and the DoH protocol in general.
-  * For the time being it is recommended to run DoH endpoint
-    on a separate machine which is not handling normal DNS operations.
-  * Read about perceived benefits and risks at
-    `Mozilla's DoH page <https://support.mozilla.org/en-US/kb/firefox-dns-over-https>`_.
-  * It is important to understand **limits of encrypting only DNS traffic**.
-    Relevant security analysis can be found in article
-    *Simran Patil and Nikita Borisov. 2019. What can you learn from an IP?*
-    See `slides <https://irtf.org/anrw/2019/slides-anrw19-final44.pdf>`_
-    or `the article itself <https://dl.acm.org/authorize?N687437>`_.
-  * Independent information about political controversies around the DoH
-    deployment by default can be found in blog posts
-    `DNS Privacy at IETF 104 <http://www.potaroo.net/ispcol/2019-04/angst.html>`_
-    and
-    `More DOH <http://www.potaroo.net/ispcol/2019-04/moredoh.html>`_
-    by Geoff Huston
-    and `Centralised DoH is bad for Privacy, in 2019 and beyond <https://labs.ripe.net/Members/bert_hubert/centralised-doh-is-bad-for-privacy-in-2019-and-beyond>`_
-    by Bert Hubert.
-
-Following section compares several options for running a DoH capable server.
-Make sure you read through this chapter before exposing the DoH service to users.
-
-DoH support in Knot Resolver
-----------------------------
-
-The :ref:`HTTP module <mod-http>` in Knot Resolver also provides support for
-binary DNS-over-HTTP protocol standardized in :rfc:`8484`.
-
-This integrated DoH server has following properties:
-
-:Scenario:
-        HTTP module in Knot Resolver configured to provide ``/doh`` endpoint
-        (as shown below).
-
-:Advantages:
-        - Integrated solution provides management and monitoring in one place.
-        - Supports ACLs for DNS traffic based on client's IP address.
-
-:Disadvantages:
-        - Exposes Knot Resolver instance to attacks over HTTP.
-        - Does not offer fine grained authorization and logging at HTTP level.
-        - Let's Encrypt integration is not automated.
-
-
-:ref:`Example configuration <mod-http-example>` is part of examples for generic
-HTTP module. After configuring your endpoint you can reach the DoH endpoint using
-URL ``https://your.resolver.hostname.example/doh``, done!
-
-.. code-block:: bash
-
-       # query for www.knot-resolver.cz AAAA
-       $ curl -k https://your.resolver.hostname.example/doh?dns=l1sBAAABAAAAAAAAA3d3dw1rbm90LXJlc29sdmVyAmN6AAAcAAE
-
-Please see section :ref:`mod-http-tls` for further details about TLS configuration.
-
-Alternative configurations use HTTP proxies between clients and a Knot Resolver instance:
-
-Normal HTTP proxy
------------------
-:Scenario:
-        A standard HTTP-compliant proxy is configured to proxy `GET`
-        and `POST` requests to HTTP endpoint `/doh` to a machine
-        running Knot Resolver.
-
-:Advantages:
-        - Protects Knot Resolver instance from
-          `some` types of attacks at HTTP level.
-        - Allows fine-grained filtering and logging at HTTP level.
-        - Let's Encrypt integration is readily available.
-        - Is based on mature software.
-
-:Disadvantages:
-        - Fine-grained ACLs for DNS traffic are not available because
-          proxy hides IP address of client sending DNS query.
-        - More complicated setup with two components (proxy + Knot Resolver).
-
-HTTP proxy with DoH support
----------------------------
-:Scenario:
-        HTTP proxy extended with a
-        `special module for DNS-over-HTTP <https://github.com/facebookexperimental/doh-proxy>`_.
-        The module transforms HTTP requests to standard DNS queries
-        which are then processed by Knot Resolver.
-        DNS replies from Knot Resolver are then transformed back to HTTP
-        encoding by the proxy.
-
-:Advantages:
-        - Protects Knot Resolver instance from `all` attacks at HTTP level.
-        - Allows fine-grained filtering and logging at HTTP level.
-        - Let's Encrypt integration is readily available
-          if proxy is based on a standard HTTP software.
-
-:Disadvantages:
-        - Fine-grained ACLs for DNS traffic are not available because
-          proxy hides IP address of client sending DNS query.
-          (Unless proxy and resolver are using non-standard packet extensions like
-          `DNS X-Proxied-For <https://datatracker.ietf.org/doc/draft-bellis-dnsop-xpf/>`_.)
-        - More complicated setup with three components (proxy + special module + Knot Resolver).
-
-Client configuration
---------------------
-Most common client today is web browser Firefox, which requires manual configuration
-to use your own DNS resolver. Configuration options in Firefox are described at
-`Mozilla support site <https://support.mozilla.org/en-US/kb/firefox-dns-over-https#w_switching-providers>`_.
-
-.. warning::
-
-  Make sure you read :ref:`warnings at beginning of this section <mod-http-doh>`.
index 05ad0f3c82541f1b203904e1ea4397563a4ac2b9..b02b00abf1b8ab0564f753877b3d879303aac5ea 100644 (file)
@@ -2,8 +2,8 @@
 
 .. _mod-http:
 
-HTTP services
-=============
+Other HTTP services
+===================
 
 .. tip:: In most distributions, the ``http`` module is available from a
    separate package ``knot-resolver-module-http``. The module isn't packaged
@@ -14,18 +14,18 @@ server which provides few built-in services and also allows other
 modules to export restful APIs and websocket streams.
 
 One example is statistics module that can stream live metrics on the website,
-or publish metrics on request for Prometheus scraper, and also :ref:`mod-http-doh`.
+or publish metrics on request for Prometheus scraper.
 
 By default this module provides two kinds of endpoints,
 and unlimited number of "used-defined kinds" can be added in configuration.
 
 +--------------+---------------------------------------------------------------------------------+
-| **Endpoint** | **Explanation**                                                                 |
-+--------------+---------------------------------------------------------------------------------+
-| doh          | :ref:`mod-http-doh`                                                             |
+| **Kind**     | **Explanation**                                                                 |
 +--------------+---------------------------------------------------------------------------------+
 | webmgmt      | :ref:`built-in web management <mod-http-built-in-services>` APIs (includes DoH) |
 +--------------+---------------------------------------------------------------------------------+
+| doh          | :ref:`mod-http-doh`                                                             |
++--------------+---------------------------------------------------------------------------------+
 
 Each network address and port combination can be configured to expose
 one kind of endpoint. This is done using the same mechanisms as
@@ -124,6 +124,21 @@ Major drawback is that current browsers won't do HTTP/2 over insecure connection
    they currently won't be shared.
    It's assumed that you don't want a self-signed certificate for serious deployments anyway.
 
+.. _mod-http-doh:
+
+Legacy DNS-over-HTTPS (DoH)
+---------------------------
+
+.. warning:: The DoH implementation using ``http`` module is deprecated. It has
+   known performance and stability issues that won't be fixed. Use
+   :ref:`dns-over-https` instead.
+
+This was an experimental implementation of :rfc:`8484`. It was configured using
+``doh`` kind in :func:`net.listen`. Its configuration (such as certificates)
+took place in ``http.config()``.
+
+Queries were served on ``/doh`` and ``/dns-query`` endpoints.
+
 .. _mod-http-built-in-services:
 
 Built-in services
@@ -137,7 +152,8 @@ The HTTP module has several built-in services to use.
  "``/stats``", "Statistics/metrics", "Exported :ref:`metrics <mod-stats-list>` from :ref:`mod-stats` in JSON format."
  "``/metrics``", "Prometheus metrics", "Exported metrics for Prometheus_."
  "``/trace/:name/:type``", "Tracking", ":ref:`Trace resolution <mod-http-trace>` of a DNS query and return the verbose logs."
- "``/doh``", "DNS-over-HTTP", ":rfc:`8484` endpoint, see :ref:`mod-http-doh`."
+ "``/doh``", "Legacy DNS-over-HTTPS", ":rfc:`8484` endpoint, see :ref:`mod-http-doh`."
+ "``/dns-query``", "Legacy DNS-over-HTTPS", ":rfc:`8484` endpoint, see :ref:`mod-http-doh`."
 
 Dependencies
 ------------