-
Notifications
You must be signed in to change notification settings - Fork 295
Improve handling of trusted certificates #6826
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
Open
minglumlu
wants to merge
20
commits into
xapi-project:feature/trusted-certs
Choose a base branch
from
minglumlu:private/mingl/trusted-cert
base: feature/trusted-certs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2f42df4
Add 'purpose' field in Certificate datamodel
minglumlu 139068c
Add 'pinned' in type of Certificate
minglumlu c36ed78
Add new APIs for trusted certificates (no impl.)
minglumlu 6128c1c
Implement APIs in xapi_pool.ml
minglumlu 632c50f
Check if already exists when installing a certificate
minglumlu 09a0eb1
Update host_install
minglumlu 6c7b994
Update host_uninstall
minglumlu 6341455
Make CertificateProvider.store_path support multiple paths
minglumlu 71b8c00
Add new constructors of certificate type for trusted certs
minglumlu 2e8a306
Update copy_certs_to_host to include trusted certs
minglumlu 74a0a45
Use Cert_distrib instead of sync* in Certificates
minglumlu 9509a1f
Update how to update bundles
minglumlu 608926c
Add collect_trusted_certs
minglumlu df5b255
Add pool.exchange_trusted_certificates_on_join
minglumlu 2a3a759
Add collect_crls
minglumlu 2fdfaf4
Add pool.exchange_crls_on_join
minglumlu bc6e11b
Fix certificate error messages
minglumlu 23fbffc
Cleanup trusted on ejected host
minglumlu a6e390e
Bump up last_known_schema_hash
minglumlu 36890b6
[doc] Update how to handle trusted certificates when pool.join
minglumlu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,9 +30,16 @@ let certificate_type = | |
| ; ( "host_internal" | ||
| , "Certificate that identifies a single host to other pool members" | ||
| ) | ||
| ; ("pinned", "Pinned leaf certificate that is trusted by the whole pool") | ||
| ] | ||
| ) | ||
|
|
||
| let certificate_purpose = | ||
| Enum | ||
| ( "certificate_purpose" | ||
| , [("licensing", "Trusted certificates that are for licensing purpose.")] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "that are for" could be simplified to "Trusted certificates for licensing" |
||
| ) | ||
|
|
||
| let t = | ||
| create_obj ~name:_certificate | ||
| ~descr:"An X509 certificate used for TLS connections" ~doccomments:[] | ||
|
|
@@ -75,5 +82,8 @@ let t = | |
| ; field ~qualifier:StaticRO ~lifecycle:[] ~ty:String "fingerprint_sha1" | ||
| ~default_value:(Some (VString "")) | ||
| "The certificate's SHA1 fingerprint / hash" | ||
| ; field ~qualifier:StaticRO ~lifecycle:[] ~ty:(Set certificate_purpose) | ||
| "purpose" ~default_value:(Some (VSet [])) | ||
| "The purposes of the certificate" | ||
| ] | ||
| ~messages:[] () | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I would prefer if we used a name that signifies the purpose of the certificate rather than the method used to trust it. This means using
peer. One way to think about it is that a peer certificate is going to be pinned to a service with a particular purpose.Uh oh!
There was an error while loading. Please reload this page.
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.
The confusion of using
peercomes from the self-signed certificate. It can be either a root CA, or a leaf certificate for certificate pinning. We hope when a user or a client manipulates the certificates, it's clear for them to know the difference.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.
I don't follow the reasoning, I understand that a self-signed certificate can be used in many roles, but the enum makes clear in which role it's being used, as a
cacertificate, or apeercertificate. Maybe I don't see the confusion because a peer certificate for me is the certificate that identifies the other peer in a TLS handshake, and is completely separate from the certificate chain, the latter includes the root or CA certificates.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.
It did lead to confusion with several people involved. If "peer" generally means just the certificate of the remote entity, then it does not clearly imply (in this type field) how to use it in TLS verification, that is verify the chain and hostname or just the "pinned" certificate. If we call it
pinned, then it is unambiguous.