Skip to content

Commit ffc9f2b

Browse files
committed
Moved related.entity to security's alerts only
1 parent 1ef6253 commit ffc9f2b

File tree

8 files changed

+28
-48
lines changed

8 files changed

+28
-48
lines changed

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@
1010
import {
1111
ALERT_ACTION_GROUP,
1212
ALERT_CASE_IDS,
13-
ALERT_CONSECUTIVE_MATCHES,
1413
ALERT_DURATION,
1514
ALERT_END,
16-
ALERT_FLAPPING_HISTORY,
1715
ALERT_FLAPPING,
18-
ALERT_INSTANCE_ID,
19-
ALERT_INTENDED_TIMESTAMP,
20-
ALERT_LAST_DETECTED,
16+
ALERT_FLAPPING_HISTORY,
2117
ALERT_MAINTENANCE_WINDOW_IDS,
18+
ALERT_CONSECUTIVE_MATCHES,
2219
ALERT_PENDING_RECOVERED_COUNT,
20+
ALERT_INSTANCE_ID,
21+
ALERT_LAST_DETECTED,
2322
ALERT_PREVIOUS_ACTION_GROUP,
2423
ALERT_REASON,
2524
ALERT_RULE_CATEGORY,
@@ -46,14 +45,14 @@ import {
4645
ALERT_WORKFLOW_ASSIGNEE_IDS,
4746
ALERT_WORKFLOW_STATUS,
4847
ALERT_WORKFLOW_TAGS,
48+
SPACE_IDS,
49+
TIMESTAMP,
50+
VERSION,
4951
EVENT_ACTION,
5052
EVENT_KIND,
5153
EVENT_ORIGINAL,
52-
RELATED_ENTITY,
53-
SPACE_IDS,
5454
TAGS,
55-
TIMESTAMP,
56-
VERSION,
55+
ALERT_INTENDED_TIMESTAMP,
5756
} from '@kbn/rule-data-utils';
5857
import type { MultiField } from './types';
5958

@@ -277,11 +276,6 @@ export const alertFieldMap = {
277276
required: false,
278277
ignore_above: 1024,
279278
},
280-
[RELATED_ENTITY]: {
281-
type: 'keyword',
282-
array: true,
283-
required: false,
284-
},
285279
[SPACE_IDS]: {
286280
type: 'keyword',
287281
array: true,

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import type { ValuesType } from 'utility-types';
1111

1212
const TIMESTAMP = '@timestamp' as const;
13-
const RELATED_ENTITY = 'related.entity';
1413

1514
// namespaces
1615
const KIBANA_NAMESPACE = 'kibana' as const;
@@ -147,22 +146,22 @@ const namespaces = {
147146
export const fields = {
148147
ALERT_ACTION_GROUP,
149148
ALERT_CASE_IDS,
150-
ALERT_CONSECUTIVE_MATCHES,
151149
ALERT_DURATION,
152150
ALERT_END,
153-
ALERT_FLAPPING_HISTORY,
154151
ALERT_FLAPPING,
155-
ALERT_INSTANCE_ID,
156-
ALERT_INTENDED_TIMESTAMP,
157-
ALERT_LAST_DETECTED,
152+
ALERT_FLAPPING_HISTORY,
158153
ALERT_MAINTENANCE_WINDOW_IDS,
159154
ALERT_PENDING_RECOVERED_COUNT,
155+
ALERT_CONSECUTIVE_MATCHES,
156+
ALERT_INSTANCE_ID,
157+
ALERT_LAST_DETECTED,
160158
ALERT_PREVIOUS_ACTION_GROUP,
161159
ALERT_REASON,
162160
ALERT_RULE_CATEGORY,
163161
ALERT_RULE_CONSUMER,
164162
ALERT_RULE_EXECUTION_TIMESTAMP,
165163
ALERT_RULE_EXECUTION_TYPE,
164+
ALERT_INTENDED_TIMESTAMP,
166165
ALERT_RULE_EXECUTION_UUID,
167166
ALERT_RULE_NAME,
168167
ALERT_RULE_PARAMETERS,
@@ -183,7 +182,6 @@ export const fields = {
183182
ALERT_WORKFLOW_ASSIGNEE_IDS,
184183
ALERT_WORKFLOW_STATUS,
185184
ALERT_WORKFLOW_TAGS,
186-
RELATED_ENTITY,
187185
SPACE_IDS,
188186
TIMESTAMP,
189187
VERSION,
@@ -198,22 +196,22 @@ export {
198196
// fields
199197
ALERT_ACTION_GROUP,
200198
ALERT_CASE_IDS,
201-
ALERT_CONSECUTIVE_MATCHES,
202199
ALERT_DURATION,
203200
ALERT_END,
204-
ALERT_FLAPPING_HISTORY,
205201
ALERT_FLAPPING,
206-
ALERT_INSTANCE_ID,
207-
ALERT_INTENDED_TIMESTAMP,
208-
ALERT_LAST_DETECTED,
202+
ALERT_FLAPPING_HISTORY,
209203
ALERT_MAINTENANCE_WINDOW_IDS,
204+
ALERT_CONSECUTIVE_MATCHES,
210205
ALERT_PENDING_RECOVERED_COUNT,
206+
ALERT_INSTANCE_ID,
207+
ALERT_LAST_DETECTED,
211208
ALERT_PREVIOUS_ACTION_GROUP,
212209
ALERT_REASON,
213210
ALERT_RULE_CATEGORY,
214211
ALERT_RULE_CONSUMER,
215212
ALERT_RULE_EXECUTION_TIMESTAMP,
216213
ALERT_RULE_EXECUTION_TYPE,
214+
ALERT_INTENDED_TIMESTAMP,
217215
ALERT_RULE_EXECUTION_UUID,
218216
ALERT_RULE_NAME,
219217
ALERT_RULE_PARAMETERS,
@@ -234,7 +232,6 @@ export {
234232
ALERT_WORKFLOW_ASSIGNEE_IDS,
235233
ALERT_WORKFLOW_STATUS,
236234
ALERT_WORKFLOW_TAGS,
237-
RELATED_ENTITY,
238235
SPACE_IDS,
239236
TIMESTAMP,
240237
VERSION,

x-pack/platform/plugins/shared/alerting/common/alert_schema/field_maps/mapping_from_field_map.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,6 @@ describe('mappingFromFieldMap', () => {
368368
},
369369
},
370370
},
371-
related: {
372-
properties: {
373-
entity: {
374-
type: 'keyword',
375-
},
376-
},
377-
},
378371
tags: {
379372
type: 'keyword',
380373
},

x-pack/platform/plugins/shared/alerting/server/integration_tests/__snapshots__/alert_as_data_fields.test.ts.snap

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/platform/plugins/shared/rule_registry/common/assets/field_maps/technical_rule_field_map.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,6 @@ it('matches snapshot', () => {
391391
"required": false,
392392
"type": "version",
393393
},
394-
"related.entity": Object {
395-
"array": true,
396-
"required": false,
397-
"type": "keyword",
398-
},
399394
"tags": Object {
400395
"array": true,
401396
"required": false,

x-pack/platform/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/alerts_as_data_dynamic_templates.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ export default function createAlertsAsDataDynamicTemplatesTest({ getService }: F
6969
const numberOfExistingFields = Object.keys(existingFields).length;
7070
// there is no way to get the real number of fields from ES.
7171
// Eventhough we have only as many as alertFieldMap fields,
72-
// ES counts each child of the nested objects and multi_fields as separate fields.
73-
// therefore we add 12 to get the real number.
74-
const nestedObjectsAndMultiFields = 12;
72+
// ES counts the each childs of the nested objects and multi_fields as seperate fields.
73+
// therefore we add 11 to get the real number.
74+
const nestedObjectsAndMultiFields = 11;
7575
// Number of free slots that we want to have, so we can add dynamic fields as many
7676
const numberofFreeSlots = 2;
7777
const totalFields =

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import { alertsFieldMap8190 } from '../8.19.0';
9-
import { ACTOR_ENTITY_ID, TARGET_ENTITY_ID } from '../field_names';
9+
import { ACTOR_ENTITY_ID, RELATED_ENTITY, TARGET_ENTITY_ID } from '../field_names';
1010

1111
export const alertsFieldMap920 = {
1212
...alertsFieldMap8190,
@@ -20,6 +20,11 @@ export const alertsFieldMap920 = {
2020
array: true,
2121
required: false,
2222
},
23+
[RELATED_ENTITY]: {
24+
type: 'keyword',
25+
array: true,
26+
required: false,
27+
},
2328
[TARGET_ENTITY_ID]: {
2429
type: 'keyword',
2530
array: true,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ export const ALERT_RULE_TIMESTAMP_OVERRIDE = `${ALERT_RULE_NAMESPACE}.timestamp_
6767
export const ALERT_RULE_INDICES = `${ALERT_RULE_NAMESPACE}.indices` as const;
6868

6969
export const ACTOR_ENTITY_ID = 'actor.entity.id' as const;
70+
export const RELATED_ENTITY = 'related.entity' as const;
7071
export const TARGET_ENTITY_ID = 'target.entity.id' as const;

0 commit comments

Comments
 (0)