You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Cloud Security] Show related alert's when fetching CDR graph (elastic#224783)
## Summary
Closeselastic#221037 , shows alerts on the graph by querying both the logs and
the alerts indices
- [x] Graph API - new optional `indexPatterns` parameters to switch data
views (not in use in the UI atm). Defaults to
`.alerts-security.alerts-<spaceId>, logs-*`
- [x] Visualize loaded alerts that are identified with alerts in graph
preview and graph investigation
~Depends on elastic#224483
`actor` and `target` are not part of ECS yet. And to ease our
development process we wish to push forward with this feature in mind.
This feature supports both cases when alert's index mappings contains
definition for `actor` and `target`, and also when its not.
In this PR, we add mappings of `actor` and `target` to the es_archive of
the alerts. This way we are able to test the functionality of this
feature instead of being blocked by
elastic#224483.
<details>
<summary>Video 🎥 </summary>
https://github.com/user-attachments/assets/bcc86214-6e88-46f3-a990-300bbdc28125
</details>
<details>
<summary>Screenshots 📸 </summary>
**Before (ignore label alignments - screenshot is from a local
environment)**

**After (another event is identified with alert - marking it as such and
expands the _alert_ details)**

**Before network page - preview**

**After network page - preview identifies if event contains alert**

</details>
### How to test locally
1. Edit `kibana.dev.yml` and add:
```yml
uiSettings.overrides.securitySolution:enableGraphVisualization: true
```
2. Start elasticsearch and kibana locally
3. To add mock data run the following:
```bash
node scripts/es_archiver load x-pack/solutions/security/test/cloud_security_posture_functional/es_archives/logs_gcp_audit \
--es-url http://elastic:changeme@localhost:9200 \
--kibana-url http://elastic:changeme@localhost:5601
node scripts/es_archiver load x-pack/solutions/security/test/cloud_security_posture_functional/es_archives/security_alerts_modified_mappings \
--es-url http://elastic:changeme@localhost:9200 \
--kibana-url http://elastic:changeme@localhost:5601
```
3. Open `Alerts` page in kibana. Update the date-picker to include data
from a year ago. Then check one of the alerts details opening the
right-side flyout and find the "Graph preview" section in it.
4. Expand graph to show related alerts
5. Enable Asset Inventory in the `Inventory` page (if you don't see the
page enable the feature flag in the advanced settings)
6. Add entities mock data
```
node scripts/es_archiver load x-pack/solutions/security/test/cloud_security_posture_api/es_archives/entity_store \
--es-url http://elastic:changeme@localhost:9200 \
--kibana-url http://elastic:changeme@localhost:5601
```
7. Open `Alerts` page in kibana. Check that the graph shows the admin
entity with it's label
### Checklist
- [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/src/platform/packages/shared/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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] 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)
Copy file name to clipboardExpand all lines: x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx
0 commit comments