]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
4 years agoinstall: better warning on install-full and don't fail
Jason Ish [Wed, 10 Mar 2021 04:54:43 +0000 (22:54 -0600)] 
install: better warning on install-full and don't fail

If suricata-update is not available on "make install-full", don't
exit 1, instead give the reason why its not installed, but still
succeed the install.

4 years agogithub-ci: add libnet to ubuntu-20-04-cov-sv builder
Victor Julien [Fri, 12 Mar 2021 12:31:08 +0000 (13:31 +0100)] 
github-ci: add libnet to ubuntu-20-04-cov-sv builder

4 years agoeve/drop: use highest priority drop 5976/head
Victor Julien [Fri, 12 Mar 2021 09:22:01 +0000 (10:22 +0100)] 
eve/drop: use highest priority drop

When adding the alert to a drop record make sure the add the highest
priority.

It would until now add all drops from high to low prio, effectively
overwriting the record each time.

Ticket #4397

4 years agodetect/alert: apply pd only actions to flow
Victor Julien [Wed, 10 Mar 2021 12:25:55 +0000 (13:25 +0100)] 
detect/alert: apply pd only actions to flow

Ticket #4394

4 years agodetect/alert: minor code refactor
Victor Julien [Tue, 9 Mar 2021 19:56:14 +0000 (20:56 +0100)] 
detect/alert: minor code refactor

Use a simpler reject check and move logic into util func.

4 years agodetect/iponly: don't check & set flow flags twice
Victor Julien [Tue, 9 Mar 2021 15:25:14 +0000 (16:25 +0100)] 
detect/iponly: don't check & set flow flags twice

Per flow IP-only flags are checked and set by IP-only engine, so
no need to set/check them per alert.

4 years agoeve/ike: gracefully handle renamed output config 5959/head 5961/head
Victor Julien [Fri, 5 Mar 2021 09:55:45 +0000 (10:55 +0100)] 
eve/ike: gracefully handle renamed output config

4 years agoikev1: add documentation for ikev1
frank honza [Mon, 26 Oct 2020 12:18:06 +0000 (13:18 +0100)] 
ikev1: add documentation for ikev1

4 years agoikev1: add metadata to alerts
Sascha Steinbiss [Sun, 3 Jan 2021 22:44:23 +0000 (23:44 +0100)] 
ikev1: add metadata to alerts

4 years agoikev1: add ikev1 parser
Sascha Steinbiss [Sun, 3 Jan 2021 22:42:24 +0000 (23:42 +0100)] 
ikev1: add ikev1 parser

4 years agoikev1: rename ikev2 to common ike
frank honza [Sun, 18 Oct 2020 19:38:06 +0000 (21:38 +0200)] 
ikev1: rename ikev2 to common ike

Renaming was done with shell commands, git mv for moving the files and content like
find -iname '*.c' | xargs sed -i 's/ikev1/ike/g' respecting the different mixes of upper/lower case.

4 years agodetect: added support for protocol-aliases
frank honza [Sun, 18 Oct 2020 20:00:48 +0000 (22:00 +0200)] 
detect: added support for protocol-aliases

4 years agoutil: add function converting u8-array into a hex-String
frank honza [Sun, 18 Oct 2020 19:50:29 +0000 (21:50 +0200)] 
util: add function converting u8-array into a hex-String

4 years agodetect: add comparison-mode LTE/GTE for Detect(U32/u8)Data
frank honza [Sun, 18 Oct 2020 19:46:04 +0000 (21:46 +0200)] 
detect: add comparison-mode LTE/GTE for Detect(U32/u8)Data

4 years agodetect/analyzer: fix mpm display on payload only rules 5958/head
Victor Julien [Thu, 4 Mar 2021 12:40:15 +0000 (13:40 +0100)] 
detect/analyzer: fix mpm display on payload only rules

4 years agodetect: suppress error message for pcre only rules
Victor Julien [Fri, 19 Feb 2021 10:45:00 +0000 (11:45 +0100)] 
detect: suppress error message for pcre only rules

4 years agodetect/analyzer: suggest modern keywords
Victor Julien [Fri, 5 Feb 2021 21:01:26 +0000 (22:01 +0100)] 
detect/analyzer: suggest modern keywords

4 years agodetect/analyzer: fix json output for warnings/notes
Victor Julien [Fri, 5 Feb 2021 20:33:35 +0000 (21:33 +0100)] 
detect/analyzer: fix json output for warnings/notes

4 years agodetect/asn1: minor cleanups
Victor Julien [Sat, 6 Feb 2021 07:10:29 +0000 (08:10 +0100)] 
detect/asn1: minor cleanups

4 years agodetect/http-server-body: clean up test
Victor Julien [Fri, 5 Feb 2021 07:42:37 +0000 (08:42 +0100)] 
detect/http-server-body: clean up test

4 years agodetect/icmp: reject invalid rules for icode/itype 5953/head
Victor Julien [Wed, 3 Mar 2021 13:01:55 +0000 (14:01 +0100)] 
detect/icmp: reject invalid rules for icode/itype

4 years agodetect/prefilter: fix null ptr deref on invalid rule
Victor Julien [Wed, 3 Mar 2021 12:41:26 +0000 (13:41 +0100)] 
detect/prefilter: fix null ptr deref on invalid rule

A bad rule 'icode:<0; prefilter;' would trigger a null ptr deref
in ApplyToU8Hash.

Bug #4375.

4 years agodetect/state: fix reset bug
Victor Julien [Sun, 28 Feb 2021 08:39:16 +0000 (09:39 +0100)] 
detect/state: fix reset bug

Fix issue where after a reset the now empty list elements are not
reused and the values may not be valid for the current detect
engine anymore.

Introduce a 'current' (cur) pointer that points to the store element
currently being filled. This way existing stores will be reused.

If 'cur' is NULL and 'head' is not NULL it means we need to use
'tail' to append a new store.

4 years agodetect/state: test to show reset bug
Victor Julien [Sun, 28 Feb 2021 08:24:35 +0000 (09:24 +0100)] 
detect/state: test to show reset bug

4 years agodetect/state: minor code cleanup
Victor Julien [Sun, 28 Feb 2021 08:21:36 +0000 (09:21 +0100)] 
detect/state: minor code cleanup

4 years agofilestore: fix global counter init in unix socket mode
Jason Ish [Fri, 18 Dec 2020 17:34:30 +0000 (11:34 -0600)] 
filestore: fix global counter init in unix socket mode

Move initialization of filestore global counter to PreRunInit,
so they get registered during program initialization, or as
required in unix-socket mode, initialized for each file run.

Fixes Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4216

4 years agosmb: relax probing parser to handle first NBSS message
Philippe Antoine [Wed, 17 Feb 2021 14:36:12 +0000 (15:36 +0100)] 
smb: relax probing parser to handle first NBSS message

cf dcerpc-udp S-V test :
First message is Message Type: Session request (0x81)
Second message is SMB

4 years agoprotodetect: only run ProbingParserTc if STREAM_TOCLIENT
Philippe Antoine [Wed, 17 Feb 2021 13:54:46 +0000 (14:54 +0100)] 
protodetect: only run ProbingParserTc if STREAM_TOCLIENT

4 years agofuzz: more precise assertion for protocol detection
Philippe Antoine [Tue, 2 Feb 2021 13:44:43 +0000 (14:44 +0100)] 
fuzz: more precise assertion for protocol detection

Only in the cases of stream start is the assertion valable.
Otherwise, it can only be best effort.

4 years agosmb: probing parser for start and midstream
Philippe Antoine [Tue, 2 Feb 2021 12:31:08 +0000 (13:31 +0100)] 
smb: probing parser for start and midstream

The probing parser is more strict at the start of the stream

4 years agosmb: split probing function for code style
Philippe Antoine [Tue, 2 Feb 2021 12:29:14 +0000 (13:29 +0100)] 
smb: split probing function for code style

Introduces rs_smb_probe_tcp_midstream

4 years agodetect: fix overflows in SetupU8Hash
Philippe Antoine [Wed, 17 Feb 2021 16:02:35 +0000 (17:02 +0100)] 
detect: fix overflows in SetupU8Hash

For instance ">255" resulted in overflow

4 years agossl: reset state when breaking out of SSLV3_HANDSHAKE_PROTOCOL
Philippe Antoine [Fri, 18 Dec 2020 21:12:23 +0000 (22:12 +0100)] 
ssl: reset state when breaking out of SSLV3_HANDSHAKE_PROTOCOL

So that we cannot resumt it with corrupted values

4 years agomodbus: stop allocating transactions when flooded
Philippe Antoine [Thu, 17 Dec 2020 20:48:54 +0000 (21:48 +0100)] 
modbus: stop allocating transactions when flooded

cf #4224

4 years agoicmpv6: bail out for icmpv6.hdr keyword if not ICMPv6
Philippe Antoine [Fri, 18 Dec 2020 13:21:16 +0000 (14:21 +0100)] 
icmpv6: bail out for icmpv6.hdr keyword if not ICMPv6

4 years agooutput/http2: Multi-threaded EVE logging support
Jeff Lucovsky [Tue, 8 Dec 2020 13:38:18 +0000 (08:38 -0500)] 
output/http2: Multi-threaded EVE logging support

This commit adds multi-threaded EVE logging support to the HTTP/2
logging path.

4 years agoeve: fix memory leak in metadata
Philippe Antoine [Mon, 7 Dec 2020 11:16:31 +0000 (12:16 +0100)] 
eve: fix memory leak in metadata

Fixes #4205

4 years agodoc: fix ubuntu pkg name for tcmalloc 5935/head
Shivani Bhardwaj [Thu, 25 Feb 2021 05:44:24 +0000 (11:14 +0530)] 
doc: fix ubuntu pkg name for tcmalloc

4 years agodecode: limits the number of decoded layers
Philippe Antoine [Thu, 28 Jan 2021 16:48:48 +0000 (17:48 +0100)] 
decode: limits the number of decoded layers

so as to avoid overrecursion leading to stack exhaustion

4 years agodetect: set HTTP SWF decompress limits 5932/head
Victor Julien [Thu, 25 Feb 2021 21:38:34 +0000 (22:38 +0100)] 
detect: set HTTP SWF decompress limits

4 years agodetect/http.request_body: fix tracking with xforms
Victor Julien [Thu, 25 Feb 2021 21:00:17 +0000 (22:00 +0100)] 
detect/http.request_body: fix tracking with xforms

Fix handling of file progress tracking for regular http.request_body
along with transform combinations.

This is done by implementing the 'base id' logic.

Related tickets: #4361 #4199 #3616

4 years agodetect/file.data: fix mixing transforms (http)
Victor Julien [Thu, 25 Feb 2021 20:36:27 +0000 (21:36 +0100)] 
detect/file.data: fix mixing transforms (http)

Fix handling of file progress tracking for regular file.data along
with transform combinations for the part of the implementation that
uses the HTTP inspection logic.

This is done by implementing the 'base id' logic.

Related tickets: #4361 #4199 #3616

4 years agodetect/file.data: fix mixing transforms (file api)
Victor Julien [Thu, 25 Feb 2021 19:07:41 +0000 (20:07 +0100)] 
detect/file.data: fix mixing transforms (file api)

Fix handling of file progress tracking for regular file.data along
with transform combinations for the part of the implementation that
uses the File API.

This is done by implementing the 'base id' logic.

Related tickets: #4361 #4199 #3616

4 years agodetect: track base id for xform buffers
Victor Julien [Thu, 25 Feb 2021 19:06:40 +0000 (20:06 +0100)] 
detect: track base id for xform buffers

Buffers with transforms are based on the non-transformed "base"
buffer, with a new ID assigned and the transform callbacks added.

This patch stores the id of the original buffer in the new buffer
inspect and prefilter structures. This way the buffers with and
without transforms can share some of the logic are progression
of file and body inspection trackers.

Related tickets: #4361 #4199 #3616

4 years agodetect/analyzer: fix pkt engine display
Victor Julien [Sun, 7 Feb 2021 08:00:49 +0000 (09:00 +0100)] 
detect/analyzer: fix pkt engine display

4 years agoclassification: sync and update
Victor Julien [Wed, 24 Feb 2021 15:30:13 +0000 (16:30 +0100)] 
classification: sync and update

Sync to latest ET open and introduce inappropriate as a classification
to replace something some find inappropriate.

4 years agodcerpc: trigger raw assembly on record completion 5913/head
Shivani Bhardwaj [Tue, 23 Feb 2021 09:55:52 +0000 (15:25 +0530)] 
dcerpc: trigger raw assembly on record completion

4 years agorust/context: add AppLayerParserTriggerRawStreamReassembly
Shivani Bhardwaj [Tue, 23 Feb 2021 08:23:06 +0000 (13:53 +0530)] 
rust/context: add AppLayerParserTriggerRawStreamReassembly

