-
Notifications
You must be signed in to change notification settings - Fork 109
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
Allow for TLS keystore passwords to be given as environment variables #647
Merged
Conversation
This file contains 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
chris-j-h
requested review from
melowe,
namtruong,
nicolae-leonte-go,
prd-fox and
SatpalSandhu61
as code owners
February 28, 2019 13:18
prd-fox
suggested changes
Feb 28, 2019
config/src/main/java/com/quorum/tessera/config/util/EnvironmentVariableProvider.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #647 +/- ##
============================================
+ Coverage 99.45% 99.47% +0.01%
- Complexity 1914 1937 +23
============================================
Files 300 302 +2
Lines 5919 5947 +28
Branches 279 283 +4
============================================
+ Hits 5887 5916 +29
Misses 5 5
+ Partials 27 26 -1
Continue to review full report at Codecov.
|
melowe
reviewed
Mar 1, 2019
config/src/main/java/com/quorum/tessera/config/util/EnvironmentVariables.java
Outdated
Show resolved
Hide resolved
melowe
approved these changes
Mar 1, 2019
melowe
approved these changes
Mar 1, 2019
melowe
previously approved these changes
Mar 1, 2019
prd-fox
approved these changes
Mar 1, 2019
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.
When currently configuring P2P TLS, the passwords for client and server keystore/truststores can only be provided as part of the json configfile. Ideally, credentials should not be stored in files and so this PR allows for the passwords to be provided by setting environment variables.
Precedence
Global TLS environment variables
If set, these are applied to all server configs defined in the configfile. i.e. if a P2P and ADMIN server are both configured with TLS then the values set for the global environment variables will be used for both. The global environment variables are:
TESSERA_SERVER_KEYSTORE_PWD
TESSERA_SERVER_TRUSTSTORE_PWD
TESSERA_CLIENT_KEYSTORE_PWD
TESSERA_CLIENT_TRUSTSTORE_PWD
These values are ignored if the passwords are also provided in the configfile or prefixed environment variables.
Prefixed TLS environment variables
An optional field,
environmentVariablePrefix
, has been added tosslConfig
, e.g.:The passwords for the keystores specified in the
sslConfig
can be set using the prefixed environment variables:PREFIX_TESSERA_SERVER_KEYSTORE_PWD
PREFIX_TESSERA_SERVER_TRUSTSTORE_PWD
PREFIX_TESSERA_CLIENT_KEYSTORE_PWD
PREFIX_TESSERA_CLIENT_TRUSTSTORE_PWD
Using unique
environmentVariablePrefix
values for each TLS server configured allows for the keystore passwords for each server to be set.