-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Specification
When the root keypair is renewed, we expect the old nodeId and client certificate to still be valid (in constrast to when it is reset).
From #312 (comment):
Changing the node id will impact communications between:
- Agent to Agent - this is mTLS
- CLI to Agent - normal TLS (client does not provide cert)
- GUI to Agent - normal TLS (client does not provide cert)
Under Agent to Agent, this is going through the forward and reverse proxies, and also the GRPCClientAgent. The GRPC client does not use TLS but the TLS is being done between forward and reverse proxies. This means that when we perform a keyManager.renewRootKeyPair, the old NodeId is still valid until the certificate expiration date. This means nodes contacting the changing agent with the old NodeId should still work, but receive an automatic update to the NodeGraph when the node id changes. I believe the logic to check the cert chain is in network/utils.ts verifyServerCertificateChain, but the logic to update the node id in the nodegraph is not verified yet.
Under CLI to Agent and GUI to Agent, they are using direct TLS on the GRPCClient. Existing GRPCClient connections should continue to work and not be interrupted by the TLS change. I believe I had tests for this under tests/grpc/GRPCServer.test.ts as changing the private key and certificate on the fly. However new connections will need to be made with a new target Node ID. This can occur by reading the status each time a new connection is made. However I think a similar TLS verification logic could take place where the old node ID can still be valid.
So we need tests to ensure this is the case. One for tests/grpc/GRPCClient.test.ts to ensure that the GRPCClient node id can still work. Another for tests/network as well.
Then we would extend these tests into tests/nodes for NodeConnection, and also in tests/bin to test CLI situation.
Additional context
- Previous issue for propagating root keypair changes Propagate root keypair changes to domains external to
KeyManager
#312 - CLI and Client & Agent Service test splitting #311 (comment)
- Propagate root keypair changes to domains external to
KeyManager
#312 (comment)
Tasks
- Check logic for updating the certchain and node id
- TLS verification to allow old node ids to still be used
- Tests for GRPCClient, network domain, nodes, and CLI