Skip to content

Conversation

@n1v0lg
Copy link
Contributor

@n1v0lg n1v0lg commented Mar 30, 2025

It's more natural for manage and manage_data_stream_lifecycle to grant access to management style APIs both for regular data streams and their failure stores.

This PR adds support for privileges to grant access to both data and failures selectors (without granting access to everything, à la all), and extends manage and manage_data_stream_lifecycle to grant failure store access, in addition to regular data stream access. manage_failure_store still grants failures-only access.

@n1v0lg n1v0lg self-assigned this Mar 30, 2025
@n1v0lg n1v0lg changed the title [Failure Store] some privileges grant both data and failures access [Failure Store] Some privileges grant both data and failures access Mar 30, 2025
@n1v0lg n1v0lg changed the title [Failure Store] Some privileges grant both data and failures access [Failure Store] Manage-style privileges grant both data and failures access Mar 30, 2025
@n1v0lg n1v0lg marked this pull request as ready for review March 31, 2025 08:24
@n1v0lg n1v0lg requested a review from a team as a code owner March 31, 2025 08:24
@n1v0lg n1v0lg added >non-issue v8.19.0 :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team auto-backport Automatically create backport pull requests when merged labels Mar 31, 2025
@n1v0lg n1v0lg requested a review from slobodanadamovic March 31, 2025 08:24
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

Copy link
Contributor

@slobodanadamovic slobodanadamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM This turned out pretty neat! 👍

combined.add(union(dataSelectorAccessPrivileges, actions, IndexComponentSelectorPredicate.DATA));
}
if (false == dataAndFailuresSelectorAccessPrivileges.isEmpty()) {
combined.add(union(dataAndFailuresSelectorAccessPrivileges, Set.of(), IndexComponentSelectorPredicate.DATA_AND_FAILURES));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consider pre-sizing the combined hash set

@n1v0lg n1v0lg added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Apr 1, 2025
@elasticsearchmachine elasticsearchmachine merged commit 3be4fb1 into elastic:main Apr 1, 2025
22 checks passed
@n1v0lg n1v0lg deleted the failure-store-data-and-failures-privileges branch April 1, 2025 14:46
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Apr 2, 2025
elasticsearchmachine pushed a commit that referenced this pull request Apr 2, 2025
Adjusting the test assertion to account for the potential 3rd extra
group (#125900).

Resolves #126061
slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Apr 3, 2025
Adjusting the test assertion to account for the potential 3rd extra
group (elastic#125900).

Resolves elastic#126061

(cherry picked from commit 7b753d0)

# Conflicts:
#	muted-tests.yml
elasticsearchmachine pushed a commit that referenced this pull request Apr 3, 2025
Adjusting the test assertion to account for the potential 3rd extra
group (#125900).

Resolves #126061

(cherry picked from commit 7b753d0)

# Conflicts:
#	muted-tests.yml
elasticsearchmachine pushed a commit that referenced this pull request Apr 7, 2025
…lures access (#125900) (#126044)

* [Failure Store] Manage-style privileges grant both data and failures access (#125900)

It's more natural for `manage` and `manage_data_stream_lifecycle` to
grant access to management style APIs both for regular data streams and
their failure stores.

This PR adds support for privileges to grant access to both data and
failures selectors (without granting access to everything, à la `all`),
and extends `manage` and `manage_data_stream_lifecycle` to grant failure
store access, in addition to regular data stream access.
`manage_failure_store` still grants failures-only access.

* Fix imports

---------

Co-authored-by: Slobodan Adamović <[email protected]>
andreidan pushed a commit to andreidan/elasticsearch that referenced this pull request Apr 9, 2025
Adjusting the test assertion to account for the potential 3rd extra
group (elastic#125900).

Resolves elastic#126061
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants