-
Notifications
You must be signed in to change notification settings - Fork 66
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
Security #6
Comments
@Raynos what are your thoughts? |
@dominictarr security is as follows. Everyone sends their identity with each packet. Everyone encrypts the entire packet using their private key. There is some mechanism to turn identity -> public key. You decrypt the entire packet with the public key. If the decrypted format validates then the packet came from the identity. You now know who send you this packet and have access to public meta data about this individual. This should be all that's needed. The hard part is generating private keys securely in browsers. |
@dominictarr how do we gaurd against man in the middle attacks A sends encrypted data to B. B sends A's packets to C pretending to be A |
As for getting private keys. drag & drop + html5 file api means drop your private SSH key into the app |
I don't mean to encrypt the whole message, just sign it (i.e. add a digest as another field) |
the thing that differs from the usual way is that i'm not suggesting to encrypt the connection, but just the message. It would be possible, however, to omit messages. hmmm, or maybe could use merkle trees instead... |
@dominictarr I like the idea of being able to identify who send an update package. Could you explain in more detail how this would work. I'm not familiar
There is some public mapping between source and public keys somewhere? |
Easy, you'd just replicate the public keys in over another scuttlebutt. Of course, if you use a uuid, there is no chance another node will guess your id before you've declared it. This is a much smaller problem than impersonation of other nodes, though. |
@dominictarr how does signing work? And what about
|
with public private keys, you have a locking, and an unlocking key. the locking key encrypts a message so that only the unlocking key can open it, naturally. now, either key can be made public (just not both, of course!)
I'm suggesting publishing the unlocking key. |
person B now knows that person A wants this update to be applied to the scuttlebutt. |
Exactly. My thoughts on the use of this in practice: Since the users & their permissions are probably gonna be replicated via scuttlebutt also, so, the problem is, how does a new node know for sure who is who? How would you make the real slim shady stand up? I imagine you'll have a root user, Idea: so, you distribute the root public key to all the nodes, so they know who the root is before they are born. hmm... that wouldn't work if you had multiple root nodes operating at once. The attack would be to borrow someone elses ID and associate it with a new key pair, creating confusion about who the ID actually represented. IDEA: instead of a random uuid, use a hash of the public key. this would be impossible to associate with another key pair - because it would be deterministically related to the key pair. So a node could not create a valid message We will need to port more of the |
I've merged the security branch into master. the security object should be a singleton, except during testing. has just three methods:
to do: add documention to readme. |
hmm, one attack that is still possible is a compromised node could abstain from sending some messages. Here is an idea: when making the initial negotiation, each node could send how many significant messages it currently has. { source_id: [timestamp, count] } Then if two nodes counts that don't make sense (like same timestamp, but different counts) |
@dominictarr what it there are N nodes, and N-1 bad actors. Surely the only single good actor in the network is doomed. |
worse! he has no friends! This would still be eventually consistent provided that good nodes are able to communicate directly occasionally. From my understanding, usually if a network is robust with up to N/2 - 1 bad actors, it's considered secure, after all, In all this, probably the biggest risk is the possibility we haven't discussed - that a private key is stolen. The security of the private key relies on the security of the operating system. This is out of the scope of the scuttlebutt protocol. However, it is serious. If a private key is stolen, then it's not just DoS. The node could tell lies. This is very interesting, but is an application level problem, or an application framework level problem. The most basic approach would just be to have some way to banish certain nodes from the system. |
Idea to protect against when a private key is stolen an update author could have (1) a signature for sending updates, and (2) a signature for deauthorizing itself (adding itself to the author blacklist) to be stored in a more secure location. Though, this likely adds more problems than it removes:
|
Yes - I think an interesting way to do this would be to encrypt the revocation to some friends/family that you trust. You could encrypt it so that no single one of your friends can revoke your key, but you can retrive 4/5 of the encrypted revocations then you can reconstruct the revocation. If you pick friends who do not know each other, and know you well, then you could be confidant that they could verify your identity because they know you personally. Another idea, is to make it so that each key must have a single chain of outputs - if you ever discover a fork, because the key has been copied to another computer, then you could assume that key is compromised... In bitcoin, someone can steal your wallet... and spend your money. |
Ah the idea of multiple revocation keys that need to be combined is an interesting idea. |
like a bitcoin blockchain, or like a git commit log, except where merges means a conflict. You still want to use multiple devices with the same identity but I think you could do that another way - by signing another key, to "delegate" to it. 1:1 key:device, but multiple keys per user. |
I'm currently planning on adding a 5th field,
signature
, in order to implement a security model.Ideas: from best to worst.
Public keys will be replicated between the nodes (& each source will sign it's public key)
This will make it easy for every node to validate an update from any other node.
(note that only node's that will be creating updates need to replicate their public key)
An alternative could be to sign it with a secret shared between the client and the server,
but then, all validation must be performed by the server.
However, it will still be enough to prevent nodes from impersonating each other.
Another approach would be to associate each connection with the user,
and apply the permissions as changes came in... this is the most traditional approach,
but completely ruins the ability to have a random network topology, because you can
only validate an update as it's coming in the door...
... but once it's inside there is no way to know "who's crashed the party".
for 'behind the firewall' use, have no security. -- not suitable for end-user applications, of course.
I'm expecting the sort of validation that will be needed will mostly be:
a given source is allowed to update a given key, or keys
or apply certain updates to certain keys..
the protocol may need to be extended to allow for reverts.
This should probably be a part of the model.
Most validation errors will probably be due to bugs. run the validation on the client and the server,
maybe just reinitializing the whole client model will be the simplest way to revert a validation error.
The text was updated successfully, but these errors were encountered: