mirror of
https://github.com/acme-dns/acme-dns.git
synced 2026-04-27 04:45:48 +03:00
[PR #243] [MERGED] Relax subdomain validation from UUID to actual subdomain #355
Labels
No labels
Documentation
Documentation
bug
enhancement
feature request
feature request
help wanted
pull-request
question
security
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/acme-dns#355
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/acme-dns/acme-dns/pull/243
Author: @jvanasco
Created: 9/8/2020
Status: ✅ Merged
Merged: 1/11/2021
Merged by: @joohoi
Base:
master← Head:feature-relaxed_validation📝 Commits (1)
d099acdrelax subdomain validation from UUID to actual subdomain📊 Changes
2 files changed (+9 additions, -6 deletions)
View changed files
📝
validation.go(+6 -5)📝
validation_test.go(+3 -1)📄 Description
I hope you will consider this PR as it will make implementing and maintaining a private acme-dns server easier for certain users. I fully understand the concerns against merging this, and won't be too disappointed if rejected... but I do hope you consider this...
The current check for valid subdomains (
github.com/joohoi/acme-dns@75d4a30c1f/validation.go (L27-L33)) parses the subdomain candidate to ensure it is a UUID. This works perfectly, because acme-dns generates UUIDs for subdomains. UUID created == UUID validated. Simple enough!This PR replaces the UUID parsing with a regular expression to check if the payload is actually a valid subdomain component (initial and trailing characters are alpha-numeric, middle characters are alphanumeric + dash).
The reason for this PR - this change will allow an acme-dns administrator to manually update the database after a call to
/register, and replace the generated uuid subdomain with a custom domain. This ability allows for an ACME user to delegate authorization to predictable subdomains on the acme-dns server - which can then streamline enrollment and make reinstalls or server changes painless. For example, the change to DNS when validatingfoo.example.commight be be:This PR does not support this feature itself, nor am I proposing that acme-dns support this feature; this PR simply enables a server administrator to have a bit more control if they want to. The acme-dns server administrator would still need to manually edit the database and update the
recordsandtxttables with a custom domain. This is all advanced stuff that violates the Public API, but small changes like this PR open up a lot of possibilities.Getting custom subdomains to work with acme-dns is tricky. Because the subdomain is validated when
/updateis invoked, an acme-dns client must use the original subdomain (i.e. therecordstable must remain intact). I've been using a hack to update the subdomains in thetxttable after invoking an/update, but that takes increasingly more work to keep running and won't scale well.I would love a public api tool/script that admins could use to handle some of this stuff too, like #161 and even something to update the subdomain on an account... but I think this is a good first step for a certain type of users.
99 out of 100 acme-dns users will not need this feature -- but those working with automated systems and/or whitelabel platforms do. As we often do not control the DNS ourselves we need the abilities to (1) pre-determine target subdomains, because we are telling out clients where/how to delegate; (2) ensure/force a set of credentials into the database, because our customers must have a seamless experience if we encounter a data loss (accidents, server migrations, etc).
Thank you for your consideration.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.