]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
3 years agogithub-actions: bump actions/upload-artifact from 1 to 3 7273/head
dependabot[bot] [Tue, 19 Apr 2022 19:37:14 +0000 (19:37 +0000)] 
github-actions: bump actions/upload-artifact from 1 to 3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v1...6673cd052c4cd6fcf4b4e6e60ea986c889389535)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agodetect/frame: fix frame detect registration 7269/head
Victor Julien [Tue, 19 Apr 2022 16:54:08 +0000 (18:54 +0200)] 
detect/frame: fix frame detect registration

Rewrite keyword parser.

Duplicate short names could lead to buffer confusion and memory leaks.

Bug: #5238.

3 years agosmb/rules: add rules for new events 7262/head
Victor Julien [Tue, 19 Apr 2022 10:35:52 +0000 (12:35 +0200)] 
smb/rules: add rules for new events

3 years agodoc/smb: add resource limits section
Victor Julien [Tue, 19 Apr 2022 10:17:31 +0000 (12:17 +0200)] 
doc/smb: add resource limits section

3 years agosmb2: validate negotiate read/write max sizes
Victor Julien [Tue, 19 Apr 2022 06:13:48 +0000 (08:13 +0200)] 
smb2: validate negotiate read/write max sizes

Raise event if they exceed the configured limit.

3 years agosmb2: allow limiting in-flight data size/cnt
Victor Julien [Sat, 16 Apr 2022 04:58:20 +0000 (06:58 +0200)] 
smb2: allow limiting in-flight data size/cnt

Allow limiting in-flight out or order data chunks per size or count.

Implemented for read and writes separately:

app-layer.protocols.smb.max-write-queue-size
app-layer.protocols.smb.max-write-queue-cnt
app-layer.protocols.smb.max-read-queue-size
app-layer.protocols.smb.max-read-queue-cnt

3 years agofiletracker: track total queued data (in_flight)
Victor Julien [Sat, 16 Apr 2022 04:57:56 +0000 (06:57 +0200)] 
filetracker: track total queued data (in_flight)

As well as expose number of chunks.

3 years agosmb: log max read/write sizes
Victor Julien [Mon, 18 Apr 2022 20:14:36 +0000 (22:14 +0200)] 
smb: log max read/write sizes

3 years agosmb2: add options for max read/write size
Victor Julien [Mon, 18 Apr 2022 19:47:39 +0000 (21:47 +0200)] 
smb2: add options for max read/write size

Add options for the max read/write size accepted by the parser.

3 years agosmb2: track max read/write size and enforce its values
Victor Julien [Mon, 18 Apr 2022 15:49:58 +0000 (17:49 +0200)] 
smb2: track max read/write size and enforce its values

3 years agosmb: minor function cleanup
Victor Julien [Fri, 15 Apr 2022 18:52:48 +0000 (20:52 +0200)] 
smb: minor function cleanup

Remove used argument from `filetracker_newchunk()`. We're not
using fill_bytes with smb.

3 years agofiletracker: make FileChunk private
Victor Julien [Fri, 15 Apr 2022 18:00:55 +0000 (20:00 +0200)] 
filetracker: make FileChunk private

3 years agogithub-actions: bump codecov/codecov-action from 2.1.0 to 3 7261/head
dependabot[bot] [Tue, 19 Apr 2022 06:14:45 +0000 (06:14 +0000)] 
github-actions: bump codecov/codecov-action from 2.1.0 to 3

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/f32b3a3741e1053eb607407145bc9619351dc93b...e3c560433a6cc60aec8812599b7844a7b4fa0d71)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agogithub-actions: bump github/codeql-action from 1.0.26 to 2.1.8
dependabot[bot] [Tue, 19 Apr 2022 06:14:42 +0000 (06:14 +0000)] 
github-actions: bump github/codeql-action from 1.0.26 to 2.1.8

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.26 to 2.1.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/5f532563584d71fdef14ee64d17bafb34f751ce5...1ed1437484560351c5be56cf73a48a279d116b78)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agogithub-actions: bump actions/cache from 2.1.7 to 3.0.2
dependabot[bot] [Tue, 19 Apr 2022 06:14:37 +0000 (06:14 +0000)] 
github-actions: bump actions/cache from 2.1.7 to 3.0.2

Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.0.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/937d24475381cd9c75ae6db12cb4e79714b926ed...48af2dc4a9e8278b89d7fa154b955c30c6aaab09)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agogithub-actions: bump actions/download-artifact from 2 to 3
dependabot[bot] [Tue, 19 Apr 2022 06:14:33 +0000 (06:14 +0000)] 
github-actions: bump actions/download-artifact from 2 to 3

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...fb598a63ae348fa914e94cd0ff38f362e927b741)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agogithub-actions: bump ossf/scorecard-action from 1.0.1 to 1.0.4 7256/head
dependabot[bot] [Tue, 19 Apr 2022 06:14:30 +0000 (06:14 +0000)] 
github-actions: bump ossf/scorecard-action from 1.0.1 to 1.0.4

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 1.0.1 to 1.0.4.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Commits](https://github.com/ossf/scorecard-action/compare/e3e75cf2ffbf9364bbff86cdbdf52b23176fe492...c1aec4ac820532bab364f02a81873c555a0ba3a1)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agodetect/frames: reduce severity of validation check 7255/head
Victor Julien [Tue, 19 Apr 2022 05:33:39 +0000 (07:33 +0200)] 
detect/frames: reduce severity of validation check

3 years agodependabot: monitor github actions
Jason Ish [Thu, 14 Apr 2022 18:35:57 +0000 (12:35 -0600)] 
dependabot: monitor github actions

3 years agogithub-ci: set safe directory before reset
Jason Ish [Thu, 14 Apr 2022 19:16:55 +0000 (13:16 -0600)] 
github-ci: set safe directory before reset

While the latest checkout action does set the "safe.directory"
parameter, it doesn't appear to stick for the following "git fetch", so
call this command again.

3 years agogithub-ci: pin checkout action to latest release
Jason Ish [Thu, 14 Apr 2022 18:34:47 +0000 (12:34 -0600)] 
github-ci: pin checkout action to latest release

3 years agomqtt: fix consumed bytes computation for truncated msg 7253/head
Philippe Antoine [Mon, 11 Apr 2022 19:29:33 +0000 (21:29 +0200)] 
mqtt: fix consumed bytes computation for truncated msg

Ticket: 5268

3 years agodetect/frame: get data using stream callback 7244/head
Victor Julien [Wed, 13 Apr 2022 05:47:42 +0000 (07:47 +0200)] 
detect/frame: get data using stream callback

Inspect only data that has already been consumed by the
app-layer parser. This allows for simpler progress tracking.

3 years agoframe: introduce entry for getting stream data for frame
Victor Julien [Wed, 13 Apr 2022 05:42:56 +0000 (07:42 +0200)] 
frame: introduce entry for getting stream data for frame

3 years agostream: make raw data handling more generally usable
Victor Julien [Wed, 13 Apr 2022 05:42:09 +0000 (07:42 +0200)] 
stream: make raw data handling more generally usable

Move raw detection logic out of main StreamReassembleRawDo() so that
it can be reused for other parts of the engine.

The caller now has to specify a right edge of the data.

3 years agostream: add offset to raw stream callback
Victor Julien [Tue, 12 Apr 2022 13:22:23 +0000 (15:22 +0200)] 
stream: add offset to raw stream callback

This gives the called function to understand where it is in the
stream.

3 years agoapp-layer: disable stream app tracking on no parser
Victor Julien [Wed, 13 Apr 2022 12:00:37 +0000 (14:00 +0200)] 
app-layer: disable stream app tracking on no parser

If protocol has no parser enabled or implemented, disable the app
progress tracking in the stream engine to reduce the workload in
the stream engine.

3 years agosource: pcap timestamp microsecond consistency
Philippe Antoine [Fri, 1 Apr 2022 15:55:33 +0000 (17:55 +0200)] 
source: pcap timestamp microsecond consistency

That is it should be less than 1 000 000.
Have the same for fuzz targets where the bug came from.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44177

3 years agodcerpc: store consumed_bytes as i32
Philippe Antoine [Sat, 2 Apr 2022 19:16:53 +0000 (21:16 +0200)] 
dcerpc: store consumed_bytes as i32

As it can grow bigger than u16

3 years agoike: fix integer underflow in parse_proposal
Philippe Antoine [Fri, 8 Apr 2022 06:49:18 +0000 (08:49 +0200)] 
ike: fix integer underflow in parse_proposal

By not restricting a usize to i16

3 years agodetect: config checks alstate before getting tx 7242/head
Philippe Antoine [Fri, 8 Apr 2022 13:15:23 +0000 (15:15 +0200)] 
detect: config checks alstate before getting tx

Ticket: 4972

As is done in detect-lua-extensions.
We can have a flow with alproto unknown, no state, and therefore
cannot run AppLayerParserGetTx which could try to run a NULL
function

3 years agodetect: faster linked list copy
Philippe Antoine [Mon, 5 Jul 2021 15:05:10 +0000 (17:05 +0200)] 
detect: faster linked list copy

In DetectAppLayerInspectEngineCopyListToDetectCtx
Avoid quadratic complexity by remembering last element
of the linked list we are inserting into

3 years agoflow: fix integer warnings
Philippe Antoine [Thu, 14 Apr 2022 12:44:20 +0000 (14:44 +0200)] 
flow: fix integer warnings

Ticket: 4516

3 years agohost/ippair: fix integer warnings
Philippe Antoine [Thu, 14 Apr 2022 12:41:45 +0000 (14:41 +0200)] 
host/ippair: fix integer warnings

Ticket: 4516

3 years agoutil: using size_t len for byte utils
Philippe Antoine [Thu, 14 Apr 2022 12:36:57 +0000 (14:36 +0200)] 
util: using size_t len for byte utils

Ticket: 4516

Like ByteExtractStringUint64, because most of their inputs come
from strlen which returns a size_t

3 years agoapp-layer: fix integer warnings
Philippe Antoine [Tue, 18 Jan 2022 10:19:21 +0000 (11:19 +0100)] 
app-layer: fix integer warnings

Ticket: 4516

3 years agodebug: support %m output format again
Victor Julien [Fri, 25 Feb 2022 14:40:41 +0000 (15:40 +0100)] 
debug: support %m output format again

Use thread local storage to avoid the previous dead lock issues.

3 years agothreading: simplify thread name logic
Victor Julien [Fri, 4 Mar 2022 13:31:24 +0000 (14:31 +0100)] 
threading: simplify thread name logic

3 years agorust: update regex & memchr dependencies 7230/head
Victor Julien [Mon, 11 Apr 2022 15:25:47 +0000 (17:25 +0200)] 
rust: update regex & memchr dependencies

Bug: #5260.

3 years agosmb/ntlmssp: add stricter len/offset validation
Victor Julien [Mon, 11 Apr 2022 10:33:43 +0000 (12:33 +0200)] 
smb/ntlmssp: add stricter len/offset validation

3 years agosmb: prevents integer underflow
Philippe Antoine [Fri, 8 Apr 2022 09:23:09 +0000 (11:23 +0200)] 
smb: prevents integer underflow

Ticket: 5246

If msg_id is 0, we cannot find the previous request

3 years agosmb: ntlmssp domain_blob_offset underflow check
Philippe Antoine [Mon, 4 Apr 2022 20:51:01 +0000 (22:51 +0200)] 
smb: ntlmssp domain_blob_offset underflow check

Ticket: 5246

3 years agosmb: check on param parsing
Philippe Antoine [Mon, 4 Apr 2022 20:45:56 +0000 (22:45 +0200)] 
smb: check on param parsing

Ticket: 5246

so as not to overflow u16

3 years agoframes: remove dead condition in eof check 7226/head
Victor Julien [Sun, 10 Apr 2022 18:22:00 +0000 (20:22 +0200)] 
frames: remove dead condition in eof check

3 years agoapp-layer: don't switch dir if proto already known
Victor Julien [Sun, 10 Apr 2022 18:21:18 +0000 (20:21 +0200)] 
app-layer: don't switch dir if proto already known

3 years agofuzz/sigpcap_aware: set pkt_src to wire
Victor Julien [Sun, 10 Apr 2022 13:46:38 +0000 (15:46 +0200)] 
fuzz/sigpcap_aware: set pkt_src to wire

Avoids an assert if DEBUG is compiled in:

fuzz_sigpcap_aware: source-pcap-file.c:420: TmEcode DecodePcapFile(ThreadVars *, Packet *, void *): Assertion `!(p->pkt_src != PKT_SRC_WIRE && p->pkt_src != PKT_SRC_FFR)' failed.

3 years agodetect/frame: improve assert accuracy
Victor Julien [Sun, 10 Apr 2022 13:45:36 +0000 (15:45 +0200)] 
detect/frame: improve assert accuracy

Handle frames of unknown size correctly.

Bug: #5226.

3 years agoeve: allow /dev/null in threaded mode 7225/head
Victor Julien [Sat, 9 Apr 2022 15:24:33 +0000 (17:24 +0200)] 
eve: allow /dev/null in threaded mode

Avoids creation of actual files called /dev/null.N which take
up space in /dev/ which lives in memory.

3 years agoflow: cleanup locking debug leftovers
Victor Julien [Sat, 9 Apr 2022 08:56:04 +0000 (10:56 +0200)] 
flow: cleanup locking debug leftovers

3 years agoflow: fix and simplify locking
Victor Julien [Fri, 8 Apr 2022 20:06:09 +0000 (22:06 +0200)] 
flow: fix and simplify locking

Since:

9551cd053579 ("threading: don't pass locked flow between threads")

`MoveToWorkQueue()` unconditionally unlocks the flow. This allows simpler
locking handling, including of tcp reuse flows.

The simpler logic also fixes a scenario where TCP reuse flows got "unlocked"
twice, once in `FlowGetFlowFromHash()` and once in `MoveToWorkQueue()`.

Bug: #5248.
Coverity: 1494354.

3 years agomqtt: remove redundant "where" keyword 7223/head
Sascha Steinbiss [Fri, 11 Mar 2022 18:05:03 +0000 (19:05 +0100)] 
mqtt: remove redundant "where" keyword

3 years agomqtt: make some functions non-public
Sascha Steinbiss [Tue, 8 Mar 2022 22:23:47 +0000 (23:23 +0100)] 
mqtt: make some functions non-public

3 years agomqtt: rustfmt
Sascha Steinbiss [Tue, 8 Mar 2022 22:19:22 +0000 (23:19 +0100)] 
mqtt: rustfmt

3 years agomqtt: raise event on parse error
Sascha Steinbiss [Tue, 8 Mar 2022 22:18:36 +0000 (23:18 +0100)] 
mqtt: raise event on parse error

3 years agomqtt: ensure we do not request extra data after buffering
Sascha Steinbiss [Tue, 8 Mar 2022 22:15:05 +0000 (23:15 +0100)] 
mqtt: ensure we do not request extra data after buffering

This addresses Redmine bug #5018 by ensuring that the parser
never requests additional data via the Incomplete error, but to
raise an actual parse error, since it is supposed to have all
the data as specified by the message length in the header already.

3 years agooutput: fix integer warnings 7219/head
Philippe Antoine [Tue, 18 Jan 2022 09:56:48 +0000 (10:56 +0100)] 
output: fix integer warnings

Ticket: 4516

3 years agossh: install app-layer events rules 7210/head
Philippe Antoine [Fri, 25 Mar 2022 14:03:12 +0000 (15:03 +0100)] 
ssh: install app-layer events rules

3 years agodetect: not an iponly signature if it needs app-layer
Philippe Antoine [Wed, 30 Mar 2022 13:24:32 +0000 (15:24 +0200)] 
detect: not an iponly signature if it needs app-layer

Ticket: 4972

This may happen with `config` keyword which is postmatch,
but may require a transaction

3 years agodoc/userguide: sphinx syntax correction
William Harding [Tue, 29 Mar 2022 18:53:46 +0000 (14:53 -0400)] 
doc/userguide: sphinx syntax correction

3 years agounittests: alloc Packet with PacketGetFromAlloc
Juliana Fajardini [Fri, 28 Jan 2022 21:20:31 +0000 (21:20 +0000)] 
unittests: alloc Packet with PacketGetFromAlloc

Some unittests used SCMalloc for allocating new Packet the unittests.
While this is valid, it leads to segmentation faults when we move to
dynamic allocation of the maximum alerts allowed to be triggered by a
single packet.

This massive patch uses PacketGetFromAlloc, which initializes a Packet
in such a way that any dynamic allocated structures within will also be
initialized.

Related to
Task #4207

3 years agodetect/dataset: fix space condition in rule lang
Shivani Bhardwaj [Fri, 28 Jan 2022 20:17:17 +0000 (01:47 +0530)] 
detect/dataset: fix space condition in rule lang

If there is a space following a keyword that does not expect a value,
the rule fails to load due to improper value evaluation.
e.g. Space after "set" command
alert http any any -> any any (http.user_agent; dataset:set  ,ua-seen,type string,save datasets.csv; sid:1;)

gives error
[ERRCODE: SC_ERR_UNKNOWN_VALUE(129)] - dataset action "" is not supported.

Fix this by handling values correctly for such cases.

3 years agodetect/dataset: cleanup dead code
Shivani Bhardwaj [Fri, 28 Jan 2022 13:43:04 +0000 (19:13 +0530)] 
detect/dataset: cleanup dead code

3 years agodetect/urilen: don't pass null pointer to pcre2 free 7208/head
Victor Julien [Tue, 5 Apr 2022 11:50:30 +0000 (13:50 +0200)] 
detect/urilen: don't pass null pointer to pcre2 free

Bug #5228.

3 years agodetect/mpm: initialization micro optimization 7204/head
Victor Julien [Mon, 4 Apr 2022 11:30:19 +0000 (13:30 +0200)] 
detect/mpm: initialization micro optimization

3 years agodetect: pattern id assignment through hash table
Victor Julien [Sat, 2 Apr 2022 20:25:17 +0000 (22:25 +0200)] 
detect: pattern id assignment through hash table

Only consider active part of the pattern for mpm (so consider chop).

Move data structure to hash list table over the custom array logic.

3 years agodetect: keyword list to hash to improve perf
Victor Julien [Fri, 1 Apr 2022 13:00:05 +0000 (15:00 +0200)] 
detect: keyword list to hash to improve perf

Since the switch to pcre2 this was much more heavily used, which
would lead to measurable time spent in list handling.

3 years agodetect: optimize mpm-engine setup
Victor Julien [Fri, 1 Apr 2022 10:22:51 +0000 (12:22 +0200)] 
detect: optimize mpm-engine setup

Instead of a loop over the rules in a group *per engine* do a single
loop in which all the engines are prepared in parallel.

3 years agodetect: initialization optimization
Victor Julien [Thu, 31 Mar 2022 16:00:57 +0000 (18:00 +0200)] 
detect: initialization optimization

A lot of time was spent in `SigMatchListSMBelongsTo` for the `mpm_sm`.

Optimize this by keeping the value at hand during Signature parsing and
detection engine setup.

3 years agohash: constify data input
Victor Julien [Sat, 2 Apr 2022 08:51:42 +0000 (10:51 +0200)] 
hash: constify data input

3 years agodetect/analyzer: support frames in pattern dump
Victor Julien [Sat, 2 Apr 2022 20:02:41 +0000 (22:02 +0200)] 
detect/analyzer: support frames in pattern dump

3 years agodetect/filemagic: don't pass unused pointer
Victor Julien [Sat, 2 Apr 2022 13:37:16 +0000 (15:37 +0200)] 
detect/filemagic: don't pass unused pointer

3 years agoflow-manager: fix off-by-one in flow_hash row allocation 7187/head
Arne Welzel [Sat, 12 Feb 2022 16:49:07 +0000 (17:49 +0100)] 
flow-manager: fix off-by-one in flow_hash row allocation

The current code doesn't cover all rows when more than one flow manager is
used. It leaves a single row between ftd->max and ftd->min of the next
manager orphaned. As an example:

    hash_size=1000
    flowmgr_number=3
    range=333

    instance  ftd->min  ftd->max
    0         0         333
    1         334       666
    2         667       1000

    Rows not covered: 333, 666

3 years agohttp: fix reassembled range file accounting 7186/head
Victor Julien [Thu, 24 Mar 2022 15:44:10 +0000 (16:44 +0100)] 
http: fix reassembled range file accounting

3 years agohttp2: fix file accounting for ranged files
Victor Julien [Fri, 25 Mar 2022 13:38:40 +0000 (14:38 +0100)] 
http2: fix file accounting for ranged files

Increment files_opened for tx that 'gets' reassembled ranged file

3 years agosmb1: apply close to direction
Victor Julien [Fri, 25 Mar 2022 10:17:23 +0000 (11:17 +0100)] 
smb1: apply close to direction

Instead of closing files in both direction when receiving a close request,
close only toserver files for the request and close toclient on receiving
a response.

3 years agosmb: convert 'close' parser to function
Victor Julien [Fri, 25 Mar 2022 09:36:03 +0000 (10:36 +0100)] 
smb: convert 'close' parser to function

3 years agofiles: open/log debug validation bugon
Victor Julien [Thu, 24 Mar 2022 15:53:31 +0000 (16:53 +0100)] 
files: open/log debug validation bugon

Meant to find more cases where there is a mismatch.

3 years agodevguide: update readme
Juliana Fajardini [Tue, 15 Feb 2022 13:06:50 +0000 (13:06 +0000)] 
devguide: update readme

Use it to explain how to go about the sequence diagram images
(generation, updating, what is mscgen etc).

Also remove portion that referred to Sphinx builds, as these don't make
sense now.

3 years agouserguide: dynamically determine copyright date
Juliana Fajardini [Wed, 9 Feb 2022 19:46:24 +0000 (19:46 +0000)] 
userguide: dynamically determine copyright date

This uses the date of doc generation to determine the copyright date
for the trailing date. Based on Jeff Lucovsky solution.

3 years agodevguide: drop use of mscgen script in builds/make
Juliana Fajardini [Mon, 14 Feb 2022 18:29:00 +0000 (18:29 +0000)] 
devguide: drop use of mscgen script in builds/make

Currently, it seems easier to upload the diagram images to git than to
try to make the image generation script work with out of the tree builds
and other corner cases.

This means, however, that one must activelly remember to update msc
diagram files, run the script and re-add new png files, if those ever
need to be updated. To raise awareness to that, a watermark was added
to the diagram images.

Also removed configuration steps that added mscgen as dependency
(locally and for workflow builds and readthedocs).

3 years agodevguide: add watermark to sequence diagrams
Juliana Fajardini [Fri, 18 Feb 2022 16:28:27 +0000 (16:28 +0000)] 
devguide: add watermark to sequence diagrams

Make it more evident that the sequence diagrams in the transactions
page are generated with Mscgen

3 years agodevguide: move into userguide as last chapter
Juliana Fajardini [Thu, 16 Dec 2021 18:40:41 +0000 (18:40 +0000)] 
devguide: move into userguide as last chapter

Moved devguide dir into userguide dir.
Since the devguide is now incorporated as the last chapter of the
userguide, removed build and configuration files from the devguide
dir, as these are no longer needed.

Task #4909

3 years agodevguide: clarify cargo test usage for modules
Juliana Fajardini [Wed, 22 Dec 2021 17:57:25 +0000 (17:57 +0000)] 
devguide: clarify cargo test usage for modules

The documentation was showing an invalid path for running single tests.

3 years agohttp: move xff logging to alert object
Philippe Antoine [Tue, 30 Nov 2021 14:06:38 +0000 (15:06 +0100)] 
http: move xff logging to alert object

Ticket: 4860

instead of root field

3 years agossl: first pass limit when allocating buffer for certificates
Philippe Antoine [Thu, 10 Mar 2022 14:09:57 +0000 (15:09 +0100)] 
ssl: first pass limit when allocating buffer for certificates

With this check, on the first packet of a certificate presenting
a length of 16Mbytes, we only allocate up to 65Kb

When we get to the point where need more than 65Kb, we realloc
to the true size.

With this check, it makes it more expensive for an attacket to use
this allocation as a way to trigger ressource exhaustion...

3 years agosmtp: check if there is a transaction to close 7172/head
Philippe Antoine [Tue, 22 Feb 2022 12:10:59 +0000 (13:10 +0100)] 
smtp: check if there is a transaction to close

Ticket: 4948

When parsing the response for starttls

3 years agotmqh: fix possible null dereference
Philippe Antoine [Tue, 15 Mar 2022 19:59:28 +0000 (20:59 +0100)] 
tmqh: fix possible null dereference

Coverity ID: 1502953

As we check just on the next line my_pool against NULL, we should
not dereference it, even for debug validation

3 years agodetect: remove dead code about xbits keyword
Philippe Antoine [Tue, 15 Mar 2022 19:55:09 +0000 (20:55 +0100)] 
detect: remove dead code about xbits keyword

3 years agolog: prevents use of uninitialized variable
Philippe Antoine [Thu, 10 Mar 2022 14:26:48 +0000 (15:26 +0100)] 
log: prevents use of uninitialized variable

Even if the code seems unreachable for now

3 years agodetect-content: error on single char hex pairs
Jason Ish [Tue, 22 Mar 2022 15:46:45 +0000 (09:46 -0600)] 
detect-content: error on single char hex pairs

Fix parsing of content like "|aa b cc|" which was parsed as "|aa bc|"
without error or warning. This will now fail out, requiring all hex
values to be 2 chars.

Ticket #5201

3 years agostreaming: remove unused 'auto slide' support
Victor Julien [Sun, 20 Mar 2022 15:14:10 +0000 (16:14 +0100)] 
streaming: remove unused 'auto slide' support

Add debug validation checks for "impossible" conditions.

3 years agodetect: makes config keyword really require a flow
Philippe Antoine [Tue, 8 Mar 2022 11:50:16 +0000 (12:50 +0100)] 
detect: makes config keyword really require a flow

Ticket: 4972

Completes commit c3a220647

DETECT_CONFIG is added as DETECT_SM_LIST_POSTMATCH and not
as DETECT_SM_LIST_MATCH as other keywords handled in SignatureCreateMask

3 years agodetect-pcre: remove unittests
Modupe Falodun [Fri, 4 Mar 2022 13:10:54 +0000 (14:10 +0100)] 
detect-pcre: remove unittests

These tests are reimplemented in Suricata-Verify

Task: 4911

3 years agonfs: Implement frames 7112/head
Sam Muhammed [Wed, 23 Feb 2022 12:15:00 +0000 (14:15 +0200)] 
nfs: Implement frames

Feature #4872

Frames:
  - RPC Frames: Generic over TCP/UDP
     - rpc.pdu
     - rpc.hdr
     - rpc.data
     - rpc.creds -- for rpc calls

  - NFSv2, NFSv3
     - nfs.pdu
     - nfs.status -- for nfs responses

  - NFSv4 Only Frames
     - nfs4.pdu
     - nfs4.hdr
     - nfs4.ops -- for compound request/response operations
     - nfs4.status -- for nfs4 responses

RPC tcp/udp frames created with separate registeration functions e.g:
add_rpc_tcp_tc_frames()
add_rpc_udp_tc_frames()

3 years agorpc: Improve rpc_record struct
Sam Muhammed [Mon, 28 Feb 2022 11:44:45 +0000 (13:44 +0200)] 
rpc: Improve rpc_record struct

Add creds_len field to rpc_record
needed for rpc.creds frame length calculation

3 years agorust/nfs4: Add NFSPROC4_DESTROY_CLIENTID op parsers
Sam Muhammed [Sun, 20 Feb 2022 17:46:03 +0000 (19:46 +0200)] 
rust/nfs4: Add NFSPROC4_DESTROY_CLIENTID op parsers

3 years agorust/nfs4: Add NFSPROC4_DESTROY_SESSION op parsers
Sam Muhammed [Sun, 20 Feb 2022 17:25:02 +0000 (19:25 +0200)] 
rust/nfs4: Add NFSPROC4_DESTROY_SESSION op parsers

Also add respective request unittest
test_nfs4_request_destroy_session()

3 years agorust/nfs4: Add NFSPROC4_LAYOUTRETURN op parsers
Sam Muhammed [Sun, 20 Feb 2022 17:10:41 +0000 (19:10 +0200)] 
rust/nfs4: Add NFSPROC4_LAYOUTRETURN op parsers

Also add respective request unittest
test_nfs4_request_layoutreturn()

3 years agorust/nfs4: Add NFSPROC4_GETDEVINFO op parsers
Sam Muhammed [Sun, 20 Feb 2022 16:40:11 +0000 (18:40 +0200)] 
rust/nfs4: Add NFSPROC4_GETDEVINFO op parsers

Also add respective response/request unittests
test_nfs4_response_getdevinfo()
test_nfs4_request_getdevinfo()

3 years agorust/nfs4: Add NFSPROC4_LAYOUTGET op parsers
Sam Muhammed [Sun, 20 Feb 2022 15:45:14 +0000 (17:45 +0200)] 
rust/nfs4: Add NFSPROC4_LAYOUTGET op parsers

Also add respective response/request unittests
test_nfs4_response_layoutget()
test_nfs4_request_layoutget()