]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
4 years agoapp-layer: improve depth handling 5442/head
Victor Julien [Mon, 21 Sep 2020 19:44:36 +0000 (21:44 +0200)] 
app-layer: improve depth handling

Consider txs inspected and done for a direction after depth is reached for
that direction.

4 years agostream: make sure to call app-layer in case of depth reached
Victor Julien [Mon, 21 Sep 2020 07:12:55 +0000 (09:12 +0200)] 
stream: make sure to call app-layer in case of depth reached

4 years agodcerpc: implement tx free function
Victor Julien [Sat, 19 Sep 2020 18:57:35 +0000 (20:57 +0200)] 
dcerpc: implement tx free function

4 years agodcerpc/tcp: implement trunc logic
Victor Julien [Sat, 19 Sep 2020 18:44:40 +0000 (20:44 +0200)] 
dcerpc/tcp: implement trunc logic

When one side of the connection reaches the STREAM_DEPTH condition the
parser should be aware of this. Otherwise transactions will forever be
waiting for data in that direction.

4 years agoapplayer/rust: expose truncate callback
Victor Julien [Sat, 19 Sep 2020 18:25:05 +0000 (20:25 +0200)] 
applayer/rust: expose truncate callback

4 years agoapp-layer: don't check tx detect flags if detect is disabled
Victor Julien [Sat, 19 Sep 2020 13:50:47 +0000 (15:50 +0200)] 
app-layer: don't check tx detect flags if detect is disabled

4 years agostream: remove GAP flag from stream
Victor Julien [Wed, 23 Sep 2020 11:52:29 +0000 (13:52 +0200)] 
stream: remove GAP flag from stream

This flag was checked in many places, but never set expect in 2 unittests.

4 years agolog/eve: Rename fileinfo alert object to files
Jeff Lucovsky [Wed, 16 Sep 2020 12:11:10 +0000 (08:11 -0400)] 
log/eve: Rename fileinfo alert object to files

This commit changes the name of the "fileinfo" array in the alert object
to "files" to better support legacy use of "fileinfo" in reporting and
elsewhere.

The "fileinfo" event type is not an array while the alert "fileinfo"
member was.

4 years agodoc/userguide: include man page even when not including pdf
Jason Ish [Tue, 15 Sep 2020 15:27:36 +0000 (09:27 -0600)] 
doc/userguide: include man page even when not including pdf

Fix a mistake in Makefile.am where the man page was only being
added to the distribution if the PDF was also created. It should
be included even if the PDF cannot be included.

4 years agodcerpc: fix datatypes while handling stub data
Shivani Bhardwaj [Thu, 24 Sep 2020 05:22:01 +0000 (10:52 +0530)] 
dcerpc: fix datatypes while handling stub data

4 years agodcerpc: fix datatype for stub data len 5441/head
Shivani Bhardwaj [Thu, 24 Sep 2020 14:42:09 +0000 (20:12 +0530)] 
dcerpc: fix datatype for stub data len

4 years agorust: rebuilds std when building fuzzers 5417/head
Philippe Antoine [Wed, 9 Sep 2020 14:05:56 +0000 (16:05 +0200)] 
rust: rebuilds std when building fuzzers

so as to have MSAN working

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-rc1 suricata-6.0.0-rc1
Victor Julien [Thu, 10 Sep 2020 19:42:35 +0000 (21:42 +0200)] 
version: update to 6.0.0-rc1

4 years agochangelog: update for 6.0.0-rc1
Victor Julien [Thu, 10 Sep 2020 19:42:00 +0000 (21:42 +0200)] 
changelog: update for 6.0.0-rc1

4 years agodceprc: signature rust check with is_char_boundary
Philippe Antoine [Fri, 11 Sep 2020 07:44:25 +0000 (09:44 +0200)] 
dceprc: signature rust check with is_char_boundary

before calling split_at which would panic

4 years agodatasets: use default memcap
Shivani Bhardwaj [Fri, 11 Sep 2020 06:28:28 +0000 (11:58 +0530)] 
datasets: use default memcap

4 years agodetect: initialize pointer before calling pcre_study
Philippe Antoine [Wed, 9 Sep 2020 13:54:36 +0000 (15:54 +0200)] 
detect: initialize pointer before calling pcre_study

So as not to check an uninitialized value
Found by MSAN

4 years agodatasets: remove experimental warning 5407/head
Victor Julien [Thu, 10 Sep 2020 19:52:44 +0000 (21:52 +0200)] 
datasets: remove experimental warning

4 years agodoc/datasets: add info about memcap and hashsize
Shivani Bhardwaj [Thu, 10 Sep 2020 12:22:18 +0000 (17:52 +0530)] 
doc/datasets: add info about memcap and hashsize

4 years agodatasets: parse defaults section from yaml
Shivani Bhardwaj [Thu, 10 Sep 2020 08:34:16 +0000 (14:04 +0530)] 
datasets: parse defaults section from yaml

Datasets can now have a global defaults setting in suricata.yaml. In
case the settings for memcap and hashsize are not find in the yaml or
rule, this shall be the fallback.

Example:

datasets:
  defaults:
    memcap: 100mb
    hashsize: 2048
  ua-seen:
    type: string
    load: datasets.csv

4 years agodatasets: allow memcap, hashsize be set via yaml or rule
Shivani Bhardwaj [Thu, 10 Sep 2020 11:45:00 +0000 (17:15 +0530)] 
datasets: allow memcap, hashsize be set via yaml or rule

It is now possible to set the memcap and hashsize via suricata.yaml and
rules.

Rule example:

alert http any any -> any any (http.user_agent; dataset:isset,ua-seen,type string,load datasets.csv,memcap 100mb,hashsize 2048; sid:1;)

suricata.yaml example:

datasets:
  ua-seen:
    type: string
    load: datasets.csv
    memcap: 20mb
    hashsize: 2048

4 years agodatasets: allow max possible memcap while loading
Shivani Bhardwaj [Thu, 10 Sep 2020 11:34:21 +0000 (17:04 +0530)] 
datasets: allow max possible memcap while loading

While using the "load" option of datasets, it should be possible to load
any file from the disk, so set the limit to highest possible.

4 years agorules/tls: sync with changes to the TLS events
Jason Ish [Thu, 3 Sep 2020 19:29:57 +0000 (13:29 -0600)] 
rules/tls: sync with changes to the TLS events

Sync rules with event changes in commit
01aef49cbd32fb2437d1615a2111111e5f3ee862.

4 years agolog/eve: Ensure eve logs have sequential suffixes
Jeff Lucovsky [Wed, 9 Sep 2020 12:59:32 +0000 (08:59 -0400)] 
log/eve: Ensure eve logs have sequential suffixes

This commit ensures that the eve logs have sequential suffixes without
gaps.

4 years agoatomics: Add "decl and init with value" function
Jeff Lucovsky [Thu, 10 Sep 2020 11:47:46 +0000 (07:47 -0400)] 
atomics: Add "decl and init with value" function

This commit adds an interface to declare and initialize an atomic with a
specific value. This can help with situations where there's no defined
initialization path to set things up.

4 years agolog: Ensure threaded eve honors SIGHUP
Jeff Lucovsky [Tue, 8 Sep 2020 12:26:36 +0000 (08:26 -0400)] 
log: Ensure threaded eve honors SIGHUP

This commit ensures that all logging contexts register for the file
rotation mechanism (SIGHUP and configured).

4 years agodoc: document removal of unified2 5405/head
Jason Ish [Tue, 8 Sep 2020 20:01:02 +0000 (14:01 -0600)] 
doc: document removal of unified2

And suggest an alternate tool, Meer if compatibility with
Barnyard2 style databases is required.

Redmine ticket:
https://redmine.openinfosecfoundation.org/issues/3497

4 years agodoc: add removal of individual json loggers
Jason Ish [Tue, 8 Sep 2020 19:29:11 +0000 (13:29 -0600)] 
doc: add removal of individual json loggers

Add link to multiple eve instances as a replacement for this
feature.

4 years agohttp: disables lzma by default for HTTP
Philippe Antoine [Fri, 4 Sep 2020 07:39:44 +0000 (09:39 +0200)] 
http: disables lzma by default for HTTP

4 years agohttp2: settings from http1 upgrade
Philippe Antoine [Thu, 3 Sep 2020 12:22:29 +0000 (14:22 +0200)] 
http2: settings from http1 upgrade

4 years agohttp2: mimic HTTP1 request from upgrade
Philippe Antoine [Fri, 4 Sep 2020 14:06:16 +0000 (16:06 +0200)] 
http2: mimic HTTP1 request from upgrade

4 years agohttp2: first connection upgrade from http1
Philippe Antoine [Thu, 3 Sep 2020 12:19:28 +0000 (14:19 +0200)] 
http2: first connection upgrade from http1

4 years agodnp3: fix unit tests when fuzzing
Philippe Antoine [Sat, 5 Sep 2020 09:43:53 +0000 (11:43 +0200)] 
dnp3: fix unit tests when fuzzing

4 years agoapplayer: keep running detection on protocol change
Philippe Antoine [Tue, 8 Sep 2020 07:23:24 +0000 (09:23 +0200)] 
applayer: keep running detection on protocol change

ie do not stop on first try if we do not have enough data

4 years agoapplayer: on protocol change, use previous state
Philippe Antoine [Wed, 9 Sep 2020 08:09:33 +0000 (10:09 +0200)] 
applayer: on protocol change, use previous state

4 years agohttp: removal of connect unit tests
Philippe Antoine [Wed, 9 Sep 2020 08:08:50 +0000 (10:08 +0200)] 
http: removal of connect unit tests

moved to suricata-verify

4 years agoapplayer: pass parameter to StateAlloc
Philippe Antoine [Fri, 4 Sep 2020 13:29:41 +0000 (15:29 +0200)] 
applayer: pass parameter to StateAlloc

This parameter is NULL or the pointer to the previous state
for the previous protocol in the case of a protocol change,
for instance from HTTP1 to HTTP2

This way, the new protocol can use the old protocol context.
For instance, HTTP2 mimicks the HTTP1 request, to have a HTTP2
transaction with both request and response

4 years agomqtt: add some extra tests for varint parsing
Sascha Steinbiss [Wed, 9 Sep 2020 07:51:56 +0000 (09:51 +0200)] 
mqtt: add some extra tests for varint parsing

4 years agohttp2: handles incomplete frames after banner
Philippe Antoine [Wed, 9 Sep 2020 07:27:00 +0000 (09:27 +0200)] 
http2: handles incomplete frames after banner

To signal incomplete data, we must return the number of
consumed bytes. When we get a banner and some records, we have
to take into account the number of bytes already consumed by
the banner parsing before reaching an incomplete record.

4 years agomqtt: limit size of variable integer 5388/head
Philippe Antoine [Tue, 8 Sep 2020 19:13:07 +0000 (21:13 +0200)] 
mqtt: limit size of variable integer

4 years agodatasets: fix dataset load path construction 5386/head
Jason Ish [Tue, 8 Sep 2020 16:54:20 +0000 (10:54 -0600)] 
datasets: fix dataset load path construction

Test the full path instead of just the filename provided in the
rule to see if it exists.

Fixes the case where a rule file is loaded from a directory
other than the default-rule-directory.

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

4 years agohttp2: returns error in case of index 0
Philippe Antoine [Tue, 8 Sep 2020 14:23:29 +0000 (16:23 +0200)] 
http2: returns error in case of index 0

As is documented in RFC 7541, section 6.1
The index value of 0 is not used.  It MUST be treated as a decoding
error if found in an indexed header field representation.

4 years agosignature: frees transform options in SigMatchPrepare
Philippe Antoine [Tue, 8 Sep 2020 11:33:34 +0000 (13:33 +0200)] 
signature: frees transform options in SigMatchPrepare

4 years agodetect: checks for overflow when comparing signatures priorities
Philippe Antoine [Thu, 27 Aug 2020 15:11:10 +0000 (17:11 +0200)] 
detect: checks for overflow when comparing signatures priorities

4 years agoflow: suppress Coverity FP 5381/head
Victor Julien [Tue, 8 Sep 2020 08:41:29 +0000 (10:41 +0200)] 
flow: suppress Coverity FP

4 years agoflow: minor code cleanup
Victor Julien [Tue, 8 Sep 2020 08:40:06 +0000 (10:40 +0200)] 
flow: minor code cleanup

4 years agoflow: turn BUG_ON into debug check
Victor Julien [Tue, 8 Sep 2020 08:29:23 +0000 (10:29 +0200)] 
flow: turn BUG_ON into debug check

4 years agoebpf: fix invalid description in doc string
Eric Leblond [Sat, 5 Sep 2020 20:57:23 +0000 (22:57 +0200)] 
ebpf: fix invalid description in doc string

4 years agodoc/datasets: explain reloads, general improvements
Victor Julien [Mon, 7 Sep 2020 18:04:02 +0000 (20:04 +0200)] 
doc/datasets: explain reloads, general improvements

4 years agodetect/app-layer-events: improve warnings/errors
Victor Julien [Mon, 7 Sep 2020 14:46:39 +0000 (16:46 +0200)] 
detect/app-layer-events: improve warnings/errors

Improve handling of outdated events that are no longer supported by the engine.

4 years agoprscript: port to python 3
Eric Leblond [Sun, 6 Sep 2020 18:27:04 +0000 (20:27 +0200)] 
prscript: port to python 3

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.