Elasticsearch & OpenSearch Permissions

The Elasticsearch and OpenSearch tools (see Tools & Integrations) authenticate with an API key (recommended) or basic username and password. Both tools are read-only: CloudPeek searches and samples documents and reads index metadata; it never indexes, updates or deletes anything.

Create an API key (or role) with only these privileges, scoped to the index patterns you want investigable:

PrivilegeDescriptionUse case
read (index privilege)Search and retrieve documents in the granted indexesRun search and multi-search queries and sample documents during investigations (search, msearch, sample tools)
view_index_metadata (index privilege)Read mappings and settings for the granted indexesRead field mappings so the AI writes queries that match your schema (elasticsearch_list_mappings_for_index)
monitor (cluster privilege, optional for Elasticsearch)Read cluster monitoring informationRequired for elasticsearch_list_indexes, opensearch_list_indexes, and the OpenSearch connection probe
monitor (index privilege, Elasticsearch listing only)Read document counts and storage statistics for the granted indexesRequired by the CAT indices API used by elasticsearch_list_indexes

Elasticsearch validates a secured connection with GET /_security/_authenticate. An API key with read and view_index_metadata can initialise the provider and use search, multi-search, sampling, and mappings without cluster monitoring access. Pass Elastic's encoded API-key value in the api_key credential field; CloudPeek supplies the Authorization: ApiKey header.

For security-disabled Elasticsearch behind an authenticating proxy, an authentication-endpoint failure other than 401/403 retries GET / once using the same credentials. A 401/403 remains a failure, and a failed root retry is reported without exposing the upstream response body.

elasticsearch_list_indexes has the OpenSearch listing options: an index-pattern filter, hidden-index handling, minimum document count (min_doc_count in provider config, default 1), and optional mappings/settings. It defaults to the configured default_index pattern (logs-* if unset), returns at most limit indexes (default 20, maximum 100), and supplies has_more and next_offset. Pass next_offset as offset with the same filters to continue. Results are sorted by name; indexes added or removed between calls can shift offsets.

Listing is optional. A 403 from its CAT indices call does not prevent the index-read tools from working. Reading the Elasticsearch version through GET / also requires cluster monitor; version access is not part of the connection probe for authenticated configurations.

Scoped discovery uses elasticsearch_resolve_indexes and elasticsearch_list_data_streams, which work with view_index_metadata without CAT monitoring privileges. elasticsearch_field_capabilities reports field types and whether fields can be searched or aggregated. elasticsearch_count counts documents with index read access and reports shard failures instead of presenting a partial count as complete.

Search and multi-search preserve aggregation results, hit identifiers, sort values and partial-result status. For deep paging, open a point in time with elasticsearch_open_point_in_time, search with its id and the returned next_search_after, then release the latest id with elasticsearch_close_point_in_time. These operations require index read; they allocate/release a transient search context rather than modifying indexed documents. Keep-alive is limited to 30 seconds, 1 minute, 2 minutes or 5 minutes. See the query tool guide for Elastic's underlying cursor semantics.

See Elastic's authentication API, CAT indices permissions, and cluster information permissions.

Note

Scope the API key to specific index patterns (for example logs-*, security-*) rather than *. The index pattern on the key is the hard boundary: CloudPeek cannot search, sample or read mappings for any index outside it.