Giter VIP home page Giter VIP logo

dnsviz's Introduction

DNSViz

Table of Contents

Description

DNSViz is a tool suite for analysis and visualization of Domain Name System (DNS) behavior, including its security extensions (DNSSEC). This tool suite powers the Web-based analysis available at https://dnsviz.net/

Installation

DNSViz packages are available in repositories for popular operating systems, such as Debian, Ubuntu, Fedora, and FreeBSD, using their typical installation commands. DNSViz can also be installed on Mac OS X via Homebrew or MacPorts.

The remainer of this section covers other methods of installation, including a list of dependencies, installation to a virtual environment, and installation on RHEL 8 or 9, CentOS Stream 8 or 9,, and RHEL 7.

Instructions for running in a Docker container are also available later in this document.

Dependencies

Note that earlier versions of the software listed above might also work with DNSViz, but with some caveats. For example, M2Crypto 0.28.0 and later will work, but versions of M2Crypto earlier than 0.38.0 lack support for DNSSEC algorithms 15 (Ed25519) and 16 (Ed448). Also, while DNSViz itself still works with python 2.7, some versions of its software dependencies have moved on: pygraphviz 1.6 and dnspython 2.0.0 dropped support for python 2.7.

Optional Software

  • OpenSSL GOST Engine - https://github.com/gost-engine/engine

    With OpenSSL version 1.1.0 and later, the OpenSSL GOST Engine is necessary to validate DNSSEC signatures with algorithm 12 (GOST R 34.10-2001) and create digests of type 3 (GOST R 34.11-94).

  • ISC BIND - https://www.isc.org/bind/

    When using DNSViz for pre-deployment testing by specifying zone files and/or alternate delegation information on the command line (i.e., with -N, -x, or -D), named(8) is invoked to serve one or more zones. ISC BIND is only needed in this case, and named(8) does not need to be running (i.e., as a server).

    Note that default AppArmor policies for Debian are known to cause issues when invoking named(8) from DNSViz for pre-deployment testing. AppArmor can be temporarily disabled for named(8) with the following:

    $ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.named
    

    After pre-deployment testing is finished, AppArmor for named(8) can be re-enabled with the following:

    $ sudo apparmor_parser /etc/apparmor.d/usr.sbin.named
    

Installation in a Virtual Environment

To install DNSViz to a virtual environment, first create and activate a virtual environment, and install the dependencies:

$ virtualenv ~/myenv
$ source ~/myenv/bin/activate
(myenv) $ pip install -r requirements.txt

Note that this installs the dependencies that are python packages, but some of these packages have non-python dependencies, such as Graphviz (required for pygraphviz), OpenSSL (required for M2Crypto), and swig (required for building either) that are not installed automatically.

Next download and install DNSViz from the Python Package Index (PyPI):

(myenv) $ pip install dnsviz

or locally, from a downloaded or cloned copy of DNSViz:

(myenv) $ pip install .

RHEL 8/9 or CentOS Stream 8/9 -- RPM Build and Install

To build an RPM and install it on RHEL 8 or 9 or CentOS Stream 8 or 9, use the following instructions.

RHEL 8 and 9 only: Enable CodeReady Linux Builder and Extra Packages for Enterprise Linux (EPEL) with following:

$ sudo subscription-manager repos --enable codeready-builder-for-rhel-$(vers)-$(arch)-rpms
$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(vers).noarch.rpm

(where $(vers) refers to version, either 8 or 9, and $(arch) refers to the architecture, e.g., x86_64 or aarch64. If you are unsure, run sudo subscription-manager repos --list to show available options.)

CentOS Stream 8 or 9 only: Enable PowerTools or CodeReady Linux Builder and EPEL with the following:

$ sudo dnf config-manager --set-enabled $(tool)
$ sudo dnf install epel-release

(where $(tool) refers to the tool, either powertools for CentOS Stream 8 or crb for CentOS Stream 9.)

The remaining instructions are for RHEL 8 or 9 and CentOS Stream 8 or 9.

Install the tools for building an RPM, and set up the rpmbuild tree.

$ sudo dnf install rpm-build rpmdevtools make python3-devel python3-build
$ rpmdev-setuptree

From within the DNSViz source directory, create a source distribution tarball and copy it and the DNSViz spec file to the appropriate rpmbuild subdirectories.

$ python3 -m build
$ cp dist/dnsviz-*.tar.gz ~/rpmbuild/SOURCES/
$ cp contrib/dnsviz.spec ~/rpmbuild/SPECS/

Install dnspython, pygraphviz, and M2Crypto.

$ sudo dnf install python3-dns python3-pygraphviz python3-m2crypto

(Note that for RHEL 8 and CentOS Stream 8, the version of M2Crypto is 0.35. If you would like support for DNSSEC algorithms 15 (Ed25519) and 16 (Ed448), M2Crypto 0.38 or higher is required. Thus, if you want this functionality, you will need to install M2Crypto using pip3. For example, see installation to a virtual environment.)

Build and install the DNSViz RPM.

$ rpmbuild -ba rpmbuild/SPECS/dnsviz.spec
$ sudo rpm -iv rpmbuild/RPMS/noarch/dnsviz-*.noarch.rpm

RHEL 7 RPM Build and Install

Install pygraphviz, M2Crypto, and dnspython, after installing their build dependencies.

$ sudo yum install python3 gcc python3-devel graphviz-devel openssl-devel swig
$ pip3 install --user pbr m2crypto pygraphviz dnspython

Install rpm-build tools, then build and install the DNSViz RPM.

$ sudo yum install rpm-build
$ python3 setup.py bdist_rpm --install-script contrib/rpm-install.sh --distribution-name el7
$ sudo rpm -iv dist/dnsviz-*-1.noarch.rpm

Note that a custom install script is used to properly install the DNSViz man pages.

Usage

DNSViz is invoked using the dnsviz command-line utility. dnsviz itself uses several subcommands: probe, grok, graph, print, and query. See the man pages associated with each subcommand, in the form of "dnsviz- (1)" (e.g., "man dnsviz-probe") for more detailed documentation and usage.

dnsviz probe

dnsviz probe takes one or more domain names as input and performs a series of queries to either recursive (default) or authoritative DNS servers, the results of which are serialized into JSON format.

Examples

Analyze the domain name example.com using your configured DNS resolvers (i.e., in /etc/resolv.conf) and store the queries and responses in the file named "example.com.json":

$ dnsviz probe example.com > example.com.json

Same thing:

