Commit graph

386 commits

Author SHA1 Message Date
Albert Zaharovits
747fa59a2c
DOCS Query Roles (#110473)
These are the docs changes in relation to
https://github.com/elastic/elasticsearch/pull/108733
2024-07-05 19:46:48 +10:00
George Wallace
b6e9860919
Update role-mapping-resources.asciidoc (#110441)
made it clear that some characters need to be escaped properly

Co-authored-by: Jan Doberstein <jan.doberstein@elastic.co>
2024-07-03 13:00:52 -06:00
Johannes Fredén
89cd966b24
Add bulk delete roles API (#110383)
* Add bulk delete roles API
2024-07-03 11:04:53 +02:00
Johannes Fredén
55476041d9
Add BulkPutRoles API (#109339)
* Add BulkPutRoles API
2024-07-02 15:45:39 +02:00
Jedr Blaszyk
3b827f6a8c
Create manage_connector privilege (#110128)
* Create manage_seaech_connector privilege

* `manage_search_connector` -> `manage_connector` and exclude connector secrets patterns from this privilege

* Add `monitor_connector` privilege

* Update Kibana system privilege to monitor_connector for telemetry

* Rename privilege to 'manage_connector_state'

Since privilege names are often namespaced and used with globs, we want to ensure that if there's a future privilege like `manage_connector_secrets`, that it is not implicitly included in this new privileg's <name>*. By extending the privilege name to include "_state", we better namespace this distinct from any "_secrets" namespace.

* Revert "Rename privilege to 'manage_connector_state'"

This reverts commit 70b89eee76.
After further discussion with the security team, this name change is not needed after all
since the secret management privileges aren't currently prefixed with "manage_"

---------

Co-authored-by: Sean Story <sean.j.story@gmail.com>
2024-07-01 12:41:28 -05:00
Nikolaj Volgushev
78c812f845
Fix security index settings docs (#110126)
Docs tweak with a typo fix and a clarification on how the two available
settings interact (essentially
https://github.com/elastic/elasticsearch/issues/27871). I'm also open to
including this info in the more generic settings API but feels like a
simple enough callout to add to the security API.
2024-07-01 18:07:15 +10:00
Mayya Sharipova
405e39660b
Support k parameter for knn query (#110233)
Introduce an optional k param for knn query

If k is not set, knn query has the previous behaviour:
- `num_candidates` docs  is collected from each shard. This `num_candidates` docs
are used for combining with results with other queries and aggregations on each shard.
- docs from all shards are merged to produce the top global `size` results

If k is set, the behaviour instead is following:
- `k` docs is collected from each shard. This `k` docs are used for
combining results with other queries and aggregations on each shard.
- similarly, docs from all shards are merged to produce the top global `size`
results.

Having `k` param makes it more intuitive for users to address their needs.
They also don't need to care and can skip `num_candidates` param for this query
as it is of more internal details to tune how knn search operates.

Closes #108473
2024-06-28 09:59:28 -04:00
Jim Ferenczi
a6470fb86d
Fix cluster level dense vector stats (#107962)
The cluster level dense vector stats returns the total number of dense vector indices globally including the replicas.
This commit fixes the total to only include the value count of the primary indices.
This change aligns with the docs stats which also reports the number of primary documents when used in cluster stats.
The indices stats API still reports granular results for replicas and primaries so the information is not lost.
2024-06-18 17:45:02 +01:00
Kathleen DeRusso
8529bf71f6
Add SparseVectorStats (#108793)
* Add SparseVectorStats

* Update to use mappings in engine

* Update to be unique to primary shards

* Fix doc

* Fix null error in test

* Cleanup

* fix yaml

* remove comment

* add version to yaml

* Revert whitespace changes to stats doc

* fix yml test

* Checkstyle

* Fix NPE in test

* Update docs/changelog/108793.yaml

* Add link to sparse_vector field type in docs

* PR feedback

* Flesh out test a bit more

* PR feedback - alphabetize placement in docs

* Fix doc change
2024-06-17 11:42:14 -04:00
Albert Zaharovits
0e4888bdec
Refactor field name translator of query endpoints for security entities (#109559)
This is a refactoring of the internal logic that's used to translate
query-level into index-level field names for query APIs for
security entities (i.e. users, API Keys, and soon, roles).
The objective here is to have and reuse a single class to handle
all the translations for different security query APIs.
2024-06-13 14:12:19 +03:00
Jake Landis
7504fed0b3
remote_cluster role documentation and expose to built in privs API (#108840)
This commit introduces the documentation for remote_clusters which is used to help
 express the monitor_enrich privilege needed to use the ENRICH keyword across clusters 
when using the API key based CCS security model.

This commit also adds "remote_clusters" to the built in privs API to for easier consumption
 in Kibana.
2024-05-28 13:51:21 -05:00
Mary Gouseti
af45653e00
Expose basic x-pack telemetry for failure store (#108899) 2024-05-23 16:45:11 +03:00
Jake Landis
ff92296217
[docs] Prevent DLS/FLS if replication is assigned (#108839)
This commit adds documentation for the DLS/FLS restriction for RCS 2.0 API keys 
where both access and replication are defined and access has DSL/FLS.
This commit also fixes a few misleading variable names.
related: #108600
2024-05-22 12:05:34 -05:00
Nick Tindall
3ecdd77e97
[DOCS] Align docs to implementation for timeout parameters (#108593)
* [DOCS] Fix documentation for timeout-related parameters

Closes #108224
2024-05-16 13:05:39 +10:00
Slobodan Adamović
77ce60530c
[docs] Document new role description field (#108422)
This commit updates Role API docs to include new description field 
(introduced in #107088) and adds descriptions for all built-in roles.
2024-05-14 10:16:55 +02:00
Nick Tindall
68a8664c21
[DOCS] Fix stored_fields parameter description (#98385) (#108445)
(referenced from get and multi_get API docs)

Closes #98385
2024-05-09 03:17:10 -04:00
Martijn van Groningen
e043bce1af
Add more rollup usage stats (#108245)
This change adds `number_of_rollup_jobs` and `number_of_rollup_indices`
to  `rollup` usage. The former indicates the number of active rollup
jobs running and the latter indicated the number of rollup indices
(which could be the result of previous rollup jobs).
2024-05-07 13:02:54 -04:00
Nikolaj Volgushev
31afff92f8
Invalidate cross cluster API key docs (#108297)
This PR documents privilege requirements for cross-cluster API key
invalidation, which were updated in
https://github.com/elastic/elasticsearch/pull/107411.
2024-05-06 10:02:14 -04:00
Liam Thompson
9a62dba53c
[DOCS] Remove remaining beta flags for RCS (#108201) 2024-05-03 09:12:37 +02:00
florent-leborgne
0c500e5264
Remove Beta label for RCS2.0 from 8.14 (#108030) 2024-05-02 15:43:21 +02:00
David Turner
fc287bde8b
Interpret ?timeout=-1 as infinite ack timeout (#107675)
APIs which perform cluster state updates typically accept the
`?master_timeout=` and `?timeout=` parameters to respectively set the
pending task queue timeout and the acking timeout for the cluster state
update. Both of these parameters accept the value `-1`, but
`?master_timeout=-1` means to wait indefinitely whereas `?timeout=-1`
means the same thing as `?timeout=0`, namely that acking times out
immediately on commit.

There are some situations where it makes sense to wait for as long as
possible for nodes to ack a cluster state update. In practice this wait
is bounded by other mechanisms (e.g. the lag detector will remove the
node from the cluster after a couple of minutes of failing to apply
cluster state updates) but these are not really the concern of clients.

Therefore with this commit we change the meaning of `?timeout=-1` to
mean that the acking timeout is infinite.
2024-04-30 09:54:15 -04:00
Liam Thompson
33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00
David Turner
ccbb5badce
Fix support for infinite ?master_timeout (#107050)
Specifying `?master_timeout=-1` on an API which performs a cluster state
update means that the cluster state update task will never time out
while waiting in the pending tasks queue. However this parameter is also
re-used in a few places where a timeout of `-1` means something else,
typically to timeout immediately. This commit fixes those places so that
`?master_timeout=-1` consistently means to wait forever.
2024-04-10 18:32:38 +01:00
Albert Zaharovits
36bcb6b398
Query API Keys support for both aggs and aggregations keywords (#107054)
The Query API Key Information endpoint supports aggs since #104895.
But some lang clients actually use the `aggregations` keyword in requests,
as the preferred synonym to `aggs`.
This PR adds support for the `aggregations` request keyword as a synonym
for the existing `aggs` term.

Closes #106839
2024-04-03 18:33:14 +03:00
Parker Timmins
e59dd0b60e
Add total size in bytes to doc stats (#106840) 2024-03-29 09:40:37 -05:00
Albert Zaharovits
b4938e1645
Query API Key Information API support for the typed_keys request parameter (#106873)
The typed_keys request parameter is the canonical parameter,
that's also used in the regular index _search enpoint, in order to
return the types of aggregations in the response.
This is required by typed language clients of the _security/_query/api_key
endpoint that are using aggregations.

Closes #106817
2024-03-29 09:24:52 +02:00
Mary Gouseti
2122da31cd
[DSL] Introduce data stream global retention - Part 3 (#105682)
In this PR we introduce the API that will expose the global retention configuration and will allow users to take advantage of it.

These APIs are protected by the dedicated introduced privileges:

`manage_data_stream_global_retention` or higher, which allows all operations on the global retention configuration
`monitor_data_stream_retention` or higher, which allows the retrieval of the global retention configuration.

This PR is the final PR that makes the global retention available for our users.
2024-03-28 10:40:33 +02:00
Albert Zaharovits
3e0a0f6291
Get and Query API Key with profile uid (#106531)
Add new optional request option, `with_profile_uid`,
to the Get and Query API Key Information endpoints,
to return the API keys owner users' profile uid.

Closes #98939
2024-03-28 10:26:22 +02:00
David Kyle
2087b65523
[ML] Create inference_user and inference_admin roles (#106371)
Defines new inference_user and inference_admin roles with the 
related cluster privileges manage_inference and monitor_inference.
inference_user can list the models and preform inference, 
inference_admin can do the same plus create and delete models
2024-03-20 11:15:21 +00:00
Bogdan Pintea
1fbb085bd0
ESQL: Rename SHOW FUNCTIONS to META FUNCTIONS (#106362)
This renames the `show functions` command to `meta functions`.
It also removes its documentation and usage tracking.
2024-03-19 13:02:34 +01:00
Stef Nestor
157ce539aa
(DOC+) Version API page for ES API Base URL (#105845)
* (DOC+) Version API page for ES API Base URL

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2024-03-18 13:02:54 -06:00
Tommaso Teofili
7bff3b3bec
Add modelId and modelText to KnnVectorQueryBuilder (#106068)
* Add modelId and modelText to KnnVectorQueryBuilder

Use QueryVectorBuilder within KnnVectorQueryBuilder to make it
possible to perform knn queries also when a query vector is not
immediately available. Supplying a text_embedding query_vector_builder
with model_text and model_id instead of the query_vector will result
in the generation of a query_vector by calling inference on the
specified model_id with the supplied model_text (during query
rewrite). This is consistent with the way query vectors are built
from model_id / model_text in KnnSearchBuilder (DFS phase).
2024-03-18 16:13:38 +01:00
Panagiotis Bailis
d471ccb5bb
Adding support for hex-encoded byte vectors on knn-search (#105393) 2024-03-13 09:24:51 +02:00
Jack Conradson
68b0acac8f
Add retrievers using the parser-only approach (#105470)
This enhancement adds a new abstraction to the _search API called "retriever." A 
retriever is something that returns top hits. This adds three initial retrievers called
"standard", "knn", and "rrf". The retrievers use a parser-only approach where they
are parsed and then translated into a SearchSourceBuilder to execute the actual
search.
---------

Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
2024-03-12 10:11:55 -07:00
István Zoltán Szabó
2d4a49af53
[DOCS] Fixes get settings and update settings security API docs (#105686)
* [DOCS] Fixes get settings and update settings security API docs.

* [DOCS] Further edits.
2024-02-21 15:06:32 +01:00
Albert Zaharovits
065158e222
Expose owner realm_type in the returned API key information (#105629)
When querying or getting API key information, ES returns the key owner's
username and realm (i.e. the realm name that authenticated the username
that last updated the API key).
This PR adds the realm_type to the information on the key's owner.
2024-02-20 20:55:27 +02:00
Albert Zaharovits
6fec837e32
[Doc] API Key deletion settings (#105392)
This documents API Key delete settings.
2024-02-18 17:38:56 +02:00
Albert Zaharovits
b2e626e7df
Support Profile Activate with JWTs with client authn (#105439)
Adds support for JWTs with client authentication
to the activate user profile API.

Closes #105342
2024-02-18 17:37:28 +02:00
Albert Zaharovits
9ee76c6b26
Aggs support for Query API Key Information API (#104895)
Adds support for the aggs request body parameter to the Query API Key Information API.
This parameter works identically to the well known eponymous parameter of the _search endpoint,
but the set of allowed aggregation types as well as the field names allowed is restricted.
2024-02-12 14:22:34 +02:00
Johannes Fredén
334aa1bc8d
Add support for fetching user profileId in Query Users (#104923)
Add support for fetching user profileId in Query Users
2024-02-07 08:49:39 +01:00
Panagiotis Bailis
7ce8d76559
Making k and num_candidates optional for knn search (#101209) 2024-02-01 15:43:09 +02:00
Albert Zaharovits
111a69d15f
Support match for the Query API Key API (#104594)
This adds support for the `match` query type to the Query API key Information API.
Note that since string values associated to API Keys are mapped as `keywords`,
a `match` query with no analyzer parameter is effectively equivalent to a `term` query
for such fields (e.g. `name`, `username`, `realm_name`).

Relates: #101691
2024-01-30 19:09:08 +02:00
István Zoltán Szabó
79d6c3e70d
[DOCS] Adds get setting and update settings asciidoc files to security API index (#104916)
* [DOCS] Adds get setting and update settings asciidoc files to security API index.

* [DOCS] Fixes references in docs.
2024-01-30 15:39:34 +01:00
Johannes Fredén
666774a865
Add documentation for Query User API (#104255)
* Add documentation for Query User API

Co-authored-by: Nikolaj Volgushev <n1v0lg@users.noreply.github.com>
2024-01-30 11:27:24 +01:00
Navarone Feekery
bed59ba84f
[Enterprise Search] Add .connector-secrets system index (#104766)
- Introduce new internal system index called .connector-secrets
- Add GET and POST requests for connector secrets
- Add permission sets for read and write connector secrets
2024-01-26 11:20:32 +01:00
Navarone Feekery
05ea8c7a0f
Revert "[Enterprise Search] Add .connector-secrets system index and GET/POST requests (#103683)" (#104760)
This reverts commit b4345d9d91.
2024-01-25 14:33:33 +01:00
Navarone Feekery
b4345d9d91
[Enterprise Search] Add .connector-secrets system index and GET/POST requests (#103683)
- Introduce new internal system index called .connector-secrets
- Add GET and POST requests for connector secrets
- Create read_connector_secrets and write_connector_secrets role permissions
2024-01-25 13:56:07 +01:00
Jan Kuipers
5dec83f69e
Endpoint to test Grok pattern (#104394)
* Add extract match ranges functionality to Grok.

* TestGrokPatternAction and Request

* TestGrokPattern response

* Update docs/changelog/104394.yaml

* Polish validation error message

* Improve test_grok_pattern API

* Add explicit CharSet

* Add endpoint to operator constants

* Add TransportTestGrokPatternActionTests

* REST API spec

* One more TransportTestGrokPatternActionTest

* Fix API spec

* Refactor REST API spec

* Polish code

* Replace TransportTestGrokPatternActionTests by a YAML REST test

* Add ecs_compatibility

* Always return arrays in the API

* Documentation

* YAML test for ecs_compatibility

* Rename doc fileø

* serverless scope

* Fix docs (hopefully)

* Update docs/reference/rest-api/index.asciidoc

Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>

* Add "text structure APIs" header in docs TOC

* Move file

* Remove test grok from main index

* typo

* Nested APIs underneath text structure

---------

Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
2024-01-24 09:35:59 +01:00
Albert Zaharovits
aeb2b77c3c
Add support for the simple_query_string to the Query API Key API (#104132)
This adds support for the simple_query_string query type to the Query API key Information API.
In addition, this also adds support for querying all the API Key metadata fields simultaneously,
rather than requiring each to be specified, such as metadata.x, metadata.y, etc.

Relates: #101691
2024-01-19 14:51:12 +02:00
Albert Zaharovits
f4aaa20f28
Add support for the type parameter to the Query API Key API (#103695)
This adds support for the type parameter to the Query API key API.
The type for an API Key can currently be either rest or cross_cluster.

Relates: #101691
2024-01-11 10:53:50 +02:00