]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
4 years agofuzz/pcap: add missing flow queue 5285/head 5311/head
Victor Julien [Fri, 7 Aug 2020 14:50:56 +0000 (16:50 +0200)] 
fuzz/pcap: add missing flow queue

4 years agofuzz/pcap: enable http2
Victor Julien [Fri, 7 Aug 2020 14:43:24 +0000 (16:43 +0200)] 
fuzz/pcap: enable http2

4 years agoversion: continue 6 development
Victor Julien [Fri, 7 Aug 2020 14:42:22 +0000 (16:42 +0200)] 
version: continue 6 development

4 years agoversion: update to 6.0.0-beta1 suricata-6.0.0-beta1
Victor Julien [Fri, 7 Aug 2020 08:17:12 +0000 (10:17 +0200)] 
version: update to 6.0.0-beta1

4 years agochangelog: update for 6.0.0-beta1
Victor Julien [Fri, 7 Aug 2020 08:15:56 +0000 (10:15 +0200)] 
changelog: update for 6.0.0-beta1

4 years agoplugins: remove unused func, suppressing compile warning 5284/head
Victor Julien [Thu, 6 Aug 2020 21:06:31 +0000 (23:06 +0200)] 
plugins: remove unused func, suppressing compile warning

4 years agoplugins: add missing guards 5283/head
Victor Julien [Thu, 6 Aug 2020 19:04:03 +0000 (21:04 +0200)] 
plugins: add missing guards

4 years agodetect/http2: fix header inspection
Victor Julien [Thu, 6 Aug 2020 18:49:56 +0000 (20:49 +0200)] 
detect/http2: fix header inspection

Header inspection was overwriting data that was still being
referenced by the detect engine, leading to ASAN issues.

4 years agooutput/ssh: Use correct file context 5282/head
Jeff Lucovsky [Thu, 6 Aug 2020 14:28:55 +0000 (10:28 -0400)] 
output/ssh: Use correct file context

This commit corrects an issue with the SSH output module that resulted
in a SEGV when SSH output is logged.

4 years agoplugins: support for capture plugins
Jason Ish [Sat, 4 Jul 2020 06:33:08 +0000 (00:33 -0600)] 
plugins: support for capture plugins

Allow a plugin to register itself as a capture source. This isn't that
much different than how current sources register, it just happens
a little later on during startup.

One "slot" is reserved for capture plugins, but multiple plugins
implementing a capture can be loaded.  The --capture-plugin command
line option must be used to tell Suricata which plugin
to use.

This is still very much a work in progress, but can load
PF_RING as a capture plugin.

4 years agoplugins: initial support for a filetype plugin
Jason Ish [Fri, 3 Jul 2020 22:33:12 +0000 (16:33 -0600)] 
plugins: initial support for a filetype plugin

A filetype plugin is a plugin that implements an eve filetype. Most
of the current filetypes could likely be implemented as such a plugin.
Such a plugin must implement Open, Close and Write, where Write
is provided the formatted JSON to be logged.

This commit also includes the plumbing for plugin loading. Example
plugin to come.

Plugins are loaded by the "plugin" section in the configuration
file:

  plugins:
    - /path/to/directory/plugins
    - /path/to/plugin_file.so

This can also be done on the command line with:

  --set plugins.0=/path/plugin_file.so

4 years agoutil-error: define generic plugin error code
Jason Ish [Fri, 3 Jul 2020 22:25:55 +0000 (16:25 -0600)] 
util-error: define generic plugin error code

4 years agoconfigure: check for plugin support
Jason Ish [Thu, 23 Apr 2020 22:48:23 +0000 (16:48 -0600)] 
configure: check for plugin support

Currently plugin support requires the dlfcn.h header
file and compiler support for -rdynamic.

4 years agoplugins: config.h: move into src and rename to autoconf.h
Jason Ish [Thu, 23 Apr 2020 22:46:05 +0000 (16:46 -0600)] 
plugins: config.h: move into src and rename to autoconf.h

While fixing files that include config.h, just remove the
include if possible.

4 years agohttp2: log as http to abstract http and http2 a little
Jason Ish [Mon, 3 Aug 2020 22:21:52 +0000 (16:21 -0600)] 
http2: log as http to abstract http and http2 a little

This commit logs http2 as an http event. The idea is to somewhat
normalize http/http2 so common info can be version agnostic.

This puts the http2 specific fields in an "http2" object inside
the "http" object.

HTTP2 headers/values that are in common with HTTP1 are logged
under the "http" object to be compatible with HTTP1 logging.

4 years agohttp2: log headers in the same format as http (1)
Jason Ish [Mon, 3 Aug 2020 20:41:39 +0000 (14:41 -0600)] 
http2: log headers in the same format as http (1)

Log the headers in request_headers, and response_headers like
http1 to remain compatible.

4 years agosuricata.yaml: mark http2 as experimental
Jason Ish [Mon, 3 Aug 2020 15:24:36 +0000 (09:24 -0600)] 
suricata.yaml: mark http2 as experimental

Make it clear that HTTP2 is experimental and disabled by default.

4 years agohttp2: initial support
Philippe Antoine [Mon, 13 Jul 2020 15:07:20 +0000 (17:07 +0200)] 
http2: initial support

4 years agohttp2: adds documentation
Philippe Antoine [Mon, 13 Jul 2020 15:45:00 +0000 (17:45 +0200)] 
http2: adds documentation

4 years agodetect: generic structures for mpm with lists
Philippe Antoine [Sat, 16 May 2020 12:00:06 +0000 (14:00 +0200)] 
detect: generic structures for mpm with lists

4 years agoflow/spare: implement pool shrinking 5281/head
Victor Julien [Thu, 6 Aug 2020 12:38:36 +0000 (14:38 +0200)] 
flow/spare: implement pool shrinking

Remove at most one block per run, so it shrinks slowly.

4 years agoflow: redesign of flow timeout handling
Victor Julien [Thu, 19 Dec 2019 16:26:45 +0000 (17:26 +0100)] 
flow: redesign of flow timeout handling

Goals:
- reduce locking
- take advantage of 'hot' caches
- better locality

Locking reduction

New flow spare pool. The global pool is implmented as a list of blocks,
where each block has a 100 spare flows. Worker threads fetch a block at
a time, storing the block in the local thread storage.

Flow Recycler now returns flows to the pool is blocks as well.

Flow Recycler fetches all flows to be processed in one step instead of
one at a time.

Cache 'hot'ness

Worker threads now check the timeout of flows they evaluate during lookup.
The worker will have to read the flow into cache anyway, so the added
overhead of checking the timeout value is minimal. When a flow is considered
timed out, one of 2 things happens:

- if the flow is 'owned' by the thread it is handled locally. Handling means
  checking if the flow needs 'timeout' work.

- otherwise, the flow is added to a special 'evicted' list in the flow
  bucket where it will be picked up by the flow manager.

Flow Manager timing

By default the flow manager now tries to do passes of the flow hash in
smaller steps, where the goal is to do full pass in 8 x the lowest timeout
value it has to enforce. So if the lowest timeout value is 30s, a full pass
will take 4 minutes. The goal here is to reduce locking overhead and not
get in the way of the workers.

In emergency mode each pass is full, and lower timeouts are used.

Timing of the flow manager is also no longer relying on pthread condition
variables, as these generally cause waking up much quicker than the desired
timout. Instead a simple (u)sleep loop is used.

Both changes reduce the number of hash passes a lot.

Emergency behavior

In emergency mode there a number of changes to the workers. In this scenario
the flow memcap is fully used up and it is unavoidable that some flows won't
be tracked.

1. flow spare pool fetches are reduced to once a second. This avoids locking
   overhead, while the chance of success was very low.

2. getting an active flow directly from the hash skips flows that had very
   recent activity to avoid the scenario where all flows get only into the
   NEW state before getting reused. Rather allow some to have a chance of
   completing.

3. TCP packets that are not SYN packets will not get a used flow, unless
   stream.midstream is enabled. The goal here is again to avoid evicting
   active flows unnecessarily.

Better Localily

Flow Manager injects flows into the worker threads now, instead of one or
two packets. Advantage of this is that the worker threads can get packets
from their local packet pools, avoiding constant overhead of packets returning
to 'foreign' pools.

Counters

A lot of flow counters have been added and some have been renamed.

Overall the worker threads increment 'flow.wrk.*' counters, while the flow
manager increments 'flow.mgr.*'.

Additionally, none of the counters are snapshots anymore, they all increment
over time. The flow.memuse and flow.spare counters are exceptions.

Misc

FlowQueue has been split into a FlowQueuePrivate (unlocked) and FlowQueue.
Flow no longer has 'prev' pointers and used a unified 'next' pointer for
both hash and queue use.

4 years agounittests: check for flow memuse
Victor Julien [Mon, 3 Aug 2020 13:49:05 +0000 (15:49 +0200)] 
unittests: check for flow memuse

4 years agoflow-manager: call other timeouts max once a second
Victor Julien [Tue, 24 Dec 2019 15:12:51 +0000 (16:12 +0100)] 
flow-manager: call other timeouts max once a second

Call Defrag and others only once per second. Flow Manager may wake
up (much) more often when flow engine is under resource pressure.
As this does not affect Defrag and others, it only unnecessarily
adds load.

4 years agoflow-manager: only update FlowBucket::next_ts if it changed
Victor Julien [Mon, 23 Dec 2019 19:22:37 +0000 (20:22 +0100)] 
flow-manager: only update FlowBucket::next_ts if it changed

4 years agoflow: unref flow at end of flow worker
Victor Julien [Wed, 29 Jan 2020 06:55:12 +0000 (07:55 +0100)] 
flow: unref flow at end of flow worker

4 years agoflow: do timeout checks before tuple compare
Victor Julien [Mon, 13 Jan 2020 19:06:00 +0000 (20:06 +0100)] 
flow: do timeout checks before tuple compare

4 years agoflow: don't reorder list on lookup
Victor Julien [Mon, 13 Jan 2020 14:39:20 +0000 (15:39 +0100)] 
flow: don't reorder list on lookup

Reduces cache misses.

4 years agoflow: timeout check on flow lookup
Victor Julien [Mon, 23 Dec 2019 13:23:05 +0000 (14:23 +0100)] 
flow: timeout check on flow lookup

4 years agoflow: simplify hash lookup logic
Victor Julien [Mon, 23 Dec 2019 12:53:48 +0000 (13:53 +0100)] 
flow: simplify hash lookup logic

Remove double compare paths in favor of a single unified path.

4 years agoflow: only move lastts forward
Victor Julien [Mon, 23 Dec 2019 15:09:51 +0000 (16:09 +0100)] 
flow: only move lastts forward

Pcaps with timestamps jumping around could confuse flow timeout
handling otherwise.

4 years agoflow/worker: check pkt src using DEBUG_VALIDATE_BUG_ON
Victor Julien [Sat, 2 May 2020 18:17:04 +0000 (20:17 +0200)] 
flow/worker: check pkt src using DEBUG_VALIDATE_BUG_ON

5 years agorust/rdp: Fix use of incorrect buffer 5276/head
Jeff Lucovsky [Wed, 5 Aug 2020 13:56:58 +0000 (09:56 -0400)] 
rust/rdp: Fix use of incorrect buffer

This commit updates the connection confirmation parsing function to use
the correct buffer when determining the packet type.

5 years agosmb: use uuid crate
Shivani Bhardwaj [Wed, 5 Aug 2020 11:54:09 +0000 (17:24 +0530)] 
smb: use uuid crate

5 years agorust: only run cbindgen if needed
Jason Ish [Wed, 17 Jun 2020 22:44:28 +0000 (16:44 -0600)] 
rust: only run cbindgen if needed

Only run cbindgen when necessary. This is a bit tricky. When
building a dist we want to unconditionally build the headers.

When going through a "make; sudo make install" type process,
cbindgen should not be run as the headers already exist, are
valid, and the environment under sudo is more often than
not suitable to pick up the Rust toolchains when installed
with rustup.

For the normal "make" case we have the gen/rust-bindings.h file
depend on library file, this will cause it to only be rebuilt
if the code was modified.

For "make dist" we unconditionally create "dist/rust-bindings.h".
This means the generated file could be in 2 locations, so update
configure.ac, and the library search find to find it.

The "gen/rust-bindings.h" should be picked up first if it exists,
for those who develop from a dist archive where "dist/rust-bindings.h"
also exists.

Not completely happy having the same file in 2 locations, but not
sure how else to get the dependency tracking correct.

5 years agoalert/eve: add snmp metadata for rdp alerts
Jason Ish [Tue, 4 Aug 2020 22:27:30 +0000 (16:27 -0600)] 
alert/eve: add snmp metadata for rdp alerts

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3441

5 years agoalert/eve: add snmp metadata for snmp alerts
Jason Ish [Tue, 4 Aug 2020 21:35:07 +0000 (15:35 -0600)] 
alert/eve: add snmp metadata for snmp alerts

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3441

5 years agodcerpc: handle gap for TCP streams 5270/head
Shivani Bhardwaj [Thu, 25 Jun 2020 20:02:59 +0000 (01:32 +0530)] 
dcerpc: handle gap for TCP streams

5 years agodns: add tailing data to split tcp unit test 5266/head
Jason Ish [Tue, 4 Aug 2020 19:50:26 +0000 (13:50 -0600)] 
dns: add tailing data to split tcp unit test

Add trailing data to the complete payload to test the case
where data is consumed, but still incomplete.

5 years agodns: fix subtraction overflow in debug message
Jason Ish [Tue, 4 Aug 2020 19:47:19 +0000 (13:47 -0600)] 
dns: fix subtraction overflow in debug message

The math for the return value wasn't updated in the debug log
to match the logic and could lead to a subtraction overflow

5 years agodns: return status from parsing tcp request
Philippe Antoine [Thu, 30 Jul 2020 15:23:48 +0000 (17:23 +0200)] 
dns: return status from parsing tcp request

5 years agodns: fix incomplete results
Philippe Antoine [Thu, 30 Jul 2020 14:32:40 +0000 (16:32 +0200)] 
dns: fix incomplete results

and messages parsing whose length is >= 32768

5 years agopcap: recusively reading pcaps / documentation 5265/head
James Dutrisac [Tue, 28 Jul 2020 17:10:42 +0000 (13:10 -0400)] 
pcap: recusively reading pcaps / documentation

Changes to doc/userguide/partials/options.rst for feature 2363
   (reading pcaps recursively)

5 years agopcap: read directories recursively
James Dutrisac [Tue, 28 Jul 2020 17:09:48 +0000 (13:09 -0400)] 
pcap: read directories recursively

Describe Changes
- Added ability to recursively read pcap directories
- src/suricata.c: addition of new command line parameter
    --pcap-file-recursive
- src/source-pcap-file.c: parsing of the command line argument
- src/source-pcap-file-directory-helper.h: two thread vars tracking
    directory depth and should recurse
- src/util-error.c / src/util-error.h:
   Added new warning code "SC_WARN_PATH_READ_ERROR"
- Redmine ticket: https://redmine.openinfosecfoundation.org/issues/2363

Ticket: #2363

5 years agopath: introduce path handling util funcs
James Dutrisac [Tue, 28 Jul 2020 17:08:29 +0000 (13:08 -0400)] 
path: introduce path handling util funcs

This commit provides changes to util-path.c and util-path.h
to support the recursive reading of directories. It adds
4 functions.
- SCIsRegularFile to provide OS independent file info.
- SCIsRegularDirectory to provide OS independent directory info.
- SCRealPath is an OS independent wrapper for realpath.
- PathJoin to manage path resolution logic.

5 years agostream/app-layer: break loop on proto change
Philippe Antoine [Fri, 31 Jul 2020 06:56:37 +0000 (08:56 +0200)] 
stream/app-layer: break loop on proto change

5 years agodatasets: fix null pointer deref
Shivani Bhardwaj [Mon, 3 Aug 2020 16:43:59 +0000 (22:13 +0530)] 
datasets: fix null pointer deref

5 years agodatasets: Init even in socket mode
Shivani Bhardwaj [Mon, 3 Aug 2020 16:41:40 +0000 (22:11 +0530)] 
datasets: Init even in socket mode

Closes redmine ticket 3476.

5 years agodetect-mqtt: unify error handling in rule parsing
Sascha Steinbiss [Mon, 3 Aug 2020 08:27:26 +0000 (10:27 +0200)] 
detect-mqtt: unify error handling in rule parsing

This is meant to provide a single path to the error case.
This might help make things more clear for static
checkers.

5 years agodetect-engine: initialize struct fields
Sascha Steinbiss [Mon, 3 Aug 2020 08:26:04 +0000 (10:26 +0200)] 
detect-engine: initialize struct fields

5 years agohttp: merge duplicated code
Philippe Antoine [Tue, 19 May 2020 12:01:25 +0000 (14:01 +0200)] 
http: merge duplicated code

HtpRequestBodyHandlePUT and HtpRequestBodyHandlePOST

5 years agohttp: use more precise parameter in HtpRequestBodySetupMultipart
Philippe Antoine [Tue, 19 May 2020 11:59:56 +0000 (13:59 +0200)] 
http: use more precise parameter in HtpRequestBodySetupMultipart

So that we can see that it does not have to handle gaps