4 years agosmb: andx support 5910/head
Philippe Antoine [Fri, 4 Dec 2020 13:46:39 +0000 (14:46 +0100)] 
smb: andx support

Add AndX support for SMB1. Finishes #3475.

[Updated by Victor Julien to split functions]

4 years agostream/tcp: fix stream side after direction change 5908/head
Ilya Bakhtin [Tue, 28 Jul 2020 14:33:23 +0000 (16:33 +0200)] 
stream/tcp: fix stream side after direction change

4 years agodoc/quickstart: use new test url that works
Jason Ish [Mon, 22 Feb 2021 21:23:52 +0000 (15:23 -0600)] 
doc/quickstart: use new test url that works

Replace http://testmyids.org with http://testmynids.org/uid/index.html,
as testmyids.org now always redirects to https.

4 years agodoc: update installation documentation for CentOS and Fedora
Josh Stroschein [Fri, 18 Dec 2020 18:09:48 +0000 (12:09 -0600)] 
doc: update installation documentation for CentOS and Fedora

4 years agohttp: makes decompression time limit configurable 5899/head
Philippe Antoine [Wed, 17 Feb 2021 08:37:57 +0000 (09:37 +0100)] 
http: makes decompression time limit configurable

4 years agoutil/thash: fix memcap consolidate function 5891/head
Eric Leblond [Thu, 11 Feb 2021 10:01:18 +0000 (11:01 +0100)] 
util/thash: fix memcap consolidate function

The function THashConsolidateMemcap is used to allow to load a
dataset even when the memcap is not set. But the implementation
was in fact resetting the memcap value to the max of memory
usaga after loading and default memcap. As a result, the
function was resetting memcap to the default memcap even if
a huge memcap was set in the dataset definition. In the case
of dataset where we add to the set it was leading to memcap
limit hitting despite the settings of memcap by the user.

This patch udpates the code to set the final memcap value to
the max of memory usage after loading and set memcap.

4 years agostream: TcpStreamCnf.midstream type changed to bool
Ilya Bakhtin [Thu, 18 Feb 2021 20:25:58 +0000 (21:25 +0100)] 
stream: TcpStreamCnf.midstream type changed to bool

4 years agoprotodetect: improve midstream handling
Ilya Bakhtin [Mon, 15 Feb 2021 17:36:46 +0000 (18:36 +0100)] 
protodetect: improve midstream handling

Set "done flag" only if parsers for both directions are not found in a
case of midstream parsers from other direction are tried if nothing is found
for the initial one. "done flag" must be set if nothing is found in both
directions. Otherwise processing of incomplete data is terminated at the very
first try.

4 years agodcerpc/udp: improve detection
Shivani Bhardwaj [Sat, 13 Feb 2021 12:27:42 +0000 (17:57 +0530)] 
dcerpc/udp: improve detection

Lately, Wireguard proto starting w pattern |04 00| is misdetected as
DCERPC/UDP which also starts with the same pattern, add more checks
to make sure that it is the best guess for packet to be dcerpc/udp.

4 years agodcerpc: add probe function
Shivani Bhardwaj [Sat, 20 Feb 2021 06:32:28 +0000 (12:02 +0530)] 
dcerpc: add probe function

4 years agorust/applayer: split EOF flag per direction
Shivani Bhardwaj [Sat, 20 Feb 2021 06:31:20 +0000 (12:01 +0530)] 
rust/applayer: split EOF flag per direction

4 years agodcerpc/udp: remove transmute
Shivani Bhardwaj [Sat, 20 Feb 2021 06:30:17 +0000 (12:00 +0530)] 
dcerpc/udp: remove transmute

The book defines transmute as "This is really, truly, the most horribly unsafe
thing you can do in Rust. The guardrails here are dental floss."
Transmute can result into mind boggling undefined behaviors. Get rid of
it wherever possible.

4 years agoprotodetect: rename direction to flags 5886/head
Philippe Antoine [Tue, 2 Feb 2021 10:12:12 +0000 (11:12 +0100)] 
protodetect: rename direction to flags

And use whole flags in AppLayerProtoDetectPPGetProto

4 years agotcp: remove debug asserts about large windows
Philippe Antoine [Wed, 17 Feb 2021 14:43:17 +0000 (15:43 +0100)] 
tcp: remove debug asserts about large windows

