Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Cloud Security] Graph visualization and API (elastic#195307) (e…
…lastic#196015) # Backport This will backport the following commits from `main` to `8.x`: - [[Cloud Security] Graph visualization and API (elastic#195307)](elastic#195307) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kfir Peled","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-12T03:37:02Z","message":"[Cloud Security] Graph visualization and API (elastic#195307)\n\n## Summary\r\n\r\nThis PR adds:\r\n- Graph visualization component using `xyflow`, and layouts the graph\r\nusing `dagre`.\r\n- API that supports the graph visualization\r\n- API tests\r\n- Serverless API tests\r\n\r\n**List of open issues (will be tracked in a different ticket):**\r\n- Identify if `related.hosts`, `related.ip` and `related.user` are\r\nmapped before the query. (can be fixed by\r\nhttps://github.com/elastic/elasticsearch/issues/112912)\r\n- Update nodes rendering to match recent figma changes\r\n- Return 404 when feature is not enabled\r\n- Add keyboard accessibility\r\n- Resolve axe failures (run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n\r\n### How to test\r\n\r\nYou can view the graph using storybook's\r\n[playground](https://supreme-adventure-8qjmlp1.pages.github.io/graph-storybook/?path=/story/components-graph-components-dagree-layout-graph--graph-stacked-edge-cases).\r\n\r\nTo test this PR you can run\r\n\r\n```\r\nyarn storybook cloud_security_posture_packages\r\n```\r\n\r\nTo test the API you can use the mocked data\r\n\r\n```bash\r\nnode scripts/es_archiver load x-pack/test/cloud_security_posture_api/es_archives/logs_gcp_audit \\ \r\n--es-url http://elastic:changeme@localhost:9200 \\\r\n--kibana-url http://elastic:changeme@localhost:5601\r\n```\r\n\r\nAnd through dev tools:\r\n\r\n```\r\nPOST kbn:/internal/cloud_security_posture/graph?apiVersion=1\r\n{\r\n \"query\": {\r\n \"actorIds\": [\"[email protected]\"],\r\n \"eventIds\": [\"\"],\r\n \"start\": \"now-1y/y\",\r\n \"end\": \"now/d\"\r\n }\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n- [x] This renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"be0eadfb9fa08f0d73383884dc67bf2005b7daba","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"title":"[Cloud Security] Graph visualization and API","number":195307,"url":"https://github.com/elastic/kibana/pull/195307","mergeCommit":{"message":"[Cloud Security] Graph visualization and API (elastic#195307)\n\n## Summary\r\n\r\nThis PR adds:\r\n- Graph visualization component using `xyflow`, and layouts the graph\r\nusing `dagre`.\r\n- API that supports the graph visualization\r\n- API tests\r\n- Serverless API tests\r\n\r\n**List of open issues (will be tracked in a different ticket):**\r\n- Identify if `related.hosts`, `related.ip` and `related.user` are\r\nmapped before the query. (can be fixed by\r\nhttps://github.com/elastic/elasticsearch/issues/112912)\r\n- Update nodes rendering to match recent figma changes\r\n- Return 404 when feature is not enabled\r\n- Add keyboard accessibility\r\n- Resolve axe failures (run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n\r\n### How to test\r\n\r\nYou can view the graph using storybook's\r\n[playground](https://supreme-adventure-8qjmlp1.pages.github.io/graph-storybook/?path=/story/components-graph-components-dagree-layout-graph--graph-stacked-edge-cases).\r\n\r\nTo test this PR you can run\r\n\r\n```\r\nyarn storybook cloud_security_posture_packages\r\n```\r\n\r\nTo test the API you can use the mocked data\r\n\r\n```bash\r\nnode scripts/es_archiver load x-pack/test/cloud_security_posture_api/es_archives/logs_gcp_audit \\ \r\n--es-url http://elastic:changeme@localhost:9200 \\\r\n--kibana-url http://elastic:changeme@localhost:5601\r\n```\r\n\r\nAnd through dev tools:\r\n\r\n```\r\nPOST kbn:/internal/cloud_security_posture/graph?apiVersion=1\r\n{\r\n \"query\": {\r\n \"actorIds\": [\"[email protected]\"],\r\n \"eventIds\": [\"\"],\r\n \"start\": \"now-1y/y\",\r\n \"end\": \"now/d\"\r\n }\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n- [x] This renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"be0eadfb9fa08f0d73383884dc67bf2005b7daba"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195307","number":195307,"mergeCommit":{"message":"[Cloud Security] Graph visualization and API (elastic#195307)\n\n## Summary\r\n\r\nThis PR adds:\r\n- Graph visualization component using `xyflow`, and layouts the graph\r\nusing `dagre`.\r\n- API that supports the graph visualization\r\n- API tests\r\n- Serverless API tests\r\n\r\n**List of open issues (will be tracked in a different ticket):**\r\n- Identify if `related.hosts`, `related.ip` and `related.user` are\r\nmapped before the query. (can be fixed by\r\nhttps://github.com/elastic/elasticsearch/issues/112912)\r\n- Update nodes rendering to match recent figma changes\r\n- Return 404 when feature is not enabled\r\n- Add keyboard accessibility\r\n- Resolve axe failures (run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n\r\n### How to test\r\n\r\nYou can view the graph using storybook's\r\n[playground](https://supreme-adventure-8qjmlp1.pages.github.io/graph-storybook/?path=/story/components-graph-components-dagree-layout-graph--graph-stacked-edge-cases).\r\n\r\nTo test this PR you can run\r\n\r\n```\r\nyarn storybook cloud_security_posture_packages\r\n```\r\n\r\nTo test the API you can use the mocked data\r\n\r\n```bash\r\nnode scripts/es_archiver load x-pack/test/cloud_security_posture_api/es_archives/logs_gcp_audit \\ \r\n--es-url http://elastic:changeme@localhost:9200 \\\r\n--kibana-url http://elastic:changeme@localhost:5601\r\n```\r\n\r\nAnd through dev tools:\r\n\r\n```\r\nPOST kbn:/internal/cloud_security_posture/graph?apiVersion=1\r\n{\r\n \"query\": {\r\n \"actorIds\": [\"[email protected]\"],\r\n \"eventIds\": [\"\"],\r\n \"start\": \"now-1y/y\",\r\n \"end\": \"now/d\"\r\n }\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is usable by keyboard only (learn more\r\nabout [keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] Any UI touched in this PR does not create any new axe failures\r\n(run axe in browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n- [x] This renders correctly on smaller devices using a responsive\r\nlayout. (You can test this [in your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"be0eadfb9fa08f0d73383884dc67bf2005b7daba"}},{"url":"https://github.com/elastic/kibana/pull/196012","number":196012,"branch":"8.x","state":"OPEN"}]}] BACKPORT--> Co-authored-by: Kfir Peled <[email protected]>
- Loading branch information