Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[index management] Better privilege checking for component index templates #202251

Merged
merged 31 commits into from
Dec 18, 2024

Conversation

mattkime
Copy link
Contributor

@mattkime mattkime commented Nov 29, 2024

Summary

Builds on #201717

Part of #178654

manage_index_templates cluster privilege determines access to component index templates tab within index management.

@mattkime mattkime self-assigned this Nov 29, 2024
@mattkime mattkime changed the title Templates mgmt better privs [index management] Component index templates management UI - appropriately match privs Nov 30, 2024
@mattkime mattkime added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more Feature:Index Management Index and index templates UI release_note:fix backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Nov 30, 2024
@mattkime mattkime changed the title [index management] Component index templates management UI - appropriately match privs [index management] Better privilege checking for component index templates Dec 2, 2024
@mattkime mattkime marked this pull request as ready for review December 16, 2024 06:13
@mattkime mattkime requested a review from a team as a code owner December 16, 2024 06:13
@elasticmachine
Copy link
Contributor

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

@mattkime
Copy link
Contributor Author

/ci

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

Hi @mattkime, I tested locally (followed the instructions from #178654 to create a test user) and it looks like a user with monitor cluster privileges can view index templates but cannot view component templates. Is this the expected behavior? I thought we would expect to see both index templates and component templates.

Screenshot 2024-12-16 at 16 57 25

@mattkime
Copy link
Contributor Author

mattkime commented Dec 16, 2024

@ElenaStoeva That's expected as I haven't yet addressed the Index Templates tab. I'm going one tab at a time. Also, sometimes the privilege model doesn't make sense in some ways. I need to write something up for the ES team. More specifically, manage_index_templates doesn't have a ready only version, and nothing that is part of monitor

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

Thanks for clarifying @mattkime! I had the incorrect understanding that with monitor privileges we should be able to see the component templates list (but not edit/add templates). Anyway, knowing that we can only view them with manage_index_templates privilege, it works as expected. Changes also lgtm.

@mattkime
Copy link
Contributor Author

/ci

@mattkime mattkime enabled auto-merge (squash) December 18, 2024 13:04
@mattkime mattkime merged commit 1756918 into elastic:main Dec 18, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #91 / Alerting builtin alertTypes circuit_breakers index threshold rule that hits max alerts circuit breaker persist existing alerts to next execution if circuit breaker is hit
  • [job] [logs] FTR Configs #7 / Endpoint plugin @ess @serverless @skipInServerlessMKI Endpoint policy response api GET /api/endpoint/policy_response "before all" hook for "should return one policy response for an id"
  • [job] [logs] FTR Configs #7 / Endpoint plugin spaces support @ess @serverless @skipInServerlessMKI Endpoint management space awareness support "before all" hook in "@ess @serverless @skipInServerlessMKI Endpoint management space awareness support"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexManagement 698 696 -2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
indexManagement 699.6KB 698.1KB -1.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
indexManagement 47.6KB 47.6KB +26.0B

History

cc @mattkime

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 202251

Questions ?

Please refer to the Backport tool documentation

@mattkime
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

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 Dec 18, 2024
…lates (elastic#202251)

## Summary

Builds on elastic#201717

Part of elastic#178654

`manage_index_templates` cluster privilege determines access to
component index templates tab within index management.

(cherry picked from commit 1756918)

# Conflicts:
#	x-pack/platform/plugins/private/translations/translations/zh-CN.json
mattkime added a commit that referenced this pull request Dec 19, 2024
…x templates (#202251) (#204778)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[index management] Better privilege checking for component index
templates (#202251)](#202251)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2024-12-18T15:05:22Z","message":"[index
management] Better privilege checking for component index templates
(#202251)\n\n## Summary\r\n\r\nBuilds on
https://github.com/elastic/kibana/pull/201717\r\n\r\nPart of
https://github.com/elastic/kibana/issues/178654\r\n\r\n`manage_index_templates`
cluster privilege determines access to\r\ncomponent index templates tab
within index
management.","sha":"17569187b6992252eff68a7ba408dd8b88fd883d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Index
Management","Team:Kibana
Management","v9.0.0","backport:prev-minor"],"number":202251,"url":"https://github.com/elastic/kibana/pull/202251","mergeCommit":{"message":"[index
management] Better privilege checking for component index templates
(#202251)\n\n## Summary\r\n\r\nBuilds on
https://github.com/elastic/kibana/pull/201717\r\n\r\nPart of
https://github.com/elastic/kibana/issues/178654\r\n\r\n`manage_index_templates`
cluster privilege determines access to\r\ncomponent index templates tab
within index
management.","sha":"17569187b6992252eff68a7ba408dd8b88fd883d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202251","number":202251,"mergeCommit":{"message":"[index
management] Better privilege checking for component index templates
(#202251)\n\n## Summary\r\n\r\nBuilds on
https://github.com/elastic/kibana/pull/201717\r\n\r\nPart of
https://github.com/elastic/kibana/issues/178654\r\n\r\n`manage_index_templates`
cluster privilege determines access to\r\ncomponent index templates tab
within index
management.","sha":"17569187b6992252eff68a7ba408dd8b88fd883d"}}]}]
BACKPORT-->
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Dec 19, 2024
…lates (elastic#202251)

## Summary

Builds on elastic#201717

Part of elastic#178654

`manage_index_templates` cluster privilege determines access to
component index templates tab within index management.
benakansara pushed a commit to benakansara/kibana that referenced this pull request Jan 2, 2025
…lates (elastic#202251)

## Summary

Builds on elastic#201717

Part of elastic#178654

`manage_index_templates` cluster privilege determines access to
component index templates tab within index management.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Jan 13, 2025
…lates (elastic#202251)

## Summary

Builds on elastic#201717

Part of elastic#178654

`manage_index_templates` cluster privilege determines access to
component index templates tab within index management.
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
…lates (elastic#202251)

## Summary

Builds on elastic#201717

Part of elastic#178654

`manage_index_templates` cluster privilege determines access to
component index templates tab within index management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) Feature:Index Management Index and index templates UI release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants