]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
4 years agoflow/bypass: don't bypass on flow timeout pseudo packets 5376/head
Victor Julien [Mon, 7 Sep 2020 10:57:59 +0000 (12:57 +0200)] 
flow/bypass: don't bypass on flow timeout pseudo packets

4 years agorule parsing: valid that input rule string is UTF8
Jason Ish [Fri, 4 Sep 2020 16:45:52 +0000 (10:45 -0600)] 
rule parsing: valid that input rule string is UTF8

Before parsing a rule string, validate that it is UTF-8 first.

Related Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3850

4 years agorust/util: expose function to test strings for valid UTF-8
Jason Ish [Fri, 4 Sep 2020 16:44:27 +0000 (10:44 -0600)] 
rust/util: expose function to test strings for valid UTF-8

rs_check_utf8 will check that the provided string is valid
UTF-8 by converting it to a Rust string and returning true
or false.

4 years agohttp/eve: use set_string_from_bytes where appropriate
Jason Ish [Fri, 4 Sep 2020 15:04:34 +0000 (09:04 -0600)] 
http/eve: use set_string_from_bytes where appropriate

The JsonBuilder set_string_from_bytes will escape unprintable
characters in the output stream. Using BytesToStringBuffer
can generate invalid UTF-8 which prevents the conversion from
a C string to a Rust string.

4 years agodetect/dataset: error if set couldn't be fully loaded
Victor Julien [Mon, 7 Sep 2020 09:38:11 +0000 (11:38 +0200)] 
detect/dataset: error if set couldn't be fully loaded

4 years agodatasets: free old data when reusing a hash container
Victor Julien [Mon, 7 Sep 2020 08:25:37 +0000 (10:25 +0200)] 
datasets: free old data when reusing a hash container

4 years agolog: Log errors while writing log info
Jeff Lucovsky [Tue, 11 Aug 2020 12:17:12 +0000 (08:17 -0400)] 
log: Log errors while writing log info

This commit adds logic to log errors during output. Errors are logged
once and the number of errors is maintained.

4 years agolog: Add log output error code
Jeff Lucovsky [Tue, 11 Aug 2020 12:16:52 +0000 (08:16 -0400)] 
log: Add log output error code

4 years agolog: Use unlocked variants of stdio functions
Jeff Lucovsky [Fri, 7 Aug 2020 12:34:20 +0000 (08:34 -0400)] 
log: Use unlocked variants of stdio functions

This commit uses the unlocked variants of additional stdio functions

4 years agolog: Add more stdio_unlocked macros
Jeff Lucovsky [Tue, 11 Aug 2020 12:15:52 +0000 (08:15 -0400)] 
log: Add more stdio_unlocked macros

This commit adds additional macros for interfaces in stdio_unlocked
according to their local availability.

4 years agoerror: reformat enum
Victor Julien [Mon, 7 Sep 2020 05:09:05 +0000 (07:09 +0200)] 
error: reformat enum

4 years agoapp-layer: handle parser return code issues more gracefully 5368/head
Victor Julien [Fri, 4 Sep 2020 13:38:58 +0000 (15:38 +0200)] 
app-layer: handle parser return code issues more gracefully

4 years agopcap: fix minor scan-build warnings 5361/head
Victor Julien [Fri, 4 Sep 2020 08:52:04 +0000 (10:52 +0200)] 
pcap: fix minor scan-build warnings

4 years agocommandline: add static analyzer hint for -r parsing
Victor Julien [Fri, 4 Sep 2020 08:46:59 +0000 (10:46 +0200)] 
commandline: add static analyzer hint for -r parsing

4 years agocommandline: minor formatting fixes
Victor Julien [Fri, 4 Sep 2020 08:44:54 +0000 (10:44 +0200)] 
commandline: minor formatting fixes

4 years agogeneral: Improve grammar in error messages
Jeff Lucovsky [Thu, 6 Aug 2020 12:34:45 +0000 (08:34 -0400)] 
general: Improve grammar in error messages

This commit corrects a minor grammar issue in address/port error
messages.

4 years agodecode/geneve: add config to yaml
Victor Julien [Fri, 4 Sep 2020 08:11:40 +0000 (10:11 +0200)] 
decode/geneve: add config to yaml

4 years agogithub-ci: apply default CFLAGS to all builds
Jason Ish [Wed, 2 Sep 2020 17:53:20 +0000 (11:53 -0600)] 
github-ci: apply default CFLAGS to all builds

4 years agogithub-ci: add test build without jansson
Jason Ish [Tue, 1 Sep 2020 21:37:54 +0000 (15:37 -0600)] 
github-ci: add test build without jansson

This is to cover a test from Travis CI where we make sure
that ./configure fails if libjansson is not available.

4 years agogithub-ci: update debian 9 test to use known Rust version
Jason Ish [Tue, 1 Sep 2020 21:32:38 +0000 (15:32 -0600)] 
github-ci: update debian 9 test to use known Rust version

Choose Rust 1.39.0 as a known version of Rust that we build against
to see in CI if we build with this version, but fail with latest.

This is to cover a similar test from Travis CI.

4 years agogithub-ci: enable debug on Fedora 32 build
Jason Ish [Tue, 1 Sep 2020 21:23:03 +0000 (15:23 -0600)] 
github-ci: enable debug on Fedora 32 build

4 years agogithub-ci: check that configure fails if rust to old
Jason Ish [Wed, 19 Aug 2020 18:17:00 +0000 (12:17 -0600)] 
github-ci: check that configure fails if rust to old

Migration of similar test from Travis-CI.

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

4 years agogithub-ci: Ubuntu 20.4 build with -NDEBUG
Jason Ish [Wed, 19 Aug 2020 15:28:07 +0000 (09:28 -0600)] 
github-ci: Ubuntu 20.4 build with -NDEBUG

To cover Travis-CI test that builds with -NDEBUG.

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

4 years agogithub-ci: ubuntu 20.04 build without nss/nspr
Jason Ish [Mon, 17 Aug 2020 22:51:38 +0000 (16:51 -0600)] 
github-ci: ubuntu 20.04 build without nss/nspr

Adds a test that builds and tests Suricata without nss/nspr
to replace the similar test on Travis-CI.

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

4 years agogithub-ci: Fedora 32 builder with asan enabled
Jason Ish [Wed, 12 Aug 2020 15:06:23 +0000 (09:06 -0600)] 
github-ci: Fedora 32 builder with asan enabled

Also enables -Wshadow and rust-strict to cover those cases
from Travis.

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

4 years agodecode/teredo: Modified/refactored Teredo logic
Ali Jad Khalil [Sat, 2 May 2020 21:04:07 +0000 (21:04 +0000)] 
decode/teredo: Modified/refactored Teredo logic

This is just a slight refactor to make analagous decoding/encapsulation
schemes - Geneve, Teredo, and VXLAN - be implemented as similarly as
possible.

4 years agodecode/vxlan: Modified/refactored VXLAN logic
Ali Jad Khalil [Sat, 2 May 2020 21:01:58 +0000 (21:01 +0000)] 
decode/vxlan: Modified/refactored VXLAN logic

This is just a slight refactor to make analagous decoding/encapsulation
schemes - Geneve, Teredo, and VXLAN - be implemented as similarly as
possible.

4 years agodecode/geneve: Add Geneve decoding functionality
Ali Jad Khalil [Wed, 29 Apr 2020 07:36:18 +0000 (07:36 +0000)] 
decode/geneve: Add Geneve decoding functionality

These changes are in response to feature request 3063. Geneve is
very similar to VXLAN, but uses a slightly different encapsulation
scheme.

4 years agodoc: dns - document additional fields in eve event
Simon Dugas [Thu, 23 Apr 2020 18:29:23 +0000 (18:29 +0000)] 
doc: dns - document additional fields in eve event

Documentation of additional fields for soa and sshfp. Also some minor
doc fixes and updates.

