Skip to content

[8.18] [Upgrade Assistant] Fix privileges for reindexing indices (#237055)#237350

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

[8.18] [Upgrade Assistant] Fix privileges for reindexing indices (#237055)#237350
mattkime merged 9 commits intoelastic:8.18from
mattkime:backport/8.18/pr-237055

Conversation

@mattkime
Copy link
Contributor

@mattkime mattkime commented Oct 2, 2025

Backport

This will backport the following commits from main to 8.18:

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 16:12
@mattkime
Copy link
Contributor Author

mattkime commented Oct 6, 2025

/ci

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@mattkime mattkime merged commit 82f2a55 into elastic:8.18 Oct 8, 2025
8 checks passed
@SoniaSanzV
Copy link
Contributor

tested locally, works well

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