-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pfsense] Add SNORT log processing (#11182)
* [pfsense] Add SNORT log processing * Update changelog with PR number * Address code review * Address code review feedback
- Loading branch information
Showing
8 changed files
with
243 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/pfsense/data_stream/log/_dev/test/pipeline/test-pfsense-snort.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<190>Jul 23 18:12:00 snort[87537]: [136:1:1] (spp_reputation) packets blacklisted [Classification: Potentially Bad Traffic] [Priority: 2] {TCP} 67.43.156.1:16856 -> 89.160.20.128:2222 | ||
<190>Jul 23 18:12:00 snort[87537]: [119:4:1] (http_inspect) BARE BYTE UNICODE ENCODING [Classification: Not Suspicious Traffic] [Priority: 3] {TCP} 67.43.156.0:63651 -> 89.160.20.128:8080 |
186 changes: 186 additions & 0 deletions
186
packages/pfsense/data_stream/log/_dev/test/pipeline/test-pfsense-snort.log-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
{ | ||
"expected": [ | ||
{ | ||
"@timestamp": "2024-07-23T18:12:00.000-04:00", | ||
"destination": { | ||
"address": "89.160.20.128", | ||
"as": { | ||
"number": 29518, | ||
"organization": { | ||
"name": "Bredband2 AB" | ||
} | ||
}, | ||
"geo": { | ||
"city_name": "Linköping", | ||
"continent_name": "Europe", | ||
"country_iso_code": "SE", | ||
"country_name": "Sweden", | ||
"location": { | ||
"lat": 58.4167, | ||
"lon": 15.6167 | ||
}, | ||
"region_iso_code": "SE-E", | ||
"region_name": "Östergötland County" | ||
}, | ||
"ip": "89.160.20.128", | ||
"port": 2222 | ||
}, | ||
"ecs": { | ||
"version": "8.11.0" | ||
}, | ||
"event": { | ||
"category": [ | ||
"network" | ||
], | ||
"kind": "event", | ||
"original": "<190>Jul 23 18:12:00 snort[87537]: [136:1:1] (spp_reputation) packets blacklisted [Classification: Potentially Bad Traffic] [Priority: 2] {TCP} 67.43.156.1:16856 -> 89.160.20.128:2222", | ||
"provider": "snort", | ||
"timezone": "-04:00" | ||
}, | ||
"log": { | ||
"syslog": { | ||
"priority": 190 | ||
} | ||
}, | ||
"message": "[136:1:1] (spp_reputation) packets blacklisted [Classification: Potentially Bad Traffic] [Priority: 2] {TCP} 67.43.156.1:16856 -> 89.160.20.128:2222", | ||
"network": { | ||
"protocol": "tcp", | ||
"type": "ipv4" | ||
}, | ||
"observer": { | ||
"type": "firewall", | ||
"vendor": "netgate" | ||
}, | ||
"process": { | ||
"name": "snort", | ||
"pid": 87537 | ||
}, | ||
"related": { | ||
"ip": [ | ||
"89.160.20.128", | ||
"67.43.156.1" | ||
] | ||
}, | ||
"snort": { | ||
"alert_message": "packets blacklisted", | ||
"classification": "Potentially Bad Traffic", | ||
"generator_id": "136", | ||
"preprocessor": "spp_reputation", | ||
"priority": 2, | ||
"signature_id": "1", | ||
"signature_revision": "1" | ||
}, | ||
"source": { | ||
"address": "67.43.156.1", | ||
"as": { | ||
"number": 35908 | ||
}, | ||
"geo": { | ||
"continent_name": "Asia", | ||
"country_iso_code": "BT", | ||
"country_name": "Bhutan", | ||
"location": { | ||
"lat": 27.5, | ||
"lon": 90.5 | ||
} | ||
}, | ||
"ip": "67.43.156.1", | ||
"port": 16856 | ||
}, | ||
"tags": [ | ||
"preserve_original_event" | ||
] | ||
}, | ||
{ | ||
"@timestamp": "2024-07-23T18:12:00.000-04:00", | ||
"destination": { | ||
"address": "89.160.20.128", | ||
"as": { | ||
"number": 29518, | ||
"organization": { | ||
"name": "Bredband2 AB" | ||
} | ||
}, | ||
"geo": { | ||
"city_name": "Linköping", | ||
"continent_name": "Europe", | ||
"country_iso_code": "SE", | ||
"country_name": "Sweden", | ||
"location": { | ||
"lat": 58.4167, | ||
"lon": 15.6167 | ||
}, | ||
"region_iso_code": "SE-E", | ||
"region_name": "Östergötland County" | ||
}, | ||
"ip": "89.160.20.128", | ||
"port": 8080 | ||
}, | ||
"ecs": { | ||
"version": "8.11.0" | ||
}, | ||
"event": { | ||
"category": [ | ||
"network" | ||
], | ||
"kind": "event", | ||
"original": "<190>Jul 23 18:12:00 snort[87537]: [119:4:1] (http_inspect) BARE BYTE UNICODE ENCODING [Classification: Not Suspicious Traffic] [Priority: 3] {TCP} 67.43.156.0:63651 -> 89.160.20.128:8080", | ||
"provider": "snort", | ||
"timezone": "-04:00" | ||
}, | ||
"log": { | ||
"syslog": { | ||
"priority": 190 | ||
} | ||
}, | ||
"message": "[119:4:1] (http_inspect) BARE BYTE UNICODE ENCODING [Classification: Not Suspicious Traffic] [Priority: 3] {TCP} 67.43.156.0:63651 -> 89.160.20.128:8080", | ||
"network": { | ||
"protocol": "tcp", | ||
"type": "ipv4" | ||
}, | ||
"observer": { | ||
"type": "firewall", | ||
"vendor": "netgate" | ||
}, | ||
"process": { | ||
"name": "snort", | ||
"pid": 87537 | ||
}, | ||
"related": { | ||
"ip": [ | ||
"89.160.20.128", | ||
"67.43.156.0" | ||
] | ||
}, | ||
"snort": { | ||
"alert_message": "BARE BYTE UNICODE ENCODING", | ||
"classification": "Not Suspicious Traffic", | ||
"generator_id": "119", | ||
"preprocessor": "http_inspect", | ||
"priority": 3, | ||
"signature_id": "4", | ||
"signature_revision": "1" | ||
}, | ||
"source": { | ||
"address": "67.43.156.0", | ||
"as": { | ||
"number": 35908 | ||
}, | ||
"geo": { | ||
"continent_name": "Asia", | ||
"country_iso_code": "BT", | ||
"country_name": "Bhutan", | ||
"location": { | ||
"lat": 27.5, | ||
"lon": 90.5 | ||
} | ||
}, | ||
"ip": "67.43.156.0", | ||
"port": 63651 | ||
}, | ||
"tags": [ | ||
"preserve_original_event" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/pfsense/data_stream/log/elasticsearch/ingest_pipeline/snort.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
description: Pipeline for PFsense SNORT logs. | ||
processors: | ||
- grok: | ||
field: message | ||
patterns: | ||
- '\[%{NUMBER:snort.generator_id}:%{NUMBER:snort.signature_id}:%{NUMBER:snort.signature_revision}\] \(%{DATA:snort.preprocessor}\) %{GREEDYDATA:snort.alert_message} \[Classification: %{DATA:snort.classification}\] \[Priority: %{NONNEGINT:snort.priority:long}\] \{%{WORD:network.protocol}\} %{IP:source.address}:%{NUMBER:source.port:long} -> %{IP:destination.address}:%{NUMBER:destination.port:long}' | ||
- lowercase: | ||
field: network.protocol | ||
ignore_missing: true | ||
on_failure: | ||
- set: | ||
field: error.message | ||
value: "{{{ _ingest.on_failure_message }}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters