-
Notifications
You must be signed in to change notification settings - Fork 21
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
Per-Replica Encryption Keys #371
Comments
I think we'd basically need PKI.
|
For context for those reading along, the current design is just a single, shared symmetric key for all replicas of the same task database. This is a substantial improvement over the Taskwarrior-2.x sync model, which stores all data in cleartext -- a server operator can easily read all users' tasks. The use-case I was targeting was a service like I think this issue is addressing the following cases, but please let me know where I've gotten it wrong:
My concern with the proposal in the previous comment is that a malicious server operator could add a new public key. It's not clear how the "existing replica" would be validated. Would that replica sign the new public key with its private key? That would create a tree of keys which would need to be validated back to the root (where that root would presumably be a secret shared by all replicas). Another alternative is to add keys to the sync'd data (so the "task database" contains both a set of tasks and a set of keys). This would need some care to ensure that other replicas could not push versions not encrypted for that new key before downloading and applying the version that adds the new key. This sort of thing -- changing the set of participants -- is really hard to get right in other distributed systems like Raft or Paxos. Overall, I want to consider the complexity of what we implement:
|
It feels like leaning on GPG for tracking keys and handling encryption + decryption might be a good path forward. Especially if Taskwarrior including tooling to a) share public keys via the sync server, and b) easily "rotate" by re-encrypting existing tasks with a new set of recipients. |
Yes, though I would clarify that key rotation is good even in (the more common case) where you don't know a key is compromised. With my proposal, it would be fairly easy to automatically roll keys on a frequent basis. The easiest way would be for a replica to roll it's own key when making a snapshot. However, because the lowest resource devices are probably the most likely to be compromised, it may make more sense for a multi-step process in which a replica adds it's new key to the database and marks it's old key as needing to be deleted next time a higher-resourced replica makes a snapshot.
Yes, I should have specified that the public keys would need to be signed with the private key of the "sponsoring replica".
Yes, that's not wrong. But the validation wouldn't have to go back to the root every time, it would only have to go back as far as the last validated key. A new replica is valid if its key is signed by an already-trusted replica.
I agree completely. I think all this can be implemented under the hood.
It's a valid concern that we might not have the skill set to implement this securely. However, I don't think admonitions against rolling your own crypto are applicable. I've always seen such advice in the context of implementing -- or worse inventing -- your own cryptography algorithms. I've never seen it used as an argument against implementing a cryptosystem using cryptography libraries and primitives constructed by experts. In fact, I'm not even proposing a novel cryptosystem. I didn't look at this page too closely so I could be mistaken, but I believe this is called a hybrid cryptosystem. Regardless, I'm pretty sure this pattern has been around a long time. And to @dathanb's point, we could potentially use gpg or some other tool or library that already implements this pattern. I described the low-level details of the implementation because I was responding to the suggestion that such a system might not be feasible and I wanted to describe the mechanics rather than say "find some library that implements the cryptography..." |
Having filed GothenburgBitFactory/taskwarrior#3185, I remembered that the server backends are pluggable and we can in fact support lots of options, so we don't have to trade off ease-of-use for more sophisticated security models. We could decide, for example, that the cloud-provider-backed implementation just uses a shared key (and shared cloud credentials), while the sync-server model implements a hybrid cryptosystem. That actually provides a nice solution to one of the places Taskwarrior is currently "stuck": the taskchampion-sync-server is at a "proof of concept" level of quality right now, and I don't have the resources or experience to take it beyond that. If we can ship Taskwarrior 3.0 with just a cloud backend for sync, then probably most users can simply migrate to that, and the remaining few may provide more focused feedback on what they need from a sync server. So, let's keep working on this idea. Maybe a mock-up is a good next step? |
That's one possible route, but I was thinking a good next step would be to explore how tooling could help implement this. If there happened to be the perfect tooling out there, a real implementation might be easier than a fake. On the other hand, if there's utterly no tooling support available I might be inclined to close this as impractical. |
Having looked at GothenburgBitFactory/taskwarrior#3185, I wonder how important the "hosted taskwarrior" use case is. Is there still a need for such a service if there are cloud options? Why would users choose such a service over generic cloud storage? If we dropped or de-prioritized this use case for the sync server, that would change the threat model and make the current shared key a more questionable approach. (Yeah, defense in depth is good, but promoting the sync server as "encrypted" while not offering a security model that meets the standard of modern applications might be bordering on security theater.) |
That you have a different use case in mind does not make the existing solution "security theater". Hyperbole is not persuasive. I suspect that a hosted solution will always be easier than setting up a cloud account, so the hosted case remains useful for the less-technical end of the user base. One of the ways I expect a hosted solution would support itself is to offer a web interface for tasks, which would mean that the hosting provider needs the encryption key. I suspect users would very much want to be able to leave that hosting provider when it inevitably goes public and changes its TOS to sell their data. Per-replica keys might be useful there as defense-in-depth (the first layer being, stop sending your task data to the company). At any rate, carry on looking at tooling! |
I'd hate to escalate the tone of this discussion but I'm really at a loss for how to respond to this. I'm questioning whether there's really a use case in which the current encryption scheme provides any real security value. If not, it's textbook security theater. You proceed to give an example in which the server owner has custody of the encryption key. What value does the current encryption scheme provide in this case? |
Lots (hundreds? thousands? I don't actually know) of people used inthe.am and freecinc.com. Both of those services could read everyone's tasks in cleartext (like, with It could be even better, sure. And that's what this issue is about. Please, go on an implement it! |
The threat model of the TC encryption scheme is to defend against services such as those. Those services shut down essentially because they weren't economically viable and, as you suggested, in an effort to add value future services are likely to undermine the TC encryption scheme by requiring the key. It's hard to understand how you think it's "strictly better" if you don't expect the threat model to be applicable. Or is your point that the TC encryption scheme helps server operators appropriately implement encryption at rest? I could accept that. |
Preliminary Tooling ResearchMessaging Layer Security (MLS)
ToolsTerminology Mapping
Pros
Cons
GPG
ToolsImplementation Notes
Pros
Cons
Age
ToolsPros
Cons
|
Spinning off discussion from GothenburgBitFactory/taskchampion-sync-server#3.
@djmitche:
@ryneeverett:
@djmitche:
The text was updated successfully, but these errors were encountered: