Support proxy_auth_domain on gRPC auxiliary transport - #6469
Merged
finnegancarroll merged 2 commits intoSep 17, 2026
Merged
finnegancarroll merged 2 commits into
finnegancarroll merged 2 commits into
Conversation
abhinavp105
requested review from
DarshitChanpura,
Rishav9852Kumar,
RyanL1997,
cwperks,
derek-ho,
finnegancarroll,
nibix,
reta,
shikharj05 and
willyborankin
as code owners
September 4, 2026 15:15
Contributor
PR Reviewer Guide 🔍(Review updated until commit 931657d)Here are some key observations to aid the review process:
|
Contributor
|
Persistent review updated to latest commit 5fb409c |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6469 +/- ##
==========================================
- Coverage 75.92% 75.89% -0.04%
==========================================
Files 461 461
Lines 30968 30968
Branches 4674 4674
==========================================
- Hits 23513 23502 -11
- Misses 5290 5302 +12
+ Partials 2165 2164 -1
🚀 New features to boost your workflow:
|
Collaborator
|
Thanks for adding this support @abhinavp105 ! |
finnegancarroll
requested changes
Sep 16, 2026
BackendRegistry gated the gRPC auth path on GRPC_SUPPORTED_AUTH =
Set.of("jwt", "basic"), which silently dropped any configured
proxy_auth_domain. This adds "proxy" to that set so HTTPProxyAuthenticator
is included in the gRPC auth chain.
No other changes were needed:
- BackendRegistry.authenticate() already calls XFFResolver.resolve()
unconditionally for both REST and gRPC, so RemoteIpDetector sets
OPENDISTRO_SECURITY_XFF_DONE on the thread context when the caller
IP matches the configured internal-proxies allowlist.
- GrpcRequestChannel.getRemoteAddress() returns the client
InetSocketAddress from Grpc.TRANSPORT_ATTR_REMOTE_ADDR.
- GrpcRequestChannel.getHeaders() exposes ASCII headers
case-insensitively so user_header / roles_header lookups work.
Tests
- BackendRegistryGrpcAuthTest: added a success case and a regression
guard that fails if "proxy" is dropped from GRPC_SUPPORTED_AUTH.
- ProxyAuthGrpcTest (new): full integration test on
SINGLENODE + SecureNetty4GrpcServerTransport + TLS, exercising
SecurityGrpcFilter -> BackendRegistry -> HTTPProxyAuthenticator ->
roles_mapping with a real DocumentService.Bulk call. Covers a
positive case plus negative cases for missing x-forwarded-for and
missing user header.
- ProxyAuthGrpcUntrustedProxyTest (new): security-critical negative
suite that pins internalProxies to a non-loopback address. Asserts
that a well-formed x-proxy-user request from an untrusted source IP
(127.0.0.1) is rejected as UNAUTHENTICATED, matching REST behavior
and guarding against caller-forged identity headers.
Also updates the stale "JWT only" comment inside authenticate().
Signed-off-by: Abhinav Pandey <avinodkumarpandey@atlassian.com>
abhinavp105
force-pushed
the
feature/grpc-proxy-auth-domain
branch
from
September 17, 2026 04:26
5fb409c to
87734ef
Compare
Contributor
|
Persistent review updated to latest commit 87734ef |
Contributor
|
Persistent review updated to latest commit 931657d |
finnegancarroll
approved these changes
Sep 17, 2026
finnegancarroll
merged commit Sep 17, 2026
d6e21e3
into
opensearch-project:main
67 of 68 checks passed
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
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.
Closes #6439
BackendRegistry.GRPC_SUPPORTED_AUTHgated the gRPC auth path on{jwt, basic}, silently dropping any configuredproxy_auth_domain. This adds"proxy"to that set soHTTPProxyAuthenticatoris included in the gRPC auth chain — enabling Envoyext_authz-style header-based identity (x-proxy-user/x-proxy-roles) to be trusted on gRPC the same way it is on REST today.No other wiring changes were needed:
BackendRegistry.authenticate()already callsXFFResolver.resolve()unconditionally for both REST and gRPC, soRemoteIpDetectorsetsOPENDISTRO_SECURITY_XFF_DONEon the thread context when the caller IP matches the configured internal-proxies allowlist.GrpcRequestChannel.getRemoteAddress()returns the clientInetSocketAddressfromGrpc.TRANSPORT_ATTR_REMOTE_ADDR.GrpcRequestChannel.getHeaders()exposes ASCII headers case-insensitively souser_header/roles_headerlookups work.Tests
BackendRegistryGrpcAuthTest— added a success case (testGrpcAuthenticateWithValidProxyAuthAndConfiguredDomain) and a regression guard (testGrpcProxyAuthDomainIsNotSkipped) that fails if"proxy"is dropped fromGRPC_SUPPORTED_AUTH.ProxyAuthGrpcTest(new) — full integration test onSINGLENODE+SecureNetty4GrpcServerTransport+ TLS, exercisingSecurityGrpcFilter→BackendRegistry→HTTPProxyAuthenticator→roles_mappingwith a realDocumentService.Bulkcall. Positive case, plus negatives for missingx-forwarded-forand missing user header.Also updates the stale
"JWT only"comment insideauthenticate().Check List