Skip to content

TSIG downstream support#587

Merged
ximon18 merged 143 commits into
mainfrom
tsig-downstream-support
Apr 30, 2026
Merged

TSIG downstream support#587
ximon18 merged 143 commits into
mainfrom
tsig-downstream-support

Conversation

@ximon18

@ximon18 ximon18 commented Apr 15, 2026

Copy link
Copy Markdown
Member

Summary

This PR implements the last piece of work needed for #301: downstream TSIG support.

Downstream TSIG support consists of accepting TSIG signed XFR related requests sent by downstream nameservers to Cascadea nd replying with an appropriately signed response.

Known issues

  • TSIG state isn't properly restored on startup so that the key used by a zone will after restart become orphaned, the zone source is not properly reconstituted and so will lack the TSIG key. This issue wasn't caused by this PR but was found while testing it. It is fixed in separate PR FIX: Restore zone TSIG key state on startup. #590.

Changes made

CLI changes:

  • Update tsig list to also show policies that use TSIG key(s) with downstreams, in addition to zones whose source uses a TSIG key with an upstream.

Policy changes:

  • New server.outbound.accept-xfr-from policy setting. Actually it was already supported (under a slightly different name, accept-xfr-requests-from, but was not used anywhere).

Daemon changes:

  • Extend SimpleNameserverCommsSpec from string parsing to handle a [^<TSIG_KEY_NAME>] suffix.
  • Remove the unused InboundPolicy type, this is currently handled by the --source argument to the zone add CLI subcommand, not via policy.
  • Enforce the accept-xfr-from ACL on incoming XFR requests handled by the zone server, rejecting requests that have an incorrect source IP address or mismatched TSIG key.
  • Use the TSIG key defined in send-notify-to to sign NOTIFY messages sent by Cascade.
  • Note: no changes were required to check XFR request TSIG keys or to TSIG sign responses as this was already handled by the existing TsigMiddlewareSvc.

Documentation changes:

  • Extend the Nameserver Integrations/NSD page showing how to use NSD as a downstream, optionally with TSIG.

System test changes:

  • Extend the secondary NSD configuration to include a TSIG tsig-key definition and new versions of the existing secondary zone which use TSIG for XFR and for NOTIFY+XFR.
  • Adds a downstream-tsig system test which tests XFR and NOTIFY against NSD with and without TSIG keys for NOTIFY and XFR communication.

  • If you are changing Rust code or integration tests (Cargo.*, crates/, etc/, integration-tests/, src/):

    • Did you run the integration tests with act through the act-wrapper (as described in TESTING.md)?
  • If you are modifying man pages:

    • Did you commit the updated built man pages?

ximon18 and others added 30 commits April 2, 2026 11:38
- New `cascade tsig add` client command to request that the daemon add a
TSIG key to the Cascade TSIG store.
- New cascaded POST /tsig/ API to add a TSIG key to the Cascade TSIG
store.
- Extension of the `cascade zone add` command `--source` argument with
an optional `!<TSIG key name>` syntax to define the TSIG key that
Cascade should use when sending an XFR request to the upstream.
- Pass the key defined by the source to the zone loader instead of None
(the zone loader is already capable of using the key, it just wasn't
being told which key to use)
As Base64 is typically how tooling present/accept TSIG key secret data
to/from users.
Begin with a test that should fail: fetching a zone without using the
required TSIG key.
ximon18 added 15 commits April 24, 2026 08:45
And use add instead of register as we say add in some places and
register in others, and because remove is used as the opposite of add,
we don't say de/unregister.
Also, reverse the change on failure to register the zone.
Also, add some missing zone server updates and failure to mark state as
dirty.
- Improved field names in TsigListResult.
- Include policy names in TsigListResult.
- Rename accept_xfr_requests_from to accept_xfr_from to better mirror
send_notify_to.
- Document accept_xfr_from in policy example and man page.
- Rebuild man pages.
- Don't allow IP on ACL to be optional. (we can always support ACL by
TSIG key only and not by IP later if we wish, but nobody asked for it at
this point and it adds complexity)
- Reduce noise output by TSIG downstream system test.
- Add TSIG key name to NameserverCommsPolicy and friends.
- Add parsing of TSIG key name in SimpleNameserverCommsSpec.
- Enforce ACLs on outbound XFRs.
@ximon18
ximon18 force-pushed the tsig-downstream-support branch from 6d0c81f to 1b65da9 Compare April 28, 2026 08:56
@ximon18
ximon18 marked this pull request as ready for review April 28, 2026 11:00
@bal-e bal-e changed the title TSIG downstream support, TSIG downstream support Apr 28, 2026

@bal-e bal-e left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from one minor bug.

Comment thread src/units/http_server.rs
Comment thread src/units/zone_server.rs Outdated
Base automatically changed from tsig-upstream-support to main April 30, 2026 10:05
@ximon18
ximon18 merged commit 7e69930 into main Apr 30, 2026
9 checks passed
@ximon18
ximon18 deleted the tsig-downstream-support branch April 30, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants