elasticsearch/plugins/examples
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
..
custom-processor Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
custom-settings Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
custom-significance-heuristic Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
custom-suggester Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
gradle/wrapper Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
painless-whitelist Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
rescore Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
rest-handler Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
script-expert-scoring Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896) 2025-03-05 08:02:13 +01:00
security-authorization-engine Failure Store Access Authorization (#123986) 2025-03-20 20:10:16 +11:00
stable-analysis Update Gradle wrapper to 8.12 (#118683) 2024-12-30 15:34:24 +01:00
build.gradle Bump the min java version for examples (#112843) 2024-09-26 20:05:44 -05:00
gradle.properties Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
gradlew Update the gradlew stuff in plugins/examples (#112517) 2024-09-04 11:27:17 -04:00
gradlew.bat Update the gradlew stuff in plugins/examples (#112517) 2024-09-04 11:27:17 -04:00
NOTICE.txt Remove Joda dependency (#79007) 2021-10-13 17:37:31 -07:00
settings.gradle Update Gradle Enterprise Plugin (Develocity) to 3.19.2 (#125137) 2025-03-19 19:19:54 +01:00
SSPL-1.0+ELASTIC-LICENSE-2.0.txt Isolate example plugins projects from main Elasticsearch build (#78140) 2021-09-22 12:01:26 -07:00