Skip to content

Support proxy_auth_domain on gRPC auxiliary transport - #6469

Open
abhinavp105 wants to merge 1 commit into
opensearch-project:mainfrom
abhinavp105:feature/grpc-proxy-auth-domain
Open

Support proxy_auth_domain on gRPC auxiliary transport#6469
abhinavp105 wants to merge 1 commit into
opensearch-project:mainfrom
abhinavp105:feature/grpc-proxy-auth-domain

Conversation

@abhinavp105

Copy link
Copy Markdown

Closes #6439

BackendRegistry.GRPC_SUPPORTED_AUTH gated the gRPC auth path on {jwt, basic}, silently dropping any configured proxy_auth_domain. This adds "proxy" to that set so HTTPProxyAuthenticator is included in the gRPC auth chain — enabling Envoy ext_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 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 (testGrpcAuthenticateWithValidProxyAuthAndConfiguredDomain) and a regression guard (testGrpcProxyAuthDomainIsNotSkipped) that fails if "proxy" is dropped from GRPC_SUPPORTED_AUTH.
  • ProxyAuthGrpcTest (new) — full integration test on SINGLENODE + SecureNetty4GrpcServerTransport + TLS, exercising SecurityGrpcFilterBackendRegistryHTTPProxyAuthenticatorroles_mapping with a real DocumentService.Bulk call. Positive case, plus negatives for missing x-forwarded-for and missing user header.

Also updates the stale "JWT only" comment inside authenticate().

Check List

  • New functionality includes testing
  • New functionality has been documented in the code (Javadoc / comments where relevant)
  • Commits are signed per the DCO using --signoff

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.

Also updates the stale "JWT only" comment inside authenticate().

Signed-off-by: Abhinav Pandey <avinodkumarpandey@atlassian.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] proxy_auth_domain support on gRPC auxiliary transport

2 participants