-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remote clusters should only send their own CAs. #1108
Conversation
|
||
// create a request to validate a trusted cluster (token and local certificate authorities) | ||
validateRequest := ValidateTrustedClusterRequest{ | ||
Token: trustedCluster.GetToken(), | ||
CAs: localCertAuthorities, | ||
} | ||
|
||
// log the local certificate authorities that we are sending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like a lot of repetition of the same logic, can you factor this into separate function, e.g.
type CertAuthorities []CertAuthority
func (s CertAuthorities) String() string {
... formatting logic
}
so later you can do this:
log.Debugf("[TRUSTED CLUSTER %v", CertAuthority(validateRequest.CAs))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good except verbose formatting logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I would like @klizhentas to take a look as well.
b25bef3
to
2286c65
Compare
@klizhentas Made the changes you suggested, can you take another look? |
Calling `electron-builder install-app-deps` during `yarn build-and-package-term` is unnecessary as `electron-builder build` already does that. The only time where you'd need to run `electron-builder install-app-deps` is when you just cloned the repo and would like to run the dev version of the app without building the prod version.
Purpose
At the moment, when doing a Trusted Cluster exchange, the remote cluster sends all the CAs that it has to the main cluster which then adds these CAs to it's own backend. Then the main CA sends it's CAs to the Trusted Cluster which adds them to it's own backend.
This exchange works correctly the first time it occurs. However if you try and add an existing Trusted Cluster twice, since the Trusted Cluster sends all of the CAs it has, it sends back the CA for the main cluster as well, but it sends it back without signing keys. The main cluster adds it to it's backend which then causes an error similar to the following to occur when trying to add a node (because the CA legitimately no longer has it's signing keys).
To fix this problem, the Trusted Cluster should only send it's own CAs to the main cluster.
Implementation
Related Issues
Fixes #1050