[Security Solution][Attacks/Alerts][Setup and miscellaneous] Unified Alerts: Hooks to work with the new endpoints (#247387)#247389
Merged
e40pud merged 4 commits intoelastic:mainfrom Dec 24, 2025
Conversation
…Alerts: Hooks to work with the new endpoints (elastic#247387)
Contributor
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Contributor
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
Contributor
|
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Unknown metric groupsESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
cc @e40pud |
PhilippeOberti
approved these changes
Dec 23, 2025
Contributor
PhilippeOberti
left a comment
There was a problem hiding this comment.
Nice work! I like to see the all the error will show up in a toast!
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this pull request
Jan 6, 2026
…Alerts: Hooks to work with the new endpoints (elastic#247387) (elastic#247389) ## Summary Closes elastic#247387 This PR implements public-side logic to interact with the unified alerts management endpoints created in as part of this [ticket](elastic#247065) in this [PR](elastic#247068). It provides React Query hooks and API wrappers that enable the frontend to perform bulk operations (search, tag updates, assignee updates, and workflow status changes) on both detection alerts and attack alerts through a unified interface. ## Motivation The new **Attacks page** requires a unified way to manage different types of alerts (detection engine alerts and attack discovery alerts) in a single view. This PR provides the frontend infrastructure needed to interact with the backend unified alerts endpoints, enabling consistent user experience across alert management operations. ## Implementation Details ### API Layer (`api/index.ts`) - **`searchUnifiedAlerts`**: Wraps `POST /internal/detection_engine/unified_alerts/search` endpoint for searching unified alerts - **`setUnifiedAlertsWorkflowStatus`**: Wraps `POST /internal/detection_engine/unified_alerts/workflow_status` endpoint - **`setUnifiedAlertsTags`**: Wraps `POST /internal/detection_engine/unified_alerts/tags` endpoint - **`setUnifiedAlertsAssignees`**: Wraps `POST /internal/detection_engine/unified_alerts/assignees` endpoint ### React Query Hooks #### Query Hook - **`useSearchUnifiedAlerts`**: React Query hook for searching unified alerts - Accepts `SearchUnifiedAlertsRequestBody` as parameter - Provides automatic caching, error handling, and loading states - Includes cache invalidation support via `useInvalidateSearchUnifiedAlerts` #### Mutation Hooks - **`useSetUnifiedAlertsWorkflowStatus`**: Mutation hook for updating workflow status - **`useSetUnifiedAlertsTags`**: Mutation hook for adding/removing tags - **`useSetUnifiedAlertsAssignees`**: Mutation hook for adding/removing assignees ## File Structure ``` x-pack/solutions/security/plugins/security_solution/public/common/containers/unified_alerts/ ├── __mocks__/ │ ├── index.ts │ ├── unified_alerts.ts │ └── update_responses.ts ├── api/ │ ├── index.ts │ └── index.test.ts ├── hooks/ │ ├── constants.ts │ ├── translations.ts │ ├── use_search_unified_alerts.ts │ ├── use_search_unified_alerts.test.tsx │ ├── use_set_unified_alerts_workflow_status.ts │ ├── use_set_unified_alerts_workflow_status.test.tsx │ ├── use_set_unified_alerts_tags.ts │ ├── use_set_unified_alerts_tags.test.tsx │ ├── use_set_unified_alerts_assignees.ts │ └── use_set_unified_alerts_assignees.test.tsx └── index.ts ``` ## Testing Instructions 1. Run unit tests: ```bash yarn test:jest x-pack/solutions/security/plugins/security_solution/public/common/containers/unified_alerts ``` 2. Verify all tests pass (13 tests across 5 test suites)
dej611
pushed a commit
to dej611/kibana
that referenced
this pull request
Jan 8, 2026
…Alerts: Hooks to work with the new endpoints (elastic#247387) (elastic#247389) ## Summary Closes elastic#247387 This PR implements public-side logic to interact with the unified alerts management endpoints created in as part of this [ticket](elastic#247065) in this [PR](elastic#247068). It provides React Query hooks and API wrappers that enable the frontend to perform bulk operations (search, tag updates, assignee updates, and workflow status changes) on both detection alerts and attack alerts through a unified interface. ## Motivation The new **Attacks page** requires a unified way to manage different types of alerts (detection engine alerts and attack discovery alerts) in a single view. This PR provides the frontend infrastructure needed to interact with the backend unified alerts endpoints, enabling consistent user experience across alert management operations. ## Implementation Details ### API Layer (`api/index.ts`) - **`searchUnifiedAlerts`**: Wraps `POST /internal/detection_engine/unified_alerts/search` endpoint for searching unified alerts - **`setUnifiedAlertsWorkflowStatus`**: Wraps `POST /internal/detection_engine/unified_alerts/workflow_status` endpoint - **`setUnifiedAlertsTags`**: Wraps `POST /internal/detection_engine/unified_alerts/tags` endpoint - **`setUnifiedAlertsAssignees`**: Wraps `POST /internal/detection_engine/unified_alerts/assignees` endpoint ### React Query Hooks #### Query Hook - **`useSearchUnifiedAlerts`**: React Query hook for searching unified alerts - Accepts `SearchUnifiedAlertsRequestBody` as parameter - Provides automatic caching, error handling, and loading states - Includes cache invalidation support via `useInvalidateSearchUnifiedAlerts` #### Mutation Hooks - **`useSetUnifiedAlertsWorkflowStatus`**: Mutation hook for updating workflow status - **`useSetUnifiedAlertsTags`**: Mutation hook for adding/removing tags - **`useSetUnifiedAlertsAssignees`**: Mutation hook for adding/removing assignees ## File Structure ``` x-pack/solutions/security/plugins/security_solution/public/common/containers/unified_alerts/ ├── __mocks__/ │ ├── index.ts │ ├── unified_alerts.ts │ └── update_responses.ts ├── api/ │ ├── index.ts │ └── index.test.ts ├── hooks/ │ ├── constants.ts │ ├── translations.ts │ ├── use_search_unified_alerts.ts │ ├── use_search_unified_alerts.test.tsx │ ├── use_set_unified_alerts_workflow_status.ts │ ├── use_set_unified_alerts_workflow_status.test.tsx │ ├── use_set_unified_alerts_tags.ts │ ├── use_set_unified_alerts_tags.test.tsx │ ├── use_set_unified_alerts_assignees.ts │ └── use_set_unified_alerts_assignees.test.tsx └── index.ts ``` ## Testing Instructions 1. Run unit tests: ```bash yarn test:jest x-pack/solutions/security/plugins/security_solution/public/common/containers/unified_alerts ``` 2. Verify all tests pass (13 tests across 5 test suites)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #247387
This PR implements public-side logic to interact with the unified alerts management endpoints created in as part of this ticket in this PR. It provides React Query hooks and API wrappers that enable the frontend to perform bulk operations (search, tag updates, assignee updates, and workflow status changes) on both detection alerts and attack alerts through a unified interface.
Motivation
The new Attacks page requires a unified way to manage different types of alerts (detection engine alerts and attack discovery alerts) in a single view. This PR provides the frontend infrastructure needed to interact with the backend unified alerts endpoints, enabling consistent user experience across alert management operations.
Implementation Details
API Layer (
api/index.ts)searchUnifiedAlerts: WrapsPOST /internal/detection_engine/unified_alerts/searchendpoint for searching unified alertssetUnifiedAlertsWorkflowStatus: WrapsPOST /internal/detection_engine/unified_alerts/workflow_statusendpointsetUnifiedAlertsTags: WrapsPOST /internal/detection_engine/unified_alerts/tagsendpointsetUnifiedAlertsAssignees: WrapsPOST /internal/detection_engine/unified_alerts/assigneesendpointReact Query Hooks
Query Hook
useSearchUnifiedAlerts: React Query hook for searching unified alertsSearchUnifiedAlertsRequestBodyas parameteruseInvalidateSearchUnifiedAlertsMutation Hooks
useSetUnifiedAlertsWorkflowStatus: Mutation hook for updating workflow statususeSetUnifiedAlertsTags: Mutation hook for adding/removing tagsuseSetUnifiedAlertsAssignees: Mutation hook for adding/removing assigneesFile Structure
Testing Instructions
Run unit tests:
Verify all tests pass (13 tests across 5 test suites)