Skip to main content
Connect your OpenSearch instance to NOFire AI to query and analyze application and infrastructure logs for causal root cause analysis and predictive reliability.
NOFire AI supports both AWS OpenSearch Service and self-hosted OpenSearch instances using JWT bearer token authentication for secure, standardized access.

Prerequisites

Before you connect OpenSearch to NOFire AI, make sure that you have:
  • An OpenSearch cluster (AWS OpenSearch Service version 2.11+ or self-hosted)
  • Network access to your OpenSearch endpoint from NOFire AI
  • Admin access to configure authentication
  • For AWS OpenSearch: Fine-grained access control enabled

Step 1: Configure OpenSearch authentication

Choose the authentication method based on your OpenSearch deployment: AWS OpenSearch Service supports JWT authentication for secure, token-based access. This requires OpenSearch version 2.11 or later with fine-grained access control enabled.

1. Generate an RSA key pair

Generate an RSA public/private key pair using OpenSSL:
The publickey.pem file contains your public key, and privatekey.pem contains the private key for signing JWTs.
You can also use ECDSA encryption. AWS OpenSearch Service supports both RSA and ECDSA asymmetric algorithms. Learn more in the AWS OpenSearch JWT documentation.

2. Update domain access policy

Before you enable JWT authentication, update your domain access policy to allow JWT-authenticated requests:

3. Enable JWT authentication

In the AWS Console or using the AWS CLI: Via AWS Console:
  1. Navigate to Amazon OpenSearch Service > Select your domain
  2. Under Domain configuration, find JWT authentication and authorization for OpenSearch
  3. Select Enable JWT authentication and authorization
  4. Upload your publickey.pem file or paste its content
  5. (Optional) Configure Subject key (default: sub) and Roles key (default: roles)
  6. Save the changes
Via AWS CLI:

4. Create a JWT token

Generate a JWT token signed with your private key. The token must include:
  • Subject (sub): A valid OpenSearch user
  • Roles (roles): Array of OpenSearch roles (for example, ["readall"])
You can use tools like jwt.io, libraries (PyJWT, jsonwebtoken), or your identity provider to create the token. Example JWT payload:
Sign this payload with your privatekey.pem, using the RS256 or ES256 algorithm.
Make sure that the user (sub) and the roles exist in your OpenSearch domain with the correct permissions. If needed, create them in the OpenSearch Dashboards Security panel.

5. Note your connection details

You will need:
  • OpenSearch Endpoint: https://search-your-domain.region.es.amazonaws.com
  • JWT Token: The signed token from step 4

Option B: Self-hosted OpenSearch (bearer token authentication)

For self-hosted OpenSearch instances, use JWT bearer token authentication.

1. Configure JWT authentication

Edit your opensearch.yml to enable JWT authentication:

2. Create service account or user

Access OpenSearch Dashboards and create an internal user for the token:
  1. Navigate to OpenSearch Dashboards (typically https://your-opensearch-host:5601)
  2. Go to Security > Internal Users
  3. Click Create internal user
  4. Set username: nofireai-logs-reader
  5. Set as service account with "service": "true" attribute
  6. Assign the correct roles (for example, readall)

3. Generate bearer token

Create a JWT token with the correct claims, or use the token from your identity provider. The token must include:
  • User identity claims: Subject matching the OpenSearch user
  • Role/permission information: Roles array with read permissions
For detailed JWT configuration on self-hosted OpenSearch, see the OpenSearch Authentication Tokens documentation.

4. Note your connection details

You will need:
  • OpenSearch URL: https://opensearch.mycompany.com:9200
  • Bearer Token: Your JWT token

Step 2: Add OpenSearch connection to NOFire AI

Additional resources

Test the connection

  1. Open the Connections dashboard and make sure that the OpenSearch connection status is READY. A connection that stays in an error state did not authenticate.
  2. Ask NOFire a question that needs logs, for example “show me the errors for the checkout service in the last hour”. An answer that quotes your log lines confirms the connection works end to end.

Troubleshooting

The token is expired, or the JWT signing key on the connection does not match the one in the domain security settings.
The mapped role does not cover the indices you query. Open the role mapping in OpenSearch Dashboards and add the index pattern.