Skip to content

[9.2] [Upgrade Assistant] Fix privileges for reindexing indices (#237055)#237325

Closed
mattkime wants to merge 1 commit intoelastic:9.2from
mattkime:backport/9.2/pr-237055
Closed

[9.2] [Upgrade Assistant] Fix privileges for reindexing indices (#237055)#237325
mattkime wants to merge 1 commit intoelastic:9.2from
mattkime:backport/9.2/pr-237055

Conversation

@mattkime
Copy link
Contributor

@mattkime mattkime commented Oct 2, 2025

Backport

This will backport the following commits from main to 9.2:

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)
@mattkime mattkime requested a review from a team as a code owner October 2, 2025 15:12
@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:12
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 2, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #15 / prAutomatedChecks Download schema from main branch fails to download the file from the 9.2 branch
  • [job] [logs] Jest Tests #15 / prAutomatedChecks Download schema from main branch fails to download the file from the 9.2 branch

The CI Stats report is too large to be displayed here, check out the CI build annotation for this information.

History

@mattkime mattkime closed this Oct 3, 2025
auto-merge was automatically disabled October 3, 2025 01:30

Pull request was closed

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.

2 participants