Skip to content

[Upgrade Assistant] Fix privileges for reindexing indices#237055

Merged
mattkime merged 4 commits intomainfrom
upgrade_assistant_reindex_without_superuser_role
Oct 2, 2025
Merged

[Upgrade Assistant] Fix privileges for reindexing indices#237055
mattkime merged 4 commits intomainfrom
upgrade_assistant_reindex_without_superuser_role

Conversation

@mattkime
Copy link
Contributor

@mattkime mattkime commented Oct 1, 2025

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 #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 - #228705
Mocked response - 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.

@mattkime
Copy link
Contributor Author

mattkime commented Oct 1, 2025

/ci

@mattkime mattkime changed the title remove check for .tasks index access Oct 1, 2025
@mattkime mattkime self-assigned this Oct 1, 2025
@mattkime mattkime added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// Feature:Upgrade Assistant bug Fixes for quality problems that affect the customer experience backport:version Backport to applied version labels v9.2.0 v8.18.8 v8.19.5 v9.0.8 v9.1.5 labels Oct 1, 2025
@elasticmachine
Copy link
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @mattkime

@mattkime
Copy link
Contributor Author

mattkime commented Oct 1, 2025

/ci

@mattkime mattkime changed the title [Upgrade Assistant] Remove check for .tasks index access Oct 1, 2025
@mattkime mattkime marked this pull request as ready for review October 1, 2025 20:25
@mattkime mattkime requested a review from a team as a code owner October 1, 2025 20:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

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! Thank you for the fix @mattkime

