Commit graph

220 commits

Author SHA1 Message Date
Yang Wang
6c04abc68c
Fix compilation and tests for customAuthzEngine (#125469)
Relates: #123812
2025-03-24 12:03:06 +11:00
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
Rene Groeschke
6f7a206a8a
Update Gradle Enterprise Plugin (Develocity) to 3.19.2 (#125137)
with develocity updated to 2024.3.4 we are unblocked on updating the gradle enterprise plugin
2025-03-19 19:19:54 +01:00
Armin Braun
b1c75d1868
Move some security APIs to using promises in place of callbacks (#123812)
We have some incredibly deep callstacks in security that seem to visibly
raise context switch costs, make profiling more complicated and
generally make the code rather hard to follow.
Since the methods adjusted here return a result synchronously we can
both save overhead and make things a little easier to follow by using
promises as returns in place of consuming callbacks.
2025-03-05 12:08:29 +01:00
Rene Groeschke
496c38e5a5
Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896)
This reverts commit 36660f2e5f.
2025-03-05 08:02:13 +01:00
Tim Vernum
23e5c15590
Fix custom authz engine for multi-project (#123937) 2025-03-04 01:21:07 +00:00
Rene Groeschke
36660f2e5f
Revert "Update Gradle wrapper to 8.13 (#122421)" (#123889)
This reverts commit e19b2264af.
2025-03-03 15:51:07 +01:00
Rene Groeschke
e19b2264af
Update Gradle wrapper to 8.13 (#122421)
* Fix Gradle Deprecation warning as declaring an is- property with a Boolean type has been deprecated.
* Make use of new layout.settingsFolder api to address some cross project references
* Fix buildParams snapshot check for multiprojet projects
2025-03-03 14:10:00 +01:00
Ryan Ernst
30a65fbec5
Fix example plugin using config dir (#122212)
This commit fixes a use of accessing the config dir from the
environment.
2025-02-11 11:06:22 -08:00
Ryan Ernst
f77201fb12
Fix compilation of custom auth engine example (#121089) 2025-02-04 19:34:41 +01:00
Rene Groeschke
2b16515166
Update Gradle wrapper to 8.12.1 (#120960) 2025-01-28 15:41:44 +01:00
Rene Groeschke
ba61f8c7f7
Update Gradle wrapper to 8.12 (#118683)
This updates the gradle wrapper to 8.12

We addressed deprecation warnings due to the update that includes:

- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions
2024-12-30 15:34:24 +01:00
Rene Groeschke
d2b3dc51d1
[Build] Reapply updating to Gradle 8.11.1 (#117394)
This reverts commit b5c6d927c1.
* Simplify and fix dynamic project dependency handling
2024-11-24 15:13:15 +01:00
Rene Groeschke
b5c6d927c1 Revert "[Build] Update Gradle wrapper to 8.11.1 (#115886)"
This reverts commit 8f943a6a7c.

breaks serverless build. needs further investigation
2024-11-22 21:30:54 +01:00
Rene Groeschke
8f943a6a7c
[Build] Update Gradle wrapper to 8.11.1 (#115886)
replace deprecated gradle api

fix permission api usage in debian and rpm package creation
remove deprecated usage of #ProjectDependency..getDependencyProject()
improves gradle configuration cache reading in our weekly benchmark by almost 30%
2024-11-22 21:11:28 +01:00
Mark Vieira
099a3dbb25
Fix example plugins tests (#115890) 2024-10-30 07:32:17 -07:00
Mark Vieira
cc0da6d309
Upgrade develocity plugin (#115139) 2024-10-18 14:10:11 -07:00
Rene Groeschke
259b0cdd30
Update Gradle wrapper to 8.10.2 (#113603)
Update Gradle wrapper to 8.10.2
2024-09-28 04:52:13 +10:00
Jake Landis
e77dc6dc13
Bump the min java version for examples (#112843) 2024-09-26 20:05:44 -05:00
Rene Groeschke
3aa84159fc
Update Gradle wrapper to 8.10.1 (#112948) 2024-09-19 19:23:42 +02:00
Mark Vieira
a59c182f9f
Add AGPLv3 as a supported license 2024-09-13 15:29:46 -07:00
Sam Xiao
52bb54b7dc
Comment: Correct plugin examples comment (#112609)
Minor change to correct the comment for running YAML test in plugin examples.
2024-09-06 14:43:19 -04:00
Sam Xiao
7cd6de76f4
Adds example plugin for custom ingest processor (#112282)
* Adds example plugin for custom ingest processor

Adds an example for creating a plugin with a simple custom ingest
processor. The example processor repeats the value of an expected filed
in a document, or ignores it if the expected field does not exist.

Closes #111539
2024-09-06 12:05:52 -04:00
Joe Gallo
9b2bad3949
Update the gradlew stuff in plugins/examples (#112517) 2024-09-04 11:27:17 -04:00
Ryan Ernst
b000271885
Update expert script example with termStats (#112377)
This commit fixes compilation of the expert script example to implement
the new required method of score script making termStats available.
2024-08-30 10:11:24 -07:00
Rene Groeschke
fb6c5a55dd
Update Gradle wrapper to 8.10 (#111736) 2024-08-22 12:15:22 +02:00
john-wagster
5510ad98f8
Updated Function Score Query Test with Explain Fixes for 8.15.1 (#111929)
* updated test for 8.15.1

* Update docs/changelog/111929.yaml

* Delete docs/changelog/111929.yaml
2024-08-16 00:55:52 +10:00
john-wagster
935c0e4e2b
Explain Function Score Query (#111807)
allowing for a custom explanation to be passed through as part of supporting building a plugin with a custom script score; previously threw an npe
2024-08-13 17:03:30 -05:00
Rene Groeschke
cb0ecb86df
Update Gradle wrapper to 8.9 (#110109) 2024-07-19 13:42:33 +02:00
Rene Groeschke
02439e321d
Update Gradle gradleEnterprise plugin (develocity now) (#109443)
* Update Gradle gradleEnterprise plugin (develocity now)
* Fix imports in build scan script
* Fix build scan api usage
* Dependency cleanup and API fix
* Fix API update for BuildResult in Build scans
* Fix buildkite buildscan annotations based on gradle failures
2024-06-10 14:26:43 +02:00
Rene Groeschke
8ac3e3dd90
Update Gradle wrapper to 8.8 (#108021)
Fix incompatibility with 8.8 and our internal api usages

- Update ospackage to a version that contains a fix we provided
- Tweak build logic to avoid deprecation warnings
- Use newer permission api
- Use custom shadowplugin
- Rework ElasticsearchDistribution dependencies resolution
- Update Gradle wrapper to 8.8
2024-06-04 12:43:02 +02:00
Jake Landis
19e3e732cd
Fix compilation issue for example plugins (#108270) 2024-05-03 16:36:11 -05:00
Mark Vieira
cf9a333d3a
Remove unused code from example plugin (#106928) 2024-03-29 12:44:31 -07:00
Rene Groeschke
c15f727f2d
Update Gradle wrapper to 8.7 (#105854)
removed tiny issue on build script that seems like an oversight and doesn't do anything at all
2024-03-25 12:16:18 +01:00
Rene Groeschke
0a7c88cfd6
Update Gradle Enterprise plugin to 3.16.2 (#105871) 2024-03-01 13:03:11 -05:00
Jonathan Wilson
8df3a30326
adding field data test (#105523)
Co-authored-by: jonathan wilson <jonathan@revcontent.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-02-27 04:12:59 -05:00
Rene Groeschke
b984b44767
Update Gradle wrapper to 8.6 (#103796) 2024-02-13 11:13:29 -08:00
Mark Vieira
a42a940b78
Update Gradle Enterprise plugin to 3.16.1 (#104435) 2024-02-13 08:15:59 -08:00
Ryan Ernst
e1488a0fc7
Fix compilation of example rest handler (#105101) 2024-02-03 20:48:11 -08:00
Simon Cooper
8739f9a665
Update example plugin for API changes in #103277 (#104357) 2024-01-16 12:46:07 +00:00
Rene Groeschke
8e9a88b63d
Update gradle wrapper to 8.5 (#102154)
Update BuildLayout references
2023-11-30 10:01:32 -05:00
Rene Groeschke
1773d4b5d1
Fix Gradle deprecation warning in examples project (#100988) 2023-10-17 12:00:47 -04:00
Rene Groeschke
8a6df32de6
Update gradle wrapper to 8.4 (#99856)
* Remove deprecated forConfigurationTime usage
2023-10-11 17:02:27 +02:00
Panagiotis Bailis
d32dc6dd8b
Refactoring & adding tests to rescorer in the example plugin, to account for non strictly increasing doc ids in the results. (#100189)
* Updating ExampleRescoreBuilder.ExampleRescorer#rescore to use the ordered sortedByDocId array when iterating through the leaves to fetch the NumericFieldData used or reranking. 
* Adding test to account for the above behavior, ensuring that the docs will be properly rescored when the original results are in descending _id order.

Closes #39665
2023-10-04 12:28:18 +03:00
Rene Groeschke
b23e000c30
Update gradle wrapper to 8.3 (#97838)
Gradle now fully supports compiling, testing and running on Java 20. 
Among other general performance improvements this release introduces --test-dry-run command line option that allows checking if tests are filtered or not by gradle.
Required updating nebula ospackage plugin as setuid was broken in gradle 8.3.
2023-09-27 08:48:21 +02:00
Ryan Ernst
fe31e92020
Fix example referencing TransportVersion constant (#99375)
With the recent move of constants to the TransportVersions class, the
example plugins were missed. This commit fixes the example plugins which
referenced a constant.
2023-09-08 10:23:15 -07:00
Mark Vieira
60e178eb3a
Update Gradle Enterprise plugin to 3.14.1 (#98551) 2023-09-06 08:13:46 -07:00
Simon Cooper
b67a9e1ec3
Move text references to index created version to IndexVersion (#98727) 2023-08-23 10:51:56 +01:00
Rene Groeschke
b8627079b4
Update Gradle Wrapper to 8.2 (#96686)
- Convention usage has been deprecated and was fixed in our build files
- Fix test dependencies and deprecation
2023-07-04 15:35:15 +02:00
Mark Vieira
047a85f30a
Update Gradle Enteprise plugin to 3.13.1 (#95896)
Upgrade Gradle Enterprise plugin to latest available.
2023-05-08 14:01:15 -04:00