All notable changes to this project are documented here.
Closes the findings of the fourth audit of v0.3.2 (commit e4dfe4a): the GPG
pipeline now requires a successful GnuPG exit code before checking the signer
fingerprint, and a latent DO-bit field bug in test/cd-check.py is fixed.
set -eux, a
gpg … | grep … | awk … | grep … pipeline's exit status is that of the last
grep; a matching VALIDSIG fingerprint was therefore enough to proceed even
if GnuPG itself reported an error. VALIDSIG only means cryptographically
valid and can appear alongside expired/revoked-key warnings. Now GnuPG runs
as a separate command (its exit code is checked by &&), the status
output is stored to a file, and only then is that file checked for the expected
signer fingerprint — so a non-zero GnuPG exit (e.g. expired/revoked key,
missing public key) fails the build. (Both the unbound and ldns source
stages.)test/cd-check.py had the DO bit in the wrong OPT field. The 0x8000
was in the 2-byte CLASS field instead of the OPT record's 4-byte EXTENDED
FLAGS field, so the DO bit was not set (verified: AD stayed 0). Fixed to
struct.pack(">HHIH", 41, 0, 0x8000, 0) — matching dns-check.py and how
unbound interprets the DO bit (verified: AD=1). The file is not used by the
current counter-test (which disables the validator via module-config:
iterator), so this is a latent bug, not a behavioral change.Closes the findings of the third audit of v0.3.1 (commit 678fdbf): the
DNSSEC negative test now proves signature rejection (not just a SERVFAIL),
probe exit codes distinguish timeouts from execution errors, the GPG signer
check uses machine-readable --status-fd output, and the cosign digest comes
from the push result.
broken.example
with an explicit trust anchor (the zone DNSKEY), so validation is
well-defined. It asserts three things:
NOERROR + AD (the signature validates);SERVFAIL (the signature
is rejected);module-config: iterator) →
NOERROR — the counter-test that separates signature rejection from a
generic resolution failure: the broken answer resolves fine, yet its
signature is rejected.
The responder now serves the zone DNSKEY (with its RRSIG) so unbound can prime
the trust anchor, and selects the A vs. DNSKEY packet by query name. New file:
test/cd-check.py.NOT VERIFIED. Now only exit code 2 is a timeout
(NOT VERIFIED); any other unexpected code is reported as an execution
error and fails the run, so a broken probe can no longer masquerade as a
network hiccup.--status-fd. The build now extracts the signer
fingerprint from GnuPG's machine-readable status output
([GNUPG:] VALIDSIG <fpr> …) instead of parsing the human-readable
using … key <fpr> line — more robust against GnuPG locale/version changes.build.sh now takes the digest from
the docker push output (digest: sha256:…) rather than
.RepoDigests[0], which with multiple entries need not be the reference just
published. The signature is bound to the exact pushed digest.Closes the remaining findings of the post-audit acceptance review of v0.3.0
(commit def097d): test isolation, probe semantics, the DNSSEC negative
test, GPG signer binding, and the cosign signing path.
docker rm -f unbound and docker compose down --volumes against the fixed
project unbound-sec, and the build tagged unbound-sec:latest — all of
which a live deployment of the same template on the same daemon would lose.
Now: the template has no fixed container_name (named after the compose
project), the test runs under a dedicated project unbound-sec-test with
a test-image override (test/compose.test.yml pins unbound-sec:test),
and cleanup removes only the resources the test created. The production
tag unbound-sec:latest is no longer touched by the test run.FAIL
results of the DNSSEC and CHAOS probes were only warnings — a leaked
identity would not have failed the run. The probes now use a three-state
exit code: 0=pass, 1=content deviation, 2=timeout. Content deviations
fail the run; timeouts are reported as NOT VERIFIED (visible in the
result line) and do not mask a real finding.broken.example served
by a static responder: a well-formed RRSIG whose DNSKEY cannot be anchored in
the trust chain (no parent DS). The test asserts SERVFAIL (without CD)
for www.broken.example A with DO. This catches regressions such as
val-permissive-mode: yes, which would keep validating good answers while
letting broken ones through. New files: test/make-broken-zone.py,
test/broken-zone-responder.py.gpg --verify could accept a foreign signature. The build
now extracts the signer's fingerprint from the gpg --verify output
(using … key <FPR> line) and requires it to equal the pinned
GNUPG_FINGERPRINT — binding the signature to the expected key (both the
unbound and ldns source stages).cosign sign carried
verification-only flags (--certificate-identity-regexp,
--certificate-oidc-issuer-regexp) and signed before the image was pushed.
build.sh now pushes REGISTRY_IMAGE first, resolves the exact pushed
digest, and signs that digest; the identity conditions are documented on the
cosign verify side.include:
"/config/*.conf" was inside the server: block, so drop-ins could only use
server: keywords — top-level keywords like forward-zone were ignored. The
include is now top-level, so drop-ins may use both server: settings and
top-level keywords. (This is what makes the DNSSEC negative test's
forward-zone drop-in work.)ubsec-negnet), not the shared test network, so they
are unaffected by the other test containers. The responder's IP is read from
its own log (it prints its container IP) with a docker inspect fallback —
more reliable than host-side docker inspect, which can be empty while a
container is starting on a slow WSL daemon. Any stale .broken-zone.bin
(a directory left by a previous mount of a missing file) is removed before
zone generation.# syntax=docker/dockerfile:1 directive. It forced BuildKit to pull
the docker/dockerfile:1 frontend image on every build, which failed on
offline/WSL builds even with all base images cached. The Dockerfile uses no
advanced syntax features, so the built-in frontend suffices and the build now
works fully offline from the local image cache.Fixes the findings of the external security audit of 2026-10-23
(commit 0fb485d): P1 (recursive include) and all P2 items, plus the
P3 items.
./config
(containing the base unbound.conf) was mounted to /config, which the
base config includes via /config/*.conf — the base config included
itself. Drop-ins now live in a separate ./conf.d/ directory mounted to
/config; the base config stays baked in at /etc/unbound/.
New regression test: the test suite starts the container with the ACTUAL
docker-compose.yml (old fixture-based tests couldn't see this bug).cp -f reset the root
trust anchor to the package state on every start (and it lived on tmpfs
in the template). The anchor now lives in a persistent, writable
/var/unbound (named volume in the compose template) and is initialized
from the dnssec-root package only if no state file exists yet. Learned
keys and rollover state survive restarts. New test: anchor content +
mtime unchanged across a container restart, AD=1 before and after.ports
removed; the template is for a shared internal network (e.g. Pi-hole).
LAN access is an explicit opt-in via a comment example publishing on a
specific host address.forward-addr
examples now pin the TLS name: 1.1.1.1@853#cloudflare-dns.com
(without it, any CA-signed certificate on the path would be accepted).arcount=1); the old probe's 0x0020 was the header AD bit, not DO.
Deterministic checks: signed zone + DO -> NOERROR + answers + AD=1;
same zone without DO -> AD=0; repeat for stability. The
"unsigned zone -> AD=0" check is implemented via the no-DO variant
because no stable unsigned public zone is guaranteed (zones get signed
over time; dnssec-failed.org timed out during verification).private-address extended: 127.0.0.0/8, ::1/128, fc00::/7,
fe80::/10 (DNS-rebinding; the old list covered only RFC1918 +
link-local IPv4).2310…DF45 pinned in the Dockerfile
(ARG GNUPG_FINGERPRINT): the imported key must carry it, otherwise
the build fails — the signature now anchors to an independently
verified identity, not just to the downloaded key.alpine:3.24, tonistiigi/xx:1.9.0) →
reproducible builds.--enable-pie --enable-relro-now.--enable-subnet (EDNS Client Subnet, inactive by default — opt in via
config) and --enable-tfo-server --enable-tfo-client (TCP Fast Open).unbound -V configure line).test/ab-dropin.sh): v0.1.0 vs. v0.2.0 side by side
with identical config — 7/7: identical resolution, identical DNSSEC
AD-bit behavior, identical CHAOS/hide-identity behavior, identical
contract (uid 1500, port 5053, healthcheck, /config volume).
v0.2.0 is a pure drop-in for v0.1.0: only Dockerfile (build-time
integrity, hardening, feature flags) and tests/docs changed;
config/, entrypoint.sh, docker-compose.yml are untouched.docker build (without --build-arg CACHEBUST) failed with
/bin/sh: CACHEBUST: parameter not set because ARG CACHEBUST had no
default and the src stages run with set -u. Now ARG CACHEBUST="" —
plain builds work, the test suite keeps passing a timestamp to force
fresh integrity verification.curl --retry 3 --retry-delay 2 --retry-all-errors --max-time …:
build-host DNS can be flaky (observed 2026-10-23: WSL/Windows resolver
intermittently failing on nlnetlabs.nl while public resolvers answered
in ~30 ms), which aborted builds with curl: (6) Could not resolve host.crazymax/unbound./config/*.conf drop-in include, hide-identity/hide-version.build.sh with cosign keyless signing.