$ dnsviz probe -o example.com.json example.com

Analyze the domain name example.com by querying its authoritative servers directly:

$ dnsviz probe -A -o example.com.json example.com

Analyze the domain name example.com by querying explicitly-defined authoritative servers, rather than learning the servers through referrals from the IANA root servers:

$ dnsviz probe -A \
  -x example.com:a.iana-servers.org=199.43.132.53,a.iana-servers.org=[2001:500:8c::53] \
  -x example.com:b.iana-servers.org=199.43.133.53,b.iana-servers.org=[2001:500:8d::53] \
  -o example.com.json example.com

Same, but have dnsviz probe resolve the names:

$ dnsviz probe -A \
  -x example.com:a.iana-servers.org,b.iana-servers.org \
  -o example.com.json example.com

Analyze the domain name example.com and its entire ancestry by querying authoritative servers and following delegations, starting at the root:

$ dnsviz probe -A -a . -o example.com.json example.com

Analyze multiple names in parallel (four threads) using explicit recursive resolvers (replace 192.0.1.2 and 2001:db8::1 with legitimate resolver addresses):

$ dnsviz probe -s 192.0.2.1,[2001:db8::1] -t 4 -o multiple.json \
  example.com sandia.gov verisignlabs.com dnsviz.net

dnsviz grok

dnsviz grok takes serialized query results in JSON format (i.e., output from dnsviz probe) as input and assesses specified domain names based on their corresponding content in the input. The output is also serialized into JSON format.

Examples

Process the query/response output produced by dnsviz probe, and store the serialized results in a file named "example.com-chk.json":

$ dnsviz grok < example.com.json > example.com-chk.json

Same thing:

$ dnsviz grok -r example.com.json -o example.com-chk.json example.com

Show only info-level information: descriptions, statuses, warnings, and errors:

$ dnsviz grok -l info -r example.com.json -o example.com-chk.json

Show descriptions only if there are related warnings or errors:

$ dnsviz grok -l warning -r example.com.json -o example.com-chk.json

Show descriptions only if there are related errors:

$ dnsviz grok -l error -r example.com.json -o example.com-chk.json

Use root key as DNSSEC trust anchor, to additionally indicate authentication status of responses:

$ dig +noall +answer . dnskey | awk '$5 % 2 { print $0 }' > tk.txt
$ dnsviz grok -l info -t tk.txt -r example.com.json -o example.com-chk.json

Pipe dnsviz probe output directly to dnsviz grok:

$ dnsviz probe example.com | \
      dnsviz grok -l info -o example.com-chk.json

Same thing, but save the raw output (for re-use) along the way:

$ dnsviz probe example.com | tee example.com.json | \
      dnsviz grok -l info -o example.com-chk.json

Assess multiple names at once with error level:

$ dnsviz grok -l error -r multiple.json -o example.com-chk.json

dnsviz graph

dnsviz graph takes serialized query results in JSON format (i.e., output from dnsviz probe) as input and assesses specified domain names based on their corresponding content in the input. The output is an image file, a dot (directed graph) file, or an HTML file, depending on the options passed.

Examples

Process the query/response output produced by dnsviz probe, and produce a graph visually representing the results in a png file named "example.com.png".

$ dnsviz graph -Tpng < example.com.json > example.com.png

Same thing:

$ dnsviz graph -Tpng -o example.com.png example.com < example.com.json

Same thing, but produce interactive HTML format: interactive HTML output in a file named "example.com.html":

$ dnsviz graph -Thtml < example.com.json > example.com.html

Same thing (filename is derived from domain name and output format):

$ dnsviz graph -Thtml -O -r example.com.json

Use alternate DNSSEC trust anchor:

$ dig +noall +answer example.com dnskey | awk '$5 % 2 { print $0 }' > tk.txt
$ dnsviz graph -Thtml -O -r example.com.json -t tk.txt

Pipe dnsviz probe output directly to dnsviz graph:

$ dnsviz probe example.com | \
      dnsviz graph -Thtml -O

Same thing, but save the raw output (for re-use) along the way:

$ dnsviz probe example.com | tee example.com.json | \
      dnsviz graph -Thtml -O

Process analysis of multiple domain names, creating an image for each name processed:

$ dnsviz graph -Thtml -O -r multiple.json

Process analysis of multiple domain names, creating a single image for all names.

$ dnsviz graph -Thtml -r multiple.json > multiple.html

dnsviz print

dnsviz print takes serialized query results in JSON format (i.e., output from dnsviz probe) as input and assesses specified domain names based on their corresponding content in the input. The output is textual output suitable for file or terminal display.

Examples

Process the query/response output produced by dnsviz probe, and output the results to the terminal:

$ dnsviz print < example.com.json

Use alternate DNSSEC trust anchor:

$ dig +noall +answer example.com dnskey | awk '$5 % 2 { print $0 }' > tk.txt
$ dnsviz print -r example.com.json -t tk.txt

Pipe dnsviz probe output directly to dnsviz print:

$ dnsviz probe example.com | \
      dnsviz print

Same thing, but save the raw output (for re-use) along the way:

$ dnsviz probe example.com | tee example.com.json | \
      dnsviz print

dnsviz query

dnsviz query is a wrapper that couples the functionality of dnsviz probe and dnsviz print into a tool with minimal dig-like usage, used to make analysis queries and return the textual output to terminal or file output in one go.

Examples

Analyze the domain name example.com using the first of your configured DNS resolvers (i.e., in /etc/resolv.conf):

$ dnsviz query example.com

Same, but specify an alternate trust anchor:

$ dnsviz query +trusted-key=tk.txt example.com

Analyze example.com through the recursive resolver at 192.0.2.1:

$ dnsviz query @192.0.2.1 +trusted-key=tk.txt example.com

Pre-Deployment DNS Testing

The examples in this section demonstrate usage of DNSViz for pre-deployment testing.

Pre-Delegation Testing

The following examples involve issuing diagnostic queries for a zone before it is ever delegated.

Issue queries against a zone file on the local system (example.com.zone). named(8) is invoked to serve the file locally:

$ dnsviz probe -A -x example.com+:example.com.zone example.com

(Note the use of "+", which designates that the parent servers should not be queried for DS records.)

Issue queries to a server that is serving the zone:

$ dnsviz probe -A -x example.com+:192.0.2.1 example.com

