Skip to content

Commit 74420bf

Browse files
committed
Moved actor and target fields to be only part of security's alert
1 parent 21cc8f2 commit 74420bf

File tree

6 files changed

+46
-22
lines changed

6 files changed

+46
-22
lines changed

src/platform/packages/shared/kbn-alerts-as-data-utils/src/field_maps/alert_field_map.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99

1010
import {
11-
ACTOR_ENTITY_ID,
1211
ALERT_ACTION_GROUP,
1312
ALERT_CASE_IDS,
1413
ALERT_CONSECUTIVE_MATCHES,
@@ -53,18 +52,12 @@ import {
5352
RELATED_ENTITY,
5453
SPACE_IDS,
5554
TAGS,
56-
TARGET_ENTITY_ID,
5755
TIMESTAMP,
5856
VERSION,
5957
} from '@kbn/rule-data-utils';
6058
import type { MultiField } from './types';
6159

6260
export const alertFieldMap = {
63-
[ACTOR_ENTITY_ID]: {
64-
type: 'keyword',
65-
array: true,
66-
required: false,
67-
},
6861
[ALERT_ACTION_GROUP]: {
6962
type: 'keyword',
7063
array: false,
@@ -299,11 +292,6 @@ export const alertFieldMap = {
299292
array: true,
300293
required: false,
301294
},
302-
[TARGET_ENTITY_ID]: {
303-
type: 'keyword',
304-
array: true,
305-
required: false,
306-
},
307295
[TIMESTAMP]: {
308296
type: 'date',
309297
required: true,

src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import type { ValuesType } from 'utility-types';
1111

1212
const TIMESTAMP = '@timestamp' as const;
1313
const RELATED_ENTITY = 'related.entity';
14-
const ACTOR_ENTITY_ID = 'actor.entity.id';
15-
const TARGET_ENTITY_ID = 'target.entity.id';
1614

1715
// namespaces
1816
const KIBANA_NAMESPACE = 'kibana' as const;
@@ -147,7 +145,6 @@ const namespaces = {
147145
};
148146

149147
export const fields = {
150-
ACTOR_ENTITY_ID,
151148
ALERT_ACTION_GROUP,
152149
ALERT_CASE_IDS,
153150
ALERT_CONSECUTIVE_MATCHES,
@@ -188,7 +185,6 @@ export const fields = {
188185
ALERT_WORKFLOW_TAGS,
189186
RELATED_ENTITY,
190187
SPACE_IDS,
191-
TARGET_ENTITY_ID,
192188
TIMESTAMP,
193189
VERSION,
194190
};
@@ -200,7 +196,6 @@ export {
200196
KIBANA_NAMESPACE,
201197

202198
// fields
203-
ACTOR_ENTITY_ID,
204199
ALERT_ACTION_GROUP,
205200
ALERT_CASE_IDS,
206201
ALERT_CONSECUTIVE_MATCHES,
@@ -241,7 +236,6 @@ export {
241236
ALERT_WORKFLOW_TAGS,
242237
RELATED_ENTITY,
243238
SPACE_IDS,
244-
TARGET_ENTITY_ID,
245239
TIMESTAMP,
246240
VERSION,
247241
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import { alertsFieldMap8190 } from '../8.19.0';
9+
import { ACTOR_ENTITY_ID, TARGET_ENTITY_ID } from '../field_names';
10+
11+
export const alertsFieldMap920 = {
12+
...alertsFieldMap8190,
13+
/**
14+
* Part of audit logs fields that are now processed. These fields helps us present alerts and logs in a graphical way.
15+
* Both actor and target fields are a work in progress to become part of ECS.
16+
* Right now, these fields are only relevant for security's alerts and audit logs. Therefore, we add them here.
17+
*/
18+
[ACTOR_ENTITY_ID]: {
19+
type: 'keyword',
20+
array: true,
21+
required: false,
22+
},
23+
[TARGET_ENTITY_ID]: {
24+
type: 'keyword',
25+
array: true,
26+
required: false,
27+
},
28+
} as const;
29+
30+
export type AlertsFieldMap920 = typeof alertsFieldMap920;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
export type { AlertsFieldMap920 } from './alerts';
9+
export { alertsFieldMap920 } from './alerts';

x-pack/solutions/security/plugins/security_solution/common/field_maps/field_names.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ export const ALERT_RULE_TIMELINE_ID = `${ALERT_RULE_NAMESPACE}.timeline_id` as c
6565
export const ALERT_RULE_TIMELINE_TITLE = `${ALERT_RULE_NAMESPACE}.timeline_title` as const;
6666
export const ALERT_RULE_TIMESTAMP_OVERRIDE = `${ALERT_RULE_NAMESPACE}.timestamp_override` as const;
6767
export const ALERT_RULE_INDICES = `${ALERT_RULE_NAMESPACE}.indices` as const;
68+
69+
export const ACTOR_ENTITY_ID = 'actor.entity.id' as const;
70+
export const TARGET_ENTITY_ID = 'target.entity.id' as const;

x-pack/solutions/security/plugins/security_solution/common/field_maps/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* 2.0; you may not use this file except in compliance with the Elastic License
55
* 2.0.
66
*/
7-
import type { AlertsFieldMap8190 } from './8.19.0';
8-
import { alertsFieldMap8190 } from './8.19.0';
7+
import type { AlertsFieldMap920 } from './9.2.0';
8+
import { alertsFieldMap920 } from './9.2.0';
99
import type { RulesFieldMap } from './8.0.0/rules';
1010
import { rulesFieldMap } from './8.0.0/rules';
11-
export type { AlertsFieldMap8190 as AlertsFieldMap, RulesFieldMap };
12-
export { alertsFieldMap8190 as alertsFieldMap, rulesFieldMap };
11+
export type { AlertsFieldMap920 as AlertsFieldMap, RulesFieldMap };
12+
export { alertsFieldMap920 as alertsFieldMap, rulesFieldMap };

0 commit comments

Comments
 (0)