5 years agohttp: remove unused code
Philippe Antoine [Tue, 19 May 2020 11:58:38 +0000 (13:58 +0200)] 
http: remove unused code

HtpRequestBodySetupPUT function
So that we can see that we do not use data=NULL in there

5 years agofile: handles gaps natively
Philippe Antoine [Tue, 19 May 2020 11:55:41 +0000 (13:55 +0200)] 
file: handles gaps natively

ie data=NULL and len>0 parameters

5 years agoutil: PrintRawDataFp handles null
Philippe Antoine [Tue, 19 May 2020 11:50:24 +0000 (13:50 +0200)] 
util: PrintRawDataFp handles null

for gaps which are data=NULL and len>0

5 years agofiles: rust closes files even on 0 length chunk
Philippe Antoine [Wed, 1 Jul 2020 18:14:27 +0000 (20:14 +0200)] 
files: rust closes files even on 0 length chunk

5 years agoapplayer: allow rust parsers to have only one probe
Philippe Antoine [Fri, 13 Mar 2020 08:37:56 +0000 (09:37 +0100)] 
applayer: allow rust parsers to have only one probe

5 years agooutput-json: add MAC address output 5258/head
Sascha Steinbiss [Mon, 2 Mar 2020 18:10:30 +0000 (19:10 +0100)] 
output-json: add MAC address output

This commit adds MAC address output to the EVE-JSON format. We follow the
remarks made in Redmine ticket #962: for packets, log MAC src/dst as a
scalar field in EVE; for flows, log MAC src/dst as lists in EVE. Field names
are different between flow and packet context to avoid type confusion
(src_mac vs. src_macs). Configuration approach and JSON representation is
taken from previous GitHub PR #2700.

5 years agooutput/anomaly: Restrict anomaly logger count
Jeff Lucovsky [Sat, 1 Aug 2020 13:45:04 +0000 (09:45 -0400)] 
output/anomaly: Restrict anomaly logger count

This commit restricts the anomaly logger count. The restriction is
necessary due to state maintenance in the logger that doesn't scale
beyond a single logger.

Until that issue's solved, when multiple anomaly loggers are configured,
an error message will be emitted to highlight the restriction.

5 years agosignature: checks for integer overflow in limits propagation
Philippe Antoine [Thu, 23 Jul 2020 09:26:16 +0000 (11:26 +0200)] 
signature: checks for integer overflow in limits propagation

5 years agoeve/yaml: move mqtt down
Victor Julien [Sun, 2 Aug 2020 18:23:29 +0000 (20:23 +0200)] 
eve/yaml: move mqtt down

5 years agofuzz/pcap: enable MQTT parser
Victor Julien [Sun, 2 Aug 2020 18:23:08 +0000 (20:23 +0200)] 
fuzz/pcap: enable MQTT parser

5 years agodatasets: reload static sets
Shivani Bhardwaj [Mon, 27 Jul 2020 13:47:10 +0000 (19:17 +0530)] 
datasets: reload static sets

5 years agorust/mqtt: add MQTT parser
Sascha Steinbiss [Mon, 4 May 2020 13:29:23 +0000 (15:29 +0200)] 
rust/mqtt: add MQTT parser

5 years agodetect: adds engine for u8 keywords
Philippe Antoine [Fri, 3 Apr 2020 07:16:24 +0000 (09:16 +0200)] 
detect: adds engine for u8 keywords

5 years agodoc/output: Document multithreaded eve option
Jeff Lucovsky [Thu, 30 Jul 2020 11:08:12 +0000 (07:08 -0400)] 
doc/output: Document multithreaded eve option

5 years agooutput/json: Multi-threaded EVE logging support
Jeff Lucovsky [Tue, 28 Jul 2020 13:09:27 +0000 (09:09 -0400)] 
output/json: Multi-threaded EVE logging support

This commit modifies the JSON loggers with changes necessary to support
multi-threaded EVE output.

Each "thread-init" function sets up the per-thread log file context for
subsequent calls to the JSON output to buffer function.

5 years agolog: Support multi-threaded eve output.
Jeff Lucovsky [Tue, 28 Jul 2020 13:03:05 +0000 (09:03 -0400)] 
log: Support multi-threaded eve output.

5 years agooutput: Check for fwrite_unlocked
Jeff Lucovsky [Wed, 29 Jul 2020 13:56:55 +0000 (09:56 -0400)] 
output: Check for fwrite_unlocked

This commit creates a macro for fwrite_unlocked which is probed during
configuration time.

5 years agooutput: Correct typos
Jeff Lucovsky [Tue, 28 Jul 2020 12:39:39 +0000 (08:39 -0400)] 
output: Correct typos

5 years agooutput: Remove unused variables/define
Jeff Lucovsky [Tue, 28 Jul 2020 13:34:59 +0000 (09:34 -0400)] 
output: Remove unused variables/define

5 years agolog: remove unused include files
Jeff Lucovsky [Tue, 28 Jul 2020 12:16:12 +0000 (08:16 -0400)] 
log: remove unused include files

5 years agooutput/flow: Eliminate unnecessary parameter
Jeff Lucovsky [Sun, 26 Jul 2020 18:21:18 +0000 (14:21 -0400)] 
output/flow: Eliminate unnecessary parameter

This commit removes a parameter to an internal-only function call.
Removing the parameter allows an JSON builder optimization to be used.

5 years agooutput/netflow: Eliminate unneeded parameter
Jeff Lucovsky [Sun, 26 Jul 2020 18:19:53 +0000 (14:19 -0400)] 
output/netflow: Eliminate unneeded parameter

This commit changes an internal-only function to remove a parameter
that's invariant in all use cases. This allows an JSON builder
optimization to be used.

5 years agotransform: adds url_decode keyword
Philippe Antoine [Wed, 6 Nov 2019 10:23:35 +0000 (11:23 +0100)] 
transform: adds url_decode keyword

Fixes https://redmine.openinfosecfoundation.org/issues/2689

Adds a new source file to handle this keyword.
And modifies documentation, Makefile, and registration accordingly.

url_decode decodes url-encoded data, ie replacing '+' with space
and '%HH' with its value.

5 years agostream: fix endless loop in traffic with gaps 5247/head
Victor Julien [Thu, 30 Jul 2020 12:43:03 +0000 (14:43 +0200)] 
stream: fix endless loop in traffic with gaps

5 years agoflow: avoid double state update on reuse
Victor Julien [Thu, 30 Jul 2020 11:22:15 +0000 (13:22 +0200)] 
flow: avoid double state update on reuse

Avoids an unnecessary atomic operation.

5 years agoflow: minor cleanups
Victor Julien [Thu, 30 Jul 2020 11:21:29 +0000 (13:21 +0200)] 
flow: minor cleanups

5 years agoflow: validate emergency timeout settings
Victor Julien [Fri, 10 Jul 2020 08:42:32 +0000 (10:42 +0200)] 
flow: validate emergency timeout settings

Make sure they are below the regular values.

5 years agoflow: improve performance in emergency mode
Victor Julien [Wed, 22 Jul 2020 11:50:14 +0000 (13:50 +0200)] 
flow: improve performance in emergency mode

When the flow engine enters emergency mode, 3 things happen:

1. a different set of (lower) timeout values are applied
2. the flow manager runs more often
3. worker threads go get a flow directly from the hash table

Testing showed that performance went down significantly due to concurrency
issues:

1. worker threads would fight each other over the hash access
2. flow manager would get in the way of workers

This patch changes the behavior in 2 ways:

1. it makes the flow manager slightly less aggressive. It will still
   try to run ~3 times per second, but no longer 10 times.

   This should be reducing the contention. At the same time flows
   won't time out faster if they are checked many times per second.

2. The 'get a used flow' logic optimizes the use of atomics by only
   doing an atomic operation once, and while doing so reserving
   a slice of the hash per worker.

   The worker will also give up much quicker, to avoid the overhead
   of hash walking and taking and releasing locks.

These combined changes show much better 'under stress' behavior, esp
on multi-NUMA systems.

5 years agoenip: use status for probing parser 5242/head
Philippe Antoine [Sat, 2 May 2020 18:17:35 +0000 (20:17 +0200)] 
enip: use status for probing parser

5 years agosignature: checks for integer overflow in limits propagation
Philippe Antoine [Thu, 23 Jul 2020 09:26:16 +0000 (11:26 +0200)] 
signature: checks for integer overflow in limits propagation

5 years agodetect: fix read overflow in DetectGetLastSMByListId
Philippe Antoine [Thu, 23 Jul 2020 11:28:57 +0000 (13:28 +0200)] 
detect: fix read overflow in DetectGetLastSMByListId

5 years agoeve: remove unused jansson code
Victor Julien [Tue, 28 Jul 2020 15:25:13 +0000 (17:25 +0200)] 
eve: remove unused jansson code

5 years agoeve/metadata: create preformatted json string at start up
Victor Julien [Tue, 28 Jul 2020 15:23:50 +0000 (17:23 +0200)] 
eve/metadata: create preformatted json string at start up

Avoid runtime overhead of assembling metadata json string by
pre-creating it at rule parsing time.

5 years agodetect/profile: convert match dumps to jsonbuilder
Victor Julien [Tue, 28 Jul 2020 13:14:22 +0000 (15:14 +0200)] 
detect/profile: convert match dumps to jsonbuilder

Remove unused code and do minor misc cleanups as well.

5 years agopfring: fix compile warning 5234/head
Victor Julien [Mon, 27 Jul 2020 08:16:29 +0000 (10:16 +0200)] 
pfring: fix compile warning

5 years agoeve: remove unused json_t common functions
Victor Julien [Mon, 27 Jul 2020 17:48:08 +0000 (19:48 +0200)] 
eve: remove unused json_t common functions

These are no longer used as all callers have switched to
the JsonBuilder equivalents.

5 years agoeve/tls: minor cleanups
Victor Julien [Mon, 27 Jul 2020 17:28:22 +0000 (19:28 +0200)] 
eve/tls: minor cleanups

5 years agoeve/metadata: convert to jsonbuilder
Victor Julien [Mon, 27 Jul 2020 17:22:52 +0000 (19:22 +0200)] 
eve/metadata: convert to jsonbuilder

5 years agostream: call parser with 0 data on EOF
Victor Julien [Mon, 6 Jul 2020 10:05:08 +0000 (12:05 +0200)] 
stream: call parser with 0 data on EOF

This way both sides can call the EOF logic.

5 years agoapp-layer/tcp: don't use un-ACK'd data
Victor Julien [Mon, 6 Jul 2020 10:05:01 +0000 (12:05 +0200)] 
app-layer/tcp: don't use un-ACK'd data

Still use un-ACK'd data in unclean shutdown. This means any state
before TCP_CLOSED, or TCP_CLOSED that was caused by a RST.

5 years agoflow/timeout: flag last pseudo packet
Victor Julien [Fri, 3 Jul 2020 12:42:48 +0000 (14:42 +0200)] 
flow/timeout: flag last pseudo packet

Flag the last flow timeout pseudo packet so that we can force
TX logging w/o setting both app-layer flags.

Case this fixes:

1. flow times out when only TS TCP data received, but non of it is ACK'd.
   So there is no app-layer proto yet, or app state or Flow::alparser. So
   EOF flags can't be set.

2. Flow timeout sees no reason to create pseudo packet in TC direction.

3. TS pseudo packet finds HTTP, creates HTTP state, flag EOF TS.

4. TX logging skips HTTP logging because:
   - TC progress not reached
   - EOF TC flag not set.

The solution has been to flag the very last packet for the flow as such
and use it has a master-EOF flag.

5 years agostream/tcp: track if ssn has been closed with RST
Victor Julien [Fri, 3 Jul 2020 14:38:56 +0000 (16:38 +0200)] 
stream/tcp: track if ssn has been closed with RST

5 years agoapp-layer: set EOFs on app-layer disable
Victor Julien [Thu, 2 Jul 2020 20:31:02 +0000 (22:31 +0200)] 
app-layer: set EOFs on app-layer disable

5 years agoflow/worker: set EOF flags on change proto
Victor Julien [Thu, 2 Jul 2020 19:59:50 +0000 (21:59 +0200)] 
flow/worker: set EOF flags on change proto

5 years agoflow-timeout: set app-layer EOF flag
Victor Julien [Thu, 2 Jul 2020 19:58:48 +0000 (21:58 +0200)] 
flow-timeout: set app-layer EOF flag

5 years agoapp-layer: add debug
Victor Julien [Thu, 2 Jul 2020 19:57:04 +0000 (21:57 +0200)] 
app-layer: add debug

5 years agostream: minor debug fixup
Victor Julien [Thu, 2 Jul 2020 19:53:37 +0000 (21:53 +0200)] 
stream: minor debug fixup

5 years agoapp-layer/pd: improve size check in bail conditions
Victor Julien [Thu, 2 Jul 2020 19:25:46 +0000 (21:25 +0200)] 
app-layer/pd: improve size check in bail conditions