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

[8.x] [SecuritySolution] Add service enrichment to detection engine (#206582) #207708

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

machadoum
Copy link
Member

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…c#206582)

## Summary

* Add alert enrichment for `service.asset.criticality`,
`service.risk.calculated_level` and `service.risk.calculated_score_norm`
fields

* Add `Service Risk Level` and `Service Criticality` columns to the
alerts table

![Screenshot 2025-01-17 at 11 58
50](https://github.com/user-attachments/assets/0871dce3-338f-4123-a868-6d23b3a35763)

### How to test?
* Enable the flag `serviceEntityStoreEnabled `
* Start an empty kibana instance
* Add data using the document generator with the `yarn start
entity-store` command.
  * Add a seed when prompted
* Assign asset criticality for the service entity you are testing with
* Ensure the service entity you are testing with has a risk score.
  * You can run the engine from the Risk score page if needed.
* Add more data using the same seed
* Force the created rule to run so it generates new alerts
* Check if the alerts created for the new batch of data have the new
field populated.

### How does enrichment work?
When alerts are created, the current asset criticality and risk score
are fetched and merged into the alert document. These values won't get
updated if the risk score or asset changes.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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 888dd24)

# Conflicts:
#	x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.test.ts
#	x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.ts
@machadoum machadoum merged commit f9bed85 into elastic:8.x Jan 22, 2025
11 checks passed
@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 18.5MB 18.5MB +632.0B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants