-
Notifications
You must be signed in to change notification settings - Fork 5
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
Authentication vs. Authorisation of keynodes #45
Comments
So during our discussion it seems capability model wouldn't really be used. Instead we are using a sort of tinder like algorithm. Both keynodes must trust each other for notifications to be sent to each other. This is important to avoid spam. But at the same time, please review these resources anyway:
So you understand what's available. |
Basic sharing should just be done directly through key exchange. Beyond that, authorization of secrets within the vault really only makes sense with OAuth2. But the clients of that system would not be PK agents, they would be arbitrary external clients supporting HTTPS/GRPC transports to query a PK agent. Between PK agents, I'd like to keep it simple and stay with vaults sharing through key exchange. Only one extra thing might be read/write exchange, we may allow another agent to read a vault, or read/write a vault. That should keep it simple for MVP purposes. |
Some points of discussion... Push Authority
|
I think we also need a |
Just leaving some links here in case we do something where we can push a commit chain and have that match to some vault. |
One issue is that if the target keynode has to know the vault id to create the ACL entry to allow the source keynode to push. How does the target keynode know what vaults are available on the source keynode? The target keynode can scan the source keynode. But atm, they can only see keynodes that the source keynode has made available to be pulled. There may be situations where the source keynode doesn't want to allow vaults to be pulled. Thus it is not showing these vaults to be scannable. Therefore the target keynode won't know what vaults to be allow being pushed to itself. It seems like the source keynode will have to initiate a request. Almost a sort of "push request". Indicating to the target keynode that this is a vault they would like to push to the target. Then the target keynode can create the entry to allow this or not. Unless you couple pushing to pulling. So source keynode indicates that these vaults are allowed to be pulled by the target. Then the target scans the source and allows the source to push a specific vault. But this then prevents the possibility of pushing without allowing the target to pull. In normal git situations, this is not a problem, since the source knows what it wants to push. And the push permission is global. On Github, once you add a pub key in, the source can push anything to anywhere the pub key has access to. Here it's a bit different. Since the permission to push has to be created with a specific vault id, so that the target keynode can control what is allowed to be pushed (and it doesn't even have the vault at the beginning). It seems that when the target keynode becomes aware of the source keynode. They can elect to start communicating. Then it is possible for the source keynode to create a push request. Alternatively, the source keynode is what is configuring the target keynode. So a out-of-band channel is being used to communicate the vault id. Like if source owner talks to target owner, and says I want to push this secret to you. The secret is called "X-vault-id". Swap the people with a configuring system like Matrix OS. And it's like creating a hierarchy of keynodes. I think one of the issues is that the communication between keynodes are staged. There is the process of discovering pubkeys and IP mappings, this can be done through I think one thing we need to find out. Is that if you can push to a git repository, does that necessarily mean you must be able to pull from a git repository? I'm just thinking that way git pushes, is that there is a communication about the state of the pushed repository? If that is true, then we might as well say that if source can push to target, that necessarily means target can pull from source. If we do this, this solves the problem easily and that means, as long as target can edit the ACL to enable pullable vaults, then these are scannable, and then the target keynode can add these entries with push permission. I still think from a users perspective. There are situations where I want to be able to push a secret vault, but not allow the target to pull the secret vault. This allows me to dictate when secrets are shared. It also allows me to share only once, and then later change the secret in the secret vault. Here's a possibility. When editing the ACL, one might enable from the source side, the ability to push to a target keynode. This enables these vaults to be scanned (but instead of being pullable, these are the vaults it is advertising to push). The source keynode still has to make the decision to add its entry. This ensures that there is potential for spam. One can only allow inquiries, but never force the target keynode to make actions. This is interesting because then the ACL entries is more than just the list of things other keynodes can do to the current keynode. But also the list of things we want to be able to do to the other keynode. And advertising that. But the advertising must rely on the target keynode performing a scan operation. Scanning can be one way. So going from simply discovery active/passive stage to communication stage is actually 1 way. If the ACL has no entries related to the scanning keynode, the scanned keynode will not answer the request. It will blackhole it. The cost of sending the request has to be higher than the cost of checking whether to answer the request. This builtin cost will disadvantage spam. Simply adding an entry means that it can answer scan requests. Note that answering scan requests can be put into a queue that is event-driven as well. We need to also prevent priority inversion here between higher priority requests and lower priority requests. So handling these events means putting into a priority queue. https://stackoverflow.com/questions/26114749/assign-priority-to-nodejs-tasks-in-a-event-loop Note that allowing a push is actually multi stage thing:
|
I'm also realizing we are creating a system that uses asymmetric cryptography but also ACLs, but it's "communicating" ACLs. It doesn't seem to fit the capability paradigm at all here. |
Closing on account of migration to gitlab |
We need to separate the authentication and authorisation of the keynodes. Authentication is verifying that and agent is known and trustworthy or in other words that agent A knows agent B and trusts that person B controls keynode B. Authorisation is treated as the separate issue of what to allow the already authorised agent B to do.
One can also think of half opened vs fully opened connections. Here a half opened connection would occur when agent A has 'trusted' agent B but agent B has yet to manually vet agent A. Furthermore, agent B might not even know that agent A has trusted it so it only discovers this when it manually vets (i.e. approves the pub key of) agent A.
We probably don't want authentication to occur through pure peer discovery. What if agent B is malicious, but agent A thinks it's their friend from work? We could solve this issue by giving the agent A user some social proof (e.g. this pubkey that wants to connect with you also owns the twitter/github/facebook handle john-doe). But I think the best thing to do for now is assume that both agents have exchanged pub keys. In this way it's purely a mutual authentication and no sharing can happen unless both agents know the other's pub key already. The handshake is then the way we confirm that the target keynode actually controls the corresponding pubkey (i.e. confirm that they can use the private key to decrypt something)
This doesn't stop agent A from 'pre-sharing' one of it's vaults with agent B. In fact it's probably more efficient from a user-perspective to do it this way. Agent A knows about agent B and shares to B first, then when B verifies A, it doesn't then have to wait for A to approve a vault since its already authorised to pull from that vault.
The text was updated successfully, but these errors were encountered: