-
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][Detection Alerts] Alert tagging (#157786)
- Loading branch information
Showing
78 changed files
with
2,073 additions
and
374 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
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
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
56 changes: 56 additions & 0 deletions
56
x-pack/plugins/security_solution/common/detection_engine/schemas/alerts/8.9.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,56 @@ | ||
/* | ||
* 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_WORKFLOW_TAGS } from '@kbn/rule-data-utils'; | ||
import type { AlertWithCommonFields800 } from '@kbn/rule-registry-plugin/common/schemas/8.0.0'; | ||
import type { | ||
Ancestor880, | ||
BaseFields880, | ||
EqlBuildingBlockFields880, | ||
EqlShellFields880, | ||
NewTermsFields880, | ||
} from '../8.8.0'; | ||
|
||
/* DO NOT MODIFY THIS SCHEMA TO ADD NEW FIELDS. These types represent the alerts that shipped in 8.9.0. | ||
Any changes to these types should be bug fixes so the types more accurately represent the alerts from 8.9.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 { Ancestor880 as Ancestor890 }; | ||
|
||
export interface BaseFields890 extends BaseFields880 { | ||
[ALERT_WORKFLOW_TAGS]: string[]; | ||
} | ||
|
||
export interface WrappedFields890<T extends BaseFields890> { | ||
_id: string; | ||
_index: string; | ||
_source: T; | ||
} | ||
|
||
export type GenericAlert890 = AlertWithCommonFields800<BaseFields890>; | ||
|
||
export type EqlShellFields890 = EqlShellFields880 & BaseFields890; | ||
|
||
export type EqlBuildingBlockFields890 = EqlBuildingBlockFields880 & BaseFields890; | ||
|
||
export type NewTermsFields890 = NewTermsFields880 & BaseFields890; | ||
|
||
export type NewTermsAlert890 = NewTermsFields880 & BaseFields890; | ||
|
||
export type EqlBuildingBlockAlert890 = AlertWithCommonFields800<EqlBuildingBlockFields880>; | ||
|
||
export type EqlShellAlert890 = AlertWithCommonFields800<EqlShellFields890>; | ||
|
||
export type DetectionAlert890 = | ||
| GenericAlert890 | ||
| EqlShellAlert890 | ||
| EqlBuildingBlockAlert890 | ||
| NewTermsAlert890; |
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
13 changes: 13 additions & 0 deletions
13
...s/security_solution/common/detection_engine/schemas/request/set_alert_tags_schema.mock.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,13 @@ | ||
/* | ||
* 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 { SetAlertTagsSchema } from './set_alert_tags_schema'; | ||
|
||
export const getSetAlertTagsRequestMock = ( | ||
tagsToAdd: string[] = [], | ||
tagsToRemove: string[] = [] | ||
): SetAlertTagsSchema => ({ tags: { tags_to_add: tagsToAdd, tags_to_remove: tagsToRemove } }); |
22 changes: 22 additions & 0 deletions
22
...lugins/security_solution/common/detection_engine/schemas/request/set_alert_tags_schema.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,22 @@ | ||
/* | ||
* 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 * as t from 'io-ts'; | ||
|
||
import { alert_tag_query, alert_tags } from '../common/schemas'; | ||
|
||
export const setAlertTagsSchema = t.intersection([ | ||
t.type({ | ||
tags: alert_tags, | ||
}), | ||
t.partial({ | ||
query: alert_tag_query, | ||
}), | ||
]); | ||
|
||
export type SetAlertTagsSchema = t.TypeOf<typeof setAlertTagsSchema>; | ||
export type SetAlertTagsSchemaDecoded = SetAlertTagsSchema; |
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,26 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
|
||
export const DUPLICATE = i18n.translate('xpack.securitySolution.defaultAlertTags.duplicate', { | ||
defaultMessage: 'Duplicate', | ||
}); | ||
|
||
export const FALSE_POSITIVE = i18n.translate( | ||
'xpack.securitySolution.defaultAlertTags.falsePositive', | ||
{ | ||
defaultMessage: 'False Positive', | ||
} | ||
); | ||
|
||
export const FURTHER_INVESTIGATION_REQUIRED = i18n.translate( | ||
'xpack.securitySolution.defaultAlertTags.furtherInvestigationRequired', | ||
{ | ||
defaultMessage: 'Further investigation required', | ||
} | ||
); |
Oops, something went wrong.