Completes 00d7c9034be7470177c01e8805831c258b016d0e

4 years agodetect/prefilter: fix handling of prefilter as fast_pattern alias
Victor Julien [Sat, 20 Feb 2021 14:53:51 +0000 (15:53 +0100)] 
detect/prefilter: fix handling of prefilter as fast_pattern alias

4 years agodetect: forbids unsupported prefilters
Philippe Antoine [Sun, 7 Feb 2021 20:34:12 +0000 (21:34 +0100)] 
detect: forbids unsupported prefilters

4 years agodetect/fast_pattern: add prefilter test
Victor Julien [Sat, 20 Feb 2021 14:51:50 +0000 (15:51 +0100)] 
detect/fast_pattern: add prefilter test

4 years agofuzz: fix typo in comment
Philippe Antoine [Tue, 2 Feb 2021 10:07:13 +0000 (11:07 +0100)] 
fuzz: fix typo in comment

4 years agohttp2: http.stat_msg keyword now works for HTTP2 5875/head
Philippe Antoine [Thu, 17 Dec 2020 14:57:00 +0000 (15:57 +0100)] 
http2: http.stat_msg keyword now works for HTTP2

4 years agohttp2: http.uri.raw keyword now works for HTTP2
Philippe Antoine [Thu, 17 Dec 2020 13:19:25 +0000 (14:19 +0100)] 
http2: http.uri.raw keyword now works for HTTP2

4 years agohttp2: http.user_agent keyword now works for HTTP2
Philippe Antoine [Thu, 17 Dec 2020 12:26:35 +0000 (13:26 +0100)] 
http2: http.user_agent keyword now works for HTTP2

4 years agohttp2: http.uri keyword now works for HTTP2
Philippe Antoine [Tue, 8 Dec 2020 11:46:24 +0000 (12:46 +0100)] 
http2: http.uri keyword now works for HTTP2

cf #4067

4 years agoprotos: renaming ALPROTO_HTTP* constants
Philippe Antoine [Thu, 17 Dec 2020 11:03:08 +0000 (12:03 +0100)] 
protos: renaming ALPROTO_HTTP* constants

Having now ALPROTO_HTTP1, ALPROTO_HTTP2 and ALPROTO_HTTP

Run with 3 sed commands
git grep ALPROTO_HTTP | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP/ALPROTO_HTTP1/g'
git grep ALPROTO_HTTP12 | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP12/ALPROTO_HTTP2/g'
git grep ALPROTO_HTTP1_ANY | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP1_ANY/ALPROTO_HTTP/g'

and then running clang-format

4 years agohttp: introduces ALPROTO_HTTP_ANY
Philippe Antoine [Thu, 17 Dec 2020 10:52:42 +0000 (11:52 +0100)] 
http: introduces ALPROTO_HTTP_ANY

For any versions of HTTP, both ALPROTO_HTTP and ALPROTO_HTTP2

4 years agoproto: introduce signature protocol, as extension to flow protocol
Philippe Antoine [Mon, 7 Dec 2020 13:41:00 +0000 (14:41 +0100)] 
proto: introduce signature protocol, as extension to flow protocol

AppProtoEquals function allows to check if a flow protocol
matches a signature protocol

4 years agogithub-ci: test install of library 5866/head
Jason Ish [Thu, 11 Feb 2021 22:34:34 +0000 (16:34 -0600)] 
github-ci: test install of library

Add library install test to Fedora 33 build. In this case the
shared library is disable so the test makes sure it is not
installed.

Also make sure the library and headers are not installed until
explicitly installed.

Add similar to test to an Ubuntu 24.04 build without disable-shared
and check that the shared library is installed.

4 years agoMakefile: break headers and source into 2 vars
Jason Ish [Fri, 5 Feb 2021 15:40:09 +0000 (09:40 -0600)] 
Makefile: break headers and source into 2 vars

Split the headers and source into 2 variables. Headers are
marked noinst so they don't get automatically installed on
"make install". Instead they will be installed by a custom
Makefile target, "make install-headers".

4 years agolibsuricata-config: program to print build flags
Jason Ish [Mon, 8 Feb 2021 22:59:20 +0000 (16:59 -0600)] 
libsuricata-config: program to print build flags

Following the pattern of many other libraries, provide a -config
program to output cflags and libs to properly link an application
against the library.

usage: libsuricata-config [--cflags] [--libs] [--static]

