Skip to content

Conversation

@ximon18
Copy link
Member

@ximon18 ximon18 commented Oct 17, 2024

Currently depends on domain branch initial-nsec3-generation, which has had multiple branches/PRs merged into it (see NLnetLabs/domain#416)

Supports:

  • The basic command line arguments zonefile key [key [key]] and the NSEC3 arguments -n, -a, -t, -s and -p.
  • Additional command line arguments -o, -i, d, -e, -f,-u, -A, -U and -v.
  • -z and -Z for ZONEMD

Partially supports:

  • Command line argument -b (support for Bubble Babble DS comment output is not planned at present).

Lacks but should have support for:

Lacks and do not plan to add support for:

  • OpenSSL engine related arguments.
  • Bubble Babble DS comment output.

Other:

  • Partial signing and re-signing: LDNS has strange behaviour here, so dnst removes DNSSEC records on loading already signed zonefiles.
  • Verify that it is expected that the -U option causes a warning from dnssec-verify (it also does so for the original ldns-signzone when using -U so I think this is fine). We should think do we want to support the -U option for dnst signzone?
  • Rendering zonefile entries may not exactly match the output of ldns-signzone as the behaviour is determined by the domain crate. (see ldns_rr2buffer_str_fmt() in LDNS). Known differences are:
    • Some RDATA values are cased differently, but all known examples relate to RFCs that say that the text in question is "case-insensitive", so this is a difference but not an error.

Additional related DRAFT PRs:

This PR adds automated tests but has also been tested manually against the original ldns-signzone and dnssec-signzone.

@ximon18 ximon18 requested a review from a team October 17, 2024 13:32
@ximon18 ximon18 marked this pull request as ready for review October 17, 2024 13:32
@ximon18 ximon18 changed the title Add ldns-sign-zone like support. Add ldns-signzone like support. Oct 17, 2024
@ximon18 ximon18 mentioned this pull request Oct 17, 2024
12 tasks
@ximon18 ximon18 marked this pull request as draft October 28, 2024 12:55
Copy link
Contributor

@bal-e bal-e left a comment

Choose a reason for hiding this comment

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

Good work, @ximon18! We'll have to see whether the argument parsing needs to be changed to separate ldns / dnst, but the code generally looks good.

@ximon18 ximon18 changed the title Add ldns-signzone like support. Add signzone command. Nov 13, 2024
@ximon18 ximon18 self-assigned this Nov 13, 2024
@mozzieongit
Copy link
Member

dnst-signzone currently allows not specifying a key to sign with. In that case it just copies the original zone over into the .signed file (with no signatures ofc).

@bal-e bal-e mentioned this pull request Nov 15, 2024
@ximon18
Copy link
Member Author

ximon18 commented Nov 20, 2024

dnst-signzone currently allows not specifying a key to sign with. In that case it just copies the original zone over into the .signed file (with no signatures ofc).

That's a bug.

Update: Fixed in 907a634.

@ximon18 ximon18 mentioned this pull request May 16, 2025
60 tasks
ximon18 and others added 22 commits May 19, 2025 13:33
- Don't permit signing keys to be passed as arguments when using `-H`.
- Don't attempt to process signing keys when using `-H`.
* Remove -M option.

* Fallout of merging.
- Add a test of '-u' that sets the SOA SERIAL to the Epoch time now if ahead of the SOA SERIAL, or increments the SOA SERIAL otherwise.
- Change the code that determines the serial now to do so with its own mockable source of time from the environment, instead of using Serial::now() which hard-codes use of the real system clock.
- Extend the concept of Env to support seconds since the epoch which can be overridden when using FakeEnv.

---------

Co-authored-by: Philip-NLnetLabs <[email protected]>
* Add missing arguments and re-order arguments to match -h output, plus some argument re-ordering to better group related arguments together in -h output.

* Remove orphaned comment.

* Note that we don't attempt to detect a zone file origin if not defined, unlike ldns-signzone which will use the owner of the first SOA RR as the origin. To support this would require a change in the `domain` zonefile parser which we are not convinced would be right, but may revisit this if there appears to be actual users out there depending on and wanting this detection logic.
- Be consistent with trailing periods (not shown in -h but the inconsistencies are visible via --help).
- Document in --help output arguments that have dependencies on other arguments.
- Encode some inter-argument dependencies via Clap rules.
- Also makes LDNS mode error message the same as the real ldns-signzone.
- Require `-o` for `dnst signzone`, but for `ldns-signzone` allow it to be missing and then use the owner name first SOA found as the apex. This avoids unreliable apex detection in `dnst`, while keeping maximum backward compatibility with `ldns`.
- Removed the no longer necessary separation of `execute()` into an extra `go_further()` fn, which was previously needed as a workaround for using the right generic values.
- Did some cleanup in affected/related code, e.g. bump the SOA SERIAL and use only that bumped SOA RR rather than use two different SOA RRs, refer to `new_default_rr_ttl` instead of `soa_rr.ttl()` to make it clear that it's not per se the SOA RR TTL we are interested in, this is just the default we choose to use, and make more use of the `apex` variable.
- Improved an error message.
- Added some tests for the case of early glue showing that the wrong apex is no longer searched for a SOA by the signer.
@ximon18
Copy link
Member Author

ximon18 commented Jun 2, 2025

We agreed to ignore the Windows CI failures for the moment for this PR and so are ready to merge this as is.

@ximon18 ximon18 merged commit 7ec5de2 into main Jun 2, 2025
11 of 29 checks passed
@ximon18 ximon18 deleted the add-ldns-like-sign-zone-support branch June 2, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants