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] Expandably flyout - Enable expandable flyout for generic events #176332

Merged
merged 7 commits into from
Feb 22, 2024

Conversation

christineweng
Copy link
Contributor

@christineweng christineweng commented Feb 6, 2024

Summary

This PR enables the overview tab and left section insights for a generic event. When user to go host or user page and expand details for an event, in addition to table and json tab, they now have access to:

  • Overview tab on the right section, which provide description of the event kind or event category (detail logic linked in comment), key insights such as highlighted fields, entities, prevalence and visualization previews (if available)
  • Expanded details that includes entities details and prevalence details

Many sections are shared by the alert details flyout, which we are hoping to provide a unified experience when user opens the details flyout.

When overview and expanded sections are enabled

  • Ideally event.kind and event.category should be ecs compliant, meaning the field values are of allowed_values within ecs definition.
  • If the field is not ecs compliant, and it does not fit the criteria to generate an event renderer, the overview tab and expanded sections are hidden

Variations depending on event kind

There is a variation of the about section depending on event.kind:

  • event.kind == 'event'
    • This is the most general and common event document, hence we provide details at the event.category level.
    • The title is also dynamic based on the category type (i.e if event.category is process, the process.name is displayed)
  • event.kind != 'event'
    • These are events that not as common/general as event so we are providing description at the event.kind level
    • The title matches the event.kind field
    • event.category is included as a list of categories present for the document
image

How to test

  • Enable feature flag expandableEventFlyoutEnabled
  • Generate some event data (the resolver generate data script is sufficient to the test main logic, to get the event renderer to show up, see comment on feeding additional data), alternatively, auditbeat and filebeat also feed event data.
  • Go to Explore -> Host -> Events table -> expand event details

Checklist

Delete any items that are not applicable to this PR.

@christineweng christineweng added backport:skip This commit does not require backporting Team:Threat Hunting Security Solution Threat Hunting Team release_note:feature Makes this part of the condensed release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.13.0 labels Feb 6, 2024
@christineweng christineweng self-assigned this Feb 6, 2024
@christineweng christineweng requested review from a team as code owners February 6, 2024 17:45
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@christineweng
Copy link
Contributor Author

more details on the criteria https://github.com/elastic/security-team/issues/7759

@christineweng christineweng requested a review from a team February 6, 2024 17:49
@christineweng christineweng force-pushed the event-flyout branch 2 times, most recently from 4ea7ea7 to 669801a Compare February 7, 2024 02:11
@christineweng
Copy link
Contributor Author

christineweng commented Feb 7, 2024

To test all the event renderer scenarios:

  1. Go to Dev Tool
  2. Set up an index called event-test and mapping: you can copy and paste the command in add_index.json and click run
  3. Add event data - event_test_data_bulk.json contains a bulk upload command that injects 16 events, each has its own event renderer.
  4. Go to Discover, create a dataview with the new index
  5. Go to Explore page -> Host, select the data view from step 4
  • The events are timestamped at 2/6/2024, if you don't see any events, try adjusting the time range or update the date before injecting data in step 3
  • event_test_data.json contains the events in json formatting if you want to modify/add one add a time. The _bulk API requires each event to be 1 line.
  • To read more about event renderers, go to timeline -> query tab, click on the setting icon
    image
    image

@christineweng christineweng added the ci:cloud-deploy Create or update a Cloud deployment label Feb 7, 2024
Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

This looks really good! I left a few comments. I feel like the biggest thing we need to iron out is related to UI.
It feels weird that we show the rule name for a signal event, but then show something different for other types...

@christineweng christineweng removed v8.13.0 ci:cloud-deploy Create or update a Cloud deployment labels Feb 13, 2024
@christineweng christineweng added release_note:enhancement 8.14 candidate and removed release_note:feature Makes this part of the condensed release notes labels Feb 14, 2024
@christineweng christineweng removed the request for review from a team February 15, 2024 16:55
Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

this is getting close, thanks for making all the changes!
I left a few more comments on the code and a UI question

Copy link
Contributor

@PhilippeOberti PhilippeOberti 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 making all the changes @christineweng the code looks awesome!!

@christineweng christineweng force-pushed the event-flyout branch 2 times, most recently from b991eb3 to de002ec Compare February 22, 2024 15:17
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 5004 5010 +6

Async chunks

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

id before after diff
securitySolution 11.6MB 13.0MB ⚠️ +1.4MB

Page load bundle

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

id before after diff
securitySolution 71.9KB 72.0KB +32.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @christineweng

@christineweng christineweng merged commit 250c427 into elastic:main Feb 22, 2024
35 checks passed
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…generic events (elastic#176332)

## Summary

This PR enables the overview tab and left section insights for a generic
event. When user to go `host` or `user` page and expand details for an
event, in addition to table and json tab, they now have access to:

- Overview tab on the right section, which provide description of the
event kind or event category (detail logic linked in comment), key
insights such as highlighted fields, entities, prevalence and
visualization previews (if available)
- Expanded details that includes entities details and prevalence details

Many sections are shared by the alert details flyout, which we are
hoping to provide a unified experience when user opens the details
flyout.

#### When overview and expanded sections are enabled ####
- Ideally `event.kind` and `event.category` should be ecs compliant,
meaning the field values are of `allowed_values` within [ecs
definition](https://www.elastic.co/guide/en/ecs/current/ecs-event.html).
- If the field is not ecs compliant, and it does not fit the criteria to
generate an event renderer, the overview tab and expanded sections are
hidden
 
#### Variations depending on event kind ####
There is a variation of the about section depending on `event.kind`:
- `event.kind == 'event'`
- This is the most general and common event document, hence we provide
details at the `event.category` level.
- The title is also dynamic based on the category type (i.e if
`event.category` is process, the `process.name` is displayed)
- `event.kind != 'event'`
- These are events that not as common/general as `event` so we are
providing description at the `event.kind` level
   - The title matches the `event.kind` field
- `event.category` is included as a list of categories present for the
document
<img width="1006" alt="image"
src="https://github.com/elastic/kibana/assets/18648970/bb540c62-4346-4dc6-8c11-3ad6cdd1e7c9">

#### How to test ####
- Enable feature flag `expandableEventFlyoutEnabled`
- Generate some event data (the resolver generate data script is
sufficient to the test main logic, to get the event renderer to show up,
see comment on feeding additional data), alternatively, auditbeat and
filebeat also feed event data.
- Go to Explore -> Host -> Events table -> expand event details

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [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
@michaelolo24 michaelolo24 added this to the 8.14 milestone Mar 7, 2024
@christineweng christineweng added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.14 candidate backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants