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

[Security Solution][Alerts Detail] - fix missing investigated alert id when fetching all alerts for the details panel alerts tab #206873

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

PhilippeOberti
Copy link
Contributor

@PhilippeOberti PhilippeOberti commented Jan 15, 2025

Summary

This PR fixes an issue in the session view detailed panel alerts tab when used in the expandable flyout.

As can seen in the screenshot below, when used in the alerts table, the detailed panel alerts tab renders the investigated alert if it is available.

Screenshot 2025-01-15 at 3 39 19 PM

But when rendered in the expandable flyout the investigated alert is not always rendered.

Screenshot 2025-01-15 at 3 38 56 PM

The issue came from a mistake done in this previous PR that aimed at extracting the session view detailed panel in the expandable flyout preview panel. Specifically this line where I hardcoded the investigatedAlertId to undefined. I believe this happened during early stage of the development where I just wanted to get things to run. Then when I made the investigatedAlertId available via the session view panel context, I forgot to come back and replace the undefined...

When looking at the network tab, I see 2 calls to the internal/session_view/alerts endpoint:

  • the first one made when opening the session view component the first time contains the investigatedAlertId value and returns more data
    Screenshot 2025-01-15 at 3 37 25 PM
    Screenshot 2025-01-15 at 3 37 36 PM
  • the same call made when navigating to the detailed panel alerts tab only has undefined and returns less data
    Screenshot 2025-01-15 at 3 37 29 PM
    Screenshot 2025-01-15 at 3 37 42 PM

How to test

  • make sure the securitySolution:enableVisualizationsInFlyout advanced settings is turned on

…d when fetching all alerts for the details panel alerts tab
@PhilippeOberti PhilippeOberti added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:Threat Hunting:Investigations Security Solution Investigations Team backport:version Backport to applied version labels v8.18.0 labels Jan 15, 2025
@PhilippeOberti PhilippeOberti requested a review from a team as a code owner January 15, 2025 21:50
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations)

Copy link
Contributor

@opauloh opauloh left a comment

Choose a reason for hiding this comment

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

LGTM!

@opauloh opauloh enabled auto-merge (squash) January 17, 2025 19:00
@opauloh opauloh disabled auto-merge January 17, 2025 19:00
@PhilippeOberti PhilippeOberti enabled auto-merge (squash) January 21, 2025 17:51
@PhilippeOberti PhilippeOberti merged commit 326a8d3 into elastic:main Jan 21, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 21.3MB 21.3MB -15.0B

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 21, 2025
…d when fetching all alerts for the details panel alerts tab (elastic#206873)

## Summary

This PR fixes an issue in the session view detailed panel alerts tab
when used in the expandable flyout.

As can seen in the screenshot below, when used in the alerts table, the
detailed panel alerts tab renders the investigated alert if it is
available.

![Screenshot 2025-01-15 at 3 39
19 PM](https://github.com/user-attachments/assets/56c52527-ec75-425b-8152-aa8f0581401b)

But when rendered in the expandable flyout the investigated alert is not
always rendered.

![Screenshot 2025-01-15 at 3 38
56 PM](https://github.com/user-attachments/assets/9e5256df-a022-48b9-a8ba-dbfb79a9e5ff)

The issue came from a mistake done in [this previous
PR](elastic#200270) that aimed at
extracting the session view detailed panel in the expandable flyout
preview panel. Specifically [this
line](https://github.com/elastic/kibana/pull/200270/files#diff-1f5a98dfb88e0067b1557ae15325887e48f561b35a0f99989360efea7f4aa6adR33)
where I hardcoded the `investigatedAlertId` to `undefined`. I believe
this happened during early stage of the development where I just wanted
to get things to run. Then when I made the `investigatedAlertId`
available via the session view panel context, I forgot to come back and
replace the `undefined`...

When looking at the network tab, I see 2 calls to the
`internal/session_view/alerts` endpoint:
- the first one made when opening the session view component the first
time contains the `investigatedAlertId` value and returns more data
![Screenshot 2025-01-15 at 3 37
25 PM](https://github.com/user-attachments/assets/a4c67afd-0c8c-4048-83b7-f19c621ff73f)
![Screenshot 2025-01-15 at 3 37
36 PM](https://github.com/user-attachments/assets/3efcbbaf-ca92-4c96-bda3-d44153f5cbbd)
- the same call made when navigating to the detailed panel alerts tab
only has `undefined` and returns less data
![Screenshot 2025-01-15 at 3 37
29 PM](https://github.com/user-attachments/assets/74409e70-67cc-4c3c-be17-32bf5d6ae10f)
![Screenshot 2025-01-15 at 3 37
42 PM](https://github.com/user-attachments/assets/34e2d631-5be2-4ebe-92f5-e07139f03a83)

### How to test

- make sure the `securitySolution:enableVisualizationsInFlyout` advanced
settings is turned on

Co-authored-by: Paulo Silva <[email protected]>
(cherry picked from commit 326a8d3)
@kibanamachine
Copy link
Contributor

💚 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

@PhilippeOberti PhilippeOberti deleted the session-view-alerts-tab branch January 21, 2025 21:33
kibanamachine added a commit that referenced this pull request Jan 21, 2025
…lert id when fetching all alerts for the details panel alerts tab (#206873) (#207430)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution][Alerts Detail] - fix missing investigated alert
id when fetching all alerts for the details panel alerts tab
(#206873)](#206873)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Philippe
Oberti","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-21T19:28:15Z","message":"[Security
Solution][Alerts Detail] - fix missing investigated alert id when
fetching all alerts for the details panel alerts tab (#206873)\n\n##
Summary\r\n\r\nThis PR fixes an issue in the session view detailed panel
alerts tab\r\nwhen used in the expandable flyout.\r\n\r\nAs can seen in
the screenshot below, when used in the alerts table, the\r\ndetailed
panel alerts tab renders the investigated alert if it
is\r\navailable.\r\n\r\n![Screenshot 2025-01-15 at 3
39\r\n19 PM](https://github.com/user-attachments/assets/56c52527-ec75-425b-8152-aa8f0581401b)\r\n\r\nBut
when rendered in the expandable flyout the investigated alert is
not\r\nalways rendered.\r\n\r\n![Screenshot 2025-01-15 at 3
38\r\n56 PM](https://github.com/user-attachments/assets/9e5256df-a022-48b9-a8ba-dbfb79a9e5ff)\r\n\r\nThe
issue came from a mistake done in [this
previous\r\nPR](#200270) that
aimed at\r\nextracting the session view detailed panel in the expandable
flyout\r\npreview panel. Specifically
[this\r\nline](https://github.com/elastic/kibana/pull/200270/files#diff-1f5a98dfb88e0067b1557ae15325887e48f561b35a0f99989360efea7f4aa6adR33)\r\nwhere
I hardcoded the `investigatedAlertId` to `undefined`. I believe\r\nthis
happened during early stage of the development where I just wanted\r\nto
get things to run. Then when I made the
`investigatedAlertId`\r\navailable via the session view panel context, I
forgot to come back and\r\nreplace the `undefined`...\r\n\r\nWhen
looking at the network tab, I see 2 calls to
the\r\n`internal/session_view/alerts` endpoint:\r\n- the first one made
when opening the session view component the first\r\ntime contains the
`investigatedAlertId` value and returns more data\r\n![Screenshot
2025-01-15 at 3
37\r\n25 PM](https://github.com/user-attachments/assets/a4c67afd-0c8c-4048-83b7-f19c621ff73f)\r\n![Screenshot
2025-01-15 at 3
37\r\n36 PM](https://github.com/user-attachments/assets/3efcbbaf-ca92-4c96-bda3-d44153f5cbbd)\r\n-
the same call made when navigating to the detailed panel alerts
tab\r\nonly has `undefined` and returns less data\r\n![Screenshot
2025-01-15 at 3
37\r\n29 PM](https://github.com/user-attachments/assets/74409e70-67cc-4c3c-be17-32bf5d6ae10f)\r\n![Screenshot
2025-01-15 at 3
37\r\n42 PM](https://github.com/user-attachments/assets/34e2d631-5be2-4ebe-92f5-e07139f03a83)\r\n
\r\n### How to test\r\n\r\n- make sure the
`securitySolution:enableVisualizationsInFlyout` advanced\r\nsettings is
turned on\r\n\r\nCo-authored-by: Paulo Silva
<[email protected]>","sha":"326a8d3f3b17d420f063cada2925828729186998","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","backport:version","v8.18.0"],"title":"[Security
Solution][Alerts Detail] - fix missing investigated alert id when
fetching all alerts for the details panel alerts
tab","number":206873,"url":"https://github.com/elastic/kibana/pull/206873","mergeCommit":{"message":"[Security
Solution][Alerts Detail] - fix missing investigated alert id when
fetching all alerts for the details panel alerts tab (#206873)\n\n##
Summary\r\n\r\nThis PR fixes an issue in the session view detailed panel
alerts tab\r\nwhen used in the expandable flyout.\r\n\r\nAs can seen in
the screenshot below, when used in the alerts table, the\r\ndetailed
panel alerts tab renders the investigated alert if it
is\r\navailable.\r\n\r\n![Screenshot 2025-01-15 at 3
39\r\n19 PM](https://github.com/user-attachments/assets/56c52527-ec75-425b-8152-aa8f0581401b)\r\n\r\nBut
when rendered in the expandable flyout the investigated alert is
not\r\nalways rendered.\r\n\r\n![Screenshot 2025-01-15 at 3
38\r\n56 PM](https://github.com/user-attachments/assets/9e5256df-a022-48b9-a8ba-dbfb79a9e5ff)\r\n\r\nThe
issue came from a mistake done in [this
previous\r\nPR](#200270) that
aimed at\r\nextracting the session view detailed panel in the expandable
flyout\r\npreview panel. Specifically
[this\r\nline](https://github.com/elastic/kibana/pull/200270/files#diff-1f5a98dfb88e0067b1557ae15325887e48f561b35a0f99989360efea7f4aa6adR33)\r\nwhere
I hardcoded the `investigatedAlertId` to `undefined`. I believe\r\nthis
happened during early stage of the development where I just wanted\r\nto
get things to run. Then when I made the
`investigatedAlertId`\r\navailable via the session view panel context, I
forgot to come back and\r\nreplace the `undefined`...\r\n\r\nWhen
looking at the network tab, I see 2 calls to
the\r\n`internal/session_view/alerts` endpoint:\r\n- the first one made
when opening the session view component the first\r\ntime contains the
`investigatedAlertId` value and returns more data\r\n![Screenshot
2025-01-15 at 3
37\r\n25 PM](https://github.com/user-attachments/assets/a4c67afd-0c8c-4048-83b7-f19c621ff73f)\r\n![Screenshot
2025-01-15 at 3
37\r\n36 PM](https://github.com/user-attachments/assets/3efcbbaf-ca92-4c96-bda3-d44153f5cbbd)\r\n-
the same call made when navigating to the detailed panel alerts
tab\r\nonly has `undefined` and returns less data\r\n![Screenshot
2025-01-15 at 3
37\r\n29 PM](https://github.com/user-attachments/assets/74409e70-67cc-4c3c-be17-32bf5d6ae10f)\r\n![Screenshot
2025-01-15 at 3
37\r\n42 PM](https://github.com/user-attachments/assets/34e2d631-5be2-4ebe-92f5-e07139f03a83)\r\n
\r\n### How to test\r\n\r\n- make sure the
`securitySolution:enableVisualizationsInFlyout` advanced\r\nsettings is
turned on\r\n\r\nCo-authored-by: Paulo Silva
<[email protected]>","sha":"326a8d3f3b17d420f063cada2925828729186998"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/206873","number":206873,"mergeCommit":{"message":"[Security
Solution][Alerts Detail] - fix missing investigated alert id when
fetching all alerts for the details panel alerts tab (#206873)\n\n##
Summary\r\n\r\nThis PR fixes an issue in the session view detailed panel
alerts tab\r\nwhen used in the expandable flyout.\r\n\r\nAs can seen in
the screenshot below, when used in the alerts table, the\r\ndetailed
panel alerts tab renders the investigated alert if it
is\r\navailable.\r\n\r\n![Screenshot 2025-01-15 at 3
39\r\n19 PM](https://github.com/user-attachments/assets/56c52527-ec75-425b-8152-aa8f0581401b)\r\n\r\nBut
when rendered in the expandable flyout the investigated alert is
not\r\nalways rendered.\r\n\r\n![Screenshot 2025-01-15 at 3
38\r\n56 PM](https://github.com/user-attachments/assets/9e5256df-a022-48b9-a8ba-dbfb79a9e5ff)\r\n\r\nThe
issue came from a mistake done in [this
previous\r\nPR](#200270) that
aimed at\r\nextracting the session view detailed panel in the expandable
flyout\r\npreview panel. Specifically
[this\r\nline](https://github.com/elastic/kibana/pull/200270/files#diff-1f5a98dfb88e0067b1557ae15325887e48f561b35a0f99989360efea7f4aa6adR33)\r\nwhere
I hardcoded the `investigatedAlertId` to `undefined`. I believe\r\nthis
happened during early stage of the development where I just wanted\r\nto
get things to run. Then when I made the
`investigatedAlertId`\r\navailable via the session view panel context, I
forgot to come back and\r\nreplace the `undefined`...\r\n\r\nWhen
looking at the network tab, I see 2 calls to
the\r\n`internal/session_view/alerts` endpoint:\r\n- the first one made
when opening the session view component the first\r\ntime contains the
`investigatedAlertId` value and returns more data\r\n![Screenshot
2025-01-15 at 3
37\r\n25 PM](https://github.com/user-attachments/assets/a4c67afd-0c8c-4048-83b7-f19c621ff73f)\r\n![Screenshot
2025-01-15 at 3
37\r\n36 PM](https://github.com/user-attachments/assets/3efcbbaf-ca92-4c96-bda3-d44153f5cbbd)\r\n-
the same call made when navigating to the detailed panel alerts
tab\r\nonly has `undefined` and returns less data\r\n![Screenshot
2025-01-15 at 3
37\r\n29 PM](https://github.com/user-attachments/assets/74409e70-67cc-4c3c-be17-32bf5d6ae10f)\r\n![Screenshot
2025-01-15 at 3
37\r\n42 PM](https://github.com/user-attachments/assets/34e2d631-5be2-4ebe-92f5-e07139f03a83)\r\n
\r\n### How to test\r\n\r\n- make sure the
`securitySolution:enableVisualizationsInFlyout` advanced\r\nsettings is
turned on\r\n\r\nCo-authored-by: Paulo Silva
<[email protected]>","sha":"326a8d3f3b17d420f063cada2925828729186998"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Philippe Oberti <[email protected]>
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
…d when fetching all alerts for the details panel alerts tab (elastic#206873)

## Summary

This PR fixes an issue in the session view detailed panel alerts tab
when used in the expandable flyout.

As can seen in the screenshot below, when used in the alerts table, the
detailed panel alerts tab renders the investigated alert if it is
available.

![Screenshot 2025-01-15 at 3 39
19 PM](https://github.com/user-attachments/assets/56c52527-ec75-425b-8152-aa8f0581401b)

But when rendered in the expandable flyout the investigated alert is not
always rendered.

![Screenshot 2025-01-15 at 3 38
56 PM](https://github.com/user-attachments/assets/9e5256df-a022-48b9-a8ba-dbfb79a9e5ff)

The issue came from a mistake done in [this previous
PR](elastic#200270) that aimed at
extracting the session view detailed panel in the expandable flyout
preview panel. Specifically [this
line](https://github.com/elastic/kibana/pull/200270/files#diff-1f5a98dfb88e0067b1557ae15325887e48f561b35a0f99989360efea7f4aa6adR33)
where I hardcoded the `investigatedAlertId` to `undefined`. I believe
this happened during early stage of the development where I just wanted
to get things to run. Then when I made the `investigatedAlertId`
available via the session view panel context, I forgot to come back and
replace the `undefined`...

When looking at the network tab, I see 2 calls to the
`internal/session_view/alerts` endpoint:
- the first one made when opening the session view component the first
time contains the `investigatedAlertId` value and returns more data
![Screenshot 2025-01-15 at 3 37
25 PM](https://github.com/user-attachments/assets/a4c67afd-0c8c-4048-83b7-f19c621ff73f)
![Screenshot 2025-01-15 at 3 37
36 PM](https://github.com/user-attachments/assets/3efcbbaf-ca92-4c96-bda3-d44153f5cbbd)
- the same call made when navigating to the detailed panel alerts tab
only has `undefined` and returns less data
![Screenshot 2025-01-15 at 3 37
29 PM](https://github.com/user-attachments/assets/74409e70-67cc-4c3c-be17-32bf5d6ae10f)
![Screenshot 2025-01-15 at 3 37
42 PM](https://github.com/user-attachments/assets/34e2d631-5be2-4ebe-92f5-e07139f03a83)
 
### How to test

- make sure the `securitySolution:enableVisualizationsInFlyout` advanced
settings is turned on

Co-authored-by: Paulo Silva <[email protected]>
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 release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants