Skip to content

[8.19] [Upgrade Assistant] Fix privileges for reindexing indices (#237055)#237340

Merged
mattkime merged 11 commits intoelastic:8.19from
mattkime:backport/8.19/pr-237055
Oct 8, 2025
Merged

[8.19] [Upgrade Assistant] Fix privileges for reindexing indices (#237055)#237340
mattkime merged 11 commits intoelastic:8.19from
mattkime:backport/8.19/pr-237055

Conversation

@mattkime
Copy link
Contributor

@mattkime mattkime commented Oct 2, 2025

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…7055)

## Summary

Previously Upgrade Assistant was checking for `.tasks` index access when
checking privs in order to reindex an index. Only the `superuser` role
provides access. Further, access is not needed as its been replaced by
the tasks api which is available via `cluster: ['manage']`

Additionally, the saved objects client usage required the `superuser`
role since the reindex saved object was hidden and we didn't have a way
of providing kibana feature privileges for the saved object. The
solution is to rely on our our preexisting privilege checks (cluster:
manage and 'all' access for the particular indices being reindexed) and
use the internal saved object client.

Part of elastic#237054

To test -

Create a role with the following (index names could be more limited and
it should work)
```
{
  "cluster": [ "manage" ],
  "index" : [
    {
      "names": [ "*" ],
      "privileges": [ "all" ]
    }
  ]
}
```
assign it to a user. Now try running upgrade assistant and reindexing
with that user. It should work.

Simplified testing of upgrade assistant -
To test, follow directions here -
elastic#228705
Mocked response -
elastic@5aab34c#diff-f7eb2d7fe666aad1bedcd73d356612d2f74f81c76ba2e8e26b2983b9fb92a661R50

---

Release note

Fixes privilege requirements when reindexing indices via Upgrade
Assistant. Previously, the "superuser" role was required. Now "cluster:
manage" and "all" privileges for the relevant indices are sufficient.

(cherry picked from commit 0250b59)

# Conflicts:
#	x-pack/platform/plugins/private/reindex_service/server/src/lib/reindex_service_wrapper.ts
#	x-pack/platform/plugins/private/reindex_service/server/src/routes/batch_reindex_indices.ts
#	x-pack/platform/plugins/private/reindex_service/server/src/routes/reindex_indices.ts
#	x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts
#	x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts
@mattkime mattkime added the backport This PR is a backport of another PR label Oct 2, 2025
@mattkime mattkime enabled auto-merge (squash) October 2, 2025 15:56
@mattkime
Copy link
Contributor Author

mattkime commented Oct 6, 2025

/ci

@mattkime
Copy link
Contributor Author

mattkime commented Oct 6, 2025

/ci

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

Copy link
Contributor

@SoniaSanzV SoniaSanzV left a comment

Choose a reason for hiding this comment

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

tested locally, lgtm

@mattkime mattkime merged commit 31bd60f into elastic:8.19 Oct 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants