mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #3060] [MERGED] Authenticated AXFR policy, TSIG response signing #3527
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#3527
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/3060
Author: @cpu
Created: 6/17/2025
Status: ✅ Merged
Merged: 6/25/2025
Merged by: @djc
Base:
main← Head:cpu-axfr-auth_dev📝 Commits (7)
ca6b0a2server/store: add SqliteAuthority independent AxfrPolicya177f1dadd AxfrPolicy::AllowSigned, impl in SqliteAuthority1e3ca30server: allow authorities to optionally sign some responses1035ac0proto: reorder items in tsig modulea40307dproto: extract TSIG::stub() constructor634edf0server/store: SqliteAuthority sign responses to auth'd queries632bbeaintegration-tests: SqliteAuthority update/AXFR check resp. sig.📊 Changes
22 files changed (+1090 additions, -283 deletions)
View changed files
📝
bin/tests/integration/authority_battery/basic.rs(+53 -18)📝
bin/tests/integration/authority_battery/dnssec.rs(+8 -2)📝
bin/tests/integration/authority_battery/dynamic_update.rs(+43 -17)📝
crates/proto/src/dnssec/rdata/tsig.rs(+78 -65)📝
crates/proto/src/dnssec/tsig.rs(+184 -10)📝
crates/proto/src/op/message.rs(+6 -0)📝
crates/server/src/authority/authority.rs(+23 -4)📝
crates/server/src/authority/authority_object.rs(+40 -10)📝
crates/server/src/authority/catalog.rs(+50 -14)📝
crates/server/src/authority/message_request.rs(+1 -3)📝
crates/server/src/authority/message_response.rs(+5 -0)📝
crates/server/src/store/blocklist.rs(+32 -20)📝
crates/server/src/store/file.rs(+15 -6)📝
crates/server/src/store/forwarder.rs(+19 -9)📝
crates/server/src/store/in_memory/mod.rs(+35 -17)📝
crates/server/src/store/recursor.rs(+19 -9)📝
crates/server/src/store/sqlite/mod.rs(+157 -41)📝
tests/integration-tests/tests/integration/catalog_tests.rs(+37 -0)📝
tests/integration-tests/tests/integration/chained_authority_tests.rs(+25 -12)📝
tests/integration-tests/tests/integration/client_future_tests.rs(+3 -1)...and 2 more files
📄 Description
👋 This branch is a continuation of some work started in https://github.com/hickory-dns/hickory-dns/pull/2977 and https://github.com/hickory-dns/hickory-dns/pull/2982 There's two primary changes for the authoritative server binary included (broken up into smaller individual commits for reviewability):
The existing
allow_axfrbool is replaced with an enum,AxfrPolicy, that has three possible values:AxfrPolicy::Deny(equivalent toallow_axfr = false),AxfrPolicy::AllowAll(equivalent toallow_axfr = true), andAxfrPolicy::AllowSigned(a new addition not able to be expressed with thebool). TheAllowSignedpolicy requires the DNSSEC feature and allows AXFR requests iff they present a valid SIG(0) or TSIG signature over the request. TheSqliteAuthorityis then updated to perform the required signature verification (no other authority implementations have implemented signature validation at this time).The catalog/authority code is updated to allow an authority processing an update request, or an AXFR query, to optionally return a closure that can be used to produce a
MessageSignaturefor the response delivered to theResponseHandler. This allows addressing an oversight in the initial TSIG authentication implementation that neglected to sign the responses as mandated by RFC 8945. This requires that we change some trait definitions (for the new optional return type) and to consume the fullRequestinstead of the slimmerRequestInfoas a parameter.The TSIG response signing process is a little bit nuanced: firstly, it takes part of the authenticated request as input (the request's TSIG MAC). Additionally it may produce both signed and unsigned TSIG RR message signatures for a response. In the happy path we always produce a TSIG RR with a computed MAC. In the error paths we may produce what the RFC calls an "unsigned" response. This is a TSIG RR that has an empty MAC, and a TSIG error RCODE. One error condition (an expired request TSIG signature) produces a signed error response (e.g. a TSIG RR that has both a valid MAC and a TSIG error RCODE).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.