Skip to main content
Prerequisite: The Resolve Satellite should be installed in your environment.

Configure OpenSearch to allow auth via JWT

To see the official instructions please read https://docs.aws.amazon.com/opensearch-service/latest/developerguide/JSON-Web-tokens.html
OpenSearch 2.11 is the earliest compatible version that can be used for JWT authentication.
Below is an example of how to setup JWT authentication on OpenSearch and create a token
1

Modifying your domain access policy

Before you can configure your domain to use JWT authentication and authorization, you must update your domain access policy to allow JWT users to access the domain
2

Create your permission keys

Use OpenSSL to create the keys
  • privatekey.pem: Used to sign JWTs.
  • publickey.pem: Uploaded to OpenSearch to verify JWTs
3

Configure JWT authentication and authorization

The following steps explain how to configure an existing domain for JWT authentication and authorization in the OpenSearch Service console:
  1. Under Domain configuration, navigate to JWT authentication and authorization for OpenSearch, select Enable JWT authentication and authorization.
  2. Configure the public key to use for your domain. To do this, you can either upload a PEM file, containing a public key, or manually enter it. Use the key that you generated in the previous section.
  3. (Optional) Under Additional settings, you can configure the following optional fields
    • Subject key — you can leave this field empty to use the default sub key for your JWTs.
    • Roles key — you can leave this field empty to use the default roles key for your JWTs.

Create a JWT for ResolveAI

Use a library (e.g., jsonwebtoken in Node.js or pyjwt in Python) to generate a JWT signed with privatekey.pem. Examples are shown below
First install the following dependencies
Then create a script to generate your token. You will use
  1. The privatekey.pem that was generated in the step above
  2. The Subject key and Roles key that were generated in the step above
Finally run the script

Configure the integration in Resolve Satellite

Below is an example of how to setup the Opensearch integration in the satellite with the url property as well as using the k8s secret (potentially backed by an AWS secret manager or another mechanism) for authentication.
1

Create a Kubernetes secret

Create a Kubernetes secret of the following form. Note that the structure of the secret is important and for a Opensearch API Key, it must have the top-level key token: ‘token-value’.
opensearch-resolve-access-token.yml
Security Best Practice: Never store credentials in plaintext in configuration files or source control. Always use Kubernetes secrets and encrypt etcd or use enterprise secret management systems. See Secret Management for detailed guidance.
To apply the secret run
apply secret
2

Configure your OpenSearch JWT token in the Resolve Satellite

Update your helm values override file with the following information (e.g.: resolve-values.yaml)
resolve-values.yaml
Install the satellite and apply the values from the yaml file that you have just updated. e.g.: resolve-values.yaml. To find the latest version, visit ResolveAI’s docker hub repository for the helm chart and satellite image.
apply config to satellite and redeploy
Once your satellite is deployed, we will automatically create an integration instance for you.
3

Verify your integration status in ResolveAI

Login to https://app0.resolve.ai/. Go to the integrations page and and select “Opensearch”You should see an automatically created integration based on the provided configuration.