HDDS-7379. Use certificate bundles instead of the sole certificate#4231
Merged
fapifta merged 16 commits intoapache:masterfrom Feb 17, 2023
Conversation
Instead of just encoding one certificate as a String when passing through the proto, use the whole list of certificates encoded as a string. Refactor certificate codec for better usage.
fapifta
reviewed
Feb 15, 2023
Contributor
fapifta
left a comment
There was a problem hiding this comment.
Hi @Galsza thank you very much for working on this piece.
thank you also for your patience on the review, it is a fairly big patch, but in general most of the changes are reasonable, and good.
Please find a few inline concerns/suggestions of mine.
...n/java/org/apache/hadoop/hdds/security/x509/certificate/client/DefaultCertificateClient.java
Outdated
Show resolved
Hide resolved
...hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/CertificateClientTest.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/hadoop/hdds/security/x509/certificate/client/DefaultCertificateClient.java
Show resolved
Hide resolved
...src/main/java/org/apache/hadoop/hdds/security/x509/certificate/client/CertificateClient.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/hadoop/hdds/security/x509/certificate/client/DefaultCertificateClient.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/apache/hadoop/hdds/security/x509/certificate/utils/TestCertificateCodec.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/apache/hadoop/hdds/security/x509/certificate/utils/TestCertificateCodec.java
Show resolved
Hide resolved
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/HASecurityUtils.java
Outdated
Show resolved
Hide resolved
...-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/OMCertificateClient.java
Outdated
Show resolved
Hide resolved
...est/java/org/apache/hadoop/hdds/security/x509/certificate/authority/TestDefaultCAServer.java
Outdated
Show resolved
Hide resolved
…ove static imports
…CertificateServer. Fix small issues around testing
Contributor
|
Thank you for the continued work on this one @Galsza. I went through the changes that you added after my comments so far, and it seems to be good. I would like to scan through the changes together with all the commits just to be sure I checked all changes together as well. |
fapifta
approved these changes
Feb 17, 2023
Contributor
fapifta
left a comment
There was a problem hiding this comment.
Thank you once again to work on this one.
+1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Instead of using the sole certificate the whole cert bundle is used now.
In this new version, certificates are stored along with their entire certificate path up to the root CA. When getting these certificates, the whole chain is read back instead. In protocol messages the chain is converted into a String, so in reality
SCMGetCertResponseProto.x509Certificateis now a pem encoded full certification chain.Some minor refactors in CertificateCodec and removing some dead code is also included.
What is the link to the Apache JIRA
HDDS-7379
How was this patch tested?
Some local tests were added as well as a sanity check of running a local cluster with security enabled and inserting a key.