]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
20 months agostats: improve sync signalling 9882/head
Victor Julien [Wed, 22 Nov 2023 08:31:38 +0000 (09:31 +0100)] 
stats: improve sync signalling

Make syncs more reliable by using a atomic "sync now" variable and
signalling the conditions under lock.

Ticket: #6569.

20 months agostats: turn sync macros into functions
Victor Julien [Wed, 22 Nov 2023 08:31:09 +0000 (09:31 +0100)] 
stats: turn sync macros into functions

20 months agoflow: fix condition signalling
Victor Julien [Wed, 22 Nov 2023 08:03:09 +0000 (09:03 +0100)] 
flow: fix condition signalling

Signal threads while holding lock. This should make the signalling
more reliable.

From PTHREAD_COND(3):

"Unlocking the mutex and suspending on the condition variable is done
 atomically. Thus, if all threads always acquire the mutex before
 signaling the condition, this guarantees that the condition cannot be
 signaled (and thus ignored) between the time a thread locks the
 mutex and the time it waits on the condition variable."

Ticket: #6569.

20 months agoippair: fix minor coverity warning
Victor Julien [Wed, 22 Nov 2023 07:21:23 +0000 (08:21 +0100)] 
ippair: fix minor coverity warning

CID 1554232:  Data race undermines locking  (LOCK_EVASION)

Ticket #6565.

20 months agohost: fix minor coverity warning
Victor Julien [Wed, 22 Nov 2023 07:17:45 +0000 (08:17 +0100)] 
host: fix minor coverity warning

CID 1554240:  Data race undermines locking  (LOCK_EVASION)

20 months agodetect/xbits: fix coverity warning
Philippe Antoine [Tue, 21 Nov 2023 20:31:10 +0000 (21:31 +0100)] 
detect/xbits: fix coverity warning

CID 1554237 and CID 1554233

Basically make the code easier to reason with for coverity
without changing the behavior which was fine.

20 months agopacketpool: signal condition within lock 9859/head
Victor Julien [Thu, 16 Nov 2023 14:29:53 +0000 (15:29 +0100)] 
packetpool: signal condition within lock

Completes: dc40a139acb3 ("packetpool: signal waiter within lock")

20 months agopacketpool: dynamic return threshold
Victor Julien [Wed, 13 Sep 2023 05:01:53 +0000 (07:01 +0200)] 
packetpool: dynamic return threshold

Problem:

In pcap autofp mode, there is one threads reading packets (RX). These packets
are then passed on to worker threads. When these workers are done with a
packet, they return packets to the pcap reader threads packet pool, which is
the owner of the packets. Since this requires expensive synchronization between
threads, there is logic in place to batch this operation.

When the reader thread depletes its pool, it notifies the other threads that
it is starving and that a sync needs to happen asap. Then the reader enters
a wait state. During this time no new packets are read.

However, there is a problem with this approach. When the reader encountered
an empty pool, it would set an atomic flag that it needed a sync. The first
worker to return a packet to the pool would then set this flag, sync, and
unset the flag. This forced sync could result in just a single packet being
synchronized, or several. So if unlucky, the reader would just get a single
packet before hitting the same condition again.

Solution:

This patch updates the logic to use a new approach. Instead of using a
binary flag approach where the behavior only changes when the reader is
already starved, it uses a dynamic sync threshold that is controlled by
the reader. The reader keeps a running count of packets it its pool,
and calculates the percentage of available packets. This percentage is
then used to set the sync threshold.

When the pool is starved, it sets the threshold to 1 (sync for each packet).
After each successful get/sync the threshold is adjusted.

20 months agocalloc: Use nmemb with SCCalloc 9858/head
Jeff Lucovsky [Tue, 21 Nov 2023 13:55:28 +0000 (08:55 -0500)] 
calloc: Use nmemb with SCCalloc

This commit modifies calls to SCCalloc that had a member count of 1 and
a size count calculated as: element_count * sizeof(element).

20 months agomemory/alloc: Use SCCalloc instead of malloc/memset
Jeff Lucovsky [Sat, 29 Jul 2023 14:03:39 +0000 (10:03 -0400)] 
memory/alloc: Use SCCalloc instead of malloc/memset

20 months agodetect: SigMatchAppendSMToList can fail 9853/head
Philippe Antoine [Thu, 7 Sep 2023 09:00:42 +0000 (11:00 +0200)] 
detect: SigMatchAppendSMToList can fail

Ticket: #6104

And failures should be handled to say that the rule failed to load

Reverts the fix by 299ee6ed5561f01575150b436d5db31485dab146
that was simple, but not complete (memory leak),
to have this bigger API change which simplifies code.

20 months agooutput/krb5: have krb5 properties in alerts 9851/head
Philippe Antoine [Thu, 16 Nov 2023 08:55:03 +0000 (09:55 +0100)] 
output/krb5: have krb5 properties in alerts

Ticket: 5977

20 months agooutput/tftp: have tftp properties in alerts
Philippe Antoine [Thu, 16 Nov 2023 08:52:12 +0000 (09:52 +0100)] 
output/tftp: have tftp properties in alerts

Ticket: 6501

20 months agooutput/ftp: have ftp properties in alerts
Philippe Antoine [Thu, 16 Nov 2023 08:49:58 +0000 (09:49 +0100)] 
output/ftp: have ftp properties in alerts

Ticket: 6500

20 months agooutput/alert: rewrite code for app-layer properties
Philippe Antoine [Thu, 11 May 2023 08:02:32 +0000 (10:02 +0200)] 
output/alert: rewrite code for app-layer properties

Especially fix setup-app-layer script to not forget this part

This allows, for simple loggers, to have a unique definition
of the actual logging function with the jsonbuilder.
This way, alerts, files, and app-layer event can share the code
to output the same data.

Ticket: #3827

20 months agorust: remove unused 9847/head
Philippe Antoine [Mon, 12 Jun 2023 20:17:26 +0000 (22:17 +0200)] 
rust: remove unused

Ticket: #4083

20 months agodetect: header_lowercase transform
Philippe Antoine [Thu, 9 Nov 2023 08:57:58 +0000 (09:57 +0100)] 
detect: header_lowercase transform

Ticket: 6290

20 months agoaf-xdp: detach XDP program early
Joseph Reilly [Tue, 1 Aug 2023 12:42:48 +0000 (12:42 +0000)] 
af-xdp: detach XDP program early

To mitigate a bug with AF_XDP sockets in high traffic scenarios, the XDP program must be detatched before
the sockets are closed. This issue happens when large ammounts of traffic are sent to suricata and
the XDP program is not removed before AF_XDP sockets are closed. I believe this is a race
condition bug as detailed here: https://bugzilla.kernel.org/show_bug.cgi?id=217712

Further investigation shows this may be a bug exclusive to the driver/AMD processor combination.

This commit addresses the bug by ensuring the first thread to run the deinit function
removes the XDP program, which fixes the bug as detailed in the bugzilla link.

Bug #6238

20 months agodetect/stream_size: fix prefiltering registration 9831/head
Eric Leblond [Sat, 18 Nov 2023 21:07:47 +0000 (22:07 +0100)] 
detect/stream_size: fix prefiltering registration

Ticket: #6551

20 months agodoc: update file.data keyword documentation
jason taylor [Thu, 16 Nov 2023 13:49:50 +0000 (13:49 +0000)] 
doc: update file.data keyword documentation

Signed-off-by: jason taylor <jtfas90@gmail.com>
20 months agorule-reload: Release excess memory freed during engine reload
Thomas Winter [Thu, 27 Apr 2023 04:08:46 +0000 (16:08 +1200)] 
rule-reload: Release excess memory freed during engine reload

The hot reload results in large chunks of memory being freed as the
as the old signature tables are discarded. Help the memory management
system along by telling to release as much memory as it can at this
point.

Bug: #6454.

20 months agoexamples: add an example plugin of an eve filetype 9829/head
Jason Ish [Mon, 30 Oct 2023 23:25:12 +0000 (17:25 -0600)] 
examples: add an example plugin of an eve filetype

This is an example of what adding plugin examples to the Suricata repo
could look like.

This plugin is an example plugin for an EVE filetype. It could be
extended to support outputs like Redis, syslog, etc.

There is one issue with adding plugins like this to an autotools
project, the project can't be built with --disable-shared, which is
more of an autotools limitation, and not really a Suricata issue.
Suricata built with --disable-shared will load plugins just fine.

Note that the examples directory was added as DIST_SUBDIRS as we don't
want normal builds to recurse into it and attempt to build the plugin,
its just an example, but we still need to keep distcheck happy.

20 months agouserguide: update tls not_after/not_before mentions
Juliana Fajardini [Thu, 16 Nov 2023 17:37:32 +0000 (14:37 -0300)] 
userguide: update tls not_after/not_before mentions

Our tls fields not_after and not_before are actually logged as
`notafter` and `notbefore`, but were documented with the underscore.

Update the documentation, since updating the log format itself would be
a breaking change.

Task #5494

20 months agouserguide: document flow_id, with examples
Juliana Fajardini [Tue, 14 Nov 2023 09:46:31 +0000 (06:46 -0300)] 
userguide: document flow_id, with examples

Flow_id explanation expanded from version shared by Peter Manev.

Task #6445

20 months agogithub-ci: don't add author names/emails to new author comment
Jason Ish [Thu, 16 Nov 2023 13:33:35 +0000 (07:33 -0600)] 
github-ci: don't add author names/emails to new author comment

The new author details will still be available in the artifact, we're
just not calling them out in a nighly visible pull request comment.

20 months agogithub-ci: cancel previous builds workflow for branch
Jason Ish [Wed, 15 Nov 2023 20:48:40 +0000 (14:48 -0600)] 
github-ci: cancel previous builds workflow for branch

On a push of the same branch, cancel the previous running builds.yml
workflow.

20 months agobool: Remove TRUE/FALSE
Jeff Lucovsky [Thu, 27 Jul 2023 17:00:31 +0000 (13:00 -0400)] 
bool: Remove TRUE/FALSE

20 months agodebug/bool: Switch use_color to a bool
Jeff Lucovsky [Thu, 27 Jul 2023 16:54:27 +0000 (12:54 -0400)] 
debug/bool: Switch use_color to a bool

20 months agorun/bool: Use bool for threading value
Jeff Lucovsky [Thu, 27 Jul 2023 16:52:21 +0000 (12:52 -0400)] 
run/bool: Use bool for threading value

20 months agohtp/bool: Use bool instead of int
Jeff Lucovsky [Thu, 27 Jul 2023 14:50:40 +0000 (10:50 -0400)] 
htp/bool: Use bool instead of int

20 months agodetect/bool: Use bool type for unittests
Jeff Lucovsky [Thu, 27 Jul 2023 14:41:44 +0000 (10:41 -0400)] 
detect/bool: Use bool type for unittests

20 months agoprefilter/bool: Use bool values for is_last
Jeff Lucovsky [Thu, 27 Jul 2023 14:41:18 +0000 (10:41 -0400)] 
prefilter/bool: Use bool values for is_last

20 months agopcap/bool: Use bool type for is_private
Jeff Lucovsky [Thu, 27 Jul 2023 14:36:15 +0000 (10:36 -0400)] 
pcap/bool: Use bool type for is_private

20 months agostream/bool: Use bool for StreamTcpInlineMode
Jeff Lucovsky [Thu, 27 Jul 2023 14:09:02 +0000 (10:09 -0400)] 
stream/bool: Use bool for StreamTcpInlineMode

20 months agogeneral/bool: Change Suricata int to bool
Jeff Lucovsky [Thu, 27 Jul 2023 13:59:06 +0000 (09:59 -0400)] 
general/bool: Change Suricata int to bool

Change Suricata operational values from int to bool.

20 months agogeneral/bool: Use bool for file support
Jeff Lucovsky [Thu, 27 Jul 2023 13:30:09 +0000 (09:30 -0400)] 
general/bool: Use bool for file support

20 months agogeneral: Use bool instead of int for condition fns
Jeff Lucovsky [Thu, 27 Jul 2023 13:17:14 +0000 (09:17 -0400)] 
general: Use bool instead of int for condition fns

This commit changes the conditional logging functions to use bool rather
than int values.

20 months agoutil-memcmp: Convert unittests to new FAIL/PASS API
Comfort Amaechi [Mon, 6 Nov 2023 10:36:50 +0000 (05:36 -0500)] 
util-memcmp: Convert unittests to new FAIL/PASS API

Ticket: #6107

20 months agodetect: fix typo
Sascha Steinbiss [Wed, 11 Oct 2023 20:25:55 +0000 (22:25 +0200)] 
detect: fix typo

20 months agodetect: add mqtt.connect.protocolstring
Sascha Steinbiss [Wed, 11 Oct 2023 20:25:46 +0000 (22:25 +0200)] 
detect: add mqtt.connect.protocolstring

Ticket:  OISF#6396

20 months agompm: thread ctx cleanups 9816/head
Victor Julien [Wed, 20 Sep 2023 08:46:23 +0000 (10:46 +0200)] 
mpm: thread ctx cleanups

Remove unused thread ctx' from AC variants

Use single thread store in detection.

Minor cleanups.

20 months agodetect/tag: reuse result of previous host lookup
Victor Julien [Wed, 15 Nov 2023 18:18:08 +0000 (19:18 +0100)] 
detect/tag: reuse result of previous host lookup

Minor optimization that could lead to a reduction in host table
lookups if more than one host feature is in use.

20 months agodoc/userguide: add tag keyword page
Victor Julien [Wed, 15 Nov 2023 08:11:32 +0000 (09:11 +0100)] 
doc/userguide: add tag keyword page

Ticket: #3015.

20 months agodoc/userguide: document host table yaml settings
Victor Julien [Wed, 15 Nov 2023 09:13:14 +0000 (10:13 +0100)] 
doc/userguide: document host table yaml settings

20 months agounittests: free packet using PacketFree
Victor Julien [Thu, 16 Nov 2023 11:37:08 +0000 (12:37 +0100)] 
unittests: free packet using PacketFree

Update SigTest17 which left a dangling pointer.

20 months agodetect: fix inspect engine return codes
Victor Julien [Tue, 14 Nov 2023 05:44:11 +0000 (06:44 +0100)] 
detect: fix inspect engine return codes

Use proper inspect engine codes instead of bool.

20 months agodetect/flow: optimize only_stream/no_stream options
Victor Julien [Sat, 9 Sep 2023 15:38:17 +0000 (17:38 +0200)] 
detect/flow: optimize only_stream/no_stream options

Until now the implementation would scan the stream, fallback to the
packet payload in exception cases, then keep track of where the match
was and in the flow match logic reject the match if it was in the wrong
buffer.

This patch simplifies this logic, by refusing to inspect the packet
payload when `only_stream` is set.

To do this the `only_stream`/`no_stream` options are now translated
to the pseudo protocols `tcp-stream` and `tcp-pkt` at parsing, so that
the `flow` keyword doesn't have to evaluate these conditions anymore.

20 months agohttp2: app-layer event for userinfo in uri
Philippe Antoine [Tue, 7 Nov 2023 16:23:23 +0000 (17:23 +0100)] 
http2: app-layer event for userinfo in uri

Ticket: #6426

as per RFC 9113
":authority" MUST NOT include the deprecated userinfo subcomponent
for "http" or "https" schemed URIs.

20 months agodetect/transform: Clarify transformation validation
Jeff Lucovsky [Tue, 14 Nov 2023 13:23:43 +0000 (08:23 -0500)] 
detect/transform: Clarify transformation validation

Issue: 6439

Clarify the transform validation step. When a transform indicates that
the content/byte-array is not compatible, validation will stop.

Content is incompatible is some cases -- e.g., following the
to_lowercase transform with content containing uppercase characters.
An alert is not possible since the content contains uppercase and the
transform has converted the buffer into all lowercase.

20 months agodetect/transform: Register case-change transforms
Jeff Lucovsky [Thu, 9 Nov 2023 13:35:46 +0000 (08:35 -0500)] 
detect/transform: Register case-change transforms

Issue: 6439

20 months agodoc/transform: Document case-changing transforms.
Jeff Lucovsky [Thu, 9 Nov 2023 11:22:55 +0000 (06:22 -0500)] 
doc/transform: Document case-changing transforms.

Issue: 6439

20 months agodetect/transform: Add case changing transforms
Jeff Lucovsky [Thu, 9 Nov 2023 10:39:33 +0000 (05:39 -0500)] 
detect/transform: Add case changing transforms

This commit adds the implementation for the case changing transforms:
to_lowercase and to_uppercase

Issue: 6439

20 months agodetect/transform: Add case-change transform constants
Jeff Lucovsky [Thu, 9 Nov 2023 10:38:44 +0000 (05:38 -0500)] 
detect/transform: Add case-change transform constants

Add the constants for the to_lowercase and to_uppercase transforms

Issue: 6439

20 months agodetect/tenants: Add tenant context to rule loads
Jeff Lucovsky [Sun, 22 Oct 2023 14:05:49 +0000 (10:05 -0400)] 
detect/tenants: Add tenant context to rule loads

Issue: 1520

This commit adds the tenant id for context to rule and .config file
loads.

20 months agogeneral: Remove vi formatting directives
Jeff Lucovsky [Mon, 16 Oct 2023 12:28:50 +0000 (08:28 -0400)] 
general: Remove vi formatting directives

20 months agooutput/null: Add the null output device
Jeff Lucovsky [Tue, 10 Oct 2023 12:02:12 +0000 (08:02 -0400)] 
output/null: Add the null output device

This commit adds the null output device; to use, set the filetype
to "nullsink" for each output that should discard and never persist
logs/alerts/etc.

This is implemented as an "internal eve output plugin" just like the
syslog eve output type.

20 months agonapatech: update docs to remove hba reference
Ralph Eastwood [Thu, 5 Oct 2023 08:02:19 +0000 (08:02 +0000)] 
napatech: update docs to remove hba reference

20 months agonapatech: remove deprecated hba support
Ralph Eastwood [Thu, 28 Sep 2023 17:19:10 +0000 (19:19 +0200)] 
napatech: remove deprecated hba support

20 months agodetect: adds flow integer keywords
Philippe Antoine [Tue, 20 Jun 2023 14:20:34 +0000 (16:20 +0200)] 
detect: adds flow integer keywords

Ticket: #6164

flow.pkts_toclient
flow.pkts_toserver
flow.bytes_toclient
flow.bytes_toserver

20 months agodoc: quic in eve/schema
Philippe Antoine [Fri, 26 May 2023 06:58:43 +0000 (08:58 +0200)] 
doc: quic in eve/schema

Ticket: #6076

20 months agoversion: start work on 8.0.0
Victor Julien [Thu, 16 Nov 2023 08:13:50 +0000 (09:13 +0100)] 
version: start work on 8.0.0

20 months agomacset: remove dead flow init/cleanup code 9789/head
Victor Julien [Fri, 8 Sep 2023 08:01:41 +0000 (10:01 +0200)] 
macset: remove dead flow init/cleanup code

FlowInit() will only be called on a newly allocated, or a fully cleaned
up flow, so no existing storage will exist.

The only caller of `FLOW_RECYCLE` first calls `FlowFreeStorage()`, so
the reset logic in `FLOW_RECYCLE` can never trigger.

Remove now unused MacSetReset logic.

20 months agodetect/flow: fix DETECT_FLOW_FLAG_ESTABLISHED check
daniel zhao [Tue, 14 Nov 2023 11:04:10 +0000 (19:04 +0800)] 
detect/flow: fix DETECT_FLOW_FLAG_ESTABLISHED check

Ticket: #6448

20 months agogithub-ci: Fedora 37 to 39; use packaged cbindgen
Victor Julien [Sat, 16 Sep 2023 09:17:58 +0000 (11:17 +0200)] 
github-ci: Fedora 37 to 39; use packaged cbindgen

20 months agooutputs: call plugin ThreadDeinit, not Deinit
Jason Ish [Wed, 1 Nov 2023 22:57:39 +0000 (16:57 -0600)] 
outputs: call plugin ThreadDeinit, not Deinit

With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: #6438

20 months agoeve: remove some dead code
Jason Ish [Mon, 30 Oct 2023 23:05:50 +0000 (17:05 -0600)] 
eve: remove some dead code

20 months agohttp2: normalize host when there is user info
Philippe Antoine [Thu, 9 Nov 2023 13:19:59 +0000 (14:19 +0100)] 
http2: normalize host when there is user info

Ticket: 6479

20 months agohttp2: update brotli crate 9767/head
Philippe Antoine [Wed, 8 Nov 2023 10:12:59 +0000 (11:12 +0100)] 
http2: update brotli crate

Fixes debug assertion found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63144

20 months agohttp2: event on mismatch between authority and host 9748/head
Philippe Antoine [Mon, 6 Nov 2023 15:38:27 +0000 (16:38 +0100)] 
http2: event on mismatch between authority and host

Ticket: #6425

20 months agodetect: parse units for integers 9745/head
Philippe Antoine [Mon, 6 Nov 2023 13:42:42 +0000 (14:42 +0100)] 
detect: parse units for integers

Ticket: #6423

Especially for filesize, instead of just a number, a signature
can use a number and a unit such as kb, mb or Gb

21 months agodoc/rule-profiling: fix suricatasc typo 9736/head
Kirjan Kohuladas [Wed, 1 Nov 2023 19:29:57 +0000 (15:29 -0400)] 
doc/rule-profiling: fix suricatasc typo

21 months agoprivs: refactor SCGetUser/GroupID to void functions
Lukas Sismis [Fri, 8 Sep 2023 09:13:26 +0000 (11:13 +0200)] 
privs: refactor SCGetUser/GroupID to void functions

SCGetUserID/SCGetGroupID either FatalErrored out or
returned zero. As a result, the functions got refactored
into non-returning void functions.

21 months agoprivs: hint the user of unset user/group name
Lukas Sismis [Fri, 8 Sep 2023 09:13:01 +0000 (11:13 +0200)] 
privs: hint the user of unset user/group name

Ticket: #6278

21 months agopacketpool: signal waiter within lock 9727/head
Victor Julien [Thu, 14 Sep 2023 04:49:31 +0000 (06:49 +0200)] 
packetpool: signal waiter within lock

Needed for predictable scheduling. From pthread_cond_signal man page:

"The pthread_cond_signal() or pthread_cond_broadcast() functions may
 be called by a thread whether or not it currently owns the mutex that
 threads calling pthread_cond_wait() or pthread_cond_timedwait() have
 associated with the condition variable during their waits; however, if
 predictable scheduling behaviour is required, then that mutex is locked
 by the thread calling pthread_cond_signal() or pthread_cond_broadcast()."

21 months agopacketpool: return one packet as well on sync now
Victor Julien [Tue, 12 Sep 2023 10:27:03 +0000 (12:27 +0200)] 
packetpool: return one packet as well on sync now

If a thread is hitting the packet pool return on a 'sync_now' return
the packet also if it is the first packet since the last flush.

Bug: #6435.

21 months agopacketpool: remove WaitForN logic as it is unused
Victor Julien [Tue, 12 Sep 2023 10:15:54 +0000 (12:15 +0200)] 
packetpool: remove WaitForN logic as it is unused

21 months agoflow/timeout: no need to wait for packetpool
Victor Julien [Tue, 12 Sep 2023 10:13:52 +0000 (12:13 +0200)] 
flow/timeout: no need to wait for packetpool

The timeout logic no longer passes packets around, so don't depend
on the packet pool.

Bug: #6292.

21 months agohost/iprep: run all timeout logic
Victor Julien [Mon, 11 Sep 2023 05:05:48 +0000 (07:05 +0200)] 
host/iprep: run all timeout logic

Run all timeout logic if iprep is in use as well.

Minor code cleanups.

Bug: #6436.

21 months agodetect/urilen: fix discontinue matching logic
Victor Julien [Fri, 22 Sep 2023 07:48:15 +0000 (09:48 +0200)] 
detect/urilen: fix discontinue matching logic

Actually discontinue matching.

Fixes: 21f9cc3a39a0 ("discontinue matching on buffer if urilen returns a match failure.")
21 months agodetect/bytetest: convert unittests to FAIL/PASS 9716/head
Daniel Olatunji [Tue, 31 Oct 2023 00:09:43 +0000 (00:09 +0000)] 
detect/bytetest: convert unittests to FAIL/PASS

Issue: #6332

21 months agodns/eve: make removed v1 style a warning, not an error 9714/head
Jason Ish [Mon, 30 Oct 2023 18:16:33 +0000 (12:16 -0600)] 
dns/eve: make removed v1 style a warning, not an error

We don't error out in this case, but instead default to v2. So use a
warning instead of an error.

21 months agodns/eve: use default formats if formats is empty
Jason Ish [Fri, 27 Oct 2023 16:19:31 +0000 (10:19 -0600)] 
dns/eve: use default formats if formats is empty

If the configuration field "formats" is empty, DNS response records do
not have any relevant information other than that there was a
response, but not much about the response.

I'm pretty sure the intention here was to log the response details if
no formats were provided, which is what happens when the field is
commented out.

So if no formats are specified, use the default of all.

Bug: #6420

21 months agodetect/bytejump: convert unittests to FAIL/PASS
Daniel Olatunji [Mon, 30 Oct 2023 01:13:17 +0000 (01:13 +0000)] 
detect/bytejump: convert unittests to FAIL/PASS

Issue: #6328

21 months agorunmodes: remove obsolete references to pcap auto modes
Jason Ish [Fri, 27 Oct 2023 22:58:08 +0000 (16:58 -0600)] 
runmodes: remove obsolete references to pcap auto modes

These auto modes were remove many years ago. Also cleanup the wording
a little.

Task: #6427

21 months agodetect/bytejump: Improve end-of-buffer handling
Jeff Lucovsky [Fri, 27 Oct 2023 13:10:47 +0000 (09:10 -0400)] 
detect/bytejump: Improve end-of-buffer handling

Issue: 4623

This commit addresses the issues reported in issue 4623 when the jump
value points at the last byte in the buffer.

21 months agodetect/bytejump: Remove unused "Match" function
Jeff Lucovsky [Fri, 27 Oct 2023 13:09:43 +0000 (09:09 -0400)] 
detect/bytejump: Remove unused "Match" function

Issue: 4623

DetectBytejumpMatch is no longer used -- it's counterpart --
DetectByteJumpDoMatch is and will remain.

21 months agounix-manager: prioritize the shutdown check
Lukas Sismis [Mon, 25 Sep 2023 13:37:07 +0000 (15:37 +0200)] 
unix-manager: prioritize the shutdown check

Make sure Suricata is in the running state before
you attempt to execute commands on the Unix sockets.
UnixMain is being called in an infinite loop where
TmThreadsCheckFlag(th_v, THV_KILL) is checked for the
deinit phase. However, it may take some time between
the start of Suricata's deinitialization and
the receipt of THV_KILL flag in the Unix thread.

In between this time period, the Unix manager can still
perform select() operation on the Unix socket while
the socket being already deinitialized.

Likely with a longer time span between the initial shutdown
command and actual closing of Unix sockets resulted in
an error of invalid file descriptors.

Ticket: #6272

21 months agogithub: improve template CLA request info 9701/head
Juliana Fajardini [Mon, 23 Oct 2023 18:25:44 +0000 (15:25 -0300)] 
github: improve template CLA request info

Indicate that the CLA only has to be signed once, as we have had
contributors think that was required for each new PR.

21 months agouserguide: add proper label to RPM install section
Juliana Fajardini [Mon, 23 Oct 2023 18:19:45 +0000 (15:19 -0300)] 
userguide: add proper label to RPM install section

Use a reference label that is stable, instead of one that could change
in case a new section is added above it.

21 months agodetect-tcp-window: Convert unittests to new FAIL/PASS API
Hadiqa Alamdar Bukhari [Mon, 23 Oct 2023 15:25:28 +0000 (20:25 +0500)] 
detect-tcp-window: Convert unittests to new FAIL/PASS API

Task #6339

21 months agoflow-bit: Convert unittests to new FAIL/PASS API
Hadiqa Alamdar Bukhari [Fri, 20 Oct 2023 21:25:50 +0000 (02:25 +0500)] 
flow-bit: Convert unittests to new FAIL/PASS API

Task #6329

21 months agoutil-misc: Convert unittests to new FAIL/PASS API
Hadiqa Alamdar Bukhari [Thu, 19 Oct 2023 19:40:50 +0000 (00:40 +0500)] 
util-misc: Convert unittests to new FAIL/PASS API

Task #6345

21 months agomisc: improve code documentation
Liza Opar [Thu, 12 Oct 2023 11:07:48 +0000 (14:07 +0300)] 
misc: improve code documentation

Task #6383

21 months agorust: remove cbindgen:ignore on frames module
Daniel Olatunji [Thu, 12 Oct 2023 11:13:41 +0000 (11:13 +0000)] 
rust: remove cbindgen:ignore on frames module

This directive is no longer required, and does
mess up the rustdoc description of the module.

21 months agorust/doc: add docstring to rust module files.
Daniel Olatunji [Wed, 11 Oct 2023 19:24:03 +0000 (19:24 +0000)] 
rust/doc: add docstring to rust module files.

Issue: #4584

21 months agodoc: be consistent with the use of "sudo"
Daniel Olatunji [Wed, 11 Oct 2023 21:42:47 +0000 (21:42 +0000)] 
doc: be consistent with the use of "sudo"

Issue: #5720

21 months agoversion: start development towards 7.0.3
Victor Julien [Thu, 19 Oct 2023 14:13:19 +0000 (16:13 +0200)] 
version: start development towards 7.0.3

21 months agorelease: 7.0.2; update changelog suricata-7.0.2
Shivani Bhardwaj [Wed, 18 Oct 2023 14:14:53 +0000 (19:44 +0530)] 
release: 7.0.2; update changelog

21 months agomime: avoid quadratic complexity in MimeDecAddEntity
Philippe Antoine [Mon, 11 Sep 2023 14:49:48 +0000 (16:49 +0200)] 
mime: avoid quadratic complexity in MimeDecAddEntity

Ticket: #6306

Keep a reference to last child, consume a bit more RAM to save CPU

21 months agodetect: error early when too many buffers 9645/head
Philippe Antoine [Thu, 5 Oct 2023 07:18:50 +0000 (09:18 +0200)] 
detect: error early when too many buffers

Ticket: #6104

To get a chance to clean properly, before we leak memory.