-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Detections] Add alert source to detection rule ac…
…tion context (#85488) (#85910) * Adds context.alerts as available parameter for detection rule actions Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
d3ce8ae
commit 4b57ac5
Showing
21 changed files
with
273 additions
and
104 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
43 changes: 43 additions & 0 deletions
43
x-pack/plugins/security_solution/server/lib/detection_engine/notifications/get_signals.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { AlertServices } from '../../../../../alerts/server'; | ||
import { SignalSearchResponse } from '../signals/types'; | ||
import { buildSignalsSearchQuery } from './build_signals_query'; | ||
|
||
interface GetSignalsParams { | ||
from?: string; | ||
to?: string; | ||
size?: number; | ||
ruleId: string; | ||
index: string; | ||
callCluster: AlertServices['callCluster']; | ||
} | ||
|
||
export const getSignals = async ({ | ||
from, | ||
to, | ||
size, | ||
ruleId, | ||
index, | ||
callCluster, | ||
}: GetSignalsParams): Promise<SignalSearchResponse> => { | ||
if (from == null || to == null) { | ||
throw Error('"from" or "to" was not provided to signals query'); | ||
} | ||
|
||
const query = buildSignalsSearchQuery({ | ||
index, | ||
ruleId, | ||
to, | ||
from, | ||
size, | ||
}); | ||
|
||
const result: SignalSearchResponse = await callCluster('search', query); | ||
|
||
return result; | ||
}; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.