Skip to content

Commit bb7d8ab

Browse files
authored
arista_ngfw: fix handling of event.type duplication (#6878)
1 parent 98342d6 commit bb7d8ab

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

packages/arista_ngfw/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: "0.1.1"
3+
changes:
4+
- description: Fix bugs in default ingest pipeline
5+
type: bugfix
6+
link: https://github.com/elastic/integrations/pull/6878
27
- version: "0.1.0"
38
changes:
49
- description: Add support for session stats events

packages/arista_ngfw/data_stream/log/_dev/test/pipeline/test-intrusion-detection.log-expected.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"provider": "intrusion_prevention",
2525
"timezone": "America/Denver",
2626
"type": [
27-
"denied",
2827
"denied"
2928
]
3029
},
@@ -109,7 +108,6 @@
109108
"provider": "intrusion_prevention",
110109
"timezone": "America/Denver",
111110
"type": [
112-
"denied",
113111
"denied"
114112
]
115113
},
@@ -191,7 +189,6 @@
191189
"provider": "intrusion_prevention",
192190
"timezone": "America/Denver",
193191
"type": [
194-
"denied",
195192
"denied"
196193
]
197194
},
@@ -279,7 +276,6 @@
279276
"provider": "intrusion_prevention",
280277
"timezone": "America/Denver",
281278
"type": [
282-
"denied",
283279
"denied"
284280
]
285281
},
@@ -367,7 +363,6 @@
367363
"provider": "intrusion_prevention",
368364
"timezone": "America/Denver",
369365
"type": [
370-
"denied",
371366
"denied"
372367
]
373368
},
@@ -455,7 +450,6 @@
455450
"provider": "intrusion_prevention",
456451
"timezone": "America/Denver",
457452
"type": [
458-
"denied",
459453
"denied"
460454
]
461455
},
@@ -543,7 +537,6 @@
543537
"provider": "intrusion_prevention",
544538
"timezone": "America/Denver",
545539
"type": [
546-
"denied",
547540
"denied"
548541
]
549542
},
@@ -631,7 +624,6 @@
631624
"provider": "intrusion_prevention",
632625
"timezone": "America/Denver",
633626
"type": [
634-
"denied",
635627
"denied"
636628
]
637629
},
@@ -719,7 +711,6 @@
719711
"provider": "intrusion_prevention",
720712
"timezone": "America/Denver",
721713
"type": [
722-
"denied",
723714
"denied"
724715
]
725716
},
@@ -807,7 +798,6 @@
807798
"provider": "intrusion_prevention",
808799
"timezone": "America/Denver",
809800
"type": [
810-
"denied",
811801
"denied"
812802
]
813803
},

packages/arista_ngfw/data_stream/log/elasticsearch/ingest_pipeline/default.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ processors:
7777
return;
7878
}
7979
ctx.log.syslog.severity.name = params[(ctx.log.syslog.severity.code).toString()];
80+
81+
# Remove port number from syslog source, and put to ECS log.syslog.hostname
82+
- gsub:
83+
if: ctx.log?.source?.address != null && ctx.log.source.address != ''
84+
field: log.source.address
85+
pattern: :.*
86+
replacement: ''
87+
target_field: log.syslog.hostname
8088
8189
# Parse the JSON message to arista.*
8290
- json:
@@ -572,10 +580,14 @@ processors:
572580
}
573581
if (ctx.event.category.contains('network') || ctx.event.category.contains('intrusion_detection')) {
574582
if (ctx.event.outcome == 'success') {
575-
ctx.event.type.add('allowed');
583+
if (ctx.event?.type == null || !ctx.event.type.contains('allowed')) {
584+
ctx.event.type.add('allowed');
585+
}
576586
}
577587
if (ctx.event.outcome == 'failure') {
578-
ctx.event.type.add('denied');
588+
if (ctx.event?.type == null || !ctx.event.type.contains('denied')) {
589+
ctx.event.type.add('denied');
590+
}
579591
}
580592
}
581593

packages/arista_ngfw/data_stream/log/fields/ecs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@
128128
name: log.syslog.facility.code
129129
- external: ecs
130130
name: log.syslog.facility.name
131+
- external: ecs
132+
name: log.syslog.hostname
131133
- external: ecs
132134
name: log.syslog.severity.code
133135
- external: ecs

packages/arista_ngfw/docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ An example event for `log` looks as following:
256256
| log.source.address | Source address from which the log event was read / sent from. | keyword |
257257
| log.syslog.facility.code | The Syslog numeric facility of the log event, if available. According to RFCs 5424 and 3164, this value should be an integer between 0 and 23. | long |
258258
| log.syslog.facility.name | The Syslog text-based facility of the log event, if available. | keyword |
259+
| log.syslog.hostname | The hostname, FQDN, or IP of the machine that originally sent the Syslog message. This is sourced from the hostname field of the syslog header. Depending on the environment, this value may be different from the host that handled the event, especially if the host handling the events is acting as a collector. | keyword |
259260
| log.syslog.priority | Syslog numeric priority of the event, if available. According to RFCs 5424 and 3164, the priority is 8 \* facility + severity. This number is therefore expected to contain a value between 0 and 191. | long |
260261
| log.syslog.severity.code | The Syslog numeric severity of the log event, if available. If the event source publishing via Syslog provides a different numeric severity value (e.g. firewall, IDS), your source's numeric severity should go to `event.severity`. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to `event.severity`. | long |
261262
| log.syslog.severity.name | The Syslog numeric severity of the log event, if available. If the event source publishing via Syslog provides a different severity value (e.g. firewall, IDS), your source's text severity should go to `log.level`. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to `log.level`. | keyword |

packages/arista_ngfw/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: 2.5.1
22
name: arista_ngfw
33
title: "Arista NG Firewall"
4-
version: 0.1.0
4+
version: 0.1.1
55
source:
66
license: "Elastic-2.0"
77
description: "Collect logs and metrics from Arista NG Firewall."

0 commit comments

Comments
 (0)