forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inputs.suricata) v2 message parsing
Adds a new v2 message parsing that will parse any event type that is received. fixes: influxdata#13032
- Loading branch information
Showing
11 changed files
with
710 additions
and
32 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
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
# Suricata stats and alerts plugin | ||
[[inputs.suricata]] | ||
## Data sink for Suricata stats log. | ||
# This is expected to be a filename of a | ||
# unix socket to be created for listening. | ||
source = "/var/run/suricata-stats.sock" | ||
## Source | ||
## Data sink for Suricata stats log. This is expected to be a filename of a | ||
## unix socket to be created for listening. | ||
# source = "/var/run/suricata-stats.sock" | ||
|
||
# Delimiter for flattening field keys, e.g. subitem "alert" of "detect" | ||
# becomes "detect_alert" when delimiter is "_". | ||
delimiter = "_" | ||
## Delimiter | ||
## Used for flattening field keys, e.g. subitem "alert" of "detect" becomes | ||
## "detect_alert" when delimiter is "_". | ||
# delimiter = "_" | ||
|
||
# Detect alert logs | ||
alerts = false | ||
## Metric version | ||
## Version 1 only collects stats and optionally will look for alerts if | ||
## the configuration setting alerts is set to true. | ||
## Version 2 parses any event type message by default and produced metrics | ||
## under a single metric name using a tag to differentiate between event | ||
## types. The timestamp for the message is applied to the generated metric. | ||
## Additional tags and fields are included as well. | ||
# version = "1" | ||
|
||
## Alerts | ||
## In metric version 1, only status is captured by default, alerts must be | ||
## turned on with this configuration option. This option does not apply for | ||
## metric version 2. | ||
# alerts = false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"timestamp": "2021-05-30T20:07:13.208777+0200", | ||
"flow_id": 1696236471136137, | ||
"in_iface": "s1-suricata", | ||
"event_type": "alert", | ||
"src_ip": "10.0.0.5", | ||
"src_port": 18715, | ||
"dest_ip": "179.60.192.3", | ||
"dest_port": 80, | ||
"proto": "TCP", | ||
"alert": { | ||
"action": "allowed", | ||
"gid": 1, | ||
"source": { | ||
"ip": "10.0.0.5", | ||
"port": 18715 | ||
}, | ||
"target": { | ||
"ip": "179.60.192.3", | ||
"port": 80 | ||
}, | ||
"signature_id": 6, | ||
"rev": 0, | ||
"signature": "Corrupted HTTP body", | ||
"severity": 3, | ||
"category": "Misc activity" | ||
}, | ||
"flow": { | ||
"pkts_toserver": 1, | ||
"pkts_toclient": 0, | ||
"bytes_toserver": 174, | ||
"bytes_toclient": 0, | ||
"start": "2021-05-30T20:07:13.208777+0200" | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"timestamp": "2023-04-07T00:20:57.995497+0800", | ||
"flow_id": 2150129093506313, | ||
"in_iface": "eth1", | ||
"event_type": "dns", | ||
"src_ip": "192.168.0.100", | ||
"src_port": 39262, | ||
"dest_ip": "192.168.0.1", | ||
"dest_port": 53, | ||
"proto": "UDP", | ||
"dns": { | ||
"type": "query", | ||
"id": 7145, | ||
"rrname": "reddit.com", | ||
"rrtype": "A", | ||
"tx_id": 10 | ||
} | ||
} |
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,29 @@ | ||
{ | ||
"timestamp": "2023-04-07T00:21:01.318245+0800", | ||
"flow_id": 180225164834117, | ||
"in_iface": "eth1", | ||
"event_type": "drop", | ||
"src_ip": "192.168.0.110", | ||
"src_port": 46016, | ||
"dest_ip": "54.192.18.125", | ||
"dest_port": 443, | ||
"proto": "TCP", | ||
"drop": { | ||
"len": 76, | ||
"tos": 0, | ||
"ttl": 64, | ||
"ipid": 62316, | ||
"tcpseq": 3900248957, | ||
"tcpack": 2339873683, | ||
"tcpwin": 501, | ||
"syn": false, | ||
"ack": true, | ||
"psh": true, | ||
"rst": false, | ||
"urg": false, | ||
"fin": true, | ||
"tcpres": 0, | ||
"tcpurgp": 0, | ||
"reason": "stream error" | ||
} | ||
} |
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,21 @@ | ||
{ | ||
"timestamp": "2023-04-07T00:28:22.136079+0800", | ||
"flow_id": 911610881873910, | ||
"in_iface": "eth1", | ||
"event_type": "flow", | ||
"src_ip": "192.168.0.121", | ||
"src_port": 50212, | ||
"dest_ip": "142.251.130.3", | ||
"dest_port": 443, | ||
"proto": "TCP", | ||
"flow": { | ||
"age": 0, | ||
"state": "new", | ||
"alerted": false | ||
}, | ||
"tcp": { | ||
"tcp_flags": "00", | ||
"tcp_flags_ts": "00", | ||
"tcp_flags_tc": "00" | ||
} | ||
} |
Oops, something went wrong.