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.
This patch enhances libStorage security:
If discovered in
$LIBSTORAGE_HOME_ETC_TLS
the following files are automatically loaded:libstorage.crt
libstorage.key
cacerts
If
$LIBSTORAGE_HOME_ETC_TLS/known_hosts
exists it is automatically loaded unless the propertylibstorage.tls.knownHosts
is explicitly defined. This is the system'sknown_hosts
file.If
$HOME/.libstorage/known_hosts
exists it is automatically used when TLS security is set to verify peer certificates. This is the user'sknown_hosts
file.The above
known_hosts
files are line-delimited with each line following the format:HOST ALGORITHM FINGERPRINT
When matching a remote host's known host information the peer's host (derived from the certificate's Subject.CommonName) is also taken into account. Thus if a host is marked as trusted but later provides a different certificate during TLS negotiation the connection will fail. This is identical to SSH's known host logic.
The property
libstorage.tls.verifyPeers
is introduced. It's a boolean flag that indicates TLS connections should be verified against a known list of peer certificate fingerprints in the system's and user'sknown_hosts
files.Enabling this property also sets
libstorage.tls.insecure
totrue
. The connection will be encrypted, but the certificate verification is disabled and deferred to the peer verification.The property
libstorage.tls
can now be set to a simple string value ofverifyPeers
to indicate TLS connections should be verified against the system's and user'sknown_hosts
files.