4 years agodns: parse and log fields for SOA record type
Simon Dugas [Fri, 24 Apr 2020 17:57:20 +0000 (17:57 +0000)] 
dns: parse and log fields for SOA record type

Added `dns_parse_rdata_soa` to parse SOA fields into an `DNSRDataSOA`
struct.

Added logging for answer and authority SOA records in both version
1 & 2, as well as grouped formats.

4 years agodns: use nom's rest to take all remaining rdata
Simon Dugas [Fri, 24 Apr 2020 18:03:23 +0000 (18:03 +0000)] 
dns: use nom's rest to take all remaining rdata

Using nom's `rest` combinator eliminates the need to call the do_parse
macro for parsing a single element.

4 years agodns: refactor to handle more rdata formats
Simon Dugas [Wed, 15 Apr 2020 15:20:22 +0000 (15:20 +0000)] 
dns: refactor to handle more rdata formats

Represent rdata as `DNSRData` enum variants instead of `Vec<u8>`.
This will allow parsing/logging of more complex formats like SOA.

4 years agodecode: reformat event table
Victor Julien [Fri, 4 Sep 2020 10:57:54 +0000 (12:57 +0200)] 
decode: reformat event table

4 years agodoc: Improve grammar, spelling and clarifications 5356/head
Jeff Lucovsky [Sun, 23 Aug 2020 23:42:21 +0000 (19:42 -0400)] 
doc: Improve grammar, spelling and clarifications

This commit improves the overall documentation's grammar, spelling, and
adds clarifications  where needed.

4 years agoplugins: require registration function SCPluginRegister
Jason Ish [Tue, 25 Aug 2020 19:52:00 +0000 (13:52 -0600)] 
plugins: require registration function SCPluginRegister

Instead of looking for a symbol, "PluginSpec" look for a function
named SCPluginRegister that returns a SCPlugin.

This makes it much easier to create Rust plugins without having
to deal with dlopen constructors and such, which is rather
straight forward in C, but a bit of advanced boilerplate in Rust
that can be eliminated by simply calling a registration function.

4 years agorust/log: minor cleanup
Jason Ish [Tue, 25 Aug 2020 19:17:55 +0000 (13:17 -0600)] 
rust/log: minor cleanup

Group functions for setting and getting the log level
together.

4 years agorust: function macro now returns the function name
Jason Ish [Tue, 25 Aug 2020 19:15:21 +0000 (13:15 -0600)] 
rust: function macro now returns the function name

Borrow a macro from https://github.com/popzxc/stdext-rs that
will give us the Rust function name in SCLog messages in Rust.

As this trick only works on Rust 1.38 and newer, keep the old
macro around and set a feature based on a Rust version test
done during ./configure.

4 years agorust: plugin bootstrap function
Jason Ish [Tue, 25 Aug 2020 18:51:26 +0000 (12:51 -0600)] 
rust: plugin bootstrap function

Functions written in Rust will need to suricata::plugin::init()
to bootstrap themselves. This bootstrap process sets the log level
within the Rust address space, and hooks up function pointers
that are expected to be set during normal runs of Suricata.

4 years agorust/log: set the log level with a pure Rust function
Jason Ish [Tue, 25 Aug 2020 18:50:31 +0000 (12:50 -0600)] 
rust/log: set the log level with a pure Rust function

Make sure the log level is setup with a pure Rust function, so
when it is set, its set within the address space of the caller.

This is important for Rust plugins where the Rust modules are not
in the address space of the Suricata main process.

4 years agosuricata: expose the SuricataContext with a function
Jason Ish [Tue, 25 Aug 2020 16:12:04 +0000 (10:12 -0600)] 
suricata: expose the SuricataContext with a function

Expose the "SuricataContext" required by Rust as a function. During
normal startup we register this context with the Rust code, but
plugins written in Rust will need to get the same registration
done, but to do this in a plugin, the plugin code must
call and set the context within its address space.

4 years agologging: expose the log level with a function
Jason Ish [Tue, 25 Aug 2020 18:47:10 +0000 (12:47 -0600)] 
logging: expose the log level with a function

The log level needs to exposed so Rust plugins can bootstrap
themselves with the correct login to SCLogNotice!(), etc work
as expected.

4 years agorust/logging: allow log macros to be used by plugins
Jason Ish [Mon, 17 Aug 2020 16:36:19 +0000 (10:36 -0600)] 
rust/logging: allow log macros to be used by plugins

Fix plugin macros so they can be used by external Rust crates
such as plugins.

4 years agorust/Cargo: build as rlib for plugin linkage
Jason Ish [Mon, 17 Aug 2020 16:32:05 +0000 (10:32 -0600)] 
rust/Cargo: build as rlib for plugin linkage

Build Rust code as an rlib, in addition to a staticlib so plugins
can link with the Rust code.

4 years agorust-context: remove unused opaque type Store
Jason Ish [Tue, 25 Aug 2020 16:10:03 +0000 (10:10 -0600)] 
rust-context: remove unused opaque type Store

4 years agorunmodes: memory leak on runmode single
Joshua Lumb [Thu, 13 Aug 2020 13:43:05 +0000 (09:43 -0400)] 
runmodes: memory leak on runmode single

4 years agoconfigure: fix test for rust headers for cross compile
Jason Ish [Tue, 1 Sep 2020 15:49:46 +0000 (09:49 -0600)] 
configure: fix test for rust headers for cross compile

Use "if test ..." instead of AC_CHECK_FILES which does not work
when cross compiling.

4 years agoconfig/lua: Cross-compiling support
Jeff Lucovsky [Sat, 29 Aug 2020 14:59:49 +0000 (10:59 -0400)] 
config/lua: Cross-compiling support

This commit guards the run-time check for a Lua integer so that it no
longer attempts execution in a cross-compilation environment.

4 years agoconfig/pcre: Improved support for cross-compiling
Jeff Lucovsky [Sat, 29 Aug 2020 14:58:54 +0000 (10:58 -0400)] 
config/pcre: Improved support for cross-compiling

This commit changes the logic used to determine if pcre_jit_exec is
available from a run-time to a compile-time check.

4 years agooutput: Remove unused output functions
Jeff Lucovsky [Wed, 12 Aug 2020 13:51:00 +0000 (09:51 -0400)] 
output: Remove unused output functions

This commit removes registration, initialization, and de-initialization
functions no longer needed

4 years agolog: Remove standalone output registration
Jeff Lucovsky [Wed, 12 Aug 2020 13:50:09 +0000 (09:50 -0400)] 
log: Remove standalone output registration

Remove standalone output logger registration since eve is
multi-instance.

4 years agodoc: http.host keyword note for matching on port
jason taylor [Wed, 26 Aug 2020 17:25:23 +0000 (13:25 -0400)] 
doc: http.host keyword note for matching on port

Signed-off-by: jason taylor <jtfas90@gmail.com>
4 years agoflow: fix multi-manager hash range calculation
Victor Julien [Thu, 3 Sep 2020 10:34:37 +0000 (12:34 +0200)] 
flow: fix multi-manager hash range calculation

4 years agogithub-ci: fix building against request libhtp/sv PR 5347/head 5349/head
Jason Ish [Tue, 1 Sep 2020 16:55:57 +0000 (10:55 -0600)] 
github-ci: fix building against request libhtp/sv PR

The variable name was wrong, causing the libhtp-pr and sv-pr
parameters in the commit message to not be applied.

4 years agoflow: suppress noisy messages 5346/head
Victor Julien [Mon, 31 Aug 2020 13:00:28 +0000 (15:00 +0200)] 
flow: suppress noisy messages

4 years agodns: simply skips zero-sized dns requests/responses
Philippe Antoine [Wed, 26 Aug 2020 08:52:54 +0000 (10:52 +0200)] 
dns: simply skips zero-sized dns requests/responses

4 years agodcerpc: validate signature with dcerpc keywords
Philippe Antoine [Thu, 27 Aug 2020 15:32:41 +0000 (17:32 +0200)] 
dcerpc: validate signature with dcerpc keywords

so that they do not use another protocol's keywords

4 years agohttp: handles gaps
Philippe Antoine [Tue, 19 May 2020 11:57:45 +0000 (13:57 +0200)] 
http: handles gaps

ie data=NULL and len>0 from libhtp callbacks

4 years agoflowbits: convert flowbits dumping to json builder
Victor Julien [Fri, 28 Aug 2020 15:26:47 +0000 (17:26 +0200)] 
flowbits: convert flowbits dumping to json builder

4 years agodetect/analyzer: convert to jsonbuilder
Victor Julien [Tue, 28 Jul 2020 21:26:01 +0000 (23:26 +0200)] 
detect/analyzer: convert to jsonbuilder

4 years agoci: Run formatting check on pull request
Roland Fischer [Wed, 15 Jul 2020 03:43:58 +0000 (23:43 -0400)] 
ci: Run formatting check on pull request

4 years agoutil: Add clang-format helper script
Roland Fischer [Fri, 3 Jul 2020 04:22:35 +0000 (00:22 -0400)] 
util: Add clang-format helper script

4 years agodoc: Add dev code-style
Roland Fischer [Fri, 3 Jul 2020 04:22:03 +0000 (00:22 -0400)] 
doc: Add dev code-style

4 years agocommon: Add clang-format file
Roland Fischer [Tue, 7 Jul 2020 21:54:36 +0000 (17:54 -0400)] 
common: Add clang-format file

clang-format allows to auto-format C code. The settings here are set
up to follow the code style, see
https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Coding_Style.

4 years agothreshold: fix potential memory leak 5325/head
Victor Julien [Tue, 25 Aug 2020 14:06:34 +0000 (16:06 +0200)] 
threshold: fix potential memory leak

4 years agoreject: minor code cleanup
Victor Julien [Tue, 25 Aug 2020 13:58:52 +0000 (15:58 +0200)] 
reject: minor code cleanup

Use enum for direction to assist compiler.

4 years agostream: fix GAP size
Victor Julien [Tue, 25 Aug 2020 12:08:37 +0000 (14:08 +0200)] 
stream: fix GAP size

Fix GAPs sizes sometimes exceeding the ACK'd data size.

4 years agostream: fix deinit after incomplete init
Victor Julien [Tue, 25 Aug 2020 10:36:08 +0000 (12:36 +0200)] 
stream: fix deinit after incomplete init

4 years agooutput/flow: fix deinit after incomplete init
Victor Julien [Tue, 25 Aug 2020 10:35:51 +0000 (12:35 +0200)] 
output/flow: fix deinit after incomplete init

4 years agonfq: suppress debug message using info level
Victor Julien [Tue, 25 Aug 2020 09:47:38 +0000 (11:47 +0200)] 
nfq: suppress debug message using info level

4 years agoplugins: suppress coverity toctou warning
Victor Julien [Tue, 25 Aug 2020 09:46:47 +0000 (11:46 +0200)] 
plugins: suppress coverity toctou warning

4 years agoflow: work around harmless coverity warnings
Victor Julien [Tue, 25 Aug 2020 09:44:13 +0000 (11:44 +0200)] 
flow: work around harmless coverity warnings

4 years agoflow: fix spare sync incomplete counter
Victor Julien [Tue, 25 Aug 2020 09:40:50 +0000 (11:40 +0200)] 
flow: fix spare sync incomplete counter

4 years agoreject: work around coverity warning
Victor Julien [Tue, 25 Aug 2020 09:39:00 +0000 (11:39 +0200)] 
reject: work around coverity warning

4 years agoplugin: fix typo in long_opts struct 5321/head
Vadym Malakhatko [Mon, 17 Aug 2020 12:29:52 +0000 (15:29 +0300)] 
plugin: fix typo in long_opts struct

4 years agomqtt: fixed wrong slice access
Ilya Bakhtin [Tue, 18 Aug 2020 17:26:36 +0000 (19:26 +0200)] 
mqtt: fixed wrong slice access

Slice access esults in rust panic when mqtt ping is processed

4 years agonapatech: Style -- remove extra space
Jeff Lucovsky [Thu, 20 Aug 2020 15:29:10 +0000 (11:29 -0400)] 
napatech: Style -- remove extra space

4 years agonapatech: Use proper parser for type
Jeff Lucovsky [Thu, 20 Aug 2020 15:28:28 +0000 (11:28 -0400)] 
napatech: Use proper parser for type

This commit uses the proper parser call for the value being parsed.

4 years agonapatech: Improve configuration range handling
Jeff Lucovsky [Thu, 20 Aug 2020 15:27:47 +0000 (11:27 -0400)] 
napatech: Improve configuration range handling

This commit corrects issues parsing ranges from the Napatech section of
the configuration file.

4 years agonapatech: Fix compiler issues w/out bypass
Jeff Lucovsky [Thu, 20 Aug 2020 15:26:33 +0000 (11:26 -0400)] 
napatech: Fix compiler issues w/out bypass

This commit fixes compiler errors when Napatech bypass is not configured

4 years agothreshold: Change rule parsing to use pcre_copy_substring
Carl Smith [Sun, 16 Aug 2020 20:41:35 +0000 (08:41 +1200)] 
threshold: Change rule parsing to use pcre_copy_substring

Fixes memory leak when parsing threshold rules.
All parsed strings are less than 16 characters except
for the IP address which could be up to 48 characters.
Remove redefinition of MAX_SUBSTRINGS

4 years agoconfigure: fix detection of netfilter_queue with older headers
Jason Ish [Fri, 7 Aug 2020 14:57:04 +0000 (08:57 -0600)] 
configure: fix detection of netfilter_queue with older headers

Define _GNU_SOURCE and include sys/types.h so older
netfilter_queue headers can be detected properly, as they are
using u_int_xx style integers.

4 years agodoc/userguide: fix outdated xdp info
Odin Jenseg [Wed, 5 Aug 2020 12:09:08 +0000 (14:09 +0200)] 
doc/userguide: fix outdated xdp info

4 years agoplugins: track all loaded plugins in a list 5317/head
Jason Ish [Tue, 11 Aug 2020 16:26:43 +0000 (10:26 -0600)] 
plugins: track all loaded plugins in a list

Track the pointer returned from dlopen in a list to prevent a
resource leak by the pointer going out of scope.

Found by Coverity, CID 1465661.

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

4 years agoplugins: use closedir to close open directory (not free)
Jason Ish [Tue, 11 Aug 2020 15:31:09 +0000 (09:31 -0600)] 
plugins: use closedir to close open directory (not free)

Found by Coverity, CID 1465665: ALLOC_FREE_MISMATCH.

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

4 years agooutput-json: fix Coverity USE_AFTER_FREE
Jason Ish [Tue, 11 Aug 2020 15:30:01 +0000 (09:30 -0600)] 
output-json: fix Coverity USE_AFTER_FREE

Return error if plugin open fails. Fixes Coverity CID 1465664
USE_AFTER_FREE error.

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

4 years agoautomake: add acsite.m4 to EXTRA_DIST 5286/head
Jason Ish [Mon, 10 Aug 2020 17:20:52 +0000 (11:20 -0600)] 
automake: add acsite.m4 to EXTRA_DIST

This file is required to successfully re-run autoreconf, which
many packaging tools will do even on a prepared distribution
archive.

4 years agogithub-ci: add autoreconf to centos-7 build
Jason Ish [Mon, 10 Aug 2020 17:15:45 +0000 (11:15 -0600)] 
github-ci: add autoreconf to centos-7 build

The prepared distribution packages are failing autoreconf
due to a missing acsite.m4. Add autoreconf to the centos-7
build which uses the prepared package to test for this
issue.

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.