]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
14 months agooutput/streaming: suppress noisy start up message 11214/head
Victor Julien [Sat, 1 Jun 2024 14:11:36 +0000 (16:11 +0200)] 
output/streaming: suppress noisy start up message

14 months agooutput/lua: handle registration error
Victor Julien [Sat, 1 Jun 2024 14:11:10 +0000 (16:11 +0200)] 
output/lua: handle registration error

Use error message instead of info message.

14 months agoeve: revert ethernet addresses when needed
Eric Leblond [Sun, 15 Oct 2023 13:39:40 +0000 (15:39 +0200)] 
eve: revert ethernet addresses when needed

EVE logging has a direction parameter that can cause the logging
of an application layer to be done in a direction that is not linked
to the packet. As a result the source IP addres could be assigned the
MAC address of the destination IP and reverse.

This patch addresses this by propagating the direction to the ethernet
logging function and using it there to define the correct mapping.

Issue #6405

14 months agoutil/radix-tree: fix potential dereference of nullptr
Alexey Simakov [Tue, 28 May 2024 16:36:58 +0000 (19:36 +0300)] 
util/radix-tree: fix potential dereference of nullptr

Fix potential dereferece of nullptr in case of
unsuccessful allocation of memory leak for tree nodes

Bug: #7049

14 months agolua: use quoted include style to avoid system includes 11199/head
Jason Ish [Thu, 30 May 2024 18:19:39 +0000 (12:19 -0600)] 
lua: use quoted include style to avoid system includes

Use quoted include style for Lua includes ("lua.h" instead of <lua.h>)
as this could result in system includes being picked up instead of the
includes from our vendor directory.

14 months agostyle: remove some useless return
Philippe Antoine [Wed, 15 May 2024 13:06:39 +0000 (15:06 +0200)] 
style: remove some useless return

and remove empty line before end of function

14 months agosrc: remove some unused parameters
Philippe Antoine [Tue, 14 May 2024 20:38:22 +0000 (22:38 +0200)] 
src: remove some unused parameters

14 months agodevguide: highlight commit message example 11179/head
Juliana Fajardini [Wed, 29 May 2024 15:24:30 +0000 (12:24 -0300)] 
devguide: highlight commit message example

Although we have the example for a commit message in our Code Submission
Process sub-chapter, seems that people still oversee it a lot. It was
suggested that we put it in a note-box, to make it more visible.

14 months agothreads: give threads more time to get ready
Victor Julien [Wed, 29 May 2024 05:03:24 +0000 (07:03 +0200)] 
threads: give threads more time to get ready

In certain conditions, it can take a long time for threads to start up.
For example in af-packet, setting up the socket, rings, etc has been
observed to take close to half a second per thread, and since the
threads go one by one in a preset order, this means the start up can
take a lot of time if there are many threads. The old logic would just
allow a hard coded 60s. This was not always enough when the number of
threads was high.

This patch makes the wait time take the number of threads into account.
It adds a second of time budget to the base 60s for each thread.

So as an example, if a system has 112 af-packet threads, it would wait
172 seconds (60 + 112) for the threads to get ready.

Ticket: #7048.

14 months agothreads: optimize start up check
Victor Julien [Mon, 27 May 2024 15:12:09 +0000 (17:12 +0200)] 
threads: optimize start up check

When starting a large amount of threads, the loop was inefficient. It
would loop over the threads and if one wasn't yet ready it would sleep a
bit and then reevaluate all the threads. This reevaluation of threads
already checked was inefficient, and could lead to the time budget
running out.

This patch splits the check, and keeps track of the threads that have
already passed. This avoids the rescanning of already checked threads.

14 months agotls-store: support client logging
Victor Julien [Sat, 25 May 2024 15:35:26 +0000 (17:35 +0200)] 
tls-store: support client logging

Adds a `client-` prefix to the logged certs and meta files.

Ticket: #7045.

14 months agotlsstore: remove stale FIXME
Victor Julien [Sat, 25 May 2024 17:22:04 +0000 (19:22 +0200)] 
tlsstore: remove stale FIXME

14 months agodetect/tls.store: fix direction check
Victor Julien [Sat, 25 May 2024 07:36:48 +0000 (09:36 +0200)] 
detect/tls.store: fix direction check

STREAM_* flags are invalid for `Flow::flags`.

Fixes: dfcb4295240f ("detect/cert: Use client side certs")
14 months agogithub-ci: re-add --disable-lua to commit check 11161/head 11165/head 11170/head
Jason Ish [Tue, 28 May 2024 18:20:29 +0000 (12:20 -0600)] 
github-ci: re-add --disable-lua to commit check

This is required for some older versions in the pull request to build
as the commits change some compile time options with respect to Lua.

14 months agodoc: update lua sandbox docs for allowed packages/functions
Jason Ish [Mon, 27 May 2024 22:12:30 +0000 (16:12 -0600)] 
doc: update lua sandbox docs for allowed packages/functions

14 months agolua: track memory limit exceede errors
Jason Ish [Mon, 27 May 2024 21:37:17 +0000 (15:37 -0600)] 
lua: track memory limit exceede errors

Update the Lua allocated to set a code on memory allocation limit
exceeded errors so an appropriate error message can be logged and a
state incremented.

Fixes the tracking of the allocated size by using the difference
between original size, and new size and toss in some debug
validations.

14 months agolua: remove sandbox lib for now
Jason Ish [Fri, 24 May 2024 22:05:58 +0000 (16:05 -0600)] 
lua: remove sandbox lib for now

Not sure if I see a use for it, some extra debug logging might be just
as useful for those writing Lua scripts.

14 months agolua: add logging and counter for instruction limit being exceeded
Jason Ish [Fri, 24 May 2024 21:57:08 +0000 (15:57 -0600)] 
lua: add logging and counter for instruction limit being exceeded

14 months agolua: add blocked functions as a special log type plus stat
Jason Ish [Fri, 24 May 2024 21:26:32 +0000 (15:26 -0600)] 
lua: add blocked functions as a special log type plus stat

Distinguish between a generic Lua script error and an error created by a
function being blocked, so each is logged once respective of each other.

Also add a stat that is incremented when a script fails due to a
blocked function.

NOTE: This does not catch calls to functions that are blocked by not
having the library loaded, such as "io.open", as they are blocked by
not even loading the "io" library.

14 months agolua: use a function allow list instead of a deny list
Jason Ish [Thu, 23 May 2024 17:55:28 +0000 (11:55 -0600)] 
lua: use a function allow list instead of a deny list

The Lua library surface area is small enough to manage an allow list,
which is generally better than a deny list, as we'll explicitly need
to opt-in to new functions provided by the Lua runtime.

14 months agorust/Makefile: cleanup "clean" targets
Jason Ish [Mon, 15 Apr 2024 16:16:31 +0000 (10:16 -0600)] 
rust/Makefile: cleanup "clean" targets

Remove maintainer-clean-local, this is not needed.

In distclean-local, remove "rust/dist" and "rust/vendor" as they are
created during "make dist".

In "clean-local", remove "rust/target" and "rust/gen" as they are
created during a normal "make".

14 months agogithub-ci/scan-build: exclude rust (lua)
Jason Ish [Mon, 15 Apr 2024 04:44:52 +0000 (22:44 -0600)] 
github-ci/scan-build: exclude rust (lua)

The vendored Lua code triggers some scan-build failures, so exclude
the rust/ directory for now. Might want to look at these separately
though.

14 months agogithub-ci: test make after clean without cbindgen
Jason Ish [Mon, 15 Apr 2024 18:00:34 +0000 (12:00 -0600)] 
github-ci: test make after clean without cbindgen

Modify the CentOS 9 Stream build to not have cbdingen available, as
its already building from the dist.  But add a "make clean" followed
by a "make" to test that it still builds after a clean.

14 months agolua: remove lua as a compile time feature
Jason Ish [Wed, 1 May 2024 20:44:52 +0000 (14:44 -0600)] 
lua: remove lua as a compile time feature

Its always built-in. However, can be disabled at runtime.

14 months agorust/lua: remove lua_int8 feature
Jason Ish [Tue, 30 Apr 2024 22:45:18 +0000 (16:45 -0600)] 
rust/lua: remove lua_int8 feature

Now that we're fixed to Lua 5.4, the integer size is always 8.

14 months agolua: use rust crate to vendor (bundle) lua
Jason Ish [Sat, 13 Apr 2024 23:08:09 +0000 (17:08 -0600)] 
lua: use rust crate to vendor (bundle) lua

Remove lua-dev(el) from all CI tests.

14 months agolua: reset instruction counter before calling script
Jason Ish [Fri, 24 May 2024 21:26:19 +0000 (15:26 -0600)] 
lua: reset instruction counter before calling script

14 months agolua: misc cleanups in sandbox implementation
Jason Ish [Thu, 11 Apr 2024 17:06:29 +0000 (11:06 -0600)] 
lua: misc cleanups in sandbox implementation

Including:
- rename guards
- SCMalloc to SCCalloc
- remove unused enum
- rename public functions to our naming standard

14 months agodoc: Initial doc for lua sandbox
Jo Johnson [Mon, 5 Feb 2024 22:58:34 +0000 (14:58 -0800)] 
doc: Initial doc for lua sandbox

14 months agolua: Add config to allow sandbox bypass
Jo Johnson [Mon, 5 Feb 2024 20:03:59 +0000 (12:03 -0800)] 
lua: Add config to allow sandbox bypass

14 months agolua: Add config override for lua sandbox limits
Jo Johnson [Mon, 29 Jan 2024 16:56:53 +0000 (08:56 -0800)] 
lua: Add config override for lua sandbox limits

14 months agolua: Add lua sandbox for detection rules
Jo Johnson [Wed, 20 Dec 2023 20:14:03 +0000 (12:14 -0800)] 
lua: Add lua sandbox for detection rules

14 months agolua: remove internal references to luajit
Jo Johnson [Fri, 26 Jan 2024 18:09:00 +0000 (10:09 -0800)] 
lua: remove internal references to luajit

14 months agolua: build lua by default
Jo Johnson [Tue, 16 Jan 2024 18:59:28 +0000 (10:59 -0800)] 
lua: build lua by default

Ticket: #4776

[Edits by Jason Ish]
- Add Lua in CI where needed
- Disable Lua for builds that don't have Lua 5.4

14 months agolua: Remove luajit support
Jo Johnson [Fri, 12 Jan 2024 19:37:03 +0000 (11:37 -0800)] 
lua: Remove luajit support

lua 5.4 support is not available in luajit

Ticket: #4776

14 months agolua: require lua 5.4
Jo Johnson [Thu, 11 Jan 2024 00:20:31 +0000 (16:20 -0800)] 
lua: require lua 5.4

github-ci: Disable lua on debian 10 as it doesn't have Lua 5.4.

Ticket: #4776

14 months agogithub-actions: bump scan-build to Ubuntu 24.04 / clang 18 11152/head
Victor Julien [Sat, 25 May 2024 05:04:29 +0000 (07:04 +0200)] 
github-actions: bump scan-build to Ubuntu 24.04 / clang 18

14 months agomisc: move prototypes to correct header
Jason Ish [Fri, 24 May 2024 22:45:10 +0000 (16:45 -0600)] 
misc: move prototypes to correct header

Move prototypes for functions that exist in util-port-interval-tree.c
from detect-engine-port.h to util-port-interval-tree.h.

Fix header guard names while there.

14 months agodoc: add source verification docs
jason taylor [Wed, 22 May 2024 01:04:09 +0000 (21:04 -0400)] 
doc: add source verification docs

Ticket: #6908

Signed-off-by: jason taylor <jtfas90@gmail.com>
14 months agodetect/http-server-body: clean up tests 11139/head
Philippe Antoine [Thu, 23 May 2024 13:55:24 +0000 (15:55 +0200)] 
detect/http-server-body: clean up tests

Ticket: 4083

14 months agodetect: unify functions for multi-buffer
Philippe Antoine [Thu, 8 Feb 2024 08:43:45 +0000 (09:43 +0100)] 
detect: unify functions for multi-buffer

Ticket: 6575

Multi buffers keywords now use a single registration function
DetectAppLayerMultiRegister with a GetBuffer argument.

This GetBuffer function pointer is similar to the ones used by
single-buffer keyword, except that it takes an additional
parameter which is the index of the buffer to get.
Under the hood, an anonymous union between these 2 functions
pointers types is used.

In the end, this deduplicates code, especially the calls to
DetectEngineContentInspection

14 months agodetect/template: make template use DetectEngineInspectBufferGeneric
Philippe Antoine [Thu, 8 Feb 2024 13:31:20 +0000 (14:31 +0100)] 
detect/template: make template use DetectEngineInspectBufferGeneric

14 months agoci: fix and test with Wunused-macros
Philippe Antoine [Thu, 11 Apr 2024 12:49:10 +0000 (14:49 +0200)] 
ci: fix and test with Wunused-macros

Ticket: 6937

14 months agoclean: remove unused struct definitions 11120/head
Philippe Antoine [Wed, 22 May 2024 13:33:44 +0000 (15:33 +0200)] 
clean: remove unused struct definitions

Found with
git grep "typedef struct" src/ | awk '{print $3}' | sort |
uniq | sed 's/_$//' | while read i; do
echo -n $i; git grep $i | wc -l; done | awk '$2 < 3'

Ticket: 4083

14 months agoapp-layer: Set sc_errno upon error return
Richard McConnell [Thu, 16 May 2024 09:04:24 +0000 (10:04 +0100)] 
app-layer: Set sc_errno upon error return

Bug: https://redmine.openinfosecfoundation.org/issues/6782

Callers to these allocators often use ``sc_errno`` to provide context of
the error. And in the case of the above bug, they return ``sc_errno``,
but as it has not been set ``sc_errno = 0; == SC_OK``.

This patch simply sets this variable to ensure there is context provided
upon error.

14 months agodetect/http-host: clean up tests
Victor Julien [Wed, 22 May 2024 07:06:06 +0000 (09:06 +0200)] 
detect/http-host: clean up tests

14 months agopcap-log: use correct pkthdr size for limit enforcement
Victor Julien [Tue, 21 May 2024 12:13:11 +0000 (14:13 +0200)] 
pcap-log: use correct pkthdr size for limit enforcement

The on-disk pcap pkthdr is 16 bytes. This was calculated using
`sizeof(struct pcap_pkthdr)`, which is 24 bytes on 64 bit Linux. On
Macos, it's even worse, as a comment field grows the struct to 280
bytes.

Address this by hardcoding the value of 16.

Bug: #7037.

14 months agopcap-log: minor cleanups
Victor Julien [Tue, 21 May 2024 05:01:15 +0000 (07:01 +0200)] 
pcap-log: minor cleanups

14 months agopcap-log: minor cleanup
Victor Julien [Mon, 20 May 2024 20:13:37 +0000 (22:13 +0200)] 
pcap-log: minor cleanup

Use same pointer to one location consistently.

14 months agopcap-log: always pass 'comp' to PcapWrite
Victor Julien [Mon, 20 May 2024 18:40:22 +0000 (20:40 +0200)] 
pcap-log: always pass 'comp' to PcapWrite

The variable is always available.

14 months agopcap-log: rename connp to comp
Victor Julien [Mon, 20 May 2024 18:39:36 +0000 (20:39 +0200)] 
pcap-log: rename connp to comp

Matches other variable names for the compression settings.

14 months agopcap-log: don't check variable that is never set
Victor Julien [Mon, 20 May 2024 18:38:26 +0000 (20:38 +0200)] 
pcap-log: don't check variable that is never set

`rotate` was never modified.

14 months agotime: only consider packet threads
Victor Julien [Mon, 20 May 2024 20:09:06 +0000 (22:09 +0200)] 
time: only consider packet threads

In offline mode, a timestamp is kept per thread, and the lowest
timestamp of the active threads is used. This was also considering the
non-packet threads, which could lead to the used timestamp being further
behind that needed. This would happen at the start of the program, as
the non-packet threads were set up the same way as the packet threads.

This patch both no longer sets up the timestamp for non-packet threads
as well as not considering non-packet threads during timestamp
retrieval.

Fixes: 6f560144c1b9 ("time: improve offline time handling")
Bug: #7034.

14 months agoflow: use debug validate macro 11112/head
Shivani Bhardwaj [Tue, 21 May 2024 11:51:53 +0000 (17:21 +0530)] 
flow: use debug validate macro

14 months agoflow: add defensive check on memuse
Shivani Bhardwaj [Tue, 21 May 2024 11:50:46 +0000 (17:20 +0530)] 
flow: add defensive check on memuse

14 months agotcp: use bool wherever possible
Shivani Bhardwaj [Tue, 21 May 2024 11:50:19 +0000 (17:20 +0530)] 
tcp: use bool wherever possible

14 months agoflow: use bool wherever possible
Shivani Bhardwaj [Tue, 21 May 2024 11:49:03 +0000 (17:19 +0530)] 
flow: use bool wherever possible

14 months agoflow: remove unneeded else
Shivani Bhardwaj [Tue, 21 May 2024 11:48:21 +0000 (17:18 +0530)] 
flow: remove unneeded else

14 months agoflow: minor loop cleanups
Shivani Bhardwaj [Tue, 21 May 2024 11:44:34 +0000 (17:14 +0530)] 
flow: minor loop cleanups

14 months agohttp: fix nul deref on memcap reached
Philippe Antoine [Fri, 17 May 2024 07:39:52 +0000 (09:39 +0200)] 
http: fix nul deref on memcap reached

HttpRangeOpenFileAux may return NULL in different cases, including
when memcap is reached.
But is only caller did not check it before calling HttpRangeAppendData
which would dereference the NULL value.

Ticket: 7029

14 months agoeve/schema: add tls.subjectaltname fields
Shivani Bhardwaj [Thu, 4 Apr 2024 10:49:56 +0000 (16:19 +0530)] 
eve/schema: add tls.subjectaltname fields

Feature 5234

14 months agooutput/json: log tls subjectaltname
Shivani Bhardwaj [Thu, 4 Apr 2024 09:52:01 +0000 (15:22 +0530)] 
output/json: log tls subjectaltname

Feature 5234

14 months agodoc: add description about tls.subjectaltname
Shivani Bhardwaj [Mon, 1 Apr 2024 11:40:51 +0000 (17:10 +0530)] 
doc: add description about tls.subjectaltname

Feature 5234

14 months agodetect/tls-subjectaltname: add sticky buffer
Shivani Bhardwaj [Thu, 4 Apr 2024 10:58:59 +0000 (16:28 +0530)] 
detect/tls-subjectaltname: add sticky buffer

Add TLS SubjectAltName sticky buffer. It is implemented as multi-buffer.

Feature 5234

14 months agotls: store list of subject alternative names
Shivani Bhardwaj [Tue, 26 Mar 2024 11:04:48 +0000 (16:34 +0530)] 
tls: store list of subject alternative names

So far, the SANs were available as a part of IssuerDN via x509_parser
crate but SANs were not available to the SSLState* to be directly used
to setup and match against a sticky buffer.
Expose it to SSLStateConnp.

Feature 5234

14 months agorust: rename .cargo/config to .cargo/config.toml 11095/head
Jason Ish [Thu, 16 May 2024 16:42:53 +0000 (10:42 -0600)] 
rust: rename .cargo/config to .cargo/config.toml

Addresses this warning from the Rust compiler:

warning: `../rust/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`

14 months agodetect-lua: small cleanups
Jason Ish [Tue, 7 May 2024 20:50:37 +0000 (14:50 -0600)] 
detect-lua: small cleanups

- remove unused headers
- cleanup/rename flags

14 months agodetect/lua: don't treat a crashed script as no match
Jason Ish [Tue, 7 May 2024 17:09:30 +0000 (11:09 -0600)] 
detect/lua: don't treat a crashed script as no match

If a rule script crashed, the return value was treated as a no
match. This would make a negation of the rule match and alert.

Instead cleanup and exit early if the rule script crashed and don't
run negation logic.

A stat, detect.lua.errors has been added to count how many times a
script crashes.

Also consolidates the running of the Lua script and return value
handling to a common function.

Bug: #6940

14 months agoftp: protocol detection avoiding FP on POP3
Philippe Antoine [Thu, 2 Feb 2023 10:03:56 +0000 (11:03 +0100)] 
ftp: protocol detection avoiding FP on POP3

14 months agopop3: protocol detection
Philippe Antoine [Thu, 2 Feb 2023 10:12:08 +0000 (11:12 +0100)] 
pop3: protocol detection

Ticket: #6366

14 months agosmtp: exit data mode if data command was rejected
Philippe Antoine [Sat, 30 Mar 2024 14:05:26 +0000 (15:05 +0100)] 
smtp: exit data mode if data command was rejected

And the server was advertising pipelining.

Ticket: 6906

14 months agodetect: checks for space in http.protcol keyword
Philippe Antoine [Mon, 2 May 2022 11:39:32 +0000 (13:39 +0200)] 
detect: checks for space in http.protcol keyword

14 months agohttp: configures libhtp to allow spaces in uri
Philippe Antoine [Thu, 2 May 2019 08:49:29 +0000 (10:49 +0200)] 
http: configures libhtp to allow spaces in uri

Ticket: #2881

14 months agodecode/gre: decode arp packets 11086/head
Giuseppe Longo [Mon, 18 Mar 2024 10:02:16 +0000 (11:02 +0100)] 
decode/gre: decode arp packets

14 months agodoc: add arp changes
Giuseppe Longo [Sun, 3 Mar 2024 17:25:48 +0000 (18:25 +0100)] 
doc: add arp changes

14 months agooutput-json/arp: implement logger
Giuseppe Longo [Sun, 3 Mar 2024 17:12:03 +0000 (18:12 +0100)] 
output-json/arp: implement logger

This adds a logger for ARP, disabled by default.

Ticket #6827

14 months agooutput/json: check 5-tuple values prior to logging
Giuseppe Longo [Wed, 20 Mar 2024 17:31:42 +0000 (18:31 +0100)] 
output/json: check 5-tuple values prior to logging

This commit enhances the JSON output by introducing a feature for conditional port logging.
Now, port logging is dependent on the underlying protocol
(such as TCP, UDP, or SCTP), where port information is pertinent, while it
avoids unnecessary logging for protocols where a port is not utilized (e.g. ARP).

Furthermore, this update ensures that IP addresses and the protocol have
meaningful values set, rather than being logged as empty strings.

These changes will make each log entry more precise, eliminating cases where
5-tuple fields are empty or set to zero, indicating the absence of a field.

14 months agooutput/json: make JSONFormatAndAddMACAddr public
Giuseppe Longo [Sun, 3 Mar 2024 06:31:07 +0000 (07:31 +0100)] 
output/json: make JSONFormatAndAddMACAddr public

This change exposes 'JSONFormatAndAddMACAddr' as a public function,
allowing it to be reused across modules, such as the ARP logger, for logging
MAC addresses extracted from ARP packets.

14 months agodecode/arp: implement decoder
Giuseppe Longo [Sat, 2 Mar 2024 17:50:27 +0000 (18:50 +0100)] 
decode/arp: implement decoder

This adds a decoder for ARP.

Ticket #6827

14 months agobase64: re-add the check for destination space
Shivani Bhardwaj [Wed, 15 May 2024 09:45:47 +0000 (15:15 +0530)] 
base64: re-add the check for destination space

Cover all the calls to DecodeBase64Block with the check for enough
space. Found by the recently introduced fuzz target.

Bug 7028

Fixes: c0bc43c39318 ("util/base64: use decoder fns per RFC")
14 months agogithub-actions: set bpf to icmp for af-packet
Victor Julien [Wed, 15 May 2024 05:03:05 +0000 (07:03 +0200)] 
github-actions: set bpf to icmp for af-packet

14 months agogithub-actions: add pcap live test script and jobs
Victor Julien [Tue, 14 May 2024 19:44:49 +0000 (21:44 +0200)] 
github-actions: add pcap live test script and jobs

Asan and coverage jobs.

14 months agogithub-actions: unix pcap coverage run
Victor Julien [Tue, 14 May 2024 18:25:07 +0000 (20:25 +0200)] 
github-actions: unix pcap coverage run

To increase code coverage.

14 months agogithub-actions: add unix socket runmode script and job
Victor Julien [Tue, 14 May 2024 14:31:11 +0000 (16:31 +0200)] 
github-actions: add unix socket runmode script and job

Runs with ASAN.

14 months agogithub-actions: add ASAN enabled Ubuntu 24.04 build of live tests
Victor Julien [Tue, 14 May 2024 13:37:08 +0000 (15:37 +0200)] 
github-actions: add ASAN enabled Ubuntu 24.04 build of live tests

14 months agodetect: add options to app-layer-protocol keyword 11084/head
Philippe Antoine [Thu, 25 Jan 2024 20:46:35 +0000 (21:46 +0100)] 
detect: add options to app-layer-protocol keyword

Ticket: 4921

app-layer-protocol keyword accept an optional mode to precise
which protocol we want to match: toclient, toserver, final,
or original

14 months agoRevert "rust: temporary: disable debug assertions"
Philippe Antoine [Tue, 14 May 2024 09:18:27 +0000 (11:18 +0200)] 
Revert "rust: temporary: disable debug assertions"

This reverts commit 14ab9aa763d44dda0f4c831047966b595f5630c1.

14 months agorust/probing: safety check for null input
Philippe Antoine [Tue, 7 May 2024 14:33:00 +0000 (16:33 +0200)] 
rust/probing: safety check for null input

Ticket: 7013

Done consistently for all protocols

This may change some protocols behaviors which failed early
if they found there was not enough data...

14 months agorust: return empty slice without using from_raw_parts
Philippe Antoine [Tue, 7 May 2024 08:18:14 +0000 (10:18 +0200)] 
rust: return empty slice without using from_raw_parts

As this triggers rustc 1.78
unsafe precondition(s) violated: slice::from_raw_parts requires
the pointer to be aligned and non-null,
and the total size of the slice not to exceed `isize::MAX`

Ticket: 7013

14 months agotests: do not bother to free a null pointer
Philippe Antoine [Tue, 7 May 2024 08:17:33 +0000 (10:17 +0200)] 
tests: do not bother to free a null pointer

Ticket: #7013

14 months agogithub-actions: make sure unix socket is created in dpdk tests 11076/head
Victor Julien [Tue, 14 May 2024 10:27:22 +0000 (12:27 +0200)] 
github-actions: make sure unix socket is created in dpdk tests

14 months agogithub-actions: expand af-packet live test with more unix commands
Victor Julien [Tue, 14 May 2024 04:47:13 +0000 (06:47 +0200)] 
github-actions: expand af-packet live test with more unix commands

14 months agohostbits: release use_cnt for unix (add|remove)-hostbit
Victor Julien [Tue, 14 May 2024 04:46:25 +0000 (06:46 +0200)] 
hostbits: release use_cnt for unix (add|remove)-hostbit

Commands would leave use_cnt incremented, never decrementing them. This
would lead to a asserting triggering at shutdown.

Bug: #7020.

14 months agodevice: don't crash on unix command 'iface-bypassed-stat'
Victor Julien [Tue, 14 May 2024 04:45:30 +0000 (06:45 +0200)] 
device: don't crash on unix command 'iface-bypassed-stat'

In the default config iface bypass support is not enabled,
and storage API not initialized for it. Using it will lead to a crash.

This commit first checks if the device storage API is initialized.

Bug: #7022.

14 months agowebsocket: fix opcodes values for ping/pong 11072/head
Philippe Antoine [Tue, 14 May 2024 11:32:04 +0000 (13:32 +0200)] 
websocket: fix opcodes values for ping/pong

And also set close

Ticket: 7025

14 months agodns: set tx id for frames
Philippe Antoine [Fri, 26 Apr 2024 19:05:36 +0000 (21:05 +0200)] 
dns: set tx id for frames

14 months agoframes: rust API makes tx_id explicit
Philippe Antoine [Fri, 26 Apr 2024 08:45:08 +0000 (10:45 +0200)] 
frames: rust API makes tx_id explicit

And set it right for SIP and websocket,
so that relevant tx app-layer metadata gets logged.

Ticket: 6973

14 months agodetect: log relevant frames app-layer metadata
Philippe Antoine [Fri, 19 Apr 2024 07:57:04 +0000 (09:57 +0200)] 
detect: log relevant frames app-layer metadata

Ticket: 6973

Completes commit 2b4e10224eaebb613352e9b82556b60035d032a1

14 months agofuzz: add target for DecodeBase64
Shivani Bhardwaj [Tue, 6 Jun 2023 11:47:32 +0000 (17:17 +0530)] 
fuzz: add target for DecodeBase64

Task 6050

14 months agodoc: add note about fast_pattern w base64_data
Shivani Bhardwaj [Fri, 22 Mar 2024 06:07:39 +0000 (11:37 +0530)] 
doc: add note about fast_pattern w base64_data

Bug 5220