Skip to content
Last updated

Elasticsearch 8 integration

Elasticsearch is a distributed search and analytics engine. The Elasticsearch 8 integration with Frontegg allows your application to search, index, and manage documents, indices, clusters, nodes, snapshots, and security objects in an 8.x cluster on behalf of your users. The connector works with Elastic Cloud Hosted deployments as well as self-hosted Elasticsearch 8.x clusters.


Prerequisites

  • An Elasticsearch 8.x cluster — either an Elastic Cloud Hosted deployment or a self-managed installation reachable from Frontegg
  • Administrative access to the cluster (Kibana Stack Management → Security) to create credentials
  • The full cluster endpoint URL, including scheme and port (for example, https://my-deployment.es.us-central1.gcp.cloud.es.io:443)

Two supported authentication methods

Elasticsearch 8.x supports both API Key and Basic authentication (a native realm username and password). The Frontegg connector accepts either credential in the API Key field. Follow Option A below for API keys (recommended) or Option B for Basic authentication.

Create an Elasticsearch 8 deployment

Step 1: Open Elastic Cloud or your self-hosted Kibana

Go to cloud.elastic.co and sign in with your Elastic account, or open the Kibana console of your self-hosted cluster. If you do not have an Elastic Cloud account yet, click Sign up and complete the onboarding flow — the trial includes one free hosted deployment.

When the onboarding wizard asks for a deployment type, choose Elastic Cloud Hosted.

Elastic Cloud deployment type selection

Step 2: Select Elasticsearch version 8.x

On the Confirm the settings of your deployment step, expand Edit settings and open the Version dropdown. Pick the latest 8.x version (for example, 8.19.14). Keep the other defaults or adjust the cloud provider and region to match your data-residency requirements, then click Launch.

Version dropdown with 8.x highlighted

Step 3: Wait for the deployment to finish and open Kibana

Provisioning usually takes 2–5 minutes. When it completes you are redirected to the Kibana Getting started page of the new deployment.

Kibana Getting started page with Elasticsearch endpoint

Step 4: Copy the Elasticsearch endpoint URL

You need the full Elasticsearch endpoint URL for the Frontegg connector. You can find it in two places:

  • On the Kibana Getting started page, next to Elasticsearch endpoint.
  • In the Elastic Cloud admin console, on the deployment overview page. Open the Application endpoints, cluster and component IDs panel and click Open Elasticsearch.

Click the copy icon next to the URL. The value looks like https://<cluster-id>.<region>.<provider>.cloud.es.io:443.

Elastic Cloud deployment overview showing the Elasticsearch public endpoint

Use this path for production. API keys can be named, scoped to specific indices and APIs, and rotated without touching user accounts.

Step 1: Open API keys in Kibana

In Kibana, open Stack Management (footer navigation) → SecurityAPI keys. You land on the API keys list for your account. Click Create API key in the top-right corner.

Kibana API keys page with Create API key button highlighted

Step 2: Configure the key

In the Create API key dialog:

  • Name: Frontegg Integration
  • Type: leave as Personal
  • Apply expiration date: leave off for non-expiring keys, or set an expiration if required by your security policy
  • Control security privileges: leave off to inherit your account's privileges, or enable it to restrict the key to specific indices and APIs

Click Create API key.

Which privileges does the connector need?

The connector exposes search, documents, indices, cluster, nodes, templates, ingest, scripts, analysis, security, tasks, snapshot, and SQL APIs. For full functionality grant superuser, or build a custom role that covers read/write access to the indices your agents work with.

Create API key dialog with Name field filled in

Step 3: Copy the encoded key

After clicking Create API key, Kibana displays the generated key once. Switch the output format selector to Encoded and click the copy icon. The encoded key is a single base64 string of the form <id>:<api_key> — this is the value the Frontegg connector expects.

Copy the API key now

Kibana does not let you view the encoded value again after closing the dialog. If you lose it, create a new API key and delete the old one from the API keys list.

Option B: Create a native user for Basic authentication

Use this path if you prefer username and password credentials, already have a native realm user, or cannot use API keys in your environment.

Step 1: Open Users in Kibana

In Kibana, open Stack ManagementSecurityUsers. Click Create user in the top-right corner.

Kibana Users page with Create user button highlighted

Step 2: Fill in the user form

In the Create user form:

  • Username: choose a descriptive name such as frontegg_agent
  • Full name and Email address: optional
  • Password and Confirm password: a strong password with at least 6 characters
  • Roles: select superuser for full access, or a custom role that grants the indices and APIs your agents need

Click Create user.

Create user form with username, password, and superuser role

Step 3: Verify the user and build the Basic auth token

The new user appears in the Users list. Keep the username and password at hand.

Users list showing the newly created frontegg_agent user

Elasticsearch's HTTP Basic authentication expects an Authorization header of the form Basic <base64(username:password)>. To produce the token, base64-encode your username:password string. On macOS or Linux:

echo -n 'frontegg_agent:SecurePass123!' | base64

Prefix the result with Basic (including the trailing space) to get the value you will paste into the Frontegg API Key field, for example:

Basic ZnJvbnRlZ2dfYWdlbnQ6U2VjdXJlUGFzczEyMyE=

Configure the Frontegg portal

Once you have either an encoded API key or a Basic auth token from the steps above, enter it in the integration configuration page of the Frontegg portal:

  1. Open the Frontegg portal and navigate to [ENVIRONMENT] → Integrations → Elasticsearch 8.
  2. Paste the encoded API Key (or the full Basic <token> value) into the API Key field.
  3. Paste your cluster endpoint URL, including scheme and port, into the Elasticsearch endpoint URL field.
  4. Click Save.

Keep your credentials secure

Never share or commit your API key or Basic auth token to version control. Rotate the credential from Kibana if you suspect it has been leaked.

Additional resources