forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Execution type field (elastic#195884)
## Added new field - execution type for alerts Added new field only for security type alerts: `kibana.alert.rule.execution.type` - can be `manual` or `scheduled` Also, move intended timestamp settings from `create_persistence_rule_type_wrapper` to `build_alert` Also added those new field to Alert schema and types. https://github.com/user-attachments/assets/c5b021a6-4763-47ae-b46c-814a138be65a For tests: - tests all rule types with and without suppression: `kibana.alert.rule.execution.type` - should be `scheduled`, `kibana.alert.intended_timestamp` - should equal alert timestamp - tests all rules with and without suppression with manual run - `kibana.alert.rule.execution.type` - should be `manual`, `kibana.alert.intended_timestamp` - should equal date inside you manual rule run date range --------- Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
e89c9d5
commit 3d466a7
Showing
48 changed files
with
551 additions
and
47 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
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
40 changes: 40 additions & 0 deletions
40
...plugins/alerting/server/integration_tests/__snapshots__/alert_as_data_fields.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
57 changes: 57 additions & 0 deletions
57
x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.16.0/index.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,57 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { ALERT_RULE_EXECUTION_TYPE, ALERT_INTENDED_TIMESTAMP } from '@kbn/rule-data-utils'; | ||
import type { AlertWithCommonFields800 } from '@kbn/rule-registry-plugin/common/schemas/8.0.0'; | ||
import type { | ||
Ancestor8130, | ||
BaseFields8130, | ||
EqlBuildingBlockFields8130, | ||
EqlShellFields8130, | ||
NewTermsFields8130, | ||
} from '../8.13.0'; | ||
|
||
/* DO NOT MODIFY THIS SCHEMA TO ADD NEW FIELDS. These types represent the alerts that shipped in 8.12.0. | ||
Any changes to these types should be bug fixes so the types more accurately represent the alerts from 8.12.0. | ||
If you are adding new fields for a new release of Kibana, create a new sibling folder to this one | ||
for the version to be released and add the field(s) to the schema in that folder. | ||
Then, update `../index.ts` to import from the new folder that has the latest schemas, add the | ||
new schemas to the union of all alert schemas, and re-export the new schemas as the `*Latest` schemas. | ||
*/ | ||
|
||
export type { Ancestor8130 as Ancestor8160 }; | ||
|
||
export interface BaseFields8160 extends BaseFields8130 { | ||
[ALERT_RULE_EXECUTION_TYPE]: string; | ||
[ALERT_INTENDED_TIMESTAMP]: string; | ||
} | ||
|
||
export interface WrappedFields8160<T extends BaseFields8160> { | ||
_id: string; | ||
_index: string; | ||
_source: T; | ||
} | ||
|
||
export type GenericAlert8160 = AlertWithCommonFields800<BaseFields8160>; | ||
|
||
export type EqlShellFields8160 = EqlShellFields8130 & BaseFields8160; | ||
|
||
export type EqlBuildingBlockFields8160 = EqlBuildingBlockFields8130 & BaseFields8160; | ||
|
||
export type NewTermsFields8160 = NewTermsFields8130 & BaseFields8160; | ||
|
||
export type NewTermsAlert8160 = NewTermsFields8130 & BaseFields8160; | ||
|
||
export type EqlBuildingBlockAlert8160 = AlertWithCommonFields800<EqlBuildingBlockFields8130>; | ||
|
||
export type EqlShellAlert8160 = AlertWithCommonFields800<EqlShellFields8160>; | ||
|
||
export type DetectionAlert8160 = | ||
| GenericAlert8160 | ||
| EqlShellAlert8160 | ||
| EqlBuildingBlockAlert8160 | ||
| NewTermsAlert8160; |
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.