]> git.ipfire.org Git - thirdparty/suricata.git/commit
output/json: check 5-tuple values prior to logging 12355/head
authorGiuseppe Longo <giuseppe@glongo.it>
Wed, 20 Mar 2024 17:31:42 +0000 (18:31 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 8 Jan 2025 10:52:06 +0000 (11:52 +0100)
commit1551888f6e313a6a988d4b0d5bae279d89589bd7
tree13fcec1a666129a9fc4a9987de7fcd2182005c57
parent9e24f12027d86b108b5ece21e35c01cec121b7a0
output/json: check 5-tuple values prior to logging

This commit enhances the JSON output by introducing a feature for conditional port logging.
Now, port logging is dependent on the underlying protocol
(such as TCP, UDP, or SCTP), where port information is pertinent, while it
avoids unnecessary logging for protocols where a port is not utilized (e.g. ARP).

Furthermore, this update ensures that IP addresses and the protocol have
meaningful values set, rather than being logged as empty strings.

These changes will make each log entry more precise, eliminating cases where
5-tuple fields are empty or set to zero, indicating the absence of a field.

Backported to address ticket: https://redmine.openinfosecfoundation.org/issues/7460

Ticket: #7460

(cherry picked from commit a1c6328156ffa1e3d690fa180b0395f9dcd9f52e)
src/output-json.c
src/output-json.h