@mattkime mattkime merged commit 0250b59 into main Oct 2, 2025
15 checks passed
@mattkime mattkime deleted the upgrade_assistant_reindex_without_superuser_role branch October 2, 2025 13:43
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/18194868552

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.18 Backport failed because of merge conflicts
8.19 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.0:
- [Core][UA] Forward-port 8.18 changes into main (#214996)
9.1 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 237055

Questions ?

Please refer to the Backport tool documentation

mattkime added a commit to mattkime/kibana that referenced this pull request Oct 2, 2025
…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
mattkime added a commit to mattkime/kibana that referenced this pull request Oct 2, 2025
…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 added a commit to mattkime/kibana that referenced this pull request Oct 2, 2025
…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
Copy link
Contributor Author

mattkime commented Oct 2, 2025

💚 All backports created successfully

Status Branch Result
8.19
8.18

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

mattkime added a commit to mattkime/kibana that referenced this pull request Oct 2, 2025
…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
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 6, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mattkime

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mattkime

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mattkime

mattkime added a commit that referenced this pull request Oct 8, 2025
…7055) (#237350)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Upgrade Assistant] Fix privileges for reindexing indices
(#237055)](#237055)

<!--- Backport version: 10.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2025-10-02T13:43:31Z","message":"[Upgrade
Assistant] Fix privileges for reindexing indices (#237055)\n\n##
Summary\n\nPreviously Upgrade Assistant was checking for `.tasks` index
access when\nchecking privs in order to reindex an index. Only the
`superuser` role\nprovides access. Further, access is not needed as its
been replaced by\nthe tasks api which is available via `cluster:
['manage']`\n\nAdditionally, the saved objects client usage required the
`superuser`\nrole since the reindex saved object was hidden and we
didn't have a way\nof providing kibana feature privileges for the saved
object. The\nsolution is to rely on our our preexisting privilege checks
(cluster:\nmanage and 'all' access for the particular indices being
reindexed) and\nuse the internal saved object client.\n\nPart of
https://github.com/elastic/kibana/issues/237054\n\nTo test -\n\nCreate a
role with the following (index names could be more limited and\nit
should work)\n```\n{\n \"cluster\": [ \"manage\" ],\n \"index\" : [\n
{\n \"names\": [ \"*\" ],\n \"privileges\": [ \"all\" ]\n }\n
]\n}\n```\nassign it to a user. Now try running upgrade assistant and
reindexing\nwith that user. It should work.\n\nSimplified testing of
upgrade assistant - \nTo test, follow directions here
-\nhttps://github.com//pull/228705\nMocked response
-\nhttps://github.com//pull/230021/commits/5aab34cdcee2df76d702a058348388a7d10fb73c#diff-f7eb2d7fe666aad1bedcd73d356612d2f74f81c76ba2e8e26b2983b9fb92a661R50\n\n---\n\nRelease
note\n\nFixes privilege requirements when reindexing indices via
Upgrade\nAssistant. Previously, the \"superuser\" role was required. Now
\"cluster:\nmanage\" and \"all\" privileges for the relevant indices are
sufficient.","sha":"0250b590f20ac6dcdc5df64ee0a8fd758553957c","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Kibana
Management","Feature:Upgrade
Assistant","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Upgrade
Assistant] Fix privileges for reindexing
indices","number":237055,"url":"https://github.com/elastic/kibana/pull/237055","mergeCommit":{"message":"[Upgrade
Assistant] Fix privileges for reindexing indices (#237055)\n\n##
Summary\n\nPreviously Upgrade Assistant was checking for `.tasks` index
access when\nchecking privs in order to reindex an index. Only the
`superuser` role\nprovides access. Further, access is not needed as its
been replaced by\nthe tasks api which is available via `cluster:
['manage']`\n\nAdditionally, the saved objects client usage required the
`superuser`\nrole since the reindex saved object was hidden and we
didn't have a way\nof providing kibana feature privileges for the saved
object. The\nsolution is to rely on our our preexisting privilege checks
(cluster:\nmanage and 'all' access for the particular indices being
reindexed) and\nuse the internal saved object client.\n\nPart of
https://github.com/elastic/kibana/issues/237054\n\nTo test -\n\nCreate a
role with the following (index names could be more limited and\nit
should work)\n```\n{\n \"cluster\": [ \"manage\" ],\n \"index\" : [\n
{\n \"names\": [ \"*\" ],\n \"privileges\": [ \"all\" ]\n }\n
]\n}\n```\nassign it to a user. Now try running upgrade assistant and
reindexing\nwith that user. It should work.\n\nSimplified testing of
upgrade assistant - \nTo test, follow directions here
-\nhttps://github.com//pull/228705\nMocked response
-\nhttps://github.com//pull/230021/commits/5aab34cdcee2df76d702a058348388a7d10fb73c#diff-f7eb2d7fe666aad1bedcd73d356612d2f74f81c76ba2e8e26b2983b9fb92a661R50\n\n---\n\nRelease
note\n\nFixes privilege requirements when reindexing indices via
Upgrade\nAssistant. Previously, the \"superuser\" role was required. Now
\"cluster:\nmanage\" and \"all\" privileges for the relevant indices are
sufficient.","sha":"0250b590f20ac6dcdc5df64ee0a8fd758553957c"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/237055","number":237055,"mergeCommit":{"message":"[Upgrade
Assistant] Fix privileges for reindexing indices (#237055)\n\n##
Summary\n\nPreviously Upgrade Assistant was checking for `.tasks` index
access when\nchecking privs in order to reindex an index. Only the
`superuser` role\nprovides access. Further, access is not needed as its
been replaced by\nthe tasks api which is available via `cluster:
['manage']`\n\nAdditionally, the saved objects client usage required the
`superuser`\nrole since the reindex saved object was hidden and we
didn't have a way\nof providing kibana feature privileges for the saved
object. The\nsolution is to rely on our our preexisting privilege checks
(cluster:\nmanage and 'all' access for the particular indices being
reindexed) and\nuse the internal saved object client.\n\nPart of
https://github.com/elastic/kibana/issues/237054\n\nTo test -\n\nCreate a
role with the following (index names could be more limited and\nit
should work)\n```\n{\n \"cluster\": [ \"manage\" ],\n \"index\" : [\n
{\n \"names\": [ \"*\" ],\n \"privileges\": [ \"all\" ]\n }\n
]\n}\n```\nassign it to a user. Now try running upgrade assistant and
reindexing\nwith that user. It should work.\n\nSimplified testing of
upgrade assistant - \nTo test, follow directions here
-\nhttps://github.com//pull/228705\nMocked response
-\nhttps://github.com//pull/230021/commits/5aab34cdcee2df76d702a058348388a7d10fb73c#diff-f7eb2d7fe666aad1bedcd73d356612d2f74f81c76ba2e8e26b2983b9fb92a661R50\n\n---\n\nRelease
note\n\nFixes privilege requirements when reindexing indices via
Upgrade\nAssistant. Previously, the \"superuser\" role was required. Now
\"cluster:\nmanage\" and \"all\" privileges for the relevant indices are
sufficient.","sha":"0250b590f20ac6dcdc5df64ee0a8fd758553957c"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/237334","number":237334,"state":"OPEN"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/237326","number":237326,"state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/237325","number":237325,"branch":"9.2","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
mattkime added a commit that referenced this pull request Oct 8, 2025
…7055) (#237340)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Upgrade Assistant] Fix privileges for reindexing indices
(#237055)](#237055)

<!--- Backport version: 10.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2025-10-02T13:43:31Z","message":"[Upgrade
Assistant] Fix privileges for reindexing indices (#237055)\n\n##
Summary\n\nPreviously Upgrade Assistant was checking for `.tasks` index
access when\nchecking privs in order to reindex an index. Only the
`superuser` role\nprovides access. Further, access is not needed as its
been replaced by\nthe tasks api which is available via `cluster:
['manage']`\n\nAdditionally, the saved objects client usage required the
`superuser`\nrole since the reindex saved object was hidden and we
didn't have a way\nof providing kibana feature privileges for the saved
object. The\nsolution is to rely on our our preexisting privilege checks
(cluster:\nmanage and 'all' access for the particular indices being
reindexed) and\nuse the internal saved object client.\n\nPart of
https://github.com/elastic/kibana/issues/237054\n\nTo test -\n\nCreate a
role with the following (index names could be more limited and\nit
should work)\n```\n{\n \"cluster\": [ \"manage\" ],\n \"index\" : [\n
{\n \"names\": [ \"*\" ],\n \"privileges\": [ \"all\" ]\n }\n
]\n}\n```\nassign it to a user. Now try running upgrade assistant and
reindexing\nwith that user. It should work.\n\nSimplified testing of
upgrade assistant - \nTo test, follow directions here
-\nhttps://github.com//pull/228705\nMocked response
-\nhttps://github.com//pull/230021/commits/5aab34cdcee2df76d702a058348388a7d10fb73c#diff-f7eb2d7fe666aad1bedcd73d356612d2f74f81c76ba2e8e26b2983b9fb92a661R50\n\n---\n\nRelease
note\n\nFixes privilege requirements when reindexing indices via
Upgrade\nAssistant. Previously, the \"superuser\" role was required. Now
\"cluster:\nmanage\" and \"all\" privileges for the relevant indices are
sufficient.","sha":"0250b590f20ac6dcdc5df64ee0a8fd758553957c","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Kibana
Management","Feature:Upgrade
Assistant","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Upgrade
Assistant] Fix privileges for reindexing
indices","number":237055,"url":"https://github.com/elastic/kibana/pull/237055","mergeCommit":{"message":"[Upgrade
Assistant] Fix privileges for reindexing indices (#237055)\n\n##
Summary\n\nPreviously Upgrade Assistant was checking for `.tasks` index
access when\nchecking privs in order to reindex an index. Only the
`superuser` role\nprovides access. Further, access is not needed as its
been replaced by\nthe tasks api which is available via `cluster:
['manage']`\n\nAdditionally, the saved objects client usage required the
`superuser`\nrole since the reindex saved object was hidden and we
didn't have a way\nof providing kibana feature privileges for the saved
object. The\nsolution is to rely on our our preexisting privilege checks
(cluster:\nmanage and 'all' access for the particular indices being
reindexed) and\nuse the internal saved object client.\n\nPart of
https://github.com/elastic/kibana/issues/237054\n\nTo test -\n\nCreate a
role with the following (index names could be more limited and\nit
should work)\n```\n{\n \"cluster\": [ \"manage\" ],\n \"index\" : [\n
{\n \"names\": [ \"*\" ],\n \"privileges\": [ \"all\" ]\n }\n
]\n}\n```\nassign it to a user. Now try running upgrade assistant and
reindexing\nwith that user. It should work.\n\nSimplified testing of
upgrade assistant - \nTo test, follow directions here
-\nhttps://github.com//pull/228705\nMocked response
-\nhttps://github.com//pull/230021/commits/5aab34cdcee2df76d702a058348388a7d10fb73c#diff-f7eb2d7fe666aad1bedcd73d356612d2f74f81c76ba2e8e26b2983b9fb92a661R50\n\n---\n\nRelease
note\n\nFixes privilege requirements when reindexing indices via
Upgrade\nAssistant. Previously, the \"superuser\" role was required. Now
\"cluster:\nmanage\" and \"all\" privileges for the relevant indices are
sufficient.","sha":"0250b590f20ac6dcdc5df64ee0a8fd758553957c"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/237055","number":237055,"mergeCommit":{"message":"[Upgrade
Assistant] Fix privileges for reindexing indices (#237055)\n\n##
Summary\n\nPreviously Upgrade Assistant was checking for `.tasks` index
access when\nchecking privs in order to reindex an index. Only the
`superuser` role\nprovides access. Further, access is not needed as its
been replaced by\nthe tasks api which is available via `cluster:
['manage']`\n\nAdditionally, the saved objects client usage required the
`superuser`\nrole since the reindex saved object was hidden and we
didn't have a way\nof providing kibana feature privileges for the saved
object. The\nsolution is to rely on our our preexisting privilege checks
(cluster:\nmanage and 'all' access for the particular indices being
reindexed) and\nuse the internal saved object client.\n\nPart of
https://github.com/elastic/kibana/issues/237054\n\nTo test -\n\nCreate a
role with the following (index names could be more limited and\nit
should work)\n```\n{\n \"cluster\": [ \"manage\" ],\n \"index\" : [\n
{\n \"names\": [ \"*\" ],\n \"privileges\": [ \"all\" ]\n }\n
]\n}\n```\nassign it to a user. Now try running upgrade assistant and
reindexing\nwith that user. It should work.\n\nSimplified testing of
upgrade assistant - \nTo test, follow directions here
-\nhttps://github.com//pull/228705\nMocked response
-\nhttps://github.com//pull/230021/commits/5aab34cdcee2df76d702a058348388a7d10fb73c#diff-f7eb2d7fe666aad1bedcd73d356612d2f74f81c76ba2e8e26b2983b9fb92a661R50\n\n---\n\nRelease
note\n\nFixes privilege requirements when reindexing indices via
Upgrade\nAssistant. Previously, the \"superuser\" role was required. Now
\"cluster:\nmanage\" and \"all\" privileges for the relevant indices are
sufficient.","sha":"0250b590f20ac6dcdc5df64ee0a8fd758553957c"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/237334","number":237334,"state":"OPEN"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/237326","number":237326,"state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/237325","number":237325,"branch":"9.2","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added v8.19.6 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Oct 8, 2025
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels bug Fixes for quality problems that affect the customer experience Feature:Upgrade Assistant release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v8.18.8 v8.18.9 v8.19.5 v8.19.6 v9.3.0

4 participants