Skip to content

Reference

Elasticsearch

Connect Elasticsearch to Alter Vault for secure API access

Use Elasticsearch credentials to make authenticated API calls through Alter Vault without exposing API keys in code.

PropertyValue
Provider IDelasticsearch
CategorySearch
Credential TypeEncoded API Key

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.

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.

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.

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider path
ml-post-datasendPOST/_ml/anomaly_detectors/{job_id}/_data
async-search-deletedeleteDELETE/_async_search/{id}
bulk-2delete, writePOST/{index}/_bulk
bulk-3delete, writePUT/{index}/_bulk
cancel-reindexdelete, writePOST/_reindex/{task_id}/_cancel
ccr-delete-auto-follow-patterndeleteDELETE/_ccr/auto_follow/{name}
cluster-delete-component-templatedeleteDELETE/_component_template/{name}
connector-deletedeleteDELETE/_connector/{connector_id}
connector-sync-job-deletedeleteDELETE/_connector/_sync_job/{connector_sync_job_id}
dangling-indices-delete-dangling-indexdeleteDELETE/_dangling/{index_uuid}
deletedeleteDELETE/{index}/_doc/{id}
delete-by-querydelete, writePOST/{index}/_delete_by_query
delete-by-query-rethrottledelete, writePOST/_delete_by_query/{task_id}/_rethrottle
delete-scriptdeleteDELETE/_scripts/{id}
enrich-delete-policyadmin, deleteDELETE/_enrich/policy/{name}
eql-deletedeleteDELETE/_eql/search/{id}
esql-async-query-deletedeleteDELETE/_query/async/{id}
esql-delete-viewdeleteDELETE/_query/view/{name}
ilm-delete-lifecycleadmin, deleteDELETE/_ilm/policy/{policy}
indices-deletedeleteDELETE/{index}
indices-delete-aliasdeleteDELETE/{index}/_alias/{name}
enrich-put-policyadmin, writePUT/_enrich/policy/{name}
ilm-put-lifecycleadmin, writePUT/_ilm/policy/{policy}
security-create-service-tokenadmin, writePUT/_security/service/{namespace}/{service}/credential/token/{name}
security-create-service-token-1admin, writePOST/_security/service/{namespace}/{service}/credential/token/{name}
security-create-service-token-2admin, writePOST/_security/service/{namespace}/{service}/credential/token
ccr-followwritePUT/{index}/_ccr/follow
ccr-put-auto-follow-patternwritePUT/_ccr/auto_follow/{name}
cluster-put-component-templatewritePUT/_component_template/{name}
cluster-put-component-template-1writePOST/_component_template/{name}
connector-putwritePUT/_connector/{connector_id}
createwritePUT/{index}/_create/{id}
create-1writePOST/{index}/_create/{id}
esql-put-viewwritePUT/_query/view/{name}
get-reindexreadGET/_reindex/{task_id}
inference-get-2readGET/_inference/{task_type}/{inference_id}
inference-get-3readGET/_inference/{task_type}/_all
ml-get-recordsreadGET/_ml/anomaly_detectors/{job_id}/results/records
security-get-user-profilereadGET/_security/profile/{uid}
security-saml-service-provider-metadatareadGET/_security/saml/metadata/{realm_name}

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.