[SecuritySolution] Update API key permissions on refreshing data view API#215738
[SecuritySolution] Update API key permissions on refreshing data view API#215738machadoum merged 4 commits intoelastic:mainfrom
Conversation
x-pack/solutions/security/plugins/security_solution/server/types.ts
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-entity-analytics (Team:Entity Analytics) |
b4fe34c to
323e1ef
Compare
x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts
Outdated
Show resolved
Hide resolved
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
History
cc @machadoum |
tiansivive
left a comment
There was a problem hiding this comment.
desk tested. Seems good 🚀
|
Starting backport for target branches: 8.18, 8.x, 9.0 https://github.com/elastic/kibana/actions/runs/14080534750 |
… API (elastic#215738) Update the API key when entity store `apply_dataview_indices` is called. ## Summary This change allows the user to update the privileges the entity store data view refresh task uses. This will enable them to fix problems when the user that enabled the entity store doesn't have all data view indices privileges. This PR also improves some error messages that were hard to read. ### Context * `apply_dataview_indices`is an API that updates the entity store transform with the indices defined in the security solution data view. * There is a background task that calls `apply_dataview_indices` from time to time * The background task uses the API key to access the security solution data view indices. ### How to test it * Create a kibana instance with security data * Create a user that only has access the necessary access to the entity store indices * Enable the entity store with a the created user * Login with a superuser * Add a new index to the security solution data view, which the created user cannot access. * The task will fail because it uses the API key from the unprivileged user. * Call `apply_dataview_indices` with the superuser (`POST kbn:api/entity_store/engines/apply_dataview_indices`) * The request should succeed because it is using the superuser credentials * Add a new index to the security solution data view, which the created user cannot access. * The task should succeed because it is using the superuser API key ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit e201b94)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…a view API (#215738) (#216004) # Backport This will backport the following commits from `main` to `9.0`: - [[SecuritySolution] Update API key permissions on refreshing data view API (#215738)](#215738) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Pablo Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2025-03-26T10:03:45Z","message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team: SecuritySolution","Team:Entity Analytics","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[SecuritySolution] Update API key permissions on refreshing data view API","number":215738,"url":"https://github.com/elastic/kibana/pull/215738","mergeCommit":{"message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215738","number":215738,"mergeCommit":{"message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
… API (elastic#215738) Update the API key when entity store `apply_dataview_indices` is called. ## Summary This change allows the user to update the privileges the entity store data view refresh task uses. This will enable them to fix problems when the user that enabled the entity store doesn't have all data view indices privileges. This PR also improves some error messages that were hard to read. ### Context * `apply_dataview_indices`is an API that updates the entity store transform with the indices defined in the security solution data view. * There is a background task that calls `apply_dataview_indices` from time to time * The background task uses the API key to access the security solution data view indices. ### How to test it * Create a kibana instance with security data * Create a user that only has access the necessary access to the entity store indices * Enable the entity store with a the created user * Login with a superuser * Add a new index to the security solution data view, which the created user cannot access. * The task will fail because it uses the API key from the unprivileged user. * Call `apply_dataview_indices` with the superuser (`POST kbn:api/entity_store/engines/apply_dataview_indices`) * The request should succeed because it is using the superuser credentials * Add a new index to the security solution data view, which the created user cannot access. * The task should succeed because it is using the superuser API key ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit e201b94) # Conflicts: # x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts # x-pack/solutions/security/plugins/security_solution/server/types.ts
… API (elastic#215738) Update the API key when entity store `apply_dataview_indices` is called. ## Summary This change allows the user to update the privileges the entity store data view refresh task uses. This will enable them to fix problems when the user that enabled the entity store doesn't have all data view indices privileges. This PR also improves some error messages that were hard to read. ### Context * `apply_dataview_indices`is an API that updates the entity store transform with the indices defined in the security solution data view. * There is a background task that calls `apply_dataview_indices` from time to time * The background task uses the API key to access the security solution data view indices. ### How to test it * Create a kibana instance with security data * Create a user that only has access the necessary access to the entity store indices * Enable the entity store with a the created user * Login with a superuser * Add a new index to the security solution data view, which the created user cannot access. * The task will fail because it uses the API key from the unprivileged user. * Call `apply_dataview_indices` with the superuser (`POST kbn:api/entity_store/engines/apply_dataview_indices`) * The request should succeed because it is using the superuser credentials * Add a new index to the security solution data view, which the created user cannot access. * The task should succeed because it is using the superuser API key ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit e201b94) # Conflicts: # x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts # x-pack/solutions/security/plugins/security_solution/server/types.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ta view API (#215738) (#216058) # Backport This will backport the following commits from `main` to `8.18`: - [[SecuritySolution] Update API key permissions on refreshing data view API (#215738)](#215738) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Pablo Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2025-03-26T10:03:45Z","message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","Team: SecuritySolution","Team:Entity Analytics","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[SecuritySolution] Update API key permissions on refreshing data view API","number":215738,"url":"https://github.com/elastic/kibana/pull/215738","mergeCommit":{"message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/216004","number":216004,"state":"MERGED","mergeCommit":{"sha":"6c4126fd55ee8e00ecbb19054b1baddd2ff07903","message":"[9.0] [SecuritySolution] Update API key permissions on refreshing data view API (#215738) (#216004)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.0`:\n- [[SecuritySolution] Update API key permissions on refreshing data view\nAPI (#215738)](https://github.com/elastic/kibana/pull/215738)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215738","number":215738,"mergeCommit":{"message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…a view API (#215738) (#216057) # Backport This will backport the following commits from `main` to `8.x`: - [[SecuritySolution] Update API key permissions on refreshing data view API (#215738)](#215738) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Pablo Machado","email":"pablo.nevesmachado@elastic.co"},"sourceCommit":{"committedDate":"2025-03-26T10:03:45Z","message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","Team: SecuritySolution","Team:Entity Analytics","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[SecuritySolution] Update API key permissions on refreshing data view API","number":215738,"url":"https://github.com/elastic/kibana/pull/215738","mergeCommit":{"message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/216004","number":216004,"state":"MERGED","mergeCommit":{"sha":"6c4126fd55ee8e00ecbb19054b1baddd2ff07903","message":"[9.0] [SecuritySolution] Update API key permissions on refreshing data view API (#215738) (#216004)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.0`:\n- [[SecuritySolution] Update API key permissions on refreshing data view\nAPI (#215738)](https://github.com/elastic/kibana/pull/215738)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215738","number":215738,"mergeCommit":{"message":"[SecuritySolution] Update API key permissions on refreshing data view API (#215738)\n\nUpdate the API key when entity store `apply_dataview_indices` is called.\n\n## Summary\nThis change allows the user to update the privileges the entity store\ndata view refresh task uses. This will enable them to fix problems when\nthe user that enabled the entity store doesn't have all data view\nindices privileges.\n\nThis PR also improves some error messages that were hard to read.\n\n### Context\n* `apply_dataview_indices`is an API that updates the entity store\ntransform with the indices defined in the security solution data view.\n* There is a background task that calls `apply_dataview_indices` from\ntime to time\n* The background task uses the API key to access the security solution\ndata view indices.\n\n\n### How to test it\n* Create a kibana instance with security data\n* Create a user that only has access the necessary access to the entity\nstore indices\n* Enable the entity store with a the created user\n* Login with a superuser \n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task will fail because it uses the API key from the unprivileged\nuser.\n* Call `apply_dataview_indices` with the superuser (`POST\nkbn:api/entity_store/engines/apply_dataview_indices`)\n* The request should succeed because it is using the superuser\ncredentials\n* Add a new index to the security solution data view, which the created\nuser cannot access.\n* The task should succeed because it is using the superuser API key\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"e201b947be53e4e903ab1126592c3853f66108df"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
… API (elastic#215738) Update the API key when entity store `apply_dataview_indices` is called. ## Summary This change allows the user to update the privileges the entity store data view refresh task uses. This will enable them to fix problems when the user that enabled the entity store doesn't have all data view indices privileges. This PR also improves some error messages that were hard to read. ### Context * `apply_dataview_indices`is an API that updates the entity store transform with the indices defined in the security solution data view. * There is a background task that calls `apply_dataview_indices` from time to time * The background task uses the API key to access the security solution data view indices. ### How to test it * Create a kibana instance with security data * Create a user that only has access the necessary access to the entity store indices * Enable the entity store with a the created user * Login with a superuser * Add a new index to the security solution data view, which the created user cannot access. * The task will fail because it uses the API key from the unprivileged user. * Call `apply_dataview_indices` with the superuser (`POST kbn:api/entity_store/engines/apply_dataview_indices`) * The request should succeed because it is using the superuser credentials * Add a new index to the security solution data view, which the created user cannot access. * The task should succeed because it is using the superuser API key ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Update the API key when entity store
apply_dataview_indicesis called.Summary
This change allows the user to update the privileges the entity store data view refresh task uses. This will enable them to fix problems when the user that enabled the entity store doesn't have all data view indices privileges.
This PR also improves some error messages that were hard to read.
Context
apply_dataview_indicesis an API that updates the entity store transform with the indices defined in the security solution data view.apply_dataview_indicesfrom time to timeHow to test it
apply_dataview_indiceswith the superuser (POST kbn:api/entity_store/engines/apply_dataview_indices)Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:*label is applied per the guidelines