Add DNSSEC validation check via delv (#3034)#3035
Open
ChrisJr404 wants to merge 1 commit intotestssl:3.3devfrom
Open
Add DNSSEC validation check via delv (#3034)#3035ChrisJr404 wants to merge 1 commit intotestssl:3.3devfrom
ChrisJr404 wants to merge 1 commit intotestssl:3.3devfrom
Conversation
Adds a "DNSSEC" line in the certificate-info block, right next to the
DNS CAA RR check. The new get_dnssec_status() function calls delv (the
BIND validating lookup utility) on $NODE and parses delv's status comment
lines:
- "; fully validated" -> pr_svrty_good, JSON severity OK
- "; partially validated" -> pr_svrty_good, JSON severity OK
- "; unsigned answer" -> pr_svrty_low, JSON severity LOW
- ";; resolution failed:" -> pr_svrty_high if the verdict text matches
a real DNSSEC failure ("trust chain",
"no valid signature", "bogus", "DNSKEY",
"NSEC", "insecure"); otherwise treated
as a transient resolver problem and
surfaced as pr_warning so we don't
misreport a network glitch as a domain
that's been tampered with.
If delv is not installed, the line prints a hint pointing at bind9 /
bind-utils and continues. --nodns and --ip=proxy short-circuit the
check the same way the CAA block already does.
A new HAS_DELV global is initialised next to the other resolver
HAS_* vars and set in check_resolver_bins(); it is also dumped under
--debug so users can see why the DNSSEC check was skipped.
Documentation in doc/testssl.1.md is updated under the certificate-info
section listing.
The Docker images are deliberately left alone in this PR; adding
bind-utils (opensuse) / bind-tools (alpine) is a separate sizing
decision for the maintainer.
Closes testssl#3034
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds a
DNSSECline to the certificate-info section (right afterDNS CAA RRand beforeCertificate Transparency) that callsdelvagainst$NODEand reports one of:fully validated/partially validated— pr_svrty_good, JSON severityOKnot signed— pr_svrty_low, JSON severityLOW, fileout textdomain not DNSSEC-signedbroken trust chain,no valid signature found,bogus*,DNSKEY*,NSEC*,*insecure*) — pr_svrty_high, severityHIGHWARNThe two buckets at the bottom matter: I didn't want a flaky upstream resolver to make
testssl.shclaim a domain has been tampered with. Soget_dnssec_status()separates "delv really said the chain is bogus" (return 2 → red) from "delv couldn't get an answer" (return 3 → orange warning).--nodns=min|noneand--ip=proxyshort-circuit the check before we shell out, mirroring the existing CAA block one screen above. Ifdelvisn't installed, the user sees(no "delv" binary, install bind9 / bind-utils)and the rest of the report continues as before.A new
HAS_DELVglobal is initialised next to the other resolverHAS_*vars and set incheck_resolver_bins(); it's also dumped under--debugso users can quickly see why the DNSSEC check was skipped.doc/testssl.1.mdis updated under the certificate-info bullet list.Why delv
dig +dnsseconly sets the DO bit and trusts whatever AD bit the configured resolver hands back, which is exactly the answer you can't trust if the resolver is the threat.delvperforms validation locally against the root trust anchor shipped with BIND, which is the right primitive for an authenticity check. That matches the framing in the issue.Open question for the maintainer
I deliberately left
Dockerfile(opensuse leap) andDockerfile.alpinealone. Addingbind-utils/bind-toolsto the images is a sizing decision (a few extra MB on a deliberately small container) and the existing image already shipsldnsfordrill. Happy to push a follow-up commit adding them to either or both images, or to leave it for a separate PR. The fallback path means today's Docker users see the "no delv binary" hint and nothing else changes.Caveats
DNS CAA RR (experimental)block since [Feature request] Implement DNSSEC test with delv? #3034 referenced PR DNS HTTPS RR (RFC 9460) for 3.3dev #2866 where that pattern already exists. Happy to iterate on naming, severity choices, or where the line lives.pr_svrty_highfor a known-bogus chain is my best guess at the right weight. If you'd rather have it aspr_svrty_mediumor as apr_warning, that's a one-line change.get_caa_rr_record()to fall back todelvwhendig/drill/host/nslookupfail, but that's well outside the scope of this PR (one functional change per PR perCoding_Convention.md).Tests
Local checks against:
bash -n testssl.shandshellcheck -S error testssl.share clean.Closes #3034.