Tags: elastic/kibana
Tags
[8.17] [Dashboard] Fix controls being overwritten on navigation (#217596 ) Closes #208330 ## Summary Consider how we set `restoredRuntimeState` for controls in `initializeDashboard`: https://github.com/elastic/kibana/blob/ce91dea75c2bf8940f7767736656ed8a89f24470/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts#L439-L445 Now, consider the following scenario: 1. We have two dashboards - dashboard B has unsaved changes to its control group, and dashboard A does not 2. We start in dashboard B and, since it has unsaved control changes, `restoredRuntimeState[PANELS_CONTROL_GROUP_KEY]` (in `DashboardContainer`) is populated with these changes 3. We navigate to Dashboard A via the `navigateToDashboard` method, which calls `initializeDashboard` 4. In `initializeDashboard`, `overrideInput` does **not** have control group state for dashboard A (since it does not have unsaved control changes) - so, we skip calling `setRuntimeStateForChild` for dashboard A 5. This means that `DashboardContainer` still has `restoredRuntimeState[PANELS_CONTROL_GROUP_KEY]` equal to the changes from dashboard B, which results in Dashboard A's control group getting overwritten with `restoredRuntimeState[PANELS_CONTROL_GROUP_KEY]` 🔥 If we clear `restoredRuntimeState` in `navigateToDashboard`, this is no longer an issue - we will now start from a blank slate on navigation, which is the desired behaviour. **Before** https://github.com/user-attachments/assets/d04fa41f-2603-4b64-963d-b59c6be6fa14 **After** https://github.com/user-attachments/assets/ce42c204-4ed0-4c44-8c15-c2f49a60131b
No-op (#216037) This commit is an artifact no-op to test the emergency release process.
[9.0] [SecuritySolution] Add index privileges check to applyDataViewI… …ndices (#214803) (#215090) # Backport This will backport the following commits from `main` to `9.0`: - [[SecuritySolution] Add index privileges check to applyDataViewIndices (#214803)](#214803) <!--- 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-18T15:37:39Z","message":"[SecuritySolution] Add index privileges check to applyDataViewIndices (#214803)\n\n## Summary\n\nAdd a new privileges check before executing `applyDataViewIndices`.\n\nThis change impacts the API call `applyDataViewIndices` and the job. \n`applyDataViewIndices` updates the transforms. Executing without\nprivileges generates a silence error because the transform can't run.\n\nI also added some extra unit tests for `applyDataViewIndices`.\n\nRequired privileges\n['read', 'view_index_metadata'] for all security solution dataview +\nasset_criticality and risk_score indices.\n\n\n### How to test it\n1. **API call with unprivileged user scenario**\n* Enable the entity store with a superuser\n* Create an unprivileged user\n* Call `POST kbn:api/entity_store/engines/apply_dataview_indices`\n* It should return an error\n* Add the required privileges\n* It executes successfully\n\n2. **Task execution with an unprivileged user scenario**\n* Create a user and add privileges only for the required Entity Store\nindices\n* Login with the new user\n* Enable the entity store\n* Add a new index to the security data view (the new user shouldn't have\naccess to the new index)\n* Wait for 30min for the job to run, or update the [source\ncode](https://github.com/elastic/kibana/blob/8d0feb580f13cb1571beaf84a6d5763197211106/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/tasks/data_view_refresh/data_view_refresh_task.ts#L150)\nto make it run more often\n* The job execution should fail with an error message containing the new\nindex name.\n\n\n\n\n### Checklist\n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [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","sha":"6ab5523a28445a3015b2352c2c8c5153c195d697","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","backport:skip","v9.0.0","Team: SecuritySolution","Theme: entity_analytics","Feature:Entity Analytics","Team:Entity Analytics","v8.18.0","v9.1.0","v8.19.0"],"title":"[SecuritySolution] Add index privileges check to applyDataViewIndices","number":214803,"url":"https://github.com/elastic/kibana/pull/214803","mergeCommit":{"message":"[SecuritySolution] Add index privileges check to applyDataViewIndices (#214803)\n\n## Summary\n\nAdd a new privileges check before executing `applyDataViewIndices`.\n\nThis change impacts the API call `applyDataViewIndices` and the job. \n`applyDataViewIndices` updates the transforms. Executing without\nprivileges generates a silence error because the transform can't run.\n\nI also added some extra unit tests for `applyDataViewIndices`.\n\nRequired privileges\n['read', 'view_index_metadata'] for all security solution dataview +\nasset_criticality and risk_score indices.\n\n\n### How to test it\n1. **API call with unprivileged user scenario**\n* Enable the entity store with a superuser\n* Create an unprivileged user\n* Call `POST kbn:api/entity_store/engines/apply_dataview_indices`\n* It should return an error\n* Add the required privileges\n* It executes successfully\n\n2. **Task execution with an unprivileged user scenario**\n* Create a user and add privileges only for the required Entity Store\nindices\n* Login with the new user\n* Enable the entity store\n* Add a new index to the security data view (the new user shouldn't have\naccess to the new index)\n* Wait for 30min for the job to run, or update the [source\ncode](https://github.com/elastic/kibana/blob/8d0feb580f13cb1571beaf84a6d5763197211106/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/tasks/data_view_refresh/data_view_refresh_task.ts#L150)\nto make it run more often\n* The job execution should fail with an error message containing the new\nindex name.\n\n\n\n\n### Checklist\n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [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","sha":"6ab5523a28445a3015b2352c2c8c5153c195d697"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/215089","number":215089,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214803","number":214803,"mergeCommit":{"message":"[SecuritySolution] Add index privileges check to applyDataViewIndices (#214803)\n\n## Summary\n\nAdd a new privileges check before executing `applyDataViewIndices`.\n\nThis change impacts the API call `applyDataViewIndices` and the job. \n`applyDataViewIndices` updates the transforms. Executing without\nprivileges generates a silence error because the transform can't run.\n\nI also added some extra unit tests for `applyDataViewIndices`.\n\nRequired privileges\n['read', 'view_index_metadata'] for all security solution dataview +\nasset_criticality and risk_score indices.\n\n\n### How to test it\n1. **API call with unprivileged user scenario**\n* Enable the entity store with a superuser\n* Create an unprivileged user\n* Call `POST kbn:api/entity_store/engines/apply_dataview_indices`\n* It should return an error\n* Add the required privileges\n* It executes successfully\n\n2. **Task execution with an unprivileged user scenario**\n* Create a user and add privileges only for the required Entity Store\nindices\n* Login with the new user\n* Enable the entity store\n* Add a new index to the security data view (the new user shouldn't have\naccess to the new index)\n* Wait for 30min for the job to run, or update the [source\ncode](https://github.com/elastic/kibana/blob/8d0feb580f13cb1571beaf84a6d5763197211106/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/tasks/data_view_refresh/data_view_refresh_task.ts#L150)\nto make it run more often\n* The job execution should fail with an error message containing the new\nindex name.\n\n\n\n\n### Checklist\n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] [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","sha":"6ab5523a28445a3015b2352c2c8c5153c195d697"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/215088","number":215088,"state":"OPEN"}]}] BACKPORT-->
[8.17] [Custom threshold] Use createLazy instead of create when initi… …alizing searchSource (#213904) (#215208) # Backport This will backport the following commits from `main` to `8.17`: - [[Custom threshold] Use createLazy instead of create when initializing searchSource (#213904)](#213904) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maryam Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-03-19T16:23:26Z","message":"[Custom threshold] Use createLazy instead of create when initializing searchSource (#213904)\n\n## Summary\n\nIn this PR, we use a similar approach as was introduced in the ES Query\nrule in this [PR](#183694) for the\ncustom threshold rule to reduce the field_caps traffic using createLazy.\n(Thanks @mikecote for pointing this out!)\n\n||Screenshot|\n|---|---|\n|Create (796\nms)||\n|CreateLazy (321\nms)||\n\n### 🧪 How to test\n- Enable APM locally\n```\nelastic.apm.active: true\nelastic.apm.transactionSampleRate: 1.0\nelastic.apm.environment: username\n```\n- Create a custom threshold rule and check its execution in\n[traces](https://kibana-cloud-apm.elastic.dev/app/apm/traces?rangeFrom=now-15m&rangeTo=now)\nfiltered for your `username` as the environment. There should be one\nwith your rule name:\n<img\nsrc=\"https://github.com/user-attachments/assets/59274acc-3edf-4de7-8870-3b175af73523\"\nwidth=500 />\n \nThe timing for `_field_caps` would be more if you replace the\n`createLazy` with the `create` function.","sha":"cc9494ccb057414d1eea9e27c51308854e521f05","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","v8.18.1","v8.17.4"],"title":"[Custom threshold] Use createLazy instead of create when initializing searchSource","number":213904,"url":"https://github.com/elastic/kibana/pull/213904","mergeCommit":{"message":"[Custom threshold] Use createLazy instead of create when initializing searchSource (#213904)\n\n## Summary\n\nIn this PR, we use a similar approach as was introduced in the ES Query\nrule in this [PR](#183694) for the\ncustom threshold rule to reduce the field_caps traffic using createLazy.\n(Thanks @mikecote for pointing this out!)\n\n||Screenshot|\n|---|---|\n|Create (796\nms)||\n|CreateLazy (321\nms)||\n\n### 🧪 How to test\n- Enable APM locally\n```\nelastic.apm.active: true\nelastic.apm.transactionSampleRate: 1.0\nelastic.apm.environment: username\n```\n- Create a custom threshold rule and check its execution in\n[traces](https://kibana-cloud-apm.elastic.dev/app/apm/traces?rangeFrom=now-15m&rangeTo=now)\nfiltered for your `username` as the environment. There should be one\nwith your rule name:\n<img\nsrc=\"https://github.com/user-attachments/assets/59274acc-3edf-4de7-8870-3b175af73523\"\nwidth=500 />\n \nThe timing for `_field_caps` would be more if you replace the\n`createLazy` with the `create` function.","sha":"cc9494ccb057414d1eea9e27c51308854e521f05"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.x","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213904","number":213904,"mergeCommit":{"message":"[Custom threshold] Use createLazy instead of create when initializing searchSource (#213904)\n\n## Summary\n\nIn this PR, we use a similar approach as was introduced in the ES Query\nrule in this [PR](#183694) for the\ncustom threshold rule to reduce the field_caps traffic using createLazy.\n(Thanks @mikecote for pointing this out!)\n\n||Screenshot|\n|---|---|\n|Create (796\nms)||\n|CreateLazy (321\nms)||\n\n### 🧪 How to test\n- Enable APM locally\n```\nelastic.apm.active: true\nelastic.apm.transactionSampleRate: 1.0\nelastic.apm.environment: username\n```\n- Create a custom threshold rule and check its execution in\n[traces](https://kibana-cloud-apm.elastic.dev/app/apm/traces?rangeFrom=now-15m&rangeTo=now)\nfiltered for your `username` as the environment. There should be one\nwith your rule name:\n<img\nsrc=\"https://github.com/user-attachments/assets/59274acc-3edf-4de7-8870-3b175af73523\"\nwidth=500 />\n \nThe timing for `_field_caps` would be more if you replace the\n`createLazy` with the `create` function.","sha":"cc9494ccb057414d1eea9e27c51308854e521f05"}},{"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":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
PreviousNext