mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #2977] [MERGED] server: implement TSIG authentication for SqliteAuthority updates #3463
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#3463
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/2977
Author: @cpu
Created: 5/7/2025
Status: ✅ Merged
Merged: 5/8/2025
Merged by: @djc
Base:
main← Head:cpu-tsig-sqlite-store_dev📝 Commits (6)
043de9cserver: lift up sqlite store SIG(0) verificationeb0881eserver: remove unused sqlite store clippy allowc2cc375server: inline sqlite store log fmt args3b220b7server: remove superfluous sqlite store type annotations42a9a58server: impl TSIG auth for Sqlite authority9499309integration-tests: add SqliteAuthority TSIG update tests📊 Changes
3 files changed (+424 additions, -82 deletions)
View changed files
📝
bin/tests/integration/store_sqlite_tests.rs(+4 -0)📝
crates/server/src/store/sqlite/mod.rs(+195 -79)📝
tests/integration-tests/tests/integration/sqlite_authority_tests.rs(+225 -3)📄 Description
Description
This PR extends the
hickory-server'sSqliteAuthorityto support RFC 8945 TSIG authentication in addition to the pre-existing SIG(0) authentication support.This support is helpful because some other notable DNS projects like kea and k8s external-dns don't support SIG(0) and using asymmetric cryptography to authenticate requests, and instead only offer the simpler TSIG mechanism based on pre-shared symmetric MAC keys. Most of the TSIG machinery was already present (via https://github.com/hickory-dns/hickory-dns/pull/1459), but only used by a DNS client to authenticate outbound messages (and verify their responses) so there isn't any new cryptography added here - just plumbing.
Since TSIG is separate from DNSSEC, and only the
SqliteAuthorityimplements support at this time, I've chosen to place the TSIG signer configuration elements in theSqliteConfig. This might need to be revisited if other authorities are extended to support TSIG authentication in the future.Resolves https://github.com/hickory-dns/hickory-dns/issues/2822
Testing
I've added a handful of simple integration tests, but I've also been able to demonstrate this working end-to-end using a simple Go program that uses
miekg/dnsas an independent TSIG/DNS implementation.HickoryDNS config.toml
Sample zone file:
A simple Go client program:
Client-side logs:
Server-side logs:
A note on name compression
One interesting thing that fell out of the above testing is that if I don't enable name compression on the client-side, the HickoryDNS side computes the wrong message MAC and so authentication fails. You can reproduce this by deleting the line in
main.gowhere it setsupdate.Compress = true.It seems like the HickoryDNS-side is reconstituting the TBS message bytes differently than they are received on the wire w.r.t name compression. I think this should be investigated & fixed as a follow-up.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.