Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.14] [Security Solution] [Attack discovery] Fixes attack discovery …
…cache issues (#183005) (#183009) # Backport This will backport the following commits from `main` to `8.14`: - [[Security Solution] [Attack discovery] Fixes attack discovery cache issues (#183005)](#183005) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-05-09T05:01:49Z","message":"[Security Solution] [Attack discovery] Fixes attack discovery cache issues (#183005)\n\n## [Security Solution] [Attack discovery] Fixes attack discovery cache issues\r\n\r\n### Summary\r\n\r\nThis PR fixes an issue where cached attack discoveries (for the same connector) in session storage were available in the same browser when switching spaces.\r\n\r\n### Test setup\r\n\r\n- Configure at least two generative AI connectors (e.g. one OpenAI and one Claude (Sonnet))\r\n- Create another space to switch to during testing\r\n - Make sure the other space has alerts in the last 24 hours\r\n\r\n### Desk testing\r\n\r\n1. Clear the browser's local storage\r\n\r\n2. Close all open browser tabs connected to Kibana, to clear the browser's session storage\r\n\r\n3. Open the browser, and Navigate to Security > Attack discovery\r\n\r\n4. Select a connector\r\n\r\n5. Click `Generate`\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the current connector during loading (because it's the first run for the selected connector)\r\n- Attack discoveries are generated for the connector\r\n\r\n6. Once again, click `Generate`\r\n\r\n**Expected result**\r\n\r\n- A loading countdown is displayed for the current connector\r\n\r\n7. Click on the loading countdown's (i) icon\r\n\r\n**Expected result**\r\n\r\n- The tooltip displays the timing for the previous run\r\n- Attack discoveries are (once again) generated for the connector\r\n\r\n8. Select a different connector\r\n\r\n**Expected result**\r\n\r\n- The `Up to 20 alerts will be analyzed` empty state is displayed\r\n\r\n9. Click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the newly-selected connector during loading (because it's the first run for the newly-selected connector)\r\n- Attack discoveries are generated for the connector\r\n- The header displays the text `Generated a few seconds ago`\r\n\r\n10. Once again, select the first connector\r\n\r\n**Expected results**\r\n\r\n- The previous connector's results are displayed\r\n- The header displays the text `Generated: 3 minutes ago`\r\n\r\n11. Navigate to Security > Cases\r\n\r\n12. Navigate back to Security > Attack discovery\r\n\r\n**Expected results**\r\n\r\n- The previous connector's results are displayed\r\n- The header displays the text `Generated: 4 minutes ago`\r\n\r\n13. Once again, select the other connector\r\n\r\n**Expected results**\r\n\r\n- The other connector's results are displayed\r\n- The header displays the text `Generated: n minutes ago` that's different than the previously-selected connector\r\n\r\n14. Change to another space\r\n\r\n15. Navgiate to Security > Attack discovery\r\n\r\n16. Select a connector\r\n\r\n**Expected results**\r\n\r\n- The results from the other space (for the selected connector) are NOT displayed\r\n\r\n17. Once again, select the _other_ connector\r\n\r\n**Expected results**\r\n\r\n- Once again, the results from the other space (for the selected connector) are NOT displayed\r\n\r\n18. Click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the newly-selected connector during loading (because it's the first run for the newly-selected connector in this Space)\r\n- Attack discoveries are generated for the connector\r\n\r\n19. Once again, click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is displayed for the current connector\r\n- Attack discoveries are once again generated\r\n- The header displays the text `Generated a few seconds ago`\r\n\r\n20. Navigate back to the original space\r\n\r\n21. Navigate to Security > Attack discovery in the orignal space\r\n\r\n23. Re-select the previous connector\r\n\r\n**Expected results**\r\n\r\n- The (much older) attack discovery results from the original space are displayed","sha":"4f56501860cff6df09058921448ec0b46efe9441","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team: SecuritySolution","Team:Security Generative AI","v8.14.0","v8.15.0","Feature:Attack Discovery"],"title":"[Security Solution] [Attack discovery] Fixes attack discovery cache issues","number":183005,"url":"https://github.com/elastic/kibana/pull/183005","mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes attack discovery cache issues (#183005)\n\n## [Security Solution] [Attack discovery] Fixes attack discovery cache issues\r\n\r\n### Summary\r\n\r\nThis PR fixes an issue where cached attack discoveries (for the same connector) in session storage were available in the same browser when switching spaces.\r\n\r\n### Test setup\r\n\r\n- Configure at least two generative AI connectors (e.g. one OpenAI and one Claude (Sonnet))\r\n- Create another space to switch to during testing\r\n - Make sure the other space has alerts in the last 24 hours\r\n\r\n### Desk testing\r\n\r\n1. Clear the browser's local storage\r\n\r\n2. Close all open browser tabs connected to Kibana, to clear the browser's session storage\r\n\r\n3. Open the browser, and Navigate to Security > Attack discovery\r\n\r\n4. Select a connector\r\n\r\n5. Click `Generate`\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the current connector during loading (because it's the first run for the selected connector)\r\n- Attack discoveries are generated for the connector\r\n\r\n6. Once again, click `Generate`\r\n\r\n**Expected result**\r\n\r\n- A loading countdown is displayed for the current connector\r\n\r\n7. Click on the loading countdown's (i) icon\r\n\r\n**Expected result**\r\n\r\n- The tooltip displays the timing for the previous run\r\n- Attack discoveries are (once again) generated for the connector\r\n\r\n8. Select a different connector\r\n\r\n**Expected result**\r\n\r\n- The `Up to 20 alerts will be analyzed` empty state is displayed\r\n\r\n9. Click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the newly-selected connector during loading (because it's the first run for the newly-selected connector)\r\n- Attack discoveries are generated for the connector\r\n- The header displays the text `Generated a few seconds ago`\r\n\r\n10. Once again, select the first connector\r\n\r\n**Expected results**\r\n\r\n- The previous connector's results are displayed\r\n- The header displays the text `Generated: 3 minutes ago`\r\n\r\n11. Navigate to Security > Cases\r\n\r\n12. Navigate back to Security > Attack discovery\r\n\r\n**Expected results**\r\n\r\n- The previous connector's results are displayed\r\n- The header displays the text `Generated: 4 minutes ago`\r\n\r\n13. Once again, select the other connector\r\n\r\n**Expected results**\r\n\r\n- The other connector's results are displayed\r\n- The header displays the text `Generated: n minutes ago` that's different than the previously-selected connector\r\n\r\n14. Change to another space\r\n\r\n15. Navgiate to Security > Attack discovery\r\n\r\n16. Select a connector\r\n\r\n**Expected results**\r\n\r\n- The results from the other space (for the selected connector) are NOT displayed\r\n\r\n17. Once again, select the _other_ connector\r\n\r\n**Expected results**\r\n\r\n- Once again, the results from the other space (for the selected connector) are NOT displayed\r\n\r\n18. Click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the newly-selected connector during loading (because it's the first run for the newly-selected connector in this Space)\r\n- Attack discoveries are generated for the connector\r\n\r\n19. Once again, click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is displayed for the current connector\r\n- Attack discoveries are once again generated\r\n- The header displays the text `Generated a few seconds ago`\r\n\r\n20. Navigate back to the original space\r\n\r\n21. Navigate to Security > Attack discovery in the orignal space\r\n\r\n23. Re-select the previous connector\r\n\r\n**Expected results**\r\n\r\n- The (much older) attack discovery results from the original space are displayed","sha":"4f56501860cff6df09058921448ec0b46efe9441"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/183005","number":183005,"mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes attack discovery cache issues (#183005)\n\n## [Security Solution] [Attack discovery] Fixes attack discovery cache issues\r\n\r\n### Summary\r\n\r\nThis PR fixes an issue where cached attack discoveries (for the same connector) in session storage were available in the same browser when switching spaces.\r\n\r\n### Test setup\r\n\r\n- Configure at least two generative AI connectors (e.g. one OpenAI and one Claude (Sonnet))\r\n- Create another space to switch to during testing\r\n - Make sure the other space has alerts in the last 24 hours\r\n\r\n### Desk testing\r\n\r\n1. Clear the browser's local storage\r\n\r\n2. Close all open browser tabs connected to Kibana, to clear the browser's session storage\r\n\r\n3. Open the browser, and Navigate to Security > Attack discovery\r\n\r\n4. Select a connector\r\n\r\n5. Click `Generate`\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the current connector during loading (because it's the first run for the selected connector)\r\n- Attack discoveries are generated for the connector\r\n\r\n6. Once again, click `Generate`\r\n\r\n**Expected result**\r\n\r\n- A loading countdown is displayed for the current connector\r\n\r\n7. Click on the loading countdown's (i) icon\r\n\r\n**Expected result**\r\n\r\n- The tooltip displays the timing for the previous run\r\n- Attack discoveries are (once again) generated for the connector\r\n\r\n8. Select a different connector\r\n\r\n**Expected result**\r\n\r\n- The `Up to 20 alerts will be analyzed` empty state is displayed\r\n\r\n9. Click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the newly-selected connector during loading (because it's the first run for the newly-selected connector)\r\n- Attack discoveries are generated for the connector\r\n- The header displays the text `Generated a few seconds ago`\r\n\r\n10. Once again, select the first connector\r\n\r\n**Expected results**\r\n\r\n- The previous connector's results are displayed\r\n- The header displays the text `Generated: 3 minutes ago`\r\n\r\n11. Navigate to Security > Cases\r\n\r\n12. Navigate back to Security > Attack discovery\r\n\r\n**Expected results**\r\n\r\n- The previous connector's results are displayed\r\n- The header displays the text `Generated: 4 minutes ago`\r\n\r\n13. Once again, select the other connector\r\n\r\n**Expected results**\r\n\r\n- The other connector's results are displayed\r\n- The header displays the text `Generated: n minutes ago` that's different than the previously-selected connector\r\n\r\n14. Change to another space\r\n\r\n15. Navgiate to Security > Attack discovery\r\n\r\n16. Select a connector\r\n\r\n**Expected results**\r\n\r\n- The results from the other space (for the selected connector) are NOT displayed\r\n\r\n17. Once again, select the _other_ connector\r\n\r\n**Expected results**\r\n\r\n- Once again, the results from the other space (for the selected connector) are NOT displayed\r\n\r\n18. Click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is NOT displayed for the newly-selected connector during loading (because it's the first run for the newly-selected connector in this Space)\r\n- Attack discoveries are generated for the connector\r\n\r\n19. Once again, click the `Generate` button\r\n\r\n**Expected results**\r\n\r\n- A loading countdown is displayed for the current connector\r\n- Attack discoveries are once again generated\r\n- The header displays the text `Generated a few seconds ago`\r\n\r\n20. Navigate back to the original space\r\n\r\n21. Navigate to Security > Attack discovery in the orignal space\r\n\r\n23. Re-select the previous connector\r\n\r\n**Expected results**\r\n\r\n- The (much older) attack discovery results from the original space are displayed","sha":"4f56501860cff6df09058921448ec0b46efe9441"}}]}] BACKPORT--> Co-authored-by: Andrew Macri <[email protected]>
- Loading branch information