-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Support for encryption of MySQL connections #5122
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b1d8f56
Encrypting MySQL connections
fca1f62
Update docs
e283edf
Make verifyServerCertificate a configurable parameter
66271c9
Change password parameter and doc update
01f0c83
Merge branch 'master' of https://github.com/druid-io/druid into secur…
0a01071
Merge branch 'master' of https://github.com/druid-io/druid into secur…
2ba830a
Make server certificate verification disabled by default
dc187ae
Update tostring
191cbcc
Merge branch 'master' of https://github.com/druid-io/druid into secur…
f218beb
Update docs
408e74d
Add check for trust store passwords
a4faa70
Add warning for null password
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
123 changes: 123 additions & 0 deletions
123
...-metadata-storage/src/main/java/io/druid/metadata/storage/mysql/MySQLConnectorConfig.java
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 |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| /* | ||
| * Licensed to Metamarkets Group Inc. (Metamarkets) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. Metamarkets licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package io.druid.metadata.storage.mysql; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import io.druid.metadata.PasswordProvider; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class MySQLConnectorConfig | ||
| { | ||
| @JsonProperty | ||
| private boolean useSSL = false; | ||
|
|
||
| @JsonProperty | ||
| private String trustCertificateKeyStoreUrl; | ||
|
|
||
| @JsonProperty | ||
| private String trustCertificateKeyStoreType; | ||
|
|
||
| @JsonProperty("trustCertificateKeyStorePassword") | ||
| private PasswordProvider trustCertificateKeyStorePasswordProvider; | ||
|
|
||
| @JsonProperty | ||
| private String clientCertificateKeyStoreUrl; | ||
|
|
||
| @JsonProperty | ||
| private String clientCertificateKeyStoreType; | ||
|
|
||
| @JsonProperty("clientCertificateKeyStorePassword") | ||
| private PasswordProvider clientCertificateKeyStorePasswordProvider; | ||
|
|
||
| @JsonProperty | ||
| private List<String> enabledSSLCipherSuites; | ||
|
|
||
| @JsonProperty | ||
| private List<String> enabledTLSProtocols; | ||
|
|
||
| @JsonProperty | ||
| private boolean verifyServerCertificate = false; | ||
|
|
||
| public boolean isUseSSL() | ||
| { | ||
| return useSSL; | ||
| } | ||
|
|
||
| public String getTrustCertificateKeyStoreUrl() | ||
| { | ||
| return trustCertificateKeyStoreUrl; | ||
| } | ||
|
|
||
| public String getTrustCertificateKeyStoreType() | ||
| { | ||
| return trustCertificateKeyStoreType; | ||
| } | ||
|
|
||
| public String getTrustCertificateKeyStorePassword() | ||
| { | ||
| return trustCertificateKeyStorePasswordProvider == null ? null : trustCertificateKeyStorePasswordProvider.getPassword(); | ||
| } | ||
|
|
||
| public String getClientCertificateKeyStoreUrl() | ||
| { | ||
| return clientCertificateKeyStoreUrl; | ||
| } | ||
|
|
||
| public String getClientCertificateKeyStoreType() | ||
| { | ||
| return clientCertificateKeyStoreType; | ||
| } | ||
|
|
||
| public String getClientCertificateKeyStorePassword() | ||
| { | ||
| return clientCertificateKeyStorePasswordProvider == null ? null : clientCertificateKeyStorePasswordProvider.getPassword(); | ||
| } | ||
|
|
||
| public List<String> getEnabledSSLCipherSuites() | ||
| { | ||
| return enabledSSLCipherSuites; | ||
| } | ||
|
|
||
| public List<String> getEnabledTLSProtocols() | ||
| { | ||
| return enabledTLSProtocols; | ||
| } | ||
|
|
||
| public boolean isVerifyServerCertificate() | ||
| { | ||
| return verifyServerCertificate; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() | ||
| { | ||
| return "MySQLConnectorConfig{" + | ||
| "useSSL='" + useSSL + '\'' + | ||
| ", clientCertificateKeyStoreUrl='" + clientCertificateKeyStoreUrl + '\'' + | ||
| ", clientCertificateKeyStoreType='" + clientCertificateKeyStoreType + '\'' + | ||
| ", verifyServerCertificate='" + verifyServerCertificate + '\'' + | ||
| ", trustCertificateKeyStoreUrl='" + trustCertificateKeyStoreUrl + '\'' + | ||
| ", trustCertificateKeyStoreType='" + trustCertificateKeyStoreType + '\'' + | ||
| ", enabledSSLCipherSuites=" + enabledSSLCipherSuites + | ||
| ", enabledTLSProtocols=" + enabledTLSProtocols + | ||
| '}'; | ||
| } | ||
| } |
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
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.
same as above