--cflags and --libs can be used infividually or together.

--static will link against the static libraries instead of the
shared library. Note that if the shared library is not available,
the static libraries will be provided even without this option.

4 years agorust: separate the rust lib from RUST_LDADD
Jason Ish [Wed, 10 Feb 2021 20:30:38 +0000 (14:30 -0600)] 
rust: separate the rust lib from RUST_LDADD

Fix another issue with library ordering when breaking apart
LDFLAGS from LIBS for outputting usable command lines for
users of a Suricata library.

RUST_LDADD should just contain the extra libs required by
Rust, not the actual Suricata Rust library.

4 years agoconfigure: put lua libs in LIBS not LDFLAGS
Jason Ish [Wed, 10 Feb 2021 20:29:23 +0000 (14:29 -0600)] 
configure: put lua libs in LIBS not LDFLAGS

This is required to separate LIBS from LDFLAGS when outputting
a usable LIBS configuration line for users of the shared library.

4 years agoinstall: makefile target to install libraries
Jason Ish [Thu, 11 Feb 2021 22:10:02 +0000 (16:10 -0600)] 
install: makefile target to install libraries

As we don't install the libraries by default, provide a make target,
"install-library" to install the libsuricata library files.

If shared library support exists, both the static and shared
libraries will be installed, otherwise only the static libraries
will be installed.

4 years agolib: build shared library on Linux
Jason Ish [Thu, 11 Feb 2021 22:07:30 +0000 (16:07 -0600)] 
lib: build shared library on Linux

Building the shared library on Linux is not something by default.
Instead a user must opt-in to building by running the
"make libsuricata.so" target in the src/ directory.

Currently shared library support is only available on Linux. More
OSs will be supported as we can test them.

4 years agorust: rename lib to libsuricata_rust
Jason Ish [Thu, 4 Feb 2021 21:41:00 +0000 (15:41 -0600)] 
rust: rename lib to libsuricata_rust

Previously it was libsuricata.a, but eventually we want to get
to a place where libsuricata.a is a combination of the Rust
and C code.

4 years agogithub-ci: add -fsanitize=address to LDFLAGS for asan builds
Jason Ish [Thu, 4 Feb 2021 21:47:05 +0000 (15:47 -0600)] 
github-ci: add -fsanitize=address to LDFLAGS for asan builds

With fPIC, -fsanitize-address also needs to be added to LDFLAGS
to build with ASAN support.

Also fix what looks to be a copy and paste typo.

4 years agorust/Makefile: add Cargo.toml as make dependency
Jason Ish [Thu, 10 Dec 2020 21:25:31 +0000 (15:25 -0600)] 
rust/Makefile: add Cargo.toml as make dependency

This will force Cargo.toml to be recreated if Cargo.toml.in
is modified.

4 years agobuild: use a static convenience library for C code
Jason Ish [Thu, 26 Nov 2020 22:27:36 +0000 (16:27 -0600)] 
build: use a static convenience library for C code

With the circular reference gone, we can now make use
of a convenience library for the Suricata program
as well as any other programs that depend on the same
source such as the fuzzer.

While its not a libtool convenience library, it serves
the same purpose and is a common idiom in Make and CMake
projects whereas the COMMON_SOURCES approach was more
of a hack we had to resort to until the circular
reference was resolved.

4 years agohost: improve compare logic 5855/head
Victor Julien [Sat, 13 Feb 2021 16:10:15 +0000 (17:10 +0100)] 
host: improve compare logic

The old compare macro would compare all bytes of an address, even
when for IPv4 addresses the additional bytes were not in use. This
made the logic vulnerable to mistakes like in issue #4280.

4 years agodetect/iprep: fix loading of mixed ipv4/ipv6 lists
Victor Julien [Sat, 13 Feb 2021 15:54:56 +0000 (16:54 +0100)] 
detect/iprep: fix loading of mixed ipv4/ipv6 lists

Improper reuse of the address data structure between loading
different lines in the iprep file would lead to the host using
a malformed address.

4 years agogithub-ci: run suricata-verify on centos-7 build 5840/head
Jason Ish [Wed, 10 Feb 2021 15:01:49 +0000 (09:01 -0600)] 
github-ci: run suricata-verify on centos-7 build

4 years agorust/ffi: provide AppLayerRegisterParser in context
Jason Ish [Thu, 26 Nov 2020 22:21:46 +0000 (16:21 -0600)] 
rust/ffi: provide AppLayerRegisterParser in context

AppLayerRegisterParser was creating a link error when attempting
to use a convenience library for the Suricata C code, then linking
the library of C code with the library of Rust code into a final
Suricata executable, or use with fuzz targets.

By moving AppLayerRegisterParser to the context structure and
calling it like a callback the circular reference is removed
allowing the convenience libraries to work again.

This is also a stepping block to proving a Suricata library
as a single .a or .so file.

4 years ago.gitignore: ignore .a files
Jason Ish [Thu, 26 Nov 2020 22:20:36 +0000 (16:20 -0600)] 
.gitignore: ignore .a files

Ignore .a library files as we now have one created in src/
as part of adding a Suricata library.

4 years agofuzz: run OSS-Fuzz corpus and track coverage
Victor Julien [Thu, 21 Jan 2021 12:28:04 +0000 (13:28 +0100)] 
fuzz: run OSS-Fuzz corpus and track coverage

4 years agodetect: initializes memory in bytemath parsing
Philippe Antoine [Thu, 28 Jan 2021 16:02:19 +0000 (17:02 +0100)] 
detect: initializes memory in bytemath parsing

4 years agofuzz: driver running directories as well as single files
Philippe Antoine [Mon, 16 Nov 2020 09:14:46 +0000 (10:14 +0100)] 
fuzz: driver running directories as well as single files

4 years agosuricata: improve list keywords
Eric Leblond [Wed, 10 Feb 2021 16:45:16 +0000 (17:45 +0100)] 
suricata: improve list keywords

Exit with error if a keyword is not supported or not existing
and display a message.

4 years agosuricata: return error value of custom run modes
Eric Leblond [Wed, 10 Feb 2021 16:28:18 +0000 (17:28 +0100)] 
suricata: return error value of custom run modes

4 years agoutil/running-modes: don't exit in running mode
Eric Leblond [Wed, 10 Feb 2021 16:26:47 +0000 (17:26 +0100)] 
util/running-modes: don't exit in running mode

4 years agolog/pcap: exit on invalid filename
Eric Leblond [Wed, 10 Feb 2021 15:23:25 +0000 (16:23 +0100)] 
log/pcap: exit on invalid filename

If the filename has to % sign and if pcap logging is using multi
mode, then the pcap capture will fail. So let's exit if ever this
is the case.

4 years agosuricata: unix-socket mode and -l are compatible
Eric Leblond [Fri, 29 Jan 2021 22:59:11 +0000 (23:59 +0100)] 
suricata: unix-socket mode and -l are compatible

Commit 93642a0d1dd29c96e98824935ef963f6b1ef40eb did prevent to
specify the logging directory on command line and use the unix
socket.

It looks like the implementation has evolved and the arbitrary
limitation can be removed allowing a user to start unix socket
without editing the configuration file.

4 years agoeve: only output ja3 and ja3s if present
Eric Leblond [Wed, 27 Jan 2021 10:38:34 +0000 (11:38 +0100)] 
eve: only output ja3 and ja3s if present

This will prevent JSON entries like the following that occur
with the dedault configuration (ja3 deactivated and extended
tls ouput activated):

  "tls": {
    "subject": "C=GB, ST=London, L=London, O=Global Security, OU=IT Department, CN=example.com",
    "issuerdn": "C=GB, ST=London, L=London, O=Global Security, OU=IT Department, CN=example.com",
    "serial": "00:9C:FC:DA:1D:A4:70:87:5D",
    "fingerprint": "b8:18:2d:cb:c9:f8:1a:66:75:13:18:31:24:e0:92:35:42:ab:96:89",
    "version": "TLSv1",
    "notbefore": "2020-05-03T11:07:28",
    "notafter": "2021-05-03T11:07:28",
    "ja3": {},
    "ja3s": {}
  }

4 years agodetect/pcre: Test capture group/var mismatch
Jeff Lucovsky [Mon, 8 Feb 2021 13:06:53 +0000 (08:06 -0500)] 
detect/pcre: Test capture group/var mismatch

4 years agodetct/pcre: Correct capture group count check
Jeff Lucovsky [Mon, 8 Feb 2021 13:05:41 +0000 (08:05 -0500)] 
detct/pcre: Correct capture group count check

This commit corrects the validation check between the number of
variables used and the number of specified capture groups.