Skip to content

Add "dns-account-01" support from draft-ietf-acme-scoped-dns-challenges#435

Merged
jsha merged 3 commits intoletsencrypt:mainfrom
fastly:add-dns-account-01
Mar 18, 2024
Merged

Add "dns-account-01" support from draft-ietf-acme-scoped-dns-challenges#435
jsha merged 3 commits intoletsencrypt:mainfrom
fastly:add-dns-account-01

Conversation

@sheurich
Copy link
Contributor

@sheurich sheurich commented Feb 21, 2024

This change implements the dns-account-01 ACME challenge as specified in draft-ietf-acme-scoped-dns-challenges.

The relevant validation label computation is:

"_" || base32(SHA-256(<ACCOUNT_RESOURCE_URL>)[0:10]) || "._acme-" || <SCOPE> || "-challenge"

where SCOPE is one of { host, wildcard }. A SCOPE of { domain } is unimplemented.

This implementation is interoperable with the https://github.com/eggsampler/acme changes in eggsampler/acme#21 and passes the TestWildcardDNSAccount test.

Solves #425.

@sheurich
Copy link
Contributor Author

sheurich commented Feb 21, 2024

@aarongable @jsha this change is ready to begin a review. As some of the fixes are unrelated to the direct problem at hand, and possibly controversial, feel free to excise anything that doesn't fit.

Also note that the method for passing the additional scoping attributes from WFE to VA seems suboptimal and there may be a better fit for how the Pebble code aligns with Boulder. Any feedback in this area would be greatly appreciated.

@aarongable
Copy link
Contributor

Awesome, I'm exciting to do a full review of this! I'm on vacation this week, but will be able to do a full review on Monday (and other folks should be able to review before then). In the mean time, a bunch of CI improvement and fixes have been landed, so let's get this rebased on top of those / get those merged into this branch so it's just the code changes without accompanying infrastructure changes.

@sheurich sheurich force-pushed the add-dns-account-01 branch from 2923c70 to ffadbd9 Compare March 1, 2024 01:13
@sheurich
Copy link
Contributor Author

sheurich commented Mar 3, 2024

@aarongable it's only the relevant code changes here. The integration tests have been moved to #444.

@sheurich sheurich force-pushed the add-dns-account-01 branch from ffadbd9 to 97ea757 Compare March 9, 2024 00:13
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

Just a few small nits remaining at the point!

}

func (va VAImpl) ValidateChallenge(ident acme.Identifier, chal *core.Challenge, acct *core.Account) {
func (va VAImpl) ValidateChallenge(ident acme.Identifier, chal *core.Challenge, acct *core.Account, acctURL string, wildcard bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels slightly awkward to pass both a *core.Account and an acctURL, given that one can be constructed from the other, but also given that the construction method is acctURL := wfe.relativeEndpoint(request, fmt.Sprintf("%s%s", acctPath, newAcct.ID)) and half of those values are inaccessible here in the VA, I think this is fine.


// Submit a validation job to the VA, this will be processed asynchronously
wfe.va.ValidateChallenge(ident, existingChal, existingAcct)
wfe.va.ValidateChallenge(ident, existingChal, existingAcct, acctURL, wildcard)
Copy link

Choose a reason for hiding this comment

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

Copy link

@aaomidi aaomidi left a comment

Choose a reason for hiding this comment

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

I think using the KID from the JWT is probably the way to go here.

letsencrypt/boulder#7387 (comment)

@jsha
Copy link
Contributor

jsha commented Mar 18, 2024

Good points @aaomidi. Other than that the code looks good to me, and we have an earlier approval from @aarongable. I'm going to land this, and we can explore plumbing the KID from the JWT as a separate PR.

@jsha jsha merged commit b37975e into letsencrypt:main Mar 18, 2024
@sheurich sheurich deleted the add-dns-account-01 branch March 18, 2024 19:58
aszlig added a commit to aszlig/stalwart-mail that referenced this pull request May 19, 2025
When testing my Stalwart deployment with Pebble[1], I got the following
ACME error:

  ACME error (acme.error) {
    reason = "unknown variant `dns-account-01`, expected one of `http-01`, `dns-01`, `tls-alpn-01` at line 15 column 33",
    details = JSON deserialization failed
  }

In RFC 8555 section 8[2], the validation challenges are meant to be
extensible:

> The identifier validation challenges described in this section all
> relate to validation of domain names. If ACME is extended in the
> future to support other types of identifiers, there will need to be
> new challenge types, and they will need to specify which types of
> identifier they apply to.

The mentioned error refers to the following draft:

https://datatracker.ietf.org/doc/html/draft-ietf-acme-dns-account-label-01

Pebble already implemented[3] this and while it's IMHO too early to
already support this in Stalwart, we should at least make sure that we
don't break existing deployments in case ACME CAs one day add more
challange types like the above.

[1]: https://github.com/letsencrypt/pebble
[2]: https://datatracker.ietf.org/doc/html/rfc8555#section-8
[3]: letsencrypt/pebble#435

Signed-off-by: aszlig <aszlig@nix.build>
mdecimus pushed a commit to stalwartlabs/stalwart that referenced this pull request May 25, 2025
When testing my Stalwart deployment with Pebble[1], I got the following
ACME error:

  ACME error (acme.error) {
    reason = "unknown variant `dns-account-01`, expected one of `http-01`, `dns-01`, `tls-alpn-01` at line 15 column 33",
    details = JSON deserialization failed
  }

In RFC 8555 section 8[2], the validation challenges are meant to be
extensible:

> The identifier validation challenges described in this section all
> relate to validation of domain names. If ACME is extended in the
> future to support other types of identifiers, there will need to be
> new challenge types, and they will need to specify which types of
> identifier they apply to.

The mentioned error refers to the following draft:

https://datatracker.ietf.org/doc/html/draft-ietf-acme-dns-account-label-01

Pebble already implemented[3] this and while it's IMHO too early to
already support this in Stalwart, we should at least make sure that we
don't break existing deployments in case ACME CAs one day add more
challange types like the above.

[1]: https://github.com/letsencrypt/pebble
[2]: https://datatracker.ietf.org/doc/html/rfc8555#section-8
[3]: letsencrypt/pebble#435

Signed-off-by: aszlig <aszlig@nix.build>
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.

4 participants