-
Notifications
You must be signed in to change notification settings - Fork 4
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
Network Segregation #770
Comments
Alternate idea: Using Multiple Sigchains (sigchain/network)Otherwise, we can maintain multiple certchains on a single node, one for each network that we want to connect to. The certchain would work rather much the same. However, by utilising QUICs TLS verification callbacks, we can select a specific certchain to issue when establishing a connection with a new node. We can do this by
Caveats I've thought of with this could be:
|
an example of a CSR over the wire protocol: https://en.wikipedia.org/wiki/Automatic_Certificate_Management_Environment going to take this into consideration |
The only example i could find of performing a CSR, and signing using the peculiar libraries: https://gist.github.com/fmonniot/e94ed40e3902415ccb9ca5a1d932297e I believe this code completely ignores everything in the CSR other than the public key. But i'm pretty sure in our case, we would want to include all the extensions in the CSR, and then have the CA node simply pass the extensions to the X509Certificate generator. |
Peculiar example of using CSR: |
mayhaps we should instead have the |
The "network" must be a string like "microsoft.enterprise.polykey.com" or "mainnet.polykey.com". It's like a hostname that is claimed by the certificate. Thus in a way one has to "prove" one is allowed to be part of the hostname. The way we can do that is similar to the ACME protocol... one basically checks the DNS records or HTTP request (although I don't think HTTP makes sense for us here). In our case, it's actually the DNS-SD records. I'm not sure but how would DNSSEC factor into this from a trust perspective. At some point the trust anchor is going to be self-recursive. From a philosophy POV, or a mathematical theory perspective. All constructive theory decomposes to a fundamental self-recursive axiom. And so it is with trust as well. |
@tegefaulkes should be subscribed here. |
I think the scope of this is getting a little large. So we may need to split it up into sub-issues and specs.
There may be more to add here. we also need to go over the spec and pin down a final design. |
@tegefaulkes @amydevs spec separation is needed here. Make sure all PKE related specs should be here: https://github.com/MatrixAI/Polykey-Enterprise/issues/11. And only the open-source PK related work goes here. |
Noted, but I think all of the stuff discussed here so far are related for implementation in That said, we need to work out how to Mint a trust anchor token and distribute it to each seed node. That would be a enterprise specific problem. |
PKE is the progenitor of this. We simply inject the hostname of the network into the prime node and it just starts as is. Since we control the DNS as well the only issue is DNS poisoning. We may maintain our own PKE prime node that acts as a parent maintaining a chain. It always ends somewhere as an anchor though. |
Specification
In order to keep nodes from networks connecting to other networks that they are not supposed to, we need to implement some mechanism during the connection establishment process that will reject connections if say, a mainnet node tries to connect to the testnet network.
After talking with @tegefaulkes, we have come up with 2 solutions:
Using JWTs/Tokens with Verification Metadata
In order to show proof of access into a network, nodes should need to show some token to the seednodes, and peer nodes of that network in order to verify they are apart of that network.
These JWT tokens should contain information about:
From the point of view of proving that a node has access to a network we need the following.
a. The subject of the token, Who has access. This is the public key of the node asking for access
b. The issuer of the token, Who gave access. This is the public key central issuer of the network.
c. The network they have access to. This can be the public key of the network issuer. Really just the same as the issuer
d. The signature of the above facts, signed by the issuers private key.
We have decided, much like the ACL logic of our nodes, the authentication procedure should be carried out within the application layer. This parallels with the separation of authorization and TLS verification seen in the web. Separation of concerns is good here as the certchain is an immutable and inflexible structure that is purely meant to represent the flow of identity.
As for a node having access to multiple networks. It should be possible with this. It just means a node provides multiple network tokens when connecting and the connected node can decide to accept the connection based on it's access list. The only problem I can see with this is that one network might want to be strict and only allow nodes that use that one network. It would be possible to enforce this by rejecting nodes that provide multiple network tokens. but there's not way to force a node to provide all network tokens it has.
Bootstrapping
In order to bootstrap into a network, a node will make an RPC call to a seecnode in order to request a token to be signed in order to prove that the node is a part of the network. Connections to other nodes must not be made before the signed token is returned.
There should be separate RPC calls for requesting the token and receiving the token. The reason for this is so that a node can attempt to join a network and get the signed claim much later even if the node restarts or stops. This allows for nodes to be potentially individually accepted into the network by a human operator. If the node is offline when the seednode attempts to send it the fully signed token, the seednode can schedule a task to attempt to resend the token whenever a connection with the node is established again.
Trust Anchors
In order for the bootstrapping to work, there needs to be some anchor where trust is derived from.
To solve this, we present Trust Anchor entities that simply hold a public-private key. A token can be generated from the public private keypair that grants authority for seednodes to distribute tokens that prove that nodes are in the network.
An entity can be a node, a person, or some autonomous system. All that matters is that it is able to give the token to seednodes during bootstrapping so that they have a way to distribute network membership tokens.
Network membership tokens should contain the trust anchor's token embedded within. By comparing the facts between the network membership tokens and the trust anchor tokens, we can determine if a peer node is apart of a network.
Connection Procedure
When a node joins a network, it receives a token with rules and facts that represent its permissions and memberships.
An example what it could look like would be
There needs to be a way to bootstrap seednodes of a network with a same private key to use to sign tokens to allow this.
Additional context
https://github.com/MatrixAI/Polykey-Enterprise/issues/11
Related: #779
Related: #780
Related: #781
Related: #782
Related: #783
Tasks
The text was updated successfully, but these errors were encountered: