]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
4 years agodns: initialize log flags as an unsigned long long 5819/head
Jason Ish [Mon, 7 Dec 2020 21:31:34 +0000 (15:31 -0600)] 
dns: initialize log flags as an unsigned long long

On 64 bit all 64 bits were being initialized, but on 32 bit
only 32 bits were as it was being initialized as a long.

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

(cherry picked from commit f2ab5803fbd88ae613429a382f28e81841832d0d)

4 years agoebpf: avoid need of 32 bit header
Eric Leblond [Mon, 28 Dec 2020 08:41:09 +0000 (09:41 +0100)] 
ebpf: avoid need of 32 bit header

Compilation of xdp_lb.c was failing in some case with the following
error:

/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found

This patch add some define to be able to skip recursive inclusion of
header files leading to the problem.

(cherry picked from commit dfe5785bfa630905ae52267baeae5453231f9b2d)

4 years agoproto/names: add SCTP if not defined in system 5806/head
Victor Julien [Mon, 18 Jan 2021 12:56:32 +0000 (13:56 +0100)] 
proto/names: add SCTP if not defined in system

If SCTP is missing from /etc/protocols, add it manually.

(cherry picked from commit bf00285d0acf87c794f6569eb51d1f7d1247a0da)

4 years agolua/test: Test cases using SC prefix 5799/head
Jeff Lucovsky [Wed, 13 Jan 2021 18:43:52 +0000 (13:43 -0500)] 
lua/test: Test cases using SC prefix

This commit adds paired test cases to ensure that the SC variant of the
entry points are tested.

(cherry picked from commit 1c68f4aed66dceed79ce04d0f9cd14ca2fe72589)

4 years agodoc/lua: Lua API name consistency
Jeff Lucovsky [Wed, 13 Jan 2021 18:39:21 +0000 (13:39 -0500)] 
doc/lua: Lua API name consistency

This commit updates the documentation of the SCFlow* function names
available to Lua scripts.

Formerly, they used the prefix "Sc"; now they use "SC".

(cherry picked from commit 25e94831682c6eb641b416afef83d78de6f95729)

4 years agogeneral: Correct typo
Jeff Lucovsky [Tue, 12 Jan 2021 15:16:43 +0000 (10:16 -0500)] 
general: Correct typo

(cherry picked from commit c8459746396d142a9aec53e44a252c4bf4773716)

4 years agolua: Use SC prefix for Lua functions
Jeff Lucovsky [Tue, 12 Jan 2021 15:14:54 +0000 (10:14 -0500)] 
lua: Use SC prefix for Lua functions

This commit adds additional Lua API interfaces to bring consistency to
functions such that the `SC` prefix is available consistently across
flow int and flow var functions.

(cherry picked from commit 431018d6f7d81ec603d29ba990ef22e51d797139)

4 years agostream/midstream: handle packet loss after SYN/ACK 5726/head
Victor Julien [Tue, 29 Dec 2020 19:36:26 +0000 (20:36 +0100)] 
stream/midstream: handle packet loss after SYN/ACK

(cherry picked from commit db2dbaaf40a911200849b235d8408788fa379276)

4 years agostream/tcp: fix invalid ack events in timewait state
Victor Julien [Mon, 28 Dec 2020 18:18:08 +0000 (19:18 +0100)] 
stream/tcp: fix invalid ack events in timewait state

(cherry picked from commit 895938080f52db464faf8d971fd5b06bc139ad0a)

4 years agorust: require test-case 1.0.1; don't use 1.1
Victor Julien [Thu, 14 Jan 2021 08:00:27 +0000 (09:00 +0100)] 
rust: require test-case 1.0.1; don't use 1.1

4 years agomime: postpone md5 calculation to parse complete
Jason Ish [Wed, 30 Dec 2020 19:32:53 +0000 (13:32 -0600)] 
mime: postpone md5 calculation to parse complete

Instead of calculating the MD5 at the end of every part, only
compute it when parsing is complete.

With libnss, the hash never updates after the first HASH_End, so
the md5 of only the first part of the body is logged, rather than
the md5 of all the parts.

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

4 years agogithub-ci: use python3 in debian builds
Jason Ish [Fri, 8 Jan 2021 16:32:47 +0000 (10:32 -0600)] 
github-ci: use python3 in debian builds

(cherry picked from commit 18a1fd22c2dfd0613b190a656574077c1230e309)

4 years agogithub-ci/macos: use brew to install Python 3
Jason Ish [Fri, 8 Jan 2021 15:39:19 +0000 (09:39 -0600)] 
github-ci/macos: use brew to install Python 3

The default Python on MacOS is Python 2. Suricata-Verify now
depends on Python 3, so install it with Brew.

(cherry picked from commit 7904ef82d0b2478694025ca0d9043f2ae98be73a)

4 years agogithub-ci: use a unique id for the commit check cargo cache
Jason Ish [Thu, 10 Dec 2020 15:48:06 +0000 (09:48 -0600)] 
github-ci: use a unique id for the commit check cargo cache

All builds have been using the same cache id for ~/.cargo which
could lead us to conflict situations which is what I think we are
seeing with the commit-check job.

(cherry picked from commit 49ca070446cdca49afc42d71aaedaa9a1b458897)

4 years agogithub-ci: fix centos 8 build
Jason Ish [Tue, 8 Dec 2020 15:34:52 +0000 (09:34 -0600)] 
github-ci: fix centos 8 build

The "PowerTools" repo that we need to enable has been renamed
to "powertools".

(cherry picked from commit f09536a936e18cf008ea6457220f6d5600602e7a)

4 years agogithub-ci: build cbindgen during prep
Jason Ish [Tue, 1 Dec 2020 18:55:36 +0000 (12:55 -0600)] 
github-ci: build cbindgen during prep

Instead of building cbindgen in every build, build it once
during prep as a static musl binary to avoid library issues.

(cherry picked from commit 1f1a7651325934a2a96a238ab29d1aba6a086763)

4 years agogithub-ci: remove prep directories before upload
Jason Ish [Tue, 1 Dec 2020 21:46:46 +0000 (15:46 -0600)] 
github-ci: remove prep directories before upload

Removing the libhtp, suricata-update and suricata-verify directories
before uploading the artifact reduces the upload time from minutes
to seconds.

(cherry picked from commit f945acf733d15129c7533c8678b8b9570cbebff6)

4 years agogithub-ci: fedora 33 test build (based on fedora 32)
Jason Ish [Tue, 1 Dec 2020 18:40:14 +0000 (12:40 -0600)] 
github-ci: fedora 33 test build (based on fedora 32)

(cherry picked from commit 42196e932e1601a527396378b2ac63a606b1be9b)

4 years agogithub-ci: remove fedora 31 (eol)
Jason Ish [Fri, 4 Dec 2020 21:16:36 +0000 (15:16 -0600)] 
github-ci: remove fedora 31 (eol)

(cherry picked from commit ea36c01a8f712ac6032c5477ed0856f289aeb9db)

4 years agoci: buildbot is decommissioned, so remove prscript refs
Victor Julien [Fri, 11 Dec 2020 09:19:41 +0000 (10:19 +0100)] 
ci: buildbot is decommissioned, so remove prscript refs

(cherry picked from commit 372fc26739b414684ad0a7e25f444ceceb379173)

4 years agodoc: build all manpages
Sascha Steinbiss [Wed, 9 Dec 2020 17:34:49 +0000 (18:34 +0100)] 
doc: build all manpages

(cherry picked from commit f78f444a5e7a5ad536b7204ee79b14334282379a)

4 years agoeve/dhcp: avoid to call common logging twice
Eric Leblond [Sun, 2 Aug 2020 16:38:58 +0000 (18:38 +0200)] 
eve/dhcp: avoid to call common logging twice

(cherry picked from commit 8d034b4163df9b5233f03d8b1dd88e42268c5d07)

4 years agodetect: Validate that NOOPT options don't have optvals
Gianni Tedesco [Sun, 13 Dec 2020 14:54:13 +0000 (23:54 +0900)] 
detect: Validate that NOOPT options don't have optvals

Without this, a simple typo between : and ; is able to hide actual bugs
in rules.

I discovered 2 bugs in ET open ruleset this way.

(cherry picked from commit 10ea60a237cf41ddd10f7a887e2824b4b8e1c419)

4 years agodetect-fast-pattern: Mark as OPTIONAL_OPT, instead of NOOPT
Gianni Tedesco [Sun, 13 Dec 2020 14:50:23 +0000 (23:50 +0900)] 
detect-fast-pattern: Mark as OPTIONAL_OPT, instead of NOOPT

Also update the erroneous comment about it.

(cherry picked from commit cebe15c23b48e92df5181b3f0b0e6ac7195d717b)

4 years agodoc: fix URL for unix-socket python example
Kirby Kuehl [Tue, 5 Jan 2021 16:55:22 +0000 (08:55 -0800)] 
doc: fix URL for unix-socket python example

(cherry picked from commit 5499a6f7cd2265072945dbb3b5a61e2a5e1f7ad1)

4 years agosignature: Fix leak in urilen parsing
Philippe Antoine [Thu, 7 Jan 2021 08:46:02 +0000 (09:46 +0100)] 
signature: Fix leak in urilen parsing

cf #4254

(cherry picked from commit 47dd9a5ebc26dac25b63b5ca37062e7a63cd5335)

4 years agodetect/file.name: register inspect engine for ftp-data
Victor Julien [Mon, 11 Jan 2021 14:17:02 +0000 (15:17 +0100)] 
detect/file.name: register inspect engine for ftp-data

(cherry picked from commit 45eddde573ab2e807a5fa44170d544288a60ea12)

4 years agodecode/tcp: Improved handling of TFO options
Jeff Lucovsky [Tue, 5 Jan 2021 14:31:11 +0000 (09:31 -0500)] 
decode/tcp: Improved handling of TFO options

This commit improves handling of TCP fast open options
- Option length must be in [6, 18]
- Option length must be an even value

(cherry picked from commit f8fef0dd05e87c3bf25e4e5c0bcf136e94c98393)

4 years agoflow/timeout: fix TCP seq/ack for reversed flows 5679/head
Victor Julien [Wed, 23 Dec 2020 14:55:19 +0000 (15:55 +0100)] 
flow/timeout: fix TCP seq/ack for reversed flows

When a flow is swapped it also swaps the stream trackers, so it does
not make sense to reverse them during pseudo packet creation.

(cherry picked from commit 49bd1f85b99e8bd473ae28c6eb93510b2b3c7668)

4 years agodetect/stream: fix async stream inspection
Victor Julien [Thu, 17 Dec 2020 20:04:13 +0000 (21:04 +0100)] 
detect/stream: fix async stream inspection

Move raw progress forward only if detect uses stream data, indicated
by the PKT_DETECT_HAS_STREAMDATA flag.

(cherry picked from commit 3c7c361b603653a4c0bb30a4261babc45988d163)

4 years agostream/tcp: fix async mode ACK validation
Victor Julien [Thu, 17 Dec 2020 09:54:05 +0000 (10:54 +0100)] 
stream/tcp: fix async mode ACK validation

(cherry picked from commit 8aa02c6d15f013f9ce934e440ee073701d3ea502)

4 years agoversion: start development towards 6.0.2
Victor Julien [Fri, 4 Dec 2020 21:58:20 +0000 (22:58 +0100)] 
version: start development towards 6.0.2

4 years agoversion: set to 6.0.1 suricata-6.0.1
Victor Julien [Fri, 4 Dec 2020 06:54:18 +0000 (07:54 +0100)] 
version: set to 6.0.1

4 years agochangelog: update for 6.0.1
Victor Julien [Fri, 4 Dec 2020 06:53:48 +0000 (07:53 +0100)] 
changelog: update for 6.0.1

4 years agodnp3: regenerates C code with script
Philippe Antoine [Thu, 19 Nov 2020 13:30:56 +0000 (14:30 +0100)] 
dnp3: regenerates C code with script

4 years agodnp3: avoids DOS by too long loop over null-sized objects
Philippe Antoine [Thu, 19 Nov 2020 13:30:27 +0000 (14:30 +0100)] 
dnp3: avoids DOS by too long loop over null-sized objects

4 years agodnp3: fix memory leak with object containing bytearrays
Philippe Antoine [Thu, 19 Nov 2020 13:29:48 +0000 (14:29 +0100)] 
dnp3: fix memory leak with object containing bytearrays

4 years agodnp3: fix signed integer overflow
Philippe Antoine [Thu, 19 Nov 2020 13:28:43 +0000 (14:28 +0100)] 
dnp3: fix signed integer overflow

By using unsigned integers everywhere

4 years agooutput: use BASE64_BUFFER_SIZE macro
Shivani Bhardwaj [Thu, 3 Dec 2020 11:30:17 +0000 (17:00 +0530)] 
output: use BASE64_BUFFER_SIZE macro

Base64Encode function requires the maximum length of the output string
as its last parameter. Use the macro BASE64_BUFFER_SIZE to calculate it
correctly.

4 years agodatasets/string: fix buffer overflow
Shivani Bhardwaj [Thu, 3 Dec 2020 11:13:17 +0000 (16:43 +0530)] 
datasets/string: fix buffer overflow

The size of encoded_data array and the maximum output length parameter
to Base64Encode function were incorrect leading to buffer overflow for
certain cases. The algorithm requires at least 5 bytes of space to even
convert a string of length 1.

Use BASE64_BUFFER_SIZE macro to correctly calculate this output length.
Set size of encoded_data array to the calculated output length.

4 years agoutil/crypt: Add macro for max base64encode len
Shivani Bhardwaj [Thu, 3 Dec 2020 11:25:39 +0000 (16:55 +0530)] 
util/crypt: Add macro for max base64encode len

Maximum length of a base64 encoded string can be 33% over the actual
length of the input string. The formula to best cover all the edge cases
is mathematically
(4 * (input_length + 2) / 3) + 1

Add a macro to calculate this for a given input length.

4 years agoftp: optimize FTPGetOldestTx by starting from last handled tx
Philippe Antoine [Tue, 3 Nov 2020 10:55:52 +0000 (11:55 +0100)] 
ftp: optimize FTPGetOldestTx by starting from last handled tx

Avoids DOS by quadratic complexity algorithm.
Attack is
1 stack many requests/transactions (like cwd commands on a line)
2 get many answers

4 years agohttp2: files inspection API fixes
Philippe Antoine [Tue, 10 Nov 2020 15:10:07 +0000 (16:10 +0100)] 
http2: files inspection API fixes

uses right transaction id for file tracker
uses FILE_USE_DETECT for good matches with keyword startswith

4 years agohttp2: allow multiple size updates in one headers batch
Philippe Antoine [Tue, 10 Nov 2020 09:21:32 +0000 (10:21 +0100)] 
http2: allow multiple size updates in one headers batch

cf RFC 7541 section 4.2

4 years agohttp2: avoid null pointer deref in alert output
Victor Julien [Sat, 7 Nov 2020 14:34:35 +0000 (15:34 +0100)] 
http2: avoid null pointer deref in alert output

Bug #4120.

4 years agohttp2: allow filestore to work with HTTP2
Philippe Antoine [Fri, 16 Oct 2020 10:51:31 +0000 (12:51 +0200)] 
http2: allow filestore to work with HTTP2

4 years agopacket: set length of 0 for too big copy
Philippe Antoine [Thu, 19 Nov 2020 13:10:58 +0000 (14:10 +0100)] 
packet: set length of 0 for too big copy

4 years agossl: improves keyword ssl_version parsing
Philippe Antoine [Sat, 31 Oct 2020 16:12:19 +0000 (17:12 +0100)] 
ssl: improves keyword ssl_version parsing

Removes the use of PCRE for performance
Forbids empty negations after a valid pattern
Forbids mixing negative and positive forms as it is irrelevant
Forbids useless repetition of a version

4 years agosmb: do not rely on one valid NBSS byte for probing
Philippe Antoine [Thu, 15 Oct 2020 20:51:52 +0000 (22:51 +0200)] 
smb: do not rely on one valid NBSS byte for probing

Need to have the SMB header so as to validate

4 years agossl: upgarde to uint32 for bytes_processed
Philippe Antoine [Thu, 15 Oct 2020 19:32:27 +0000 (21:32 +0200)] 
ssl: upgarde to uint32 for bytes_processed

as it can overflow, and is compared with uint32 such as
message_length and message_start and

4 years agodetect: null sanity checks for pkthdr
Philippe Antoine [Wed, 14 Oct 2020 19:25:40 +0000 (21:25 +0200)] 
detect: null sanity checks for pkthdr

Even when the rules are only applied on traffic with the protocol
the structure for the protocol header can be set to NULL if there
was an error parsing the header

4 years agoconfigure: require libhtp 0.5.36 5626/head
Victor Julien [Thu, 3 Dec 2020 11:10:22 +0000 (12:10 +0100)] 
configure: require libhtp 0.5.36

4 years agodoc: explicit header normalization further
Philippe Antoine [Mon, 13 Jul 2020 09:06:58 +0000 (11:06 +0200)] 
doc: explicit header normalization further

And their concatenation as described in RFC 2616

4 years agogithub-ci: CentOS 6 is EOL
Victor Julien [Wed, 2 Dec 2020 12:31:52 +0000 (13:31 +0100)] 
github-ci: CentOS 6 is EOL

4 years agodoc: http.uri.raw has no spaces 5624/head
Philippe Antoine [Wed, 25 Nov 2020 14:20:02 +0000 (15:20 +0100)] 
doc: http.uri.raw has no spaces

as they are in the protocol

cf bug #2881

4 years agorust: handle windows naming change from .lib to .a 5618/head
Jason Ish [Mon, 30 Nov 2020 21:11:57 +0000 (15:11 -0600)] 
rust: handle windows naming change from .lib to .a

Prior to Rust 1.44, Cargo would name static libs with the .lib
extension. 1.44 changes this extension to .a when running under
a GNU environment on Windows like msys to make it more similar
to other unix environments.

Now assume static library name to be the same on Windows and
unix, but rename the .lib if found to still support older
versions of Rust on Windows.

4 years agoconfigure/mingw: move libs in LDFLAGS to LDADD
Jason Ish [Mon, 30 Nov 2020 21:37:02 +0000 (15:37 -0600)] 
configure/mingw: move libs in LDFLAGS to LDADD

Moving the libs specified in LDFLAGS to LDADD put them into the
correct placement on in the link command.

4 years agorust: do not rebuild stdlib when coverage is enabled
Philippe Antoine [Mon, 16 Nov 2020 09:12:55 +0000 (10:12 +0100)] 
rust: do not rebuild stdlib when coverage is enabled

Because both seem incompatible for now

4 years agofuzz: check PacketCopyData return value before processing packet
Philippe Antoine [Thu, 19 Nov 2020 13:10:08 +0000 (14:10 +0100)] 
fuzz: check PacketCopyData return value before processing packet

4 years agofuzz: limit memcap for datasets when fuzzing
Philippe Antoine [Tue, 3 Nov 2020 10:21:06 +0000 (11:21 +0100)] 
fuzz: limit memcap for datasets when fuzzing

4 years agodnp3: better limit for tests when fuzzing
Philippe Antoine [Sat, 31 Oct 2020 15:51:09 +0000 (16:51 +0100)] 
dnp3: better limit for tests when fuzzing

4 years agofuzz: improves detect proto target
Philippe Antoine [Thu, 15 Oct 2020 20:50:42 +0000 (22:50 +0200)] 
fuzz: improves detect proto target

By mimicking assert message so as to clusterfuzz differentiates
between failures

4 years agodetect: fix inspection order with stateful rules 5610/head
Victor Julien [Mon, 30 Nov 2020 06:44:54 +0000 (07:44 +0100)] 
detect: fix inspection order with stateful rules

When stateful detection rules, for which detection has already started
for a previous packet, are added to the candidates array, the array
is sorted to mantain the correct inspection order. However, due to a
trivial error in the sort helper the array was sorted in descending
instead of ascending order.

4 years agodcerpc/udp: fix transaction handling and logging 5601/head
Victor Julien [Thu, 26 Nov 2020 10:03:21 +0000 (11:03 +0100)] 
dcerpc/udp: fix transaction handling and logging

Implement missing transaction handling.

Fix logging wrongly casting 'state' to DCERPCState instead of
DCERPCUDPState leading to crashes and malformed output.

Remove unused fields from DCERPCUDPState.

4 years agodetect/mpm: remove usused cleanup function 5600/head
Victor Julien [Wed, 25 Nov 2020 08:49:54 +0000 (09:49 +0100)] 
detect/mpm: remove usused cleanup function

4 years agodetect: optimize prefilter result handling
Victor Julien [Wed, 25 Nov 2020 08:22:44 +0000 (09:22 +0100)] 
detect: optimize prefilter result handling

4 years agodetect/prefilter: small cleanup
Victor Julien [Wed, 25 Nov 2020 08:22:21 +0000 (09:22 +0100)] 
detect/prefilter: small cleanup

4 years agogithub-ci: check for duplicate SIDs in rules/
Jason Ish [Fri, 20 Nov 2020 15:15:37 +0000 (09:15 -0600)] 
github-ci: check for duplicate SIDs in rules/

4 years agorules/mqtt: renumber mqtt events to avoid conflict with ssh
Jason Ish [Wed, 18 Nov 2020 22:44:38 +0000 (16:44 -0600)] 
rules/mqtt: renumber mqtt events to avoid conflict with ssh

Both SSH and MQTT events were in the 2228000 range. As SSH was
added first, renumber MQTT events into the 2229000 range which is
free.

4 years agorust: fix warnings found by nightly compiler
Philippe Antoine [Thu, 19 Nov 2020 14:50:54 +0000 (15:50 +0100)] 
rust: fix warnings found by nightly compiler

warning: getting the inner pointer of a temporary `CString`
this `CString` is deallocated at the end of the statement,
bind it to a variable to extend its lifetime

4 years agodecode/null: fix type parsing
Victor Julien [Mon, 23 Nov 2020 20:59:18 +0000 (21:59 +0100)] 
decode/null: fix type parsing

4 years agoatomics: fix compilation on ppc64
Victor Julien [Mon, 23 Nov 2020 20:57:36 +0000 (21:57 +0100)] 
atomics: fix compilation on ppc64

4 years agodnp3: set byte order when logging dnp3 src and dst 5594/head
Jason Ish [Mon, 23 Nov 2020 18:11:42 +0000 (12:11 -0600)] 
dnp3: set byte order when logging dnp3 src and dst

DNP3 uses little endian on the wire, for the most part this
is handled as the messages are deserialize. However, the link
header is a cast over raw data, so swap these bytes as they
are being logged.

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

4 years agogithub-ci: windows in builds 5584/head
Victor Julien [Thu, 19 Nov 2020 21:01:40 +0000 (22:01 +0100)] 
github-ci: windows in builds

4 years agodoc/userguide: update http keywords 5581/head
Victor Julien [Thu, 5 Nov 2020 14:31:58 +0000 (15:31 +0100)] 
doc/userguide: update http keywords

4 years agodoc/userguide: explain --strict-rule-keywords
Victor Julien [Wed, 4 Nov 2020 20:00:41 +0000 (21:00 +0100)] 
doc/userguide: explain --strict-rule-keywords

4 years agoapp-layer: do not try to parse gaps during protocol change 5580/head
Philippe Antoine [Tue, 17 Nov 2020 09:16:42 +0000 (10:16 +0100)] 
app-layer: do not try to parse gaps during protocol change

As this will leak the flow alstate because AppLayerParserParse
relies on FlowChangeProto to know if it should allocate a new
alstate

4 years agodetect: apply transforms to http body 5575/head
Philippe Antoine [Tue, 12 Nov 2019 20:57:28 +0000 (21:57 +0100)] 
detect: apply transforms to http body

4 years agoci: updates github ci add-path mechanism
Philippe Antoine [Tue, 17 Nov 2020 08:48:29 +0000 (09:48 +0100)] 
ci: updates github ci add-path mechanism

4 years agotools: bash from env
Danny Browning [Tue, 27 Oct 2020 15:47:21 +0000 (09:47 -0600)] 
tools: bash from env

Use of hardcoded bash prevents users from using an upgraded bash which may
live in a different location. This behavior is often seen on OSX systems.

Utilize env to find the preferred bash to call for scripts.

4 years agorust/log: clarify comment in non-debug mode SCLogDebug
Jason Ish [Mon, 16 Nov 2020 17:43:17 +0000 (11:43 -0600)] 
rust/log: clarify comment in non-debug mode SCLogDebug

4 years agorust/log: order log macros in descending order
Jason Ish [Mon, 16 Nov 2020 17:40:05 +0000 (11:40 -0600)] 
rust/log: order log macros in descending order

Readability cleanup.
- error, notice, ... debug

4 years agorust/log: expand macros after checking log level
Jason Ish [Mon, 16 Nov 2020 17:36:39 +0000 (11:36 -0600)] 
rust/log: expand macros after checking log level

Expand macros in the do_log macro after checking the log level
instead of each log macro (ie: SCLogDebug) expanding the macros
then passing off to do_log to have the log level check.

Will eliminate any expense of expanding macros if this log level
does not permit the given message to be logged.

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

4 years agodcerpc/log: Log fields particular to an RPC version 5570/head
Shivani Bhardwaj [Thu, 12 Nov 2020 11:06:39 +0000 (16:36 +0530)] 
dcerpc/log: Log fields particular to an RPC version

Log fields that only are meant to be in a PDU for a particular RPC
version. Since DCERPC/UDP works on RPC version 4 and DCERPC/TCP works on
RPC version 5, there are certain fields that are particular to each
version.
Remove call_id from the logger for UDP.
Add activityuuid and seqnum fields to the logger for UDP.
call_id and (activityuuid + seqnum) fields are used to uniquely pair a
request with response for RPC versions 5 and 4 respectively.

4 years agorust/dcerpc: Remove redundant fields
Ilya Bakhtin [Tue, 10 Nov 2020 10:27:43 +0000 (15:57 +0530)] 
rust/dcerpc: Remove redundant fields

4 years agorust/dcerpc: Make tx_id u64
Ilya Bakhtin [Tue, 10 Nov 2020 10:20:21 +0000 (15:50 +0530)] 
rust/dcerpc: Make tx_id u64

4 years agodcerpc/udp: Fix pairing of request response
Ilya Bakhtin [Tue, 10 Nov 2020 10:05:18 +0000 (15:35 +0530)] 
dcerpc/udp: Fix pairing of request response

So far, request and response were paired with serial number fields in
the header. This is incorrect. According to
https://pubs.opengroup.org/onlinepubs/9629399/chap12.htm,
"Together, the activity UUID and the sequence number uniquely identify
a remote procedure call."

Hence, add activity uuid and sequence number to the transaction and pair
the request accordingly. Remove incorrect handling of this and fix
tests.

4 years agorust/dcerpc: Add UDP flag definitions
Ilya Bakhtin [Tue, 10 Nov 2020 08:11:29 +0000 (13:41 +0530)] 
rust/dcerpc: Add UDP flag definitions

4 years agoapp-layer: lower limit for protocol detection on protocol change
Philippe Antoine [Tue, 6 Oct 2020 13:22:59 +0000 (15:22 +0200)] 
app-layer: lower limit for protocol detection on protocol change

So that protocol detection does not run for too long because
TCPProtoDetectCheckBailConditions somehow relies on its TCP stream
to start from zero, which is not the case on protocol change

Adds also debug validation checks, such as
both sides are known on protocol change

And only sets once alproto_orig

4 years agodoc: New sticky buffer icmpv4.hdr
Jeff Lucovsky [Wed, 4 Nov 2020 13:44:39 +0000 (08:44 -0500)] 
doc: New sticky buffer icmpv4.hdr

4 years agodetect: Register icmpv4 header
Jeff Lucovsky [Thu, 5 Nov 2020 13:11:17 +0000 (08:11 -0500)] 
detect: Register icmpv4 header

4 years agodetect: Add icmpv4.hdr sticky buffer
Jeff Lucovsky [Wed, 4 Nov 2020 13:31:00 +0000 (08:31 -0500)] 
detect: Add icmpv4.hdr sticky buffer

This commit adds a new sticky buffer to access the ICMPv4 header.

4 years agodetect: New enum for icmpv4 header keyword
Jeff Lucovsky [Thu, 5 Nov 2020 13:10:41 +0000 (08:10 -0500)] 
detect: New enum for icmpv4 header keyword

4 years agodecode: Improved handling of ICMPv4 messages
Jeff Lucovsky [Wed, 4 Nov 2020 13:34:51 +0000 (08:34 -0500)] 
decode: Improved handling of ICMPv4 messages

This commit improves handling of ICMPv4 messages, especially those with
variable sized headers.

This commit also adds a header length variable for use by the new
sticky buffer for the header.

4 years agogithub-ci: fix debian 10 test using rustup 5567/head
Victor Julien [Sun, 15 Nov 2020 07:06:17 +0000 (08:06 +0100)] 
github-ci: fix debian 10 test using rustup

4 years agodetect: Treat offset as a signed value
Jeff Lucovsky [Sat, 7 Nov 2020 14:53:20 +0000 (09:53 -0500)] 
detect: Treat offset as a signed value

This commit updates the detector to treat 'offset' as a signed value to
be compatible with Snort.

4 years agonapatech: Added comment indicating that hba will be deprecated
Phil Young [Fri, 13 Nov 2020 16:38:36 +0000 (11:38 -0500)] 
napatech: Added comment indicating that hba will be deprecated

HBA will be deprecated in Suricata 7

4 years agonapatech: Add Deprecation Warning Message for HBA
Phil Young [Fri, 13 Nov 2020 16:32:32 +0000 (11:32 -0500)] 
napatech: Add Deprecation Warning Message for HBA

Added a message that HBA will be deprecated in the future and removed
hba from default conf file.

4 years agodoc: provide eve 1 deprecation date
Jason Ish [Fri, 13 Nov 2020 19:15:40 +0000 (13:15 -0600)] 
doc: provide eve 1 deprecation date

4 years agodns: eve 1 deprecation warning
Jason Ish [Fri, 13 Nov 2020 19:15:14 +0000 (13:15 -0600)] 
dns: eve 1 deprecation warning

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