Skip to content

Commit 5068ae8

Browse files
[SOPHOS UTM] Add GeopIP conditions (elastic#15130)
* [SOPHOS UTM] Add GeopIP conditions Prevent pipeline errors if source/destionation .ip is a empty string
1 parent b2ef7ff commit 5068ae8

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

packages/sophos/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "3.15.2"
3+
changes:
4+
- description: Add conditions to GeoIP processors to prevent failure on empty strings
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/15130
27
- version: "3.15.1"
38
changes:
49
- description: Changed owners.

packages/sophos/data_stream/utm/elasticsearch/ingest_pipeline/dhcp.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ processors:
121121
target_field: client.geo
122122
ignore_missing: true
123123
tag: geo_client_ip
124+
if: ctx.client?.ip != ''
124125

125126
# IP Autonomous System (AS) Lookup
126127
- geoip:
@@ -132,6 +133,7 @@ processors:
132133
- organization_name
133134
ignore_missing: true
134135
tag: geo_client_as
136+
if: ctx.client?.ip != ''
135137
- rename:
136138
field: client.as.asn
137139
target_field: client.as.number

packages/sophos/data_stream/utm/elasticsearch/ingest_pipeline/dns.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ processors:
5555
target_field: server.geo
5656
ignore_missing: true
5757
tag: geo_server_ip
58+
if: ctx.server?.ip != ''
5859

5960
# IP Autonomous System (AS) Lookup
6061
- geoip:
@@ -66,6 +67,7 @@ processors:
6667
- organization_name
6768
ignore_missing: true
6869
tag: geo_server_as
70+
if: ctx.server?.ip != ''
6971
- rename:
7072
field: server.as.asn
7173
target_field: server.as.number

packages/sophos/data_stream/utm/elasticsearch/ingest_pipeline/http.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,13 @@ processors:
209209
target_field: source.geo
210210
ignore_missing: true
211211
tag: geo_source_ip
212+
if: ctx.source?.ip != ''
212213
- geoip:
213214
field: destination.ip
214215
target_field: destination.geo
215216
ignore_missing: true
216217
tag: geo_destination_ip
218+
if: ctx.destination?.ip != ''
217219

218220
# IP Autonomous System (AS) Lookup
219221
- geoip:
@@ -225,6 +227,7 @@ processors:
225227
- organization_name
226228
ignore_missing: true
227229
tag: geo_source_as
230+
if: ctx.source?.ip != ''
228231
- geoip:
229232
database_file: GeoLite2-ASN.mmdb
230233
field: destination.ip
@@ -234,6 +237,7 @@ processors:
234237
- organization_name
235238
ignore_missing: true
236239
tag: geo_destination_as
240+
if: ctx.destination?.ip != ''
237241
- rename:
238242
field: source.as.asn
239243
target_field: source.as.number

packages/sophos/data_stream/utm/elasticsearch/ingest_pipeline/packetfilter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,13 @@ processors:
190190
target_field: source.geo
191191
ignore_missing: true
192192
tag: geo_source_ip
193+
if: ctx.source?.ip != ''
193194
- geoip:
194195
field: destination.ip
195196
target_field: destination.geo
196197
ignore_missing: true
197198
tag: geo_destination_ip
199+
if: ctx.destination?.ip != ''
198200

199201
# IP Autonomous System (AS) Lookup
200202
- geoip:
@@ -206,6 +208,7 @@ processors:
206208
- organization_name
207209
ignore_missing: true
208210
tag: geo_source_as
211+
if: ctx.source?.ip != ''
209212
- geoip:
210213
database_file: GeoLite2-ASN.mmdb
211214
field: destination.ip
@@ -215,6 +218,7 @@ processors:
215218
- organization_name
216219
ignore_missing: true
217220
tag: geo_destination_as
221+
if: ctx.destination?.ip != ''
218222
- rename:
219223
field: source.as.asn
220224
target_field: source.as.number

packages/sophos/data_stream/xg/elasticsearch/ingest_pipeline/default.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,12 @@ processors:
525525
field: source.ip
526526
target_field: source.geo
527527
ignore_missing: true
528-
if: "ctx.source?.geo == null"
528+
if: "ctx.source?.geo == null && ctx.source?.ip != ''"
529529
- geoip:
530530
field: destination.ip
531531
target_field: destination.geo
532532
ignore_missing: true
533-
if: "ctx.destination?.geo == null"
533+
if: "ctx.destination?.geo == null && ctx.destination?.ip != ''"
534534
- geoip:
535535
database_file: GeoLite2-ASN.mmdb
536536
field: source.ip
@@ -539,6 +539,7 @@ processors:
539539
- asn
540540
- organization_name
541541
ignore_missing: true
542+
if: "ctx.source?.ip != ''"
542543
- geoip:
543544
database_file: GeoLite2-ASN.mmdb
544545
field: destination.ip
@@ -547,16 +548,17 @@ processors:
547548
- asn
548549
- organization_name
549550
ignore_missing: true
551+
if: "ctx.destination?.ip != ''"
550552
- geoip:
551553
field: source.nat.ip
552554
target_field: source.geo
553555
ignore_missing: true
554-
if: "ctx.source?.geo == null"
556+
if: "ctx.source?.geo == null && ctx.source?.nat?.ip != ''"
555557
- geoip:
556558
field: destination.nat.ip
557559
target_field: destination.geo
558560
ignore_missing: true
559-
if: "ctx.destination?.geo == null"
561+
if: "ctx.destination?.geo == null && ctx.destination?.nat?.ip != ''"
560562
- geoip:
561563
database_file: GeoLite2-ASN.mmdb
562564
field: source.nat.ip
@@ -565,7 +567,7 @@ processors:
565567
- asn
566568
- organization_name
567569
ignore_missing: true
568-
if: "ctx.source?.as == null"
570+
if: "ctx.source?.as == null && ctx.source?.nat?.ip != ''"
569571
- geoip:
570572
database_file: GeoLite2-ASN.mmdb
571573
field: destination.nat.ip
@@ -574,7 +576,7 @@ processors:
574576
- asn
575577
- organization_name
576578
ignore_missing: true
577-
if: "ctx.destination?.as == null"
579+
if: "ctx.destination?.as == null && ctx.destination?.nat?.ip != ''"
578580
- rename:
579581
field: source.as.asn
580582
target_field: source.as.number

packages/sophos/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.0.3"
22
name: sophos
33
title: Sophos
4-
version: "3.15.1"
4+
version: "3.15.2"
55
description: Collect logs from Sophos with Elastic Agent.
66
categories:
77
- "security"

0 commit comments

Comments
 (0)