elasticsearch/plugins
Nikolaj Volgushev c58ac456b8
Failure Store Access Authorization (#123986)
This PR implements authorization logic for failure store access. It
builds on https://github.com/elastic/elasticsearch/pull/122715.

Access to the failure store is granted by two privileges:
`read_failure_store` and `manage_failure_store`. Either of these
privileges lets a user access a failure store via the `::failures`
selector, as well as access its backing failure indices. 
`read_failure_store` grants read access (for example to search documents
in a failure store), `manage_failure_store` grants access to write
operations, such as rollover. Users with only `read` or `manage` on a
data stream do not get failure store access. Vice versa, users with
`read_failure_store` and `manage_failure_store` do not get access to
regular data in a data stream. 

The PR implements this by making authorization logic selector-aware. It
involves two main changes:

1. Index permission groups now compare the selector under which an index resource is accessed to the selector associated with the group.
2. The `AuthorizedIndices` interface likewise uses selectors to decide which indices to treat as authorized. This part of the change requires a sizable refactor and changes to the interface. 

The high-level behavior for selector-aware search is as follows:

For a user with `read_failure_store` over data stream `logs`:

- `POST /logs::failures/_search` returns the documents in the failure store.
- `POST /logs/_search` returns a 403.
- `POST /logs/_search?ignore_unavailable=true` and `POST /*/_search` return an empty result.

Similarly, for a user with `read` over data stream `logs`:

- `POST /logs::failures/_search` returns a 403.
- `POST /logs/_search` returns documents in the data stream.
- `POST /logs::failures/_search?ignore_unavailable=true` and `POST /*::failures/_search` return an empty result.

A user with both `read` and `read_failure_store` over data stream `logs`
gets access to both `POST /logs::failures/_search` and `POST
/logs/_search`.

The index privilege `all` automatically grants access to both data and
the failures store, as well as all hypothetical future selectors. 

Resolves: ES-10873
2025-03-20 20:10:16 +11:00
..
analysis-icu Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
analysis-kuromoji Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
analysis-nori Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
analysis-phonetic Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
analysis-smartcn Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
analysis-stempel Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
analysis-ukrainian Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
discovery-azure-classic Missing policies for netty, discovery-azure and repository-s3 (#123696) 2025-03-02 22:34:38 +01:00
discovery-ec2 Work around testFilterByTags failure (#125109) 2025-03-20 02:49:54 +11:00
discovery-gce Silence known entitlement warnings (#124883) 2025-03-18 16:52:12 +02:00
examples Failure Store Access Authorization (#123986) 2025-03-20 20:10:16 +11:00
mapper-annotated-text Lazy initialization for SyntheticSourceSupport.loader() (#120896) 2025-01-27 17:12:42 +02:00
mapper-murmur3 Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
mapper-size Use FallbackSyntheticSourceBlockLoader for number fields (#122280) 2025-02-12 16:12:19 -08:00
repository-hdfs [Build] Require reason for usesDefaultDistribution (#124707) 2025-03-17 08:25:39 +01:00
store-smb [Entitlements] Add check functions for NIO Files (#122591) 2025-02-19 21:55:06 +01:00
build.gradle Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00