Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyserver: Mechanism for resetting a lost key #614

Open
i4ki opened this issue Jan 22, 2019 · 20 comments
Open

keyserver: Mechanism for resetting a lost key #614

i4ki opened this issue Jan 22, 2019 · 20 comments

Comments

@i4ki
Copy link

i4ki commented Jan 22, 2019

Related to #429

I lost the keys for both my personal and professional email. I experimented Upspin very earlier.
I understand the security concerned but as we use email as username and use it to verify the user identity, why we cannot use it also to reset the keys? Obviously, everything encrypted by the old key will be lost but the point here is recovering the username ownership.

Someone with future access to your email can’t masquerade as you in Upspin

The statement above is strong in terms of security but the implications go against the idea of Upspin being a technology aiming personal users, families or group of friends.

A token sent to user's email address could be used by the keyserver to verify the identity again.

@i4ki i4ki changed the title keyserver: Mechanism for resetting keys keyserver: Mechanism for resetting a lost key Jan 22, 2019
@n2vi
Copy link
Contributor

n2vi commented Feb 13, 2019

I'm strongly convinced that temporary access to email should not be enough to reset the key. People do have their email accounts hacked, and that already leads to too much collateral damage.

What I have agreed to, but haven't implemented yet, is a periodic flag day in which unused upspin accounts, after a public notice period, are allowed to reset their keys using the proof of continued email access. That gives everyone involved a bit more chance to contain the damage.

@n2vi n2vi self-assigned this Feb 13, 2019
@oec
Copy link
Contributor

oec commented Mar 1, 2024

I think we need to define what exactly is meant by unused upspin accounts. Probably the most sensible place to decide is on the keyserver, where we could apply the following criteria:

  1. Hostnames for dir- and storage-servers are probed regularly for existence (DNS, Dial), say, once per month. After n failures, the account is flagged as unused. (Successful checks reset the failure counter to zero)

  2. Each user-entry maintains a last-accessed timestamp, i.e. when was the last time somebody asked for the keys for that name. Entries with timestamps older than, say, m years, are flagged as unused.

One could also consider criteria on dir- and storage-servers, but those are under the control of the users and should be handled by them.

@n2vi
Copy link
Contributor

n2vi commented Mar 1, 2024

For criterion 1, you'll find my own accounts are currently inactive. I'm in the process of moving to a non-cloud-hosted server, but as a low priority project behind getting upspinfs working on more operating systems than today. I do still have all my buckets saved and might revive the cloud server if I wanted to check something out.

A possible disadvantage of criterion 2 is that a prankster could just ask for all the keys once a year and no account would ever become inactive.

It would be good to add an "inactive account notification" process as well, sending an email to the address on record at least a few weeks before taking any action on it.

For someone in my situation (no active servers but I still possess the secrets corresponding to the registered public key) it should be possible to have a registered-key-signed no-op sent to the keyserver to reset the "inactive" clock. I'm not sure we want to require that of all users, but we should allow power users to keep their accounts alive that way. Include simple instructions for doing so in the "inactive account notification" email.

Allow power users to designate themselves as such and opt out of the "inactive / recovery" process altogether, at the risk of course that they are forever frozen out of their accounts if they lose their secrets.

@oec
Copy link
Contributor

oec commented Mar 2, 2024

I think the situation you describe sounds like a perfect use case for criterion 1 for the average user: There are unreachable hostnames in the keyserver, belonging to an user. After N failed attempts (for configurable N and frequency), the keyserver sends out an email to the user with a link to a keep-alive URL, pointing at the keyserver, to basically reset the counter of failed attempts.

Assuming that we keep criterion 1, how would a REST-API for keep-alive messages, signed by the private key of a user, interact with the situation described by criterion 1? I.e.: the keyserver receives keep-alive messages, but the corresponding hostnames of dir- and storage-servers are never accessible? Does the keep-alive message overrule the failed attempts counter? (I remember vaguely that you could register an user with email only, without dir- and storage-server. That might be such a case where the keep-alive message should allow to overwrite criterion 1).

I agree that criterion 2 might in practice actually never be triggered.

@n2vi
Copy link
Contributor

n2vi commented Mar 2, 2024 via email

@oec
Copy link
Contributor

oec commented Mar 3, 2024

I do not propose to change the public key to an address or associated hosts in the key server by a link in an email, only to keep the entry marked "alive". Even if somebody had hijacked the email address, it won't be able to change the contents in the entry without the private key.

But, of course, in the email, instead of just providing a simple link, we could ask the user to use the upsin tool to generate the keep-alive message, signed by the corresponding private key and sent to the key-server via REST-API. (Also providing the opportunity to update the host records).

This would combine both use-cases: a) "power users" who send such keep-alive messages regularly and automatically and b) sending users emails when their hosts became unavailable for quite some (configurable) time.

