Managed secret providers
Elasticsearch
Connect Elasticsearch to Alter Vault for secure API access
Overview
Section titled “Overview”Use Elasticsearch credentials to make authenticated API calls through Alter Vault without exposing API keys in code.
| Property | Value |
|---|---|
| Provider ID | elasticsearch |
| Category | Search |
| Credential Type | Encoded API Key |
Step 1: Get Credentials
Section titled “Step 1: Get Credentials”Log in to Elastic Cloud
Log in to Elastic Cloud and open the deployment.
Create an API key
In Kibana, go to Stack Management > Security > API keys and click Create API key.
Copy the encoded value
Copy the Encoded value — it is the base64 form used directly after ApiKey in the Authorization header, and is only shown once.
Step 2: Add to Alter Vault
Section titled “Step 2: Add to Alter Vault”Open the Developer Portal
Go to portal.alterauth.com and navigate to the application.
Add Elasticsearch
Go to Managed Secrets > Add Provider > Elasticsearch.
Enter credentials
Paste your Encoded API Key into the credential field.
Save
Click Save. You’ll receive a grant_id to use with the SDK.
Using in Code
Section titled “Using in Code”response = await alter_app.request( HttpMethod.POST, "https://YOUR-DEPLOYMENT.es.us-east-1.aws.elastic.cloud/my-index/_search", grant_id="YOUR_GRANT_ID", json={"query": {"match": {"title": "vector search"}}, "size": 5},)- The credential is injected as
Authorization: ApiKey <encoded>— store the encoded form of the key.