Andreas Herz [Tue, 23 Feb 2016 22:27:59 +0000 (23:27 +0100)]
build-info: workaround special _FORTIFY_SOURCE defines
On systems like Gentoo where _FORTIFY_SOURCE is already defined like
FORTIFY_SOURCE=((defined __OPTIMIZE && OPTIMIZE > 0) ? 2 : 0) the use
within the printf function (%d) won't result in the correct value and
we end up with 'defined' undeclared compile error. This workaround makes
sure that just the resolved value is checked and then printed.
Victor Julien [Thu, 18 Feb 2016 09:44:14 +0000 (10:44 +0100)]
unix-socket: optimize response sends
Instead of sending responses to clients in small chunks, send it in
one big chunk. For this the JSON message is first serialized into
a MemBuffer before sending.
Jason Ish [Thu, 11 Feb 2016 20:45:23 +0000 (14:45 -0600)]
json: use top-level sensor-name if provided.
Currently the default configuration file contains a "sensor-name"
at the root of the configuration file, however, eve-log will only
use it if its specified under eve-log.
Now we will look for it at the eve-log, if present we'll use it
but log a deprecation warning, if its not present we'll look
for sensor-name at the root of the configuration.
Victor Julien [Tue, 16 Feb 2016 15:50:48 +0000 (16:50 +0100)]
eve: fix mishandling of big messages
When the string representation of a JSON message grew bigger than
64k, the JSON record would just be truncated. This lead to errors
in the parser(s) of the JSON stream.
This patch changes the buffer logic to grow the buffer on demand.
Victor Julien [Fri, 12 Feb 2016 15:31:57 +0000 (16:31 +0100)]
http: fix multipart body tracking slowdown
Optimize HTTP multipart body parsing. Big records that were not files
could slow down Suricata. The reason was that the body tracker was not
moved forward. This lead to growing body buffers, which were expensive
wrt memory and inspection.
This patch add logic to move the tracker forward in this case.
Victor Julien [Fri, 12 Feb 2016 09:54:02 +0000 (10:54 +0100)]
tls-sni: fix uninitialized memory use
On bad traffic the parser could allocated memory that was not
intialized. This was later used in the JSON output logging as
a valid null terminated string.
Victor Julien [Sun, 31 Jan 2016 12:40:07 +0000 (13:40 +0100)]
eve: fix stream payload logging wrong direction
In the EVE stream payload logging the IPS path logged the wrong dir.
Both IDS and IPS can take the same path as the detection engine
inspects in the same direction in both cases, so the alert is also
generated in the same direction.
Maurizio Abba [Mon, 16 Nov 2015 12:21:27 +0000 (12:21 +0000)]
filestore-call: forcing a call to FileStore instead of manually updating
the relative flag in order to have a single point where we actually
touch the File structure
Eric Leblond [Mon, 14 Dec 2015 14:18:07 +0000 (15:18 +0100)]
suricata: can't use -l and unix socket runmode
It is not possible to use simultaneously -l and unix socket
runmode because setting the log directory make it final so
not modifable by other call.
It is a implementation limitation but it does not make sense
to set logging directory to have it overwritten by the first
directory specified 'by pcap-file'. So it seems correct to
only trigger an error if this both options are used at the same
time.
Eric Leblond [Mon, 14 Dec 2015 13:02:20 +0000 (14:02 +0100)]
unix-manager: fix race condition
Under high load it is possible that the thread is not yet started
and that we register a command at the same time. As a consequence,
the commands list is not yet initialized and we have a segfault.
This patch moves the initialization in the ThreadInit function to
be sure the commands list is available when needed.
Victor Julien [Wed, 16 Dec 2015 09:45:05 +0000 (10:45 +0100)]
icmpv4: improve dest unreachable logic
When a ICMPv4 destination unreachable packet contains an embedded packet
this packet is parsed. When it's found to be invalid, the whole ICMP
packet is tagged as invalid.
In some cases the unreachable packet would still be used.
This patch fixes this by checking the packet is invalid flag as well
in the ICMPV4_DEST_UNREACH_IS_VALID macro.
Victor Julien [Thu, 10 Dec 2015 08:58:52 +0000 (09:58 +0100)]
ips/drop-log: fix crash on logging drops
When logging drops for fragmented UDP packets, triggered by detection
in the reassembled packet, a missing check could lead to access of the
packets UDP header pointer when it was NULL.