mirror of
https://github.com/acme-dns/acme-dns.git
synced 2026-04-27 04:45:48 +03:00
[GH-ISSUE #77] What is the purpose of having both username and password? #29
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#29
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?
Originally created by @rmbolger on GitHub (Apr 29, 2018).
Original GitHub issue: https://github.com/acme-dns/acme-dns/issues/77
In the current acme-dns design, each subdomain registration generates a random username and password to authenticate with when updating records. But why have both a username and password when a single password or api token value would do?
In most authentication setups, you have both because the username can be exposed on user facing UI and is considered more or less public info. But in this architecture, the username is kept secret for the duration of its lifetime. So it's really just like you have two passwords that have to be used together. So why not combine them into one value and reduce the complexity a bit?
@joohoi commented on GitHub (Apr 29, 2018):
This is the model I began the project with, and wanted to have a bit leeway in implementing features along the way.
This is a good idea, as the design has stabilized and there really is no reason to have both of them. This however is a backward compatibility breaking change, and I'm being careful not to break things for existing users. There are a few more breaking changes in my wishlist however, and I would see this being implemented and released in conjunction with those.
@rmbolger commented on GitHub (Apr 29, 2018):
The backwards compatibility point is definitely important. Good to know I wasn't missing anything else though.
@Ajedi32 commented on GitHub (May 7, 2018):
A good first step might be to mark the username value as deprecated in the documentation and start ignoring the
X-Api-Userheader, relying only onX-Api-Key. That way existing clients will continue to work, while updated clients can just pretend the username value doesn't exist.@Ajedi32 commented on GitHub (Aug 3, 2018):
Actually, I just looked a bit deeper at the code and it seems this is a bit trickier than I thought. The API keys are all salted and hashed in the database, so it's not feasible for the API to just accept a key without a username and look up the user that way. (You could do it, but it would involve computing a Bcrypt hash for every single user in the database every time you do a lookup.)
In light of this discovery, I'm no longer certain that getting rid of usernames is a good idea. Even aside from the backwards compatibility concerns, hashing the API keys seems like a great way to protect against possible database leaks (cracking the 40-character random passwords ACME-DNS generates is next to impossible), and switching to a key-only authentication system would necessitate getting rid of that.
@Ajedi32 commented on GitHub (Aug 3, 2018):
Although... hashing the API keys doesn't necessarily require a salted hash. In fact, since we're using long, randomly-generated keys salting isn't really necessary, nor is key stretching.
New (somewhat more complicated) transition plan:
After 3 months of running the new server, this would result in basically the same outcome mentioned in my previous comment, where existing clients will continue to work while updated clients can just pretend the username value doesn't exist.
@rmbolger commented on GitHub (Aug 3, 2018):
Sounds good to me.
@Yannik commented on GitHub (Jan 9, 2019):
@Ajedi32 Are you going to open a PR for your proposal? :-)
@Ajedi32 commented on GitHub (Jan 9, 2019):
@Yannik Not for the foreseeable future, unfortunately. If you want, you're welcome to take it on yourself.
@tcely commented on GitHub (Mar 3, 2019):
The alternative I chose was to do the lookup using the
subdomainprovided for/updatein thePOSTdata. We could also choose to keepusernameandpassword, but makesubdomainoptional instead. That just seemed less flexible to me because having multiple subdomain values in the account isn't possible with that approach.This way the required data is
password,subdomain, andtxtwhich can all be provided in thePOSTdata. No special headers are required.