@oec
Copy link
Contributor

oec commented Mar 3, 2024

... to finish to the train of thought and provide a more complete proposal:

  • A new REST-API on the key-server accepts signed (by the private key of an user) keep-alive messages from users to mark their entry as alive and used. In particular, for a valid request, any failure counters for the corresponding user are set to zero, see below.

  • The keyserver probes hostnames for dir- and storage-servers of active user accounts regularly for existence (DNS, Dial), with frequency f. After N failures (that is: after period N/f), the account is flagged as unused. (Successful probes reset the failure counter to zero, as do properly signed keep-alive messages via the new REST-API on the keyserver, see above).

  • The key-server sends emails to all users with unused accounts, asking them to use the upspin tool (newest version) to generate a keep-alive message, signed by their private key and sent to the key-server via REST-API. (Also providing the opportunity to update the host records).

  • If the user sends a signed keep-alive message, the account is marked as active again, potentially with updated host entries.

  • If no steps are taken by the user within a grace period P and the email hasn't been sent out more then M times, the key-server sends the email again.

  • After a period of M*P without receiving a signed keep-alive message from the user, the corresponding entries in the key-server are put into quarantine for a period Q and the keys are not served anymore by the key-server. However, within that period Q, the account can not be registered as new.

  • Yet, within period Q, a user can still re-active their own quarantined entry via a keep-alive message generated by the upspin tool and signed by their private key.

  • Otherwise, after period Q, the name and its corresponding entries are deleted from the keyserver completely. The name can be registered again, with new key material (by whoever owns that email address at that moment).

WDYT?

@n2vi
Copy link
Contributor

n2vi commented Mar 3, 2024 via email

@oec
Copy link
Contributor

oec commented Mar 3, 2024

I share your concern. And as I said in a different thread: Why should anybody trust the contents of the keyserver?

If I understand your suggestion correctly, upspin should maintain a file (keylist) with (name, pubkey)-pairs in a user's (upspin-)root directory and notify the user on changes of those keys, f. e. during file creation. I like that idea and suggest to add pinning: When a public key of a user is prior knowledge (f.e. retrieved via a trusted channel), even before the initial lookup of a user's key and hosts on the keyserver is executed, one could pin the public key in that keylist.

Changing a public key in that keylist will require the same choreography as with changed entries in Access files, though.

@n2vi
Copy link
Contributor

n2vi commented Mar 4, 2024 via email

@n2vi
Copy link
Contributor

n2vi commented Mar 22, 2024 via email

@oec
Copy link
Contributor

oec commented Mar 22, 2024 via email

@n2vi
Copy link
Contributor

n2vi commented Mar 22, 2024 via email

@oec
Copy link
Contributor

oec commented Mar 27, 2024 via email

@n2vi
Copy link
Contributor

n2vi commented Mar 27, 2024

I'm not strongly committed to any particular pubkey format. If whoever implements this change wants single-line, ok by me. I hope they'll change keygen to match, so we only have one format.

Also, in addition to normal unit tests let's test the new code with some ordinary, non-expert users to confirm they can add, change, email/Signal, and delete keys.

@n2vi
Copy link
Contributor

n2vi commented Mar 30, 2024

Among the peers that I need to notify when I change my key is every upspinserver that I use. It would be unworkable if that meant manual action by a human administrator so we will have to provide a signed key update command in the server.

Sending the update command needs access to old and new keys, potentially with robust queuing at the client for servers that are temporarily down, not to mention somehow maintaining a complete list of all servers I use.

Your DNS SRV keyserver record idea is sounding appealing in comparison!

@n2vi
Copy link
Contributor

n2vi commented Apr 1, 2024

If by convention my upspinserver publishes its upspin/known file, and if the server is at upspin.{mydomain} then could we remove the need for keyservers entirely?

But that only works for email addresses on custom domains like eric@n2vi.com not like grosse@gmail.com. A look at key.upspin.io/log shows a third of upspin names are on gmail.com. I wish I'd thought of this earlier, or that our original plan of leveraging a common certificate transparency site had come to pass.

@n2vi n2vi removed their assignment Apr 1, 2024
@oec
Copy link
Contributor

oec commented Apr 2, 2024 via email

@oec
Copy link
Contributor

oec commented Apr 2, 2024

... to add to the train of thought: GNS could actually serve all the upspin-metadata per individual: A user's zone would provide the SRV- and A-records for the upspin-servers and could also serve the public keys of users itself, if wanted.

[update]

Alas, I just learned that adding GNS-support to upspin as a client in pure go would require implementing the underlying distributed hash table technology that GNS is build on top of. Sounds like similar in complexity as upspin itself, so rather not an option.

@n2vi
Copy link
Contributor

n2vi commented Apr 3, 2024

I defer to Dave Presotto on DNS.

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

No branches or pull requests

3 participants