Skip to content

Integrations

OpenSearch

Connect OpenSearch to Alter Vault for secure API access

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

PropertyValue
Template IDopensearch
CategorySearch
Credential TypeBase64 Credentials

Create an internal user

Follow the OpenSearch access-control guide to create an internal user with the roles the integration needs (or use an existing one).

Encode the credentials

Base64-encode the credentials: echo -n 'username:password' | base64.

Paste the encoded string

Paste the encoded string into the credential field.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add OpenSearch

Go to Managed Secrets > Add Provider > OpenSearch.

Enter credentials

Paste the Base64 Credentials into the credential field.

Enter the deployment endpoint

Paste the Domain endpoint. Copy it from the OpenSearch Service console (or use a self-managed cluster’s HTTPS host). Alter derives this credential’s allowed hosts from that exact host, so proxied calls can only ever reach the deployment. The allowlist cannot be widened or edited separately; rotate the credential with a new endpoint to retarget it.

Save

Click Save. You’ll receive a grant_id to use with the SDK.

response = await alter_app.request(
HttpMethod.POST,
"https://YOUR-OPENSEARCH-HOST/my-index/_search",
grant_id="YOUR_GRANT_ID",
json={"query": {"match": {"title": "observability"}}, "size": 5},
)
  • OpenSearch uses HTTP Basic authentication — the stored value is injected as Authorization: Basic <encoded>.
  • Amazon OpenSearch Service domains that use IAM authentication should use the AWS (SigV4) template instead.

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

Operation IDFamiliesMethodProvider pathNotes
searchreadPOST/_search—
search_indexreadPOST/{index}/_search—
msearchreadPOST/_msearch—
scrollreadPOST/_search/scroll—
clear_scrolldeleteDELETE/_search/scroll—
countreadPOST/_count—
count_indexreadPOST/{index}/_count—
mgetreadPOST/_mget—
get_docreadGET/{index}/_doc/{id}—
doc_existsreadHEAD/{index}/_doc/{id}—
get_indexreadGET/{index}—
index_existsreadHEAD/{index}—
get_mappingreadGET/{index}/_mapping—
cat_indicesreadGET/_cat/indices—
cluster_healthreadGET/_cluster/health—
cluster_statsreadGET/_cluster/stats—
index_docwritePOST/{index}/_doc—
put_docwritePUT/{index}/_doc/{id}—
update_docwritePOST/{index}/_update/{id}—
update_by_querywritePOST/{index}/_update_by_query—
bulkdelete, writePOST/_bulk—
bulk_indexdelete, writePOST/{index}/_bulk—
create_indexwritePUT/{index}—
put_mappingwritePUT/{index}/_mapping—
update_aliasesdelete, writePOST/_aliases—
delete_docdeleteDELETE/{index}/_doc/{id}—
delete_indexdeleteDELETE/{index}—
delete_by_querydeletePOST/{index}/_delete_by_query—
security.authtoken.0adminPOST/_plugins/_security/api/authtokenrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.authtoken.0_supersededadminPOST/_opendistro/_security/api/authtokenrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.generate_obo_token.0adminPOST/_plugins/_security/api/generateonbehalfoftokenrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.generate_user_token.0adminPOST/_plugins/_security/api/internalusers/{username}/authtokenrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.generate_user_token.0_supersededadminPOST/_opendistro/_security/api/internalusers/{username}/authtokenrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.generate_user_token_legacy.0adminPOST/_plugins/_security/api/user/{username}/authtokenrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.generate_user_token_legacy.0_supersededadminPOST/_opendistro/_security/api/user/{username}/authtokenrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.change_password.0adminPUT/_plugins/_security/api/accountrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)
security.change_password.0_supersededadminPUT/_opendistro/_security/api/accountrefused by default: leaves the caller holding a provider credential (a credential_minting rule can allow it)

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.