Skip to content

Commit e73dd5a

Browse files
[Box Events] Remove non-ECS fields in ECS namespace (#15947)
box_events: remove non-ecs fields in ecs namespace
1 parent 95f5051 commit e73dd5a

File tree

12 files changed

+78
-288
lines changed

12 files changed

+78
-288
lines changed

packages/box_events/changelog.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# newer versions go on top
2+
- version: "3.0.0"
3+
changes:
4+
- description: |
5+
Remove non-ECS fields that are collided with ECS namespace.
6+
Following fields will no longer be available:
7+
`related.location.lat`, `related.location.lon`, `related.description`, `related.indicator_type`.
8+
type: breaking-change
9+
link: https://github.com/elastic/integrations/pull/15947
210
- version: "2.15.1"
311
changes:
412
- description: Fix the description of the interval setting.

packages/box_events/data_stream/events/_dev/test/pipeline/test-anomalous-download.log-expected.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,11 @@
6565
]
6666
},
6767
"related": {
68-
"description": [
69-
"Significant increase in download content week over week, 9200% (25.04 MB) more than last week 12 additional files downloaded week over week)"
70-
],
71-
"indicator_type": [
72-
"file"
73-
],
7468
"ip": [
7569
"1.128.0.0",
7670
"175.16.199.0",
7771
"10.1.2.3"
7872
],
79-
"location": [
80-
{
81-
"lat": 43.88,
82-
"lon": 125.3228
83-
}
84-
],
8573
"user": [
8674
"Unknown User",
8775
@@ -211,22 +199,10 @@
211199
]
212200
},
213201
"related": {
214-
"description": [
215-
"Significant increase in download content week over week, 9200% (25.04 MB) more than last week 12 additional files downloaded week over week)"
216-
],
217-
"indicator_type": [
218-
"file"
219-
],
220202
"ip": [
221203
"175.16.199.0",
222204
"10.1.2.3"
223205
],
224-
"location": [
225-
{
226-
"lat": 43.88,
227-
"lon": 125.3228
228-
}
229-
],
230206
"user": [
231207
"Unknown User",
232208

packages/box_events/data_stream/events/_dev/test/pipeline/test-invite.log-expected.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@
6262
"ip": [
6363
"81.2.69.144"
6464
],
65-
"location": [
66-
{
67-
"lat": 51.5142,
68-
"lon": -0.0931
69-
}
70-
],
7165
"user": [
7266
7367
"Acting User",

packages/box_events/data_stream/events/_dev/test/pipeline/test-malicious-content.log-expected.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,10 @@
8080
]
8181
},
8282
"related": {
83-
"description": [
84-
"BadMalware, MalwareBot4000, malware.exe Detected by Box Shield from IP 67.43.156.0. This is a really bad file see https://some.link/xyz"
85-
],
86-
"indicator_type": [
87-
"software"
88-
],
8983
"ip": [
9084
"67.43.156.0",
9185
"10.1.2.3"
9286
],
93-
"location": [
94-
{
95-
"lat": 27.5,
96-
"lon": 90.5
97-
}
98-
],
9987
"user": [
10088
"Unknown User",
10189
@@ -220,12 +208,6 @@
220208
]
221209
},
222210
"related": {
223-
"description": [
224-
"BadMalware, MalwareBot4000, malware.exe Detected by Box Shield from IP Unknown IP. This is a really bad file see https://some.link/xyz"
225-
],
226-
"indicator_type": [
227-
"software"
228-
],
229211
"user": [
230212
"Unknown User",
231213

packages/box_events/data_stream/events/_dev/test/pipeline/test-suspicious-locations.log-expected.json

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,10 @@
3838
]
3939
},
4040
"related": {
41-
"description": [
42-
"IP 81.2.69.144 was observed to Download file ABC/DEF/xyz.txt by Box Excel Online Previewer"
43-
],
44-
"indicator_type": [
45-
"ipv4-addr"
46-
],
4741
"ip": [
4842
"81.2.69.144",
4943
"67.43.156.0"
5044
],
51-
"location": [
52-
{
53-
"lat": 51.5142,
54-
"lon": -0.0931
55-
},
56-
{
57-
"lat": 27.5,
58-
"lon": 90.5
59-
}
60-
],
6145
"user": [
6246
"Unknown User",
6347
@@ -135,12 +119,6 @@
135119
]
136120
},
137121
"related": {
138-
"description": [
139-
"IP Unknown IP was observed to Download file ABC/DEF/xyz.txt by Box Excel Online Previewer"
140-
],
141-
"indicator_type": [
142-
"ipv4-addr"
143-
],
144122
"user": [
145123
"Unknown User",
146124

packages/box_events/data_stream/events/_dev/test/pipeline/test-suspicious-sessions.log-expected.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,10 @@
4141
]
4242
},
4343
"related": {
44-
"description": [
45-
"IP 81.2.69.142 was observed to Set shared link expiration file ABC/DEF/xyz.txt by ServiceName"
46-
],
47-
"indicator_type": [
48-
"user-account"
49-
],
5044
"ip": [
5145
"81.2.69.142",
5246
"10.1.2.3"
5347
],
54-
"location": [
55-
{
56-
"lat": 51.5142,
57-
"lon": -0.0931
58-
}
59-
],
6048
"user": [
6149
"Unknown User",
6250
@@ -137,12 +125,6 @@
137125
]
138126
},
139127
"related": {
140-
"description": [
141-
"IP Unknown IP was observed to Set shared link expiration file ABC/DEF/xyz.txt by ServiceName"
142-
],
143-
"indicator_type": [
144-
"user-account"
145-
],
146128
"user": [
147129
"Unknown User",
148130

packages/box_events/data_stream/events/elasticsearch/ingest_pipeline/default.yml

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -817,15 +817,6 @@ processors:
817817
if (ctx.related.ip == null) {
818818
ctx.related.ip = new ArrayList();
819819
}
820-
if (ctx.related.description == null) {
821-
ctx.related.description = new ArrayList();
822-
}
823-
if (ctx.related.location == null) {
824-
ctx.related.location = new ArrayList();
825-
}
826-
if (ctx.related.indicator_type == null) {
827-
ctx.related.indicator_type = new ArrayList();
828-
}
829820
}
830821
#
831822
- script:
@@ -865,9 +856,6 @@ processors:
865856
indicator.indicator.put("type","user-account");
866857
ctx.threat.enrichments.add(indicator);
867858
ctx.related.ip.add(geo.ip);
868-
ctx.related.location.add(geo.location);
869-
ctx.related.description.add(indicator.indicator.description);
870-
ctx.related.indicator_type.add(indicator.indicator.type);
871859
}
872860
}
873861
}
@@ -911,9 +899,6 @@ processors:
911899
}
912900
ctx.threat.enrichments.add(indicator);
913901
ctx.related.ip.add(geo.ip);
914-
ctx.related.location.add(geo.location);
915-
ctx.related.description.add(indicator.indicator.description);
916-
ctx.related.indicator_type.add(indicator.indicator.type);
917902
}
918903
- script:
919904
description: Unpack Anomalous Download properties
@@ -944,8 +929,6 @@ processors:
944929
indicator.indicator.type = "file";
945930
ctx.threat.enrichments.add(indicator);
946931
ctx.related.ip.add(ip.ip);
947-
ctx.related.description.add(indicator.indicator.description);
948-
ctx.related.indicator_type.add(indicator.indicator.type);
949932
}
950933
}
951934
- script:
@@ -979,10 +962,8 @@ processors:
979962
ctx.threat.indicator.last_seen = ctx.box.additional_details.shield_alert.malware_info.last_seen;
980963
ctx.threat.indicator.reference = ctx.box.additional_details.shield_alert.malware_info.detail_link;
981964
ctx.related.ip.add(ctx.threat.indicator.ip);
982-
ctx.related.description.add(ctx.threat.indicator.description);
983965
}
984966
ctx.threat.indicator.type = "software";
985-
ctx.related.indicator_type.add(ctx.threat.indicator.type);
986967
- date:
987968
field: threat.indicator.first_seen
988969
tag: date_threat_indicator_first_seen
@@ -1070,27 +1051,12 @@ processors:
10701051
.collect(Collectors.toList());
10711052
}
10721053
if (ctx.related != null) {
1073-
if (ctx.related.description != null) {
1074-
ctx.related.description = ctx.related.description.stream()
1075-
.distinct()
1076-
.collect(Collectors.toList());
1077-
}
1078-
if (ctx.related.indicator_type != null) {
1079-
ctx.related.indicator_type = ctx.related.indicator_type.stream()
1080-
.distinct()
1081-
.collect(Collectors.toList());
1082-
}
10831054
if (ctx.related.ip != null) {
10841055
ctx.related.ip = ctx.related.ip.stream()
10851056
.filter(Objects::nonNull)
10861057
.distinct()
10871058
.collect(Collectors.toList());
10881059
}
1089-
if (ctx.related.location != null) {
1090-
ctx.related.location = ctx.related.location.stream()
1091-
.distinct()
1092-
.collect(Collectors.toList());
1093-
}
10941060
}
10951061
if (ctx.box?.additional_details?.shield_alert?.alert_summary?.download_ips != null) {
10961062
ctx.box.additional_details.shield_alert.alert_summary.download_ips = ctx.box.additional_details.shield_alert.alert_summary.download_ips.stream()
@@ -1244,42 +1210,6 @@ processors:
12441210
field: threat.indicator.ip
12451211
target_field: threat.indicator.geo
12461212
ignore_missing: true
1247-
- script:
1248-
description: Initialize related.geo prior to geoip
1249-
lang: painless
1250-
source: |
1251-
if (ctx.related?.ip != null) {
1252-
ctx.related.geo = new ArrayList();
1253-
for (ip in ctx.related.ip) {
1254-
Map geo = new HashMap();
1255-
geo.put("ip",ip);
1256-
ctx.related.geo.add(geo);
1257-
}
1258-
}
1259-
- foreach:
1260-
field: related.geo
1261-
ignore_missing: true
1262-
processor:
1263-
geoip:
1264-
field: "_ingest._value.ip"
1265-
target_field: "_ingest._value.location"
1266-
ignore_missing: true
1267-
- script:
1268-
description: Collate derived locations to related.location
1269-
lang: painless
1270-
source: |
1271-
if (ctx.related?.geo != null) {
1272-
ctx.related.location = new ArrayList();
1273-
for (geo in ctx.related.geo) {
1274-
if (geo.location != null) {
1275-
ctx.related.location.add(geo.location.location);
1276-
}
1277-
}
1278-
}
1279-
- remove:
1280-
field: "related.geo"
1281-
ignore_failure: true
1282-
ignore_missing: true
12831213
# AS look-ups on enrichments within Array
12841214
- foreach:
12851215
field: threat.enrichments

packages/box_events/data_stream/events/fields/agent.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,3 @@
2323
example: "stretch"
2424
description: >
2525
OS codename, if any.
26-
27-
- name: cpu.pct
28-
type: scaled_float
29-
description: >
30-
Percent CPU used. This value is normalized by the number of CPU cores and it ranges from 0 to 1.
31-
32-
- name: network.in.bytes
33-
type: long
34-
description: >
35-
The number of bytes received on all network interfaces by the host in a given period of time.
36-
37-
- name: network.in.packets
38-
type: long
39-
description: >
40-
The number of packets received on all network interfaces by the host in a given period of time.
41-
42-
- name: network.out.bytes
43-
type: long
44-
description: >
45-
The number of bytes sent out on all network interfaces by the host in a given period of time.
46-
47-
- name: network.out.packets
48-
type: long
49-
description: >
50-
The number of packets sent out on all network interfaces by the host in a given period of time.
51-

packages/box_events/data_stream/events/fields/fields.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -451,22 +451,3 @@
451451
- name: user_name
452452
description: The name of the user that triggered the event.
453453
type: keyword
454-
- name: related
455-
type: group
456-
fields:
457-
- name: location
458-
description: Array of `location` derived from `related.ip`
459-
type: group
460-
fields:
461-
- name: lat
462-
description: Latitude coordinate
463-
type: float
464-
- name: lon
465-
description: Longitude coordinate
466-
type: float
467-
- name: description
468-
description: Array of `description` derived from `threat[.enrichments].indicator.description`
469-
type: keyword
470-
- name: indicator_type
471-
description: Array of `indicator_type` derived from `threat[.enrichments].indicator.type`
472-
type: keyword

0 commit comments

Comments
 (0)