-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[EDR Workflows] Endpoint Insights API #201521
[EDR Workflows] Endpoint Insights API #201521
Conversation
Adds an SecurityConfigurationInsightsService that is setup during security solution plugin initialization. The service setup installs the component templates, index template, and datastream used by the service.
…nto feature/endpoint-insights-api
Add create, update, and fetch methods for the SecurityWorkflowInsightsService.
… into feature/endpoint-insights-api
Add create, update, and fetch methods for the SecurityWorkflowInsightsService.
… into feature/endpoint-insights-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THI changes lgtm 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! 🚀 added some questions
x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.ts
Outdated
Show resolved
Hide resolved
.../server/assistant/tools/defend_insights/workflow_insights_builders/incompatible_antivirus.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
minLength: 1, | ||
validate: (id) => { | ||
if (id.trim() === '') { | ||
return `${field} can not be an empty string`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - should be cannot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
minLength: 1, | ||
validate: (id) => { | ||
if (id.trim() === '') { | ||
return 'insightId can not be an empty string'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - should be cannot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
}, | ||
}), | ||
}), | ||
body: schema.object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this hitting our internal API? Do you think it makes sense to enable accepting unknown
values too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t see the need for it at the moment
|
||
// ensure it waits for initialization first | ||
expect(isInitializedSpy).toHaveBeenCalledTimes(1); | ||
// updates the doc | ||
expect(esClient.update).toHaveBeenCalledTimes(1); | ||
expect(esClient.update).toHaveBeenCalledWith({ | ||
index: DATA_STREAM_NAME, | ||
index: indexName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this one different from DATA_STREAM_NAME that is still being used eg in line 213?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test on line 213 uses the data stream name, but the update method requires the name of the backing index, not the data stream itself.
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12164140572 |
💚 Build Succeeded
Metrics [docs]
History
|
### Summary This PR introduces two internal API routes: 1. `/internal/api/endpoint/workflow_isnights` 2. `/internal/api/endpoint/workflow_isnights/{insightId}` ### Details - The first route (`/internal/api/endpoint/workflow_isnights`) will be used with the `securityWorkflowInsightsService.fetch` method to retrieve stored insights. - The second route (`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with the `securityWorkflowInsightsService.update` method to update existing insights. --------- Co-authored-by: Joey F. Poon <[email protected]> (cherry picked from commit 065738b)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[EDR Workflows] Endpoint Insights API (#201521)](#201521) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Konrad Szwarc","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-04T16:31:54Z","message":"[EDR Workflows] Endpoint Insights API (#201521)\n\n### Summary\n\nThis PR introduces two internal API routes:\n\n1. `/internal/api/endpoint/workflow_isnights` \n2. `/internal/api/endpoint/workflow_isnights/{insightId}` \n\n### Details\n\n- The first route (`/internal/api/endpoint/workflow_isnights`) will be\nused with the `securityWorkflowInsightsService.fetch` method to retrieve\nstored insights.\n- The second route\n(`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with\nthe `securityWorkflowInsightsService.update` method to update existing\ninsights.\n\n---------\n\nCo-authored-by: Joey F. Poon <[email protected]>","sha":"065738bd110c4eb85c131f089d3b308d8b1dec6d","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:Defend Workflows","backport:prev-minor","v8.18.0"],"title":"[EDR Workflows] Endpoint Insights API","number":201521,"url":"https://github.com/elastic/kibana/pull/201521","mergeCommit":{"message":"[EDR Workflows] Endpoint Insights API (#201521)\n\n### Summary\n\nThis PR introduces two internal API routes:\n\n1. `/internal/api/endpoint/workflow_isnights` \n2. `/internal/api/endpoint/workflow_isnights/{insightId}` \n\n### Details\n\n- The first route (`/internal/api/endpoint/workflow_isnights`) will be\nused with the `securityWorkflowInsightsService.fetch` method to retrieve\nstored insights.\n- The second route\n(`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with\nthe `securityWorkflowInsightsService.update` method to update existing\ninsights.\n\n---------\n\nCo-authored-by: Joey F. Poon <[email protected]>","sha":"065738bd110c4eb85c131f089d3b308d8b1dec6d"}},"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/201521","number":201521,"mergeCommit":{"message":"[EDR Workflows] Endpoint Insights API (#201521)\n\n### Summary\n\nThis PR introduces two internal API routes:\n\n1. `/internal/api/endpoint/workflow_isnights` \n2. `/internal/api/endpoint/workflow_isnights/{insightId}` \n\n### Details\n\n- The first route (`/internal/api/endpoint/workflow_isnights`) will be\nused with the `securityWorkflowInsightsService.fetch` method to retrieve\nstored insights.\n- The second route\n(`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with\nthe `securityWorkflowInsightsService.update` method to update existing\ninsights.\n\n---------\n\nCo-authored-by: Joey F. Poon <[email protected]>","sha":"065738bd110c4eb85c131f089d3b308d8b1dec6d"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Konrad Szwarc <[email protected]>
### Summary This PR introduces two internal API routes: 1. `/internal/api/endpoint/workflow_isnights` 2. `/internal/api/endpoint/workflow_isnights/{insightId}` ### Details - The first route (`/internal/api/endpoint/workflow_isnights`) will be used with the `securityWorkflowInsightsService.fetch` method to retrieve stored insights. - The second route (`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with the `securityWorkflowInsightsService.update` method to update existing insights. --------- Co-authored-by: Joey F. Poon <[email protected]>
### Summary This PR introduces two internal API routes: 1. `/internal/api/endpoint/workflow_isnights` 2. `/internal/api/endpoint/workflow_isnights/{insightId}` ### Details - The first route (`/internal/api/endpoint/workflow_isnights`) will be used with the `securityWorkflowInsightsService.fetch` method to retrieve stored insights. - The second route (`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with the `securityWorkflowInsightsService.update` method to update existing insights. --------- Co-authored-by: Joey F. Poon <[email protected]>
### Summary This PR introduces two internal API routes: 1. `/internal/api/endpoint/workflow_isnights` 2. `/internal/api/endpoint/workflow_isnights/{insightId}` ### Details - The first route (`/internal/api/endpoint/workflow_isnights`) will be used with the `securityWorkflowInsightsService.fetch` method to retrieve stored insights. - The second route (`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with the `securityWorkflowInsightsService.update` method to update existing insights. --------- Co-authored-by: Joey F. Poon <[email protected]>
### Summary This PR introduces two internal API routes: 1. `/internal/api/endpoint/workflow_isnights` 2. `/internal/api/endpoint/workflow_isnights/{insightId}` ### Details - The first route (`/internal/api/endpoint/workflow_isnights`) will be used with the `securityWorkflowInsightsService.fetch` method to retrieve stored insights. - The second route (`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with the `securityWorkflowInsightsService.update` method to update existing insights. --------- Co-authored-by: Joey F. Poon <[email protected]>
### Summary This PR introduces two internal API routes: 1. `/internal/api/endpoint/workflow_isnights` 2. `/internal/api/endpoint/workflow_isnights/{insightId}` ### Details - The first route (`/internal/api/endpoint/workflow_isnights`) will be used with the `securityWorkflowInsightsService.fetch` method to retrieve stored insights. - The second route (`/internal/api/endpoint/workflow_isnights/{insightId}`) will work with the `securityWorkflowInsightsService.update` method to update existing insights. --------- Co-authored-by: Joey F. Poon <[email protected]>
Summary
This PR introduces two internal API routes:
/internal/api/endpoint/workflow_isnights
/internal/api/endpoint/workflow_isnights/{insightId}
Details
/internal/api/endpoint/workflow_isnights
) will be used with thesecurityWorkflowInsightsService.fetch
method to retrieve stored insights./internal/api/endpoint/workflow_isnights/{insightId}
) will work with thesecurityWorkflowInsightsService.update
method to update existing insights.