(Note that this server doesn't need to be a server in the NS RRset for example.com.)

Issue queries to the servers in the authoritative NS RRset, specified by name and/or address:

$ dnsviz probe -A \
      -x example.com+:ns1.example.com=192.0.2.1 \
      -x example.com+:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
      example.com

Specify the names and addresses corresponding to the future delegation NS records and (as appropriate) A/AAAA glue records in the parent zone (com):

$ dnsviz probe -A \
      -N example.com:ns1.example.com=192.0.2.1 \
      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
      example.com

Also supply future DS records:

$ dnsviz probe -A \
      -N example.com:ns1.example.com=192.0.2.1 \
      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
      -D example.com:dsset-example.com. \
      example.com

Pre-Deployment Testing of Authoritative Zone Changes

The following examples involve issuing diagnostic queries for a delegated zone before changes are deployed.

Issue diagnostic queries for a new zone file that has been created but not yet been deployed (i.e., with changes to DNSKEY or other records):

$ dnsviz probe -A -x example.com:example.com.zone example.com

(Note the absence of "+", which designates that the parent servers will be queried for DS records.)

Issue queries to a server that is serving the new version of the zone:

$ dnsviz probe -A -x example.com:192.0.2.1 example.com

(Note that this server doesn't need to be a server in the NS RRset for example.com.)

Pre-Deployment Testing of Delegation Changes

The following examples involve issuing diagnostic queries for a delegated zone before changes are deployed to the delegation, glue, or DS records for that zone.

Specify the names and addresses corresponding to the new delegation NS records and (as appropriate) A/AAAA glue records in the parent zone (com):

$ dnsviz probe -A \
      -N example.com:ns1.example.com=192.0.2.1 \
      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
      example.com

Also supply the replacement DS records:

$ dnsviz probe -A \
      -N example.com:ns1.example.com=192.0.2.1 \
      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
      -D example.com:dsset-example.com. \
      example.com

Docker Container

A ready-to-use docker container is available for use.

docker pull dnsviz/dnsviz

This section only covers Docker-related examples, for more information see the Usage section.

Simple Usage

$ docker run dnsviz/dnsviz help
$ docker run dnsviz/dnsviz query example.com

Working with Files

It might be useful to mount a local working directory into the container, especially when combining multiple commands or working with zone files.

$ docker run -v "$PWD:/data:rw" dnsviz/dnsviz probe dnsviz.net > probe.json
$ docker run -v "$PWD:/data:rw" dnsviz/dnsviz graph -r probe.json -T png -O

Using a Host Network

When running authoritative queries, a host network is recommended.

$ docker run --network host dnsviz/dnsviz probe -4 -A example.com > example.json

Otherwise, you're likely to encounter the following error: dnsviz.query.SourceAddressBindError: Unable to bind to local address (EADDRNOTAVAIL)

Interactive Mode

When performing complex analyses, where you need to combine multiple DNSViz commands, use bash redirection, etc., it might be useful to run the container interactively:

$ docker run --network host -v "$PWD:/data:rw" --entrypoint /bin/sh -ti dnsviz/dnsviz
/data # dnsviz --help

dnsviz's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dnsviz's Issues

Thank you! (Not an issue)

Thank you for this wonderful project! It helped me determine that penndot.gov was in compliance 4 months ago, but not in compliance today. More! More! Where do I donate?

Parsing of resolv.conf should be more robust

% dnsget  bortzmeyer.org > ../bortzmeyer.org.json    
Traceback (most recent call last):
  File "./bin/dnsget", line 37, in <module>
    from dnsviz.analysis import Analyst, DomainNameAnalysis, get_client_addresses, NetworkConnectivityException, _resolver
  File "/usr/local/lib/python2.7/dist-packages/dnsviz/analysis.py", line 137, in <module>
    _resolver = Resolver.Resolver.from_file('/etc/resolv.conf', StandardRecursiveQueryCD)
  File "/usr/local/lib/python2.7/dist-packages/dnsviz/resolver.py", line 99, in from_file
    if words[0] == 'nameserver':
IndexError: list index out of range

Just because there was an empty line in resolv.conf. When deleting it, it worked fine.

testing for NSEC records denying things which should exist

I recently came across a couple of authorative nameservers which somehow presented an NSEC record which declared that the whole zone it was authorative for was empty (denying the existance of itself, being in-bailiwick!). Combined with knot-resolver's aggressive caching using DNSSEC-records, lookups of records at the domains that these nameservers were supposed to be authorative for could not be resolved.

I'm not that familiar with DNSSEC and found help from https://gitter.com/CZ-NIC/knot-resolver. I could see in logs from knot-resolver that it could not find any NS with an address (what I did not react to at the time was the NSEC sname: covered by: example.com. -> example.com. -- that was probably a great clue!)

Eventually @vcunat found example.com. NSEC example.com., and I could contact the admin who corrected the problem.

Could dnsviz highlight these kind of problems?

As @pspacek said in the discussion:

It would be also useful to test for other contradictory answers, e.g. server answering test.example.com. Abut providing proof-of-nonexistence for query test.example.com. TXT which states that test.example.com. A does not exist etc.
In general proofs from NSEC records must not contradict existence of other data which were obtained during the test.

pip installing into a python 3 environment throws error

image

I can't find the offending line in the source so perhaps Pypi needs to be updated?

python version: 3.6.0
pip version: 9.0.1
virtualenv version: 15.0.3

Additionally tried the --no-cache-dir option with pip in case it was a cached bad build from building the source earlier, but same result.

warn about obsolete DNSSEC algorithms

Just recently Fedora 33 has forbidden use of SHA1 for signature verification, which effectively breaks DNSSEC on some domains.

Besides this practical consequence, bunch of DNSSEC algorithms should not be use and I believe it would be beneficial to flag these as warnings. I propose to warn about algorithms involving MD5, SHA1, DSA, and GOST.

https://tools.ietf.org/html/rfc8624#section-3.1 and https://tools.ietf.org/html/rfc8624#section-3.2 give nice tables with not recommended or outright banned algorithms.

Unfortunately I'm not able to find head and tail in DNSViz code base so I'm not able to write patch, sorry and thank you for your time!

Problem with verification on a domain

Hi folks, thanks for the great tool which is such an essential tool for me.

I seem to have a problem with a new domain I purchased photographer.hosting.
I first of all had problems trying to add the DS keys at GoDaddy for 2 weeks due to a timeout between GoDaddy and the .hosting registry.

I eventually managed to add the DS keys today and within a few minutes http://dnssec-debugger.verisignlabs.com/photographer.hosting picked it up and flagged everything as OK.

Yet http://dnsviz.net/d/photographer.hosting/dnssec/ is still showing me errors and I've been trying throughout the day by forcing DNSVIZ to update.

Is this a problem with the .hosting registry itself or perhaps that DNSVIZ is not seeing the update DNS records yet?

Can't graph broken DNSSEC test sites

I've tried to probe (recursive querying) and graph the following labels using 0.4.0 release:

bad-sig.dane.verisignlabs.com is OK but www.dnssec-failed.org and www.rhybar.cz aren't.
Here's the output for www.dnssec-failed.org [1], www.rhybar.cz yields similar output.

The local resolver is working OK [2], as well as dnsviz grok [3].

If nobody else can reproduce, I can upload the probe and grok results.

Bug or pebkac? :-)

[1]
test# dnsviz probe -s 127.0.0.1 www.dnssec-failed.org | dnsviz graph -R a -Thtml -O
Analyzing www.dnssec-failed.org
Analyzing dnssec-failed.org
Analyzing org
Analyzing .
Traceback (most recent call last):
File "/usr/bin/dnsviz", line 68, in
main()
File "/usr/bin/dnsviz", line 65, in main
mod.main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/dnsviz/commands/graph.py", line 288, in main
finish_graph(G, [name_obj], rdtypes, trusted_keys, fmt, '%s.%s' % (name, fmt))
File "/usr/lib/python2.7/site-packages/dnsviz/commands/graph.py", line 79, in finish_graph
js_img = G.draw('js')
File "/usr/lib/python2.7/site-packages/dnsviz/viz/dnssec.py", line 263, in draw
img = self.to_raphael()
File "/usr/lib/python2.7/site-packages/dnsviz/viz/dnssec.py", line 250, in to_raphael
svg = self.G.draw(format='svg', prog='dot')
File "/usr/lib64/python2.7/site-packages/pygraphviz/agraph.py", line 1474, in draw
data = self._run_prog(prog, args)
File "/usr/lib64/python2.7/site-packages/pygraphviz/agraph.py", line 1335, in _run_prog
raise IOError(b"".join(errors))
IOError: dot: mincross.c:1314: flat_reorder: Assertion `constraining_flat_edge(g,v,e) == 0' failed.

[2]
test# dig @127.0.0.1 www.dnssec-failed.org a +dnssec

; <<>> DiG 9.9.4-RedHat-9.9.4-18.el7_1.5 <<>> @127.0.0.1 www.dnssec-failed.org a +dnssec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 63152
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 4096
;; QUESTION SECTION:
;www.dnssec-failed.org. IN A

;; Query time: 84 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Oct 13 20:45:56 CEST 2015
;; MSG SIZE rcvd: 50

[3]
test# dnsviz probe -s 127.0.0.1 www.dnssec-failed.org | dnsviz grok -o /tmp/www.dnssec-failed.org.grokked.json
Analyzing www.dnssec-failed.org
Analyzing dnssec-failed.org
Analyzing org
Analyzing .
test# ls -ahl !$
ls -ahl /tmp/www.dnssec-failed.org.grokked.json
-rw-r--r-- 1 root root 16K Oct 13 20:48 /tmp/www.dnssec-failed.org.grokked.json
test# jq . !$ &>/dev/null && echo $?
jq . /tmp/www.dnssec-failed.org.grokked.json &>/dev/null && echo $?
0

pygraphviz version check

On this system (Debian Wheezy 7), easy_install pulled in pygraphviz no problem, but upon trying to execute dnsviz, it seems the version checking might be a bit off:

pygraphviz version >= 1.1 is required, but version 1.3rc2 is installed.

-O 'Derive the filename(s) from domain name(s)' for graph and print does not encode the output filename

For example, given an input domain name of "d/len.c.b.a.in-addr.arpa" (from RFC 2317 'Classless IN-ADDR.ARPA delegation'), dnsviz print and graph both fail when called with -O:

$ dnsviz probe -o probed d/len.c.b.a.in-addr.arpa
Analyzing d/len.c.b.a.in-addr.arpa
Analyzing c.b.a.in-addr.arpa
Analyzing b.a.in-addr.arpa
Analyzing a.in-addr.arpa
Analyzing in-addr.arpa
Analyzing arpa
Analyzing .
$ dnsviz print -O -r probed d/len.c.b.a.in-addr.arpa
No such file or directory: "d/len.c.b.a.in-addr.arpa.txt"

The name generated by -O could be encoded in some format - for example, BIND9's dnssec-keygen tool uses URL-like percent-encoding, where '/' becomes '%2F'.

AttributeError: can't set attribute

I often get the following error. It is completely random. When I run the same test again, no error is reported.

/usr/local/bin/dnsviz probe -p -A -R 'NS' -o '/data/web/tmp/tmpGfXmVqzWt9SmF5em.json' 'rhybar.cz' 2>&1
Analyzing cz (stub)
Analyzing rhybar.cz
Error analyzing rhybar.cz
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/commands/probe.py", line 166, in _analyze
    return a.analyze()
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/analysis/online.py", line 1513, in analyze
    return self._analyze(self.name)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/analysis/online.py", line 1652, in _analyze
    self._analyze_name(name_obj)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/analysis/online.py", line 1686, in _analyze_name
    yxdomain = self._analyze_delegation(name_obj)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/analysis/online.py", line 1895, in _analyze_delegation
    query.execute(tm=self.transport_manager, th_factories=self.th_factories)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/query.py", line 1589, in _func
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/query.py", line 1599, in execute
    self.execute_queries(self, ignore_queryid=ignore_queryid, tm=tm, th_factories=th_factories)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/query.py", line 1497, in execute_queries
    response = qh.handle_response(qtm.res, response, response_time, qtm.src, qtm.sport)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/query.py", line 811, in handle_response
    retry_action = handler.handle(response_wire, response, response_time)
  File "/usr/local/lib/python3.7/dist-packages/dnsviz/query.py", line 378, in handle
    self._request.payload = self._reduced_payload
AttributeError: can't set attribute

probe: using -t may cause deadlock with Python3

Description

When using the -t options to run dnsviz probe in multiple threads, it seems some data can cause deadlock. As of 2019-01-14, the following query deadlocks:

$ time dnsviz probe -t 2 www.adhomepage.com > /dev/null
Analyzing www.adhomepage.com
Analyzing adhomepage.com
Analyzing com
Analyzing .
Analyzing hdredirect-lb5-1afb6e2973825a56.elb.us-east-1.amazonaws.com
Analyzing elb.us-east-1.amazonaws.com
Analyzing us-east-1.amazonaws.com
Analyzing amazonaws.com
^CInterrupted.

real    7m45.040s
user    0m0.861s
sys     0m0.117s

Interestingly enough, without the -t option, the domain is analyzed just fine.

$ time dnsviz probe www.adhomepage.com > /dev/null
Analyzing www.adhomepage.com
Analyzing adhomepage.com
Analyzing com
Analyzing .
Analyzing hdredirect-lb5-1afb6e2973825a56.elb.us-east-1.amazonaws.com
Analyzing elb.us-east-1.amazonaws.com
Analyzing us-east-1.amazonaws.com
Analyzing amazonaws.com

real    0m1.211s
user    0m0.528s
sys     0m0.061s

Versions

  • latest dnsviz - master (82aa568)
  • python: 3.7.2
  • dnspython: 1.16.0
  • m2crypto: 0.30.1
  • pygraphviz: 1.5

Additional info

The probe command works fine when using dnsviz 0.6.7 and Python 2

Check key/signature lenghts

In http://dnsviz.net/d/vheng.nl/WL5hKQ/dnssec/, a leading zero was missing from the second number in a public ECDSA key, yielding a 760 bit key. For algos such as 13 and 14, we can always know the right key length, and perhaps we can point out that this key is really broken.

The same thing goes for sigs - they tend to have a fixed size and when we see a sig (that we might even consider valid!) with the wrong size, it might be nice to point that out.

Where does the build instal to ?

I'm always wary of running any kind of 'sudo' without knowing what files it plans on touching.

yes, i could read the guts of the setup.py, but is there a summary of where all this will get placed when you run the install.

or - another way to ask the question: can dnsviz be run from the build folder without installing it ?
is there a way to test the the build worked without error ?

(If i try to run './bin/dnsviz probe' i get the error:
Traceback (most recent call last): File "./bin/dnsviz", line 80, in <module> main() File "./bin/dnsviz", line 58, in main import dnsviz.commands

ImportError: No module named config

I've just installed dnsviz into a python virtualenv on my MacOSX laptop. Here's the list of installed modules:

$ pip list
Package    Version
---------- -------
appdirs    1.4.3  
dnspython  1.15.0 
dnsviz     0.6.5  
M2Crypto   0.26.0 
packaging  16.8   
pip        9.0.1  
pygraphviz 1.3.1  
pyparsing  2.2.0  
setuptools 34.3.3 
six        1.10.0 
typing     3.6.1  
wheel      0.29.0 

When I try to run any command, I get:

$ dnsviz probe
Traceback (most recent call last):
  File "/tmp/dnsviz/bin/dnsviz", line 92, in <module>
    main()
  File "/tmp/dnsviz/bin/dnsviz", line 74, in main
    mod = importlib.import_module('dnsviz.commands.%s' % command)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/tmp/dnsviz/lib/python2.7/site-packages/dnsviz/commands/probe.py", line 63, in <module>
    from dnsviz.analysis import WILDCARD_EXPLICIT_DELEGATION, PrivateAnalyst, PrivateRecursiveAnalyst, OnlineDomainNameAnalysis, NetworkConnectivityException, DNS_RAW_VERSION
  File "/tmp/dnsviz/lib/python2.7/site-packages/dnsviz/analysis/__init__.py", line 1, in <module>
    from .online import WILDCARD_EXPLICIT_DELEGATION, Analyst, OnlineDomainNameAnalysis, PrivateAnalyst, RecursiveAnalyst, PrivateRecursiveAnalyst, NetworkConnectivityException, DNS_RAW_VERSION
  File "/tmp/dnsviz/lib/python2.7/site-packages/dnsviz/analysis/online.py", line 50, in <module>
    import dnsviz.query as Q
  File "/tmp/dnsviz/lib/python2.7/site-packages/dnsviz/query.py", line 54, in <module>
    from .response import *
  File "/tmp/dnsviz/lib/python2.7/site-packages/dnsviz/response.py", line 54, in <module>
    from .util import tuple_to_dict
  File "/tmp/dnsviz/lib/python2.7/site-packages/dnsviz/util.py", line 37, in <module>
    from .config import DNSVIZ_SHARE_PATH
ImportError: No module named config

Looks like dnsviz is trying to load stuff from a module file called "config", but there's no such file in the dnsviz directory.

dnsviz grok crashing

Version: dnsviz 0.8.2 on FreeBSD
When I generate report like this:
dnsviz probe -d 0 -o report.json -A example.com
and then I try to analyze it like this:
dnsviz grok -r report.json
then this second step crashes for some reports every time and works for others.
Here is traceback.zip.
I can send failing report, if requested.

Clarify NODATA error for DS record lookup

When dnsviz performs a DS record lookup against a server that doesn't support DNSSEC (and therefore gets a referral), dnsviz reports:

The Authoritative Answer (AA) flag was not set in the response.
No SOA RR was returned with the NODATA response.

This is confusing, as the server is not returning a NODATA response. dnsviz should instead have text that indicates a referral was received rather than a NODATA response.

-A broken in docker for mac

[root@23beedbfd2bf dnsviz]# /usr/bin/dnsviz probe -A -d 3 -4 dnssec-failed.org
Error analyzing dnssec-failed.org
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/dnsviz/commands/probe.py", line 146, in _analyze
a = cls(name, dlv_domain=dlv_domain, try_ipv4=try_ipv4, try_ipv6=try_ipv6, client_ipv4=client_ipv4, client_ipv6=client_ipv6, query_class_mixin=query_class_mixin, ceiling=c, edns_diagnostics=edns_diagnostics, explicit_delegations=explicit_delegations, stop_at_explicit=stop_at_explicit, odd_ports=odd_ports, extra_rdtypes=extra_rdtypes, explicit_only=explicit_only, analysis_cache=cache, cache_level=cache_level, analysis_cache_lock=cache_lock, transport_manager=tm, th_factories=th_factories, resolver=resolver)
File "/usr/lib/python2.7/site-packages/dnsviz/analysis/online.py", line 1072, in init
self.local_ceiling = self._detect_ceiling(ceiling)[0]
File "/usr/lib/python2.7/site-packages/dnsviz/analysis/online.py", line 1163, in _detect_ceiling
ans = self.resolver.query_for_answer(ceiling, dns.rdatatype.NS, dns.rdataclass.IN)
File "/usr/lib/python2.7/site-packages/dnsviz/resolver.py", line 423, in query_for_answer
response, server = self.query(qname, rdtype, rdclass)
File "/usr/lib/python2.7/site-packages/dnsviz/resolver.py", line 411, in query
l = self._query(qname, rdtype, rdclass, 0, self.SRC_NONAUTH_ANS)
File "/usr/lib/python2.7/site-packages/dnsviz/resolver.py", line 551, in _query
a_rrset = self._query(ns_name, a_rdtype, dns.rdataclass.IN, level + 1, self.SRC_ADDITIONAL, starting_domain=sd)[-2]
File "/usr/lib/python2.7/site-packages/dnsviz/resolver.py", line 564, in _query
q.execute(tm=self._transport_manager, th_factories=self._th_factories)
File "/usr/lib/python2.7/site-packages/dnsviz/query.py", line 1468, in _func
return func(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/dnsviz/query.py", line 1478, in execute
self.execute_queries(self, ignore_queryid=ignore_queryid, tm=tm, th_factories=th_factories)
File "/usr/lib/python2.7/site-packages/dnsviz/query.py", line 1427, in execute_queries
raise SourceAddressBindError('Unable to bind to local address (%s)' % (errno.errorcode[errno1]))
SourceAddressBindError: Unable to bind to local address (EADDRNOTAVAIL)

I tested the same docker container on docker on centos 7 host and there I did not have this issue. The container itself is the official docker centos 7 from dockerhub. I tested to run bind and httpd in the same container and they had no problems binding to a port. Please advise.

(I have no issue on docker for mac when I do not use the -A option)

Docker for mac version:
Version 17.12.0-ce-mac49 (21995)

Thanks

AttributeError: 'NoneType' object has no attribute 'rdata'

This happens on dnsviz==0.9.0, but not on 0.8.2 so something has changed between these tags.

>>> graph.main(['graph', '-Thtml', '-O', '-r', '/tmp/probe_out.json'])                                                                                                 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rithvik/.pyenv/versions/HSEnv/lib/python3.7/site-packages/dnsviz/commands/graph.py", line 464, in main
    name_obj.populate_status(arghelper.trusted_keys, supported_algs=arghelper.args.algorithms, supported_digest_algs=arghelper.args.digest_algorithms, validate_prohibited_algs=arghelper.args.validate_prohibited_algs)
  File "/home/rithvik/.pyenv/versions/HSEnv/lib/python3.7/site-packages/dnsviz/analysis/offline.py", line 863, in populate_status
    self._populate_status(trusted_keys, supported_algs, supported_digest_algs, is_dlv, None, follow_mx)
  File "/home/rithvik/.pyenv/versions/HSEnv/lib/python3.7/site-packages/dnsviz/analysis/offline.py", line 837, in _populate_status
    self._populate_nxdomain_status(supported_algs)
  File "/home/rithvik/.pyenv/versions/HSEnv/lib/python3.7/site-packages/dnsviz/analysis/offline.py", line 2402, in _populate_nxdomain_status
    supported_algs)
  File "/home/rithvik/.pyenv/versions/HSEnv/lib/python3.7/site-packages/dnsviz/analysis/offline.py", line 2279, in _populate_negative_response_status
    self._populate_rrsig_status(query, soa_rrset_info, self.get_name(soa_owner_name), supported_algs, populate_response_errors=False)
  File "/home/rithvik/.pyenv/versions/HSEnv/lib/python3.7/site-packages/dnsviz/analysis/offline.py", line 1580, in _populate_rrsig_status
    rrsig_status = Status.RRSIGStatus(rrset_info, rrsig, None, zone_name, fmt.datetime_to_timestamp(self.analysis_end), supported_algs)
  File "/home/rithvik/.pyenv/versions/HSEnv/lib/python3.7/site-packages/dnsviz/analysis/status.py", line 230, in __init__
    if self.dnskey.rdata.algorithm in DNSKEY_ALGS_VALIDATION_PROHIBITED:
AttributeError: 'NoneType' object has no attribute 'rdata'

Trying to trace the code, I think it's this commit (lines selected): 992baac#diff-1e33847313500796d7f40588ef54bc13df321fbae972af733d9da7bd00fbf76fR228-R229

If self.dnskey is None, (as passed by dnsviz/analysis/offline.py, line 1580), then a few lines later, self.dnskey.rdata.algorithm must not be accessed.

CAA record support

Hi there,

Recently, Ballot 125 of the CA/Browser Forum was passed, which means every CA will need to check for CAA records somewhere in the future.

Some CA's do this already, like Let's Encrypt. Unfortunately, some users have troubles regarding CAA records.

The dnsviz site, which is build upon this software, is a very helpful tool for this, as many times DNSSEC errors or other troublesome circumstances are the reason for this.

Unfortunately, at the moment it isn't possible to explicit select CAA records on the site (the "Advanced" methods of the site has helped me in the past) and as far as I could tell from the source code of this repo, there isn't CAA record support yet.

The CAA record was added to dnspython in version 1.13.0.

Therefore my request to add CAA record support πŸ™‚

Related issue for the dnsviz site: dnsviz/dnsvizwww#2

NSID support for servers

It would be great if dnsviz could add an NSID EDNS option to queries, and include that information in the "/responses/" tab. By that way, we can identify node issues in anycasted servers.
Thanks a lot, it's a wonderful tool!

Inaccurate display for KSK algorithm rollover

Hi, I did a KSK algorithm rollover for the zone 6v6.de. My DNS server (knot) does this automatically and follows RFC6781 4.1.4 for KSK algorithm rollovers. After the new KSK was introduced it looked like it only signed itself:
http://dnsviz.net/d/6v6.de/W9AmtA/dnssec/

When in reality the new KSK signed all DNSKEYs in the zone (as it should). This only became visible after the parent introduced the new algorithm DS:

http://dnsviz.net/d/6v6.de/W9Ar5Q/dnssec/

I would have expected that the signature from the new KSK over the whole DNSKEY set would be visible even before the DS change.

UDP Errors with root servers

I have seen quite a few errors of this nature recently.

./DNSKEY: No response was received from the server over UDP (tried 4 times). (192.112.36.4, UDP_0_EDNS0_32768_512)

how reliable is it for those using DNSSEC if G.ROOT-SERVERS.NET and possibly others have faults like these?

Find the ID

Hello folks,

I want to know if itΒ΄s possible to know the id, using the tool dnsviz, ex:

dnsviz probe example.com

From the gui interface the search: http://dnsviz.net/d/dnsviz.net/dnssec/ return a DNSKEY =id 28345.

Thanks in advance,
Luis

Recursive Resolver on different port

I have a recursive resolver listening on 127.0.0.1:5350 that works with dig as expected:

$ dig @127.0.0.1 -p 5350 proofofconcept
;; QUESTION SECTION:
;proofofconcept.                        IN      A

;; ANSWER SECTION:
proofofconcept.         19466   IN      A       142.93.115.133

;; Query time: 95 msec
;; SERVER: 127.0.0.1#5350(127.0.0.1)

But when passing this to dnsviz probe with -s, it only uses 127.0.0.1:53 (the default port, not the one passed in arg).

For this to be tested, I've opened port 5350 on my VM and will keep it open for now.

# dig works as expected and returns A record
dig @40.113.229.250 -p 5350 proofofconcept

# dnsviz tries to access port 53 of that IP and fails
dnsviz probe -s 40.113.229.250:5350 proofofconcept

Support CDNSKEY and CDS records

Feature request:

Now that CDNSKEY and CDS support has been deployed by one or two registries and some DNS services, it would be neat if DNSViz supported it too.

Simple option:

  • Query for and display CDNSKEY and CDS by default.

More complicated:

  • Warn if they don't match the current DS records?

  • Error if applying them would produce DS records that would make the zone bogus.

0x20 testing

PowerDNS auth 4.0.0-4.0.3 (fixed in 4.0.4) would mess up NSEC records for 0x20 (random casing) queries. We've had trouble getting people to upgrade because 'dnsviz is happy'. Could dnsviz perhaps (additionally?) randomise case in its queries to detect this failure? I'm pretty sure we're not the only one to have done broken things in this area.

NSEC coverage clarification

Be more specific about why an NSEC record doesn't cover. Specifically, show a different error if the problem is that a name in the NSEC record is a subdomain of the name being covered (e.g., ENT).

test for non-compliance of Empty Non-Terminals

This only applies to zones that have "deep" labels like. _dns._tcp.example.com

in this case _tcp is a empty non-terminal i.e. no records exist at it
Right answer for _tcp.example.com is "empty answer"
wrong answer includes Time-out, NXDomain, Refused, SERVFAIL

sometimes hard to detect when there is a wild card so check with multiple RRtypes
after support for the RRtype's has been established

Gost absence-from-OpenSSL handling fails to handle absence

OpenSSL 1.1.0 no longer ships with GOST; it's in an external engine.

The attempts to handle this absence in dnsviz are failing, see below. Further, these failed before trying OpenSSL 1.1.0, with however Ubuntu Xenial is configuring their OpensSL 1.0.2g, and failed identically.

With brutal surgery to dnsviz/crypto.py to remove all gost-handling functions and methods, and change both validate_ds_digest() and validate_rrsig() to raise Exception() if they're somehow called on gost data anyway, I can now run dnsviz probe mx.spodhuis.org and have it work instead of failing out on me.

% dnsviz probe mx.spodhuis.org
Traceback (most recent call last):
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/bin/dnsviz", line 106, in <module>
    main()
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/bin/dnsviz", line 88, in main
    mod = importlib.import_module('dnsviz.commands.%s' % command)
  File "/home/dnsviz/.pyenv/versions/3.6.4/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/commands/probe.py", line 63, in <module>
    from dnsviz.analysis import WILDCARD_EXPLICIT_DELEGATION, PrivateAnalyst, PrivateRecursiveAnalyst, OnlineDomainNameAnalysis, NetworkConnectivityException, DNS_RAW_VERSION
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/analysis/__init__.py", line 1, in <module>
    from .online import WILDCARD_EXPLICIT_DELEGATION, Analyst, OnlineDomainNameAnalysis, PrivateAnalyst, RecursiveAnalyst, PrivateRecursiveAnalyst, NetworkConnectivityException, DNS_RAW_VERSION
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/analysis/online.py", line 50, in <module>
    import dnsviz.query as Q
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/query.py", line 54, in <module>
    from .response import *
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/response.py", line 51, in <module>
    from . import crypto
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/crypto.py", line 163, in <module>
    _check_gost_support()
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/crypto.py", line 98, in _check_gost_support
    _gost_init()
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/dnsviz/crypto.py", line 135, in _gost_init
    gost = Engine.Engine(b'gost')
  File "/home/dnsviz/.pyenv/versions/dnsviz-3.6.4/lib/python3.6/site-packages/M2Crypto-0.29.0-py3.6-linux-x86_64.egg/M2Crypto/Engine.py", line 32, in __init__
    self._ptr = m2.engine_by_id(id)
TypeError: in method 'engine_by_id', argument 1 of type 'char const *'

broken insecure delegation not detected

http://dnsviz.net/d/www.stadsmuseum.nl/WgmyGg/dnssec/ - this name is currently considered bogus by Unbound, PowerDNS, Knot, and Google Public DNS. Querying for 'DS www.stadsmuseum.nl' indeed does not yield a correct proof of insecurity for the child zone - instead it returns this:

;; ANSWER SECTION:
www.stadsmuseum.nl.	300	IN	CNAME	stadsmuseum.nl.
www.stadsmuseum.nl.	300	IN	RRSIG	CNAME 13 3 300 20171123000000 20171102000000 45942 stadsmuseum.nl. DfZytI5utWG3CXAsoFj4Uq35ZN7Zpl3FvSwL6XMaN5vFYfbhCZBeUcBG oZ7K6jaYRw0w/r6B7TUxsxOTfwQoGg==

Perhaps the CNAME 'at apex' is confusing DNSViz?

Requirements in README.md?

Would be nice to have some requirements information in terms of python modules that need to be installed, and python version.

I'm fumbling through setting this up, and will eventually guess the right requirements (and may submit a proposed merge to README.md):

~/dev/dnsviz$ python2.7 ./setup.py 
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

~/dev/dnsviz$ sudo python2.7 ./setup.py 
Traceback (most recent call last):
  File "./setup.py", line 54, in <module>
    'dnspython (==1.11)',
  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 259, in __init__
    getattr(self.metadata, "set_" + key)(val)
  File "/usr/lib/python2.7/distutils/dist.py", line 1218, in set_requires
    import distutils.versionpredicate
  File "/usr/lib/python2.7/distutils/versionpredicate.py", line 5, in <module>
    import operator
ImportError: /usr/lib/python2.7/lib-dynload/operator.so: wrong ELF class: ELFCLASS32

support DS

For pre DNSSEC delegation purposes it would be a neat feature if you provide a DS and test if it would match the DNSKEY in the zone.

./DNSKEY: No response was received from the server over UDP

Hello,

I get following errors; I could not manage the solve what cause this errors.

./DNSKEY: No response was received from the server over UDP (tried 12 times). (192.36.148.17, UDP_0_EDNS0_32768_57)

./DNSKEY: No response was received from the server over UDP (tried 4 times). (192.36.148.17, UDP_0_EDNS0_32768_512)

com/DS (alg 8, id 30909): No response was received until the UDP payload size was decreased, indicating that the server might be attempting to send a payload that exceeds the path maximum transmission unit (PMTU) size. (192.36.148.17, UDP_0_EDNS0_32768_4096)

com/DS (alg 8, id 30909): No response was received until the UDP payload size was decreased, indicating that the server might be attempting to send a payload that exceeds the path maximum transmission unit (PMTU) size. (192.36.148.17, UDP_0_EDNS0_32768_4096)

root@server:~# dig @127.0.0.1 +short rs.dns-oarc.net txt
rst.x490.rs.dns-oarc.net.
rst.x461.x490.rs.dns-oarc.net.
rst.x466.x461.x490.rs.dns-oarc.net.
"Tested at 2017-03-08 19:19:02 UTC"
"139.162.146.144 sent EDNS buffer size 512"
"139.162.146.144 DNS reply size limit is at least 490"
root@server:~#
root@server:~# dig +short rs.dns-oarc.net txt
rst.x4090.rs.dns-oarc.net.
rst.x4058.x4090.rs.dns-oarc.net.
rst.x4064.x4058.x4090.rs.dns-oarc.net.
"139.162.130.22 DNS reply size limit is at least 4090"
"139.162.130.22 sent EDNS buffer size 4096"
"Tested at 2017-03-08 19:20:26 UTC"
root@server:~#

Sincerely,

DNSVIZ don't enforce rfc5155#section-7.1 "Each empty non-terminal MUST have a corresponding NSEC3 RR"

https://github.com/dnsviz/dnsviz/blob/master/dnsviz/analysis/status.py#L1250
https://github.com/dnsviz/dnsviz/blob/master/dnsviz/analysis/status.py#L1256

Here is looks like dnsviz checks the "Closest Encloser hash" is covered by the NSEC3, whereas i believe the RFC requires to check the the label that is being requested in order to comply with https://tools.ietf.org/html/rfc5155#section-7.1

o Each empty non-terminal MUST have a corresponding NSEC3 RR, unless
the empty non-terminal is only derived from an insecure delegation
covered by an Opt-Out NSEC3 RR.

so for example

example.xx.yy

yy is a signed tld covered by an NSEC3 record
xx is a "empty non-terminal", so is not delegated (no ns records), so as per the rfc it requires an NSEC3 record, however in this example it doesn't have a NSEC

example.xx.yy is an unsigned delegation

Currently this scenario passes in dnsviz, however i think it is a false positive.

Should test prerequisites

It would be better to have an explicit test (may be in setup.py), in order to produce a better error message:

% dnsget bortzmeyer.org > ../bortzmeyer.org.json
Traceback (most recent call last):
  File "/local/bin/dnsget", line 37, in <module>
    from dnsviz.analysis import Analyst, DomainNameAnalysis, get_client_addresses, NetworkConnectivityException, _resolver
  File "/usr/local/lib/python2.7/dist-packages/dnsviz/analysis.py", line 43, in <module>
    import crypto
  File "/usr/local/lib/python2.7/dist-packages/dnsviz/crypto.py", line 33, in <module>
    from M2Crypto import DSA, EC, Engine, EVP, m2, RSA
ImportError: No module named M2Crypto

Backtrace when /etc/resolv.conf is missing

dnspython 2 needs /etc/resolv.conf , and openSUSE has 'eradicated' that. The result is rather odd here

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/dnsviz/commands/probe.py", line 153, in _analyze
    return a.analyze()
  File "/usr/lib/python3.8/site-packages/dnsviz/analysis/online.py", line 1513, in analyze
    return self._analyze(self.name)
  File "/usr/lib/python3.8/site-packages/dnsviz/analysis/online.py", line 2368, in _analyze
    self._analyze_name(name_obj)
  File "/usr/lib/python3.8/site-packages/dnsviz/analysis/online.py", line 2403, in _analyze_name
    servers = name_obj.zone.get_auth_or_designated_servers()
AttributeError: 'NoneType' object has no attribute 'get_auth_or_designated_servers'

Debugging it a bit

$ ./bin/dnsviz probe example.com
Analyzing example.com
Error analyzing example.com
Traceback (most recent call last):
  File "/home/jayvdb/projects/dns/dnsviz/dnsviz/commands/probe.py", line 159, in _analyze
    return a.analyze()
  File "/home/jayvdb/projects/dns/dnsviz/dnsviz/analysis/online.py", line 1514, in analyze
    return self._analyze(self.name)
  File "/home/jayvdb/projects/dns/dnsviz/dnsviz/analysis/online.py", line 2374, in _analyze
    self._analyze_name(name_obj)
  File "/home/jayvdb/projects/dns/dnsviz/dnsviz/analysis/online.py", line 2409, in _analyze_name
    assert name_obj.zone, name_obj
AssertionError: example.com

And is_zone() is False, so .zone is .parent which is the None we see above.

When I move /usr/etc/resolv.conf to /etc/resolv.conf it magically works.

While this is probably a problem for dnspython to improve, very likely dnsviz can better detect that dnspython is broken and fail in a more user-friendly way.

No licence?

When installing the software:

% sudo python setup.py install
...
running install_data
creating /usr/local/share/doc/dnsviz
copying README -> /usr/local/share/doc/dnsviz
error: can't copy 'COPYING': doesn't exist or not a regular file
% 

Testing the "downgrade" of DS hashing algorithms

RFC 4509 section 3 says "Validator implementations SHOULD ignore DS RRs containing SHA-1
digests if DS RRs with SHA-256 digests are present in the DS RRset." (to avoid downgrade attacks). I find no such rule for SHA-384 but it seems to me that the spirit of RFC 4509 would be to do the same (ignoring weak hashing algorithms when a DS with a stronger one is present). Resolver Unbound rejects such weak DS when its "harden-algo-downgrade" option is set to yes. (In some versions, Unbound also rejects them even without this option.)

Today, DNSviz does not report this issue, not even as a warning. See http://dnsviz.net/d/ada.eu.org/WcTxzg/dnssec/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.