opensearch-project / opensearch-project/opensearch-java

[security_exception] authentication/authorization failure

Open
#1,535 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

I have a container deployed to AWS Kubernetes, when exists method gets called, I get this exception below. Any idea?

Error:

[security_exception] authentication/authorization failure
	at org.opensearch.client.transport.aws.AwsSdk2Transport.parseResponse(AwsSdk2Transport.java:541) ~[opensearch-java-2.22.0.jar!/:?]

Java code:

SdkHttpClient httpClient = ApacheHttpClient.builder().build();

OpenSearchClient client = new OpenSearchClient(
    new AwsSdk2Transport(
        httpClient,
        "search-...us-west-2.es.amazonaws.com", // OpenSearch endpoint, without https://
        "es",
        Region.US_WEST_2, // signing service region
        AwsSdk2TransportOptions.builder().build()
    )
);

String indexName = "test-index";

BooleanResponse booleanResponse = openSearchClient
                    .indices()
                    .exists(ExistsRequest.of(builder -> builder.index(List.of(indexName))));

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at AwsSdk2Transport.java:541 and the indices().exists call shown in the report, then compare the AWS Kubernetes deployment's authentication and authorization setup with the client configuration. Reproduce the security_exception and identify the missing or incorrect configuration needed for the exists request to succeed.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java, kubernetes
Domain
api, authentication, authorization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.