Comments (14)
After reviewing TSIG RFCs this is a bigger feature than I realized. I also am thinking that it might be redundant with DNSCrypt possibly, which seems better to implement.
from hickory-dns.
Regarding the ease of implementation: I was talking only about the client side, I've not thought about what a server-side implementation would entail.
As an additional data point: it seems the PowerDNS authorative nameserver supports only TSIG-authenticated updates; at least I could not find any information about using SIG(0) with PowerDNS in a quick search. If that's correct, I think TSIG support, at least on the client side, can be considered important.
from hickory-dns.
Browsing around a bit to see how much work it would be. Hoping to hear some comments. I'm assuming this could be tied into the Signer somehow, hoping that's not a dead end :)
Here seems to be a filter on OpCode::Update
that would prevent AXFR/IXFR queries.
https://github.com/bluejekyll/trust-dns/blob/5682ba174ca0c7173b022ff0601bcd6b5972ee4a/crates/proto/src/xfer/dns_multiplexer.rs#L343-L351
Here the message is finalized, including passing timestamp:
https://github.com/bluejekyll/trust-dns/blob/5682ba174ca0c7173b022ff0601bcd6b5972ee4a/crates/proto/src/op/message.rs#L635-L645
Just like add_sig0
, there would be an add_tsig
.
And then a TSIG version of:
https://github.com/bluejekyll/trust-dns/blob/5682ba174ca0c7173b022ff0601bcd6b5972ee4a/crates/client/src/rr/dnssec/signer.rs#L518
And a TSIG version of:
https://github.com/bluejekyll/trust-dns/blob/5682ba174ca0c7173b022ff0601bcd6b5972ee4a/crates/proto/src/rr/dnssec/rdata/sig.rs#L183
There is a readable and well tested (CoreDNS etc) implementation here in Go:
https://github.com/miekg/dns/blob/d16ecb693e3f8d524769fefce2192a4c92207ff9/tsig.go#L98
@bluejekyll sounds like you've banged your head against this.. any thoughts on pitfalls? My usecase is only queries.
from hickory-dns.
The reason I backed away from TSIG was mainly due to having implemented SIG0 and then reading rfc2845, since what I needed was covered by SIG0, I didn't feel a need to build it out. Getting the signing process correct for RRSIG and SIG0 was a pain, and so by estimation, I realized that TSIG would be a similar amount. That's where my estimate of this being a lot of work comes from.
Here seems to be a filter on OpCode::Update that would prevent AXFR/IXFR queries.
SIG0 is only required right now for Update. We should have a flag for all queries that would allow the signing logic to kick in, I can't remember at the moment (need to review the code) if that was ever implemented. I did think about it being useful. We might want to make it a flag on the Client.
Here the message is finalized, including passing timestamp:
Just like add_sig0, there would be an add_tsig.
And then a TSIG version of:
MessageFinalizer
was created as a means to allow for the proto crate to be split out of the client crate. We might not want a different implementation all together, but instead a separate method on Signer for performing this. I'm open to other ideas though. Signer itself my have too much logic in it, so maybe we want separate SIG0 and TSIG MessageFinalizers? I intended the logic in that to allow MessageFinalizers to be chained so that multiple SIG0's could be performed.
There is a readable and well tested (CoreDNS etc) implementation here in Go:
As a matter of practice I tend to not look at other implementations to keep the IP totally separate, but if that gives you good guidance then that's excellent.
sounds like you've banged your head against this.
I didn't actually bang my head against this, instead I just didn't feel a pressing need to implement it, and so never added it to my own backlog. So I don't have a strong set of guidance. It does look like what you've identified as a rough plan is reasonable.
I'm happy to help, though I won't be available until next week.
from hickory-dns.
FYI, my current plan is to implement #278 (mTLS) and not TSIG. SIG0 is already supported for a standard dynamic update auth option.
from hickory-dns.
Seems to be some TSIG action going on here, https://github.com/NLnetLabs/domain
from hickory-dns.
@bluejekyll Been experimenting with this a bit and it turned out somewhat painful. Thought I could reuse more infrastructure. Think this requires a bit more refactoring to get TSIG in, without duplicating too much. Should get back with what sharp corners I found at some point.
With that conclusion I instead removed the mentioned OpCode::Update
filter for the signer, and tried out SIG(0) protected AXFR's which worked like a charm towards BIND.
from hickory-dns.
If you happen to have any notes from the issues you ran into, we could capture those here?
And yes, I've found SIG0 to be a much more straightforward implementation and generally suits my needs.
from hickory-dns.
JFYI: I've added TSIG support in tdns-cli
on top of trust-dns
. The only issue I ran into was that adding TSIG RR to the DNS query will conflict with the EDNS handling, as the latter will add an additional RR during message rendering; this required me to duplicate the update_message.rs
code from trust-dns
inside tdns-cli
.
It would be nice if trust-dns
had support for the RR record type, and attaching a TSIG signature to a DNS message; this could be done without requiring the actual signature algorithm to reside in trust-dns
, I think, if that is preferred.
I'd be willing to prepare a PR based on my implementation, if that is deemed in scope for the project. Also, I'm wondering in what ways SIG0 is more straightforward to implement than TSIG -- I found it TSIG to be quite easy to implement.
from hickory-dns.
@rotty Yes, I'd be very happy to accept TSIG into the library. I think that would be a great addition. If it's not implemented in the trust-dns-server, then my concern would be that we don't have a good method of testing the feature. There is a compatibility suite of tests built on top of BIND9, so it would be a good idea to implement a test in that suite for TSIG so that we have coverage over the feature and we don't lose it due to other breaking changes. As an example, here are the SIG0 tests: https://github.com/bluejekyll/trust-dns/blob/master/tests/compatibility-tests/tests/sig0_tests.rs
In terms of straightforwardness, let's just say that when I was implementing all of this, after DNSSEC and SIG0, I had just lost some energy in doing it, and it wasn't vital to my needs.
I will say that you might want to hold off on a PR atm, I have a very large refactor coming with #849 so we might want to hold off until I land that. I'm hoping to get it in this weekend.
from hickory-dns.
Ok, I'll look into providing a client and server implementation, but it could take a while, as I need to get familiar with the codebase first. It's great that a server-side implementation in scope -- let's see how this goes!
Thanks for the heads-up regarding #849; very nice that this is almost ready! I'm looking forward to switch to async/await in tdns-cli
.
from hickory-dns.
Oh, sorry, I wasn't suggesting you need to implement the server side, only that I want to make sure we have test coverage, and that the best way to do that would be to use the compatibility test suite for providing that coverage.
If you do want to add the support to the server, that would be great, but I don't think it's necessary.
from hickory-dns.
Ok, thanks for the clarification.
from hickory-dns.
@rotty Please deal with that if let OpCode::Update = request.op_code()
filter mentioned above while at it to allow TSIG'd AXFRs and IXFRs!
from hickory-dns.
Related Issues (20)
- Failing to read "_acme-challenge" TXT record HOT 3
- Debug assert triggered: record types do not match, DNSKEY <> Some(Unknown(48)) HOT 4
- do not leak and requested domain to the log HOT 21
- trust-dns quic client can not querry trust-dns quic server HOT 11
- RecordType does not implement Deserialize... but it does? HOT 3
- How to run async dynamic update with DNS SEC? HOT 2
- `proto::op::Message` can panic when `dnssec` is not enabled no debug builds HOT 3
- Panic: "bad character in CAA issuer value" HOT 2
- Prometheus metrics HOT 4
- `ClientConfig` and `RootCertStore` improvements HOT 4
- trust-dns only warns instead of returning Err when it has no nameservers listed in /etc/resolv.conf HOT 6
- read_system_conf returns different Error types on unix vs windows HOT 1
- Unable to build without linking against libssl/libcrypt HOT 2
- Revisit maximum request sizes in TCP, DoT, DoH, and DoQ implementations
- Axfr and AxfrStream issues with big zones HOT 3
- Sync client hang HOT 4
- Hickory DNS rebranding HOT 9
- How can AsyncClient be used with UdpStream? HOT 10
- Use AsyncClient across multiple tokio async tasks HOT 2
- Update ring to support s390x and ppc64el HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hickory-dns.