feat(dns): add DNS auto-provisioning via RFC 2136 dynamic updates#24
Draft
fobispo-tc wants to merge 2 commits into
Draft
feat(dns): add DNS auto-provisioning via RFC 2136 dynamic updates#24fobispo-tc wants to merge 2 commits into
fobispo-tc wants to merge 2 commits into
Conversation
94a3cf2 to
12d27cd
Compare
Add a port.DNSProvisioner interface and a DDNS adapter that auto-creates and deletes DNS records using RFC 2136 dynamic updates with TSIG authentication. When a DNS provisioner is configured: - Registration issues certs and provisions DNS in one call, going straight to ACTIVE (no ACME challenge, no verify-dns) - Revoke auto-deletes DNS records (best-effort) - registration.domain-suffix auto-qualifies short hostnames (e.g. "my-agent" → "my-agent.agents.example.com") When no provisioner is configured, the original ACME-based flow is unchanged. Includes the _ans-badge URL fix: badge records point to the TL badge endpoint when tl-client.public-base-url is configured. Signed-off-by: Fernando Obispo <[email protected]> Signed-off-by: Francisco Obispo <[email protected]>
12d27cd to
7b0872c
Compare
- Use url.JoinPath for badge URL construction instead of string concatenation (safer path joining and escaping) - Rename WithTLPublicBaseURL parameter from 'url' to 'publicBaseURL' to avoid shadowing net/url - Don't default PublicBaseURL to BaseURL — only use it when explicitly configured, preventing internal hostnames from leaking into public DNS records Signed-off-by: Fernando Obispo <[email protected]> Signed-off-by: Francisco Obispo <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
port.DNSProvisionerinterface for automatic DNS record creation/deletionVerifyDNS(auto-create before verify) andRevoke(best-effort cleanup)dns.provisionerconfig section — independent of thedns.typeverifier setting_ans-badgeURL fix from PR fix(domain): point _ans-badge DNS record URL at transparency log #23 (badge records now point to TL, not agent endpoint)Motivation
In org-level deployments where the RA controls the DNS zone, requiring operators to manually add
_ans,_ans-badge, and_443._tcpTLSA records between VerifyACME and VerifyDNS is unnecessary friction. This feature lets the RA provision them automatically via RFC 2136 dynamic DNS updates, collapsing the registration flow from 4 steps to 2.Configuration
When
dns.provisioneris absent or empty, behavior is unchanged (manual DNS).Design Decisions
DNSProvisionerinterface — not combined withDNSVerifier(ISP compliance, matches existing port pattern)dns.type: lookup+dns.provisioner.type: ddns)Files Changed
internal/port/dns.goDNSProvisionerinterfaceinternal/adapter/dns/ddns.gointernal/adapter/dns/ddns_test.gointernal/adapter/dns/noop_provisioner.gointernal/config/config.goPublicBaseURLinternal/domain/dnsrecords.gotlPublicBaseURLparam for badge URL fixinternal/domain/dnsrecords_test.gointernal/ra/service/registration.godnsProvisionerfield + builderinternal/ra/service/lifecycle.gointernal/ra/handler/*.gocmd/ans-ra/main.goconfig/ra-{local,docker}.yamlTest plan
go test ./...)go build ./...)