-
Notifications
You must be signed in to change notification settings - Fork 918
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
[Multiple Datasources] Add TLS configuration for multiple data sources #6171
[Multiple Datasources] Add TLS configuration for multiple data sources #6171
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6171 +/- ##
=======================================
Coverage 67.35% 67.36%
=======================================
Files 3351 3352 +1
Lines 65037 65080 +43
Branches 10475 10485 +10
=======================================
+ Hits 43805 43839 +34
- Misses 18685 18688 +3
- Partials 2547 2553 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
We might add the new config into default opensearch_dashboards.yml and comment out with recommended default value |
…rds.yml Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
@seraphjiang Added commented out examples with reasonable defaults to opensearch_dashboards.yml I also added unit tests. This is ready for review now. |
@seraphjiang In what circumstances is the legacy_client used? I'm looking through the data-source plugin now and it looks like this PR may also need to be extended to the legacy client. Is the legacy client used to connect to ES clusters? |
Signed-off-by: Craig Perkins <[email protected]>
I see an open issue around version decoupling. I added the legacy client changes into this PR as well. @BionIT @ZilongX Could you take a look at this PR when you have a chance? |
also triggered rerunning of failed checks, there were some reverted changes in the FT repo yesterday and now all CI should pass |
…OpenSearch-Dashboards into multiple-datasource-tls
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6171-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a9b400e42cf9949e7e647c0da5c37bbcd6d0f6d7
# Push it to GitHub
git push --set-upstream origin backport/backport-6171-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
I will open a manual backport |
opensearch-project#6171) * Add TLS configuration for multiple data sources Signed-off-by: Craig Perkins <[email protected]> * Add to CHANGELOG and add examples commented out in opensearch_dashboards.yml Signed-off-by: Craig Perkins <[email protected]> * Add tests and replace instance of any Signed-off-by: Craig Perkins <[email protected]> * Add tls config to legacy client Signed-off-by: Craig Perkins <[email protected]> * Add test for certificate mode Signed-off-by: Craig Perkins <[email protected]> * Respond to PR feedback Signed-off-by: Craig Perkins <[email protected]> * Extract readCertificateAuthorities to util file and add more tests Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a9b400e)
#6171) (#6244) * Add TLS configuration for multiple data sources Signed-off-by: Craig Perkins <[email protected]> * Add to CHANGELOG and add examples commented out in opensearch_dashboards.yml Signed-off-by: Craig Perkins <[email protected]> * Add tests and replace instance of any Signed-off-by: Craig Perkins <[email protected]> * Add tls config to legacy client Signed-off-by: Craig Perkins <[email protected]> * Add test for certificate mode Signed-off-by: Craig Perkins <[email protected]> * Respond to PR feedback Signed-off-by: Craig Perkins <[email protected]> * Extract readCertificateAuthorities to util file and add more tests Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit a9b400e)
Description
This PR adds 2 settings to multiple datasources:
Example multi-datasource config:
These settings are common across all configured datasources so setting
verificationMode
tonone
will disable ssl verification for all datasources. Similarly, the list of all certificateAuthorities will be used to verify across all configured datasources.These configuration values are separate then their equivalents when OSD is configured with one OpenSearch cluster where these are used to configure the legacy client to connect with the default OpenSearch cluster:
Issues Resolved
Testing the changes
I have been testing by running 2 clusters locally, both configured with the demo certificates. One cluster is the default OpenSearch and the other cluster I add as another data source.
Tested following scenarios:
Both clusters have the security plugin installed and https enabled
verificationMode
is set tonone
verificationMode
is set tocertificate
andcertificateAuthorities
are set with correct CAsverificationMode
is set tofull
andcertificateAuthorities
are set with correct CAsverificationMode
is set tocertificate
andcertificateAuthorities
are set with incorrect CAsverificationMode
is set tofull
andcertificateAuthorities
are set with incorrect CAsDisable HTTPS on cluster 2
I am setting this PR to draft while tests are added in the security plugin to verify all of these scenarios.
Check List
yarn test:jest
yarn test:jest_integration