-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSIG names cannot be reused across different zones. #1325
Comments
In cases where the If you can’t make this work with |
TsigProvider comes after this point in the code. https://github.com/miekg/dns/blob/master/xfr.go#L228-L232. You can see here that in order to even find the correct TSIG you need to query by header name. That means that if multiple TSIG across different zones share the same name, only one can exist at once because it's in a basic Map. It then uses that Tsig to verify, which may or may not use the TsigProvider interface. Unless I'm missing something, it's not possible to solve this problem using TsigProvider. Can you point me to an example of how that would work? |
A couple of things with your approach:
I've created a PR on my own repo to show this problem. The benefit of this approach is a couple of things:
If we can make a function that does the opposite of TsigBuffer, I think this whole approach would work great. Unfortunately that looks a little bit difficult IMO but maybe I'm missing something. |
And just for clarity once again this would solve the other issue that I previously opened #1161. |
I'm not sure how adding another map would help there at all. It's still not safe to mutate the map when the server is running. Edit: I think I understand what you mean. |
That we can fix. Not sure how we overlooked that initially.
I see the issue you're having. I think implementing the opposite of
Yep, exactly! Using |
I'll reopen this until #1331 is merged. There is a deficiency here. |
Absolutely, I was just showing how in the TsigProvider implementation you could use a RW Mutex so that anytime you need to check that map on the server TSIG verification, you could lock it to make sure that no secrets were being added removed. It's quite a beneficial setup for systems that need to constantly rotate tsig secrets. |
Due to the nature of the TsigSecret in the Server{} object, it's not possible to re-use TSIG names across different zones.
For example:
Here the tsig name is
axfr.
which means that if any other zone wanted to useaxfr.
as well, it would be overwrite this one. Alternatively, the server could specify the TsigSecret to use zoneName for the TSIG name, which is better because duplicates would not occur, however this means that every client using that zone would need to have the same TSIG and also wouldn't allow TSIGs to be re-used across multiple zones which again is not great.The text was updated successfully, but these errors were encountered: