Fix stream transport TLS cert hot-reload by using live SSLContext fro… - #20734
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 0a82204.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit 9592324)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 9592324
Previous suggestionsSuggestions up to commit 0a82204
|
|
❌ Gradle check result for 0a82204: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
…m SecureTransportSettingsProvider Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
0a82204 to
9592324
Compare
|
Persistent review updated to latest commit 9592324 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #20734 +/- ##
============================================
+ Coverage 73.23% 73.27% +0.03%
- Complexity 72016 72051 +35
============================================
Files 5783 5784 +1
Lines 329438 329525 +87
Branches 47534 47545 +11
============================================
+ Hits 241268 241456 +188
+ Misses 68868 68694 -174
- Partials 19302 19375 +73 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3154811
into
opensearch-project:main
| - Add support for fields containing dots in their name as literals ([#19958](https://github.com/opensearch-project/OpenSearch/pull/19958)) | ||
| - Add support for forward translog reading ([#20163](https://github.com/opensearch-project/OpenSearch/pull/20163)) | ||
| - Added public getter method in `SourceFieldMapper` to return excluded field ([#20205](https://github.com/opensearch-project/OpenSearch/pull/20205)) | ||
| - Add integ test for simulating node join left event when data node cluster state publication lag because the cluster applier thread being busy ([#19907](https://github.com/opensearch-project/OpenSearch/pull/19907)). | ||
| - Relax jar hell check when extended plugins share transitive dependencies ([#20103](https://github.com/opensearch-project/OpenSearch/pull/20103)) | ||
| - Added public getter method in `SourceFieldMapper` to return included field ([#20290](https://github.com/opensearch-project/OpenSearch/pull/20290)) | ||
| - Support for HTTP/3 (server side) ([#20017](https://github.com/opensearch-project/OpenSearch/pull/20017)) | ||
| - Add circuit breaker support for gRPC transport to prevent out-of-memory errors ([#20203](https://github.com/opensearch-project/OpenSearch/pull/20203)) | ||
| - Add index-level-encryption support for snapshots and remote-store ([#20095](https://github.com/opensearch-project/OpenSearch/pull/20095)) | ||
| - Adding BackWardCompatibility test for remote publication enabled cluster ([#20221](https://github.com/opensearch-project/OpenSearch/pull/20221)) | ||
| - Support for hll field mapper to support cardinality rollups ([#20129](https://github.com/opensearch-project/OpenSearch/pull/20129)) | ||
| - Add tracing support for StreamingRestChannel ([#20361](https://github.com/opensearch-project/OpenSearch/pull/20361)) | ||
| - Introduce new libs/netty4 module to share common implementation between netty-based plugins and modules (transport-netty4, transport-reactor-netty4) ([#20447](https://github.com/opensearch-project/OpenSearch/pull/20447)) | ||
| - Add validation to make crypto store settings immutable ([#20123](https://github.com/opensearch-project/OpenSearch/pull/20123)) | ||
| - Introduce concurrent translog recovery to accelerate segment replication primary promotion ([#20251](https://github.com/opensearch-project/OpenSearch/pull/20251)) | ||
| - Update to `almalinux:10` ([#20482](https://github.com/opensearch-project/OpenSearch/pull/20482)) | ||
| - Add X-Request-Id to uniquely identify a search request ([#19798](https://github.com/opensearch-project/OpenSearch/pull/19798)) | ||
| - Added TopN selection logic for streaming terms aggregations ([#20481](https://github.com/opensearch-project/OpenSearch/pull/20481)) | ||
| - Added support for Intra Segment Search ([#19704](https://github.com/opensearch-project/OpenSearch/pull/19704)) | ||
| - Introduce AdditionalCodecs and EnginePlugin::getAdditionalCodecs hook to allow additional Codec registration ([#20411](https://github.com/opensearch-project/OpenSearch/pull/20411)) |
There was a problem hiding this comment.
@rishabhmaurya looks like we added to the changelog
…m SecureTransportSettingsProvider (opensearch-project#20734) Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com>
…#20729) * Implement FieldMappingIngestionMessageMapper for pull-based ingestion Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address bot comment Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address comments Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address comments Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Remove affiliation column for emeritus maintainers (#20725) Emeritus maintainers are not active in the project, therefore I don't see a lot of value in tracking their affiliation. Signed-off-by: Andrew Ross <andrross@amazon.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add bitmap64 query support (#20606) --------- Signed-off-by: Divya <DIVYA2@ibm.com> Signed-off-by: Divya <divyaruhil999@gmail.com> Co-authored-by: Divya <DIVYA2@ibm.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * fix stream transport TLS cert hot-reload by using live SSLContext from SecureTransportSettingsProvider (#20734) Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Bump OpenTelemetry to 1.59.0 and OpenTelemetry Semconv to 1.40.0 (#20737) Signed-off-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * [Pull-based Ingestion] Remove experimental tag for pull-based ingestion (#20704) * remove experimental tag for pull-based ingestion Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> * update BroadcastRequest to be marked as public API Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> --------- Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Bump Apache Lucene from 10.3.2 to 10.4.0 (#20735) Signed-off-by: Ankit Jain <jainankitk@apache.org> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Minor Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address bot comment Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Make id mandatory when id field provided Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Introducing indexing & deletion strategy planner interfaces (#20585) Signed-off-by: Shashank Gowri <shnkgo@amazon.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Refactor Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Empty commit Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Remove duplicate changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Empty commit Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> --------- Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> Signed-off-by: Andrew Ross <andrross@amazon.com> Signed-off-by: Divya <DIVYA2@ibm.com> Signed-off-by: Divya <divyaruhil999@gmail.com> Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Signed-off-by: Ankit Jain <jainankitk@apache.org> Signed-off-by: Shashank Gowri <shnkgo@amazon.com> Co-authored-by: Andrew Ross <andrross@amazon.com> Co-authored-by: Divya <117009486+divyaruhil@users.noreply.github.com> Co-authored-by: Divya <DIVYA2@ibm.com> Co-authored-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Co-authored-by: Ankit Jain <jainankitk@apache.org> Co-authored-by: Shashank Gowri <shashankgowri@gmail.com>
…m SecureTransportSettingsProvider (opensearch-project#20734) Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
…opensearch-project#20729) * Implement FieldMappingIngestionMessageMapper for pull-based ingestion Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address bot comment Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address comments Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address comments Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Remove affiliation column for emeritus maintainers (opensearch-project#20725) Emeritus maintainers are not active in the project, therefore I don't see a lot of value in tracking their affiliation. Signed-off-by: Andrew Ross <andrross@amazon.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add bitmap64 query support (opensearch-project#20606) --------- Signed-off-by: Divya <DIVYA2@ibm.com> Signed-off-by: Divya <divyaruhil999@gmail.com> Co-authored-by: Divya <DIVYA2@ibm.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * fix stream transport TLS cert hot-reload by using live SSLContext from SecureTransportSettingsProvider (opensearch-project#20734) Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Bump OpenTelemetry to 1.59.0 and OpenTelemetry Semconv to 1.40.0 (opensearch-project#20737) Signed-off-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * [Pull-based Ingestion] Remove experimental tag for pull-based ingestion (opensearch-project#20704) * remove experimental tag for pull-based ingestion Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> * update BroadcastRequest to be marked as public API Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> --------- Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Bump Apache Lucene from 10.3.2 to 10.4.0 (opensearch-project#20735) Signed-off-by: Ankit Jain <jainankitk@apache.org> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Minor Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address bot comment Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Make id mandatory when id field provided Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Introducing indexing & deletion strategy planner interfaces (opensearch-project#20585) Signed-off-by: Shashank Gowri <shnkgo@amazon.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Refactor Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Empty commit Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Remove duplicate changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Empty commit Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> --------- Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> Signed-off-by: Andrew Ross <andrross@amazon.com> Signed-off-by: Divya <DIVYA2@ibm.com> Signed-off-by: Divya <divyaruhil999@gmail.com> Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Signed-off-by: Ankit Jain <jainankitk@apache.org> Signed-off-by: Shashank Gowri <shnkgo@amazon.com> Co-authored-by: Andrew Ross <andrross@amazon.com> Co-authored-by: Divya <117009486+divyaruhil@users.noreply.github.com> Co-authored-by: Divya <DIVYA2@ibm.com> Co-authored-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Co-authored-by: Ankit Jain <jainankitk@apache.org> Co-authored-by: Shashank Gowri <shashankgowri@gmail.com> Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
…m SecureTransportSettingsProvider (opensearch-project#20734) Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
…opensearch-project#20729) * Implement FieldMappingIngestionMessageMapper for pull-based ingestion Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address bot comment Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address comments Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address comments Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Remove affiliation column for emeritus maintainers (opensearch-project#20725) Emeritus maintainers are not active in the project, therefore I don't see a lot of value in tracking their affiliation. Signed-off-by: Andrew Ross <andrross@amazon.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add bitmap64 query support (opensearch-project#20606) --------- Signed-off-by: Divya <DIVYA2@ibm.com> Signed-off-by: Divya <divyaruhil999@gmail.com> Co-authored-by: Divya <DIVYA2@ibm.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * fix stream transport TLS cert hot-reload by using live SSLContext from SecureTransportSettingsProvider (opensearch-project#20734) Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Bump OpenTelemetry to 1.59.0 and OpenTelemetry Semconv to 1.40.0 (opensearch-project#20737) Signed-off-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * [Pull-based Ingestion] Remove experimental tag for pull-based ingestion (opensearch-project#20704) * remove experimental tag for pull-based ingestion Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> * update BroadcastRequest to be marked as public API Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> --------- Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Bump Apache Lucene from 10.3.2 to 10.4.0 (opensearch-project#20735) Signed-off-by: Ankit Jain <jainankitk@apache.org> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Minor Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Address bot comment Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Make id mandatory when id field provided Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Introducing indexing & deletion strategy planner interfaces (opensearch-project#20585) Signed-off-by: Shashank Gowri <shnkgo@amazon.com> Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Add changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Refactor Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Fix spotless check Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Empty commit Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Remove duplicate changelog Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> * Empty commit Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> --------- Signed-off-by: Rishab Nahata <rishabnahata07@gmail.com> Signed-off-by: Andrew Ross <andrross@amazon.com> Signed-off-by: Divya <DIVYA2@ibm.com> Signed-off-by: Divya <divyaruhil999@gmail.com> Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Signed-off-by: Andriy Redko <drreta@gmail.com> Signed-off-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Signed-off-by: Ankit Jain <jainankitk@apache.org> Signed-off-by: Shashank Gowri <shnkgo@amazon.com> Co-authored-by: Andrew Ross <andrross@amazon.com> Co-authored-by: Divya <117009486+divyaruhil@users.noreply.github.com> Co-authored-by: Divya <DIVYA2@ibm.com> Co-authored-by: Rishabh Maurya <rishabhmaurya05@gmail.com> Co-authored-by: Andriy Redko <drreta@gmail.com> Co-authored-by: Varun Bharadwaj <varunbharadwaj1995@gmail.com> Co-authored-by: Ankit Jain <jainankitk@apache.org> Co-authored-by: Shashank Gowri <shashankgowri@gmail.com>
…m SecureTransportSettingsProvider
Description
Stream transport failed after reloadcerts with "cert file read errors". The original
DefaultSslContextProviderbuiltJdkSslContextusingKeyManagerFactory/TrustManagerFactoryobtained from SslConfiguration, which reads cert files from disk.It can happen that some implementation calls reloadcerts which rebuild the in-memorySSLContextand then delete the cert files. Any new connection after deletion triggers a freshJdkSslContextbuild, which fails because the files no longer exist.Why SecureTransportSettingsProvider needed a new method
transport-netty4avoids this by callingbuildSecureServerTransportEngine() / buildSecureClientTransportEngine()per connection — these return engines from the live in-memorySSLContextwith no file reads. However, Arrow Flight uses gRPC-netty'sServerTlsHandler / ClientTlsHandler, which require aSslContextobject (not a rawSSLEngine). The correct pattern (used bytransport-grpc) is to wrap the livejavax.SSLContextonce in aJdkSslContext—JdkSslContextholds a reference to theSSLContextand callscreateSSLEngine()on it per connection, so re-initializing theSSLContextwith new key material takes effect on the next handshake automatically.transport-grpcgets the liveSSLContextviaSecureAuxTransportSettingsProvider.buildSecureAuxServerTransportContext(), but Arrow Flight is aTransport(notAuxTransport) and receivesSecureTransportSettingsProvider, which had no equivalent method. AddingbuildSecureTransportContext()(default returnsOptional.empty()) exposes the liveSSLContextthrough the same interface Arrow Flight already has.Security plugin change
The security plugin implements
buildSecureTransportContext()to return the liveSSLContextfromSslContextHandler— one line, identical to howbuildSecureAuxServerTransportContext()works. See: opensearch-project/security#5971Hostname verification and ALPN
With the client using
JdkSslContextdirectly,gRPC-nettyClientTlsHandlerbehaviors required additional handling:ALPN:
ClientTlsHandlerreadsgetSSLParameters(), addsendpointIdentificationAlgorithm, then callssetSSLParameters().ALPNmust already be set on the engine before this round-trip, soAlpnPresettingClientSslContextpre-sets it innewEngine().Hostname verification:
ClientTlsHandlerunconditionallysets endpointIdentificationAlgorithm="HTTPS"after newEngine() returns, regardless of theSslContextconfiguration. Whenenforce_hostname_verification=false, this causes handshake failures if the server cert lacks the peer IP as a SAN.AlpnAwareSSLEngineWrapperinterceptssetSSLParameters()and strips the algorithm. It must live in theio.netty.handler.sslpackage to implementApplicationProtocolAccessor(package-private in Netty), which is required forSslHandler.applicationProtocol()to return the negotiated protocol post-handshakeRelated Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.