]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 months agogithub-ci: pin bindgen test to bindgen v0.66.0 13142/head
Jason Ish [Fri, 2 May 2025 15:23:54 +0000 (09:23 -0600)] 
github-ci: pin bindgen test to bindgen v0.66.0

2 months agodoc/userguide: fix typo in lua flowvar lib
Jason Ish [Thu, 1 May 2025 22:42:23 +0000 (16:42 -0600)] 
doc/userguide: fix typo in lua flowvar lib

Was importing suricata.flow, not suricata.flowvar.

2 months agolua: convert lua flowint functions to lib: suricata.flowintlib
Jason Ish [Thu, 1 May 2025 22:33:19 +0000 (16:33 -0600)] 
lua: convert lua flowint functions to lib: suricata.flowintlib

Ticket: #7487

3 months agobuild: separate private headers from installed headers 13125/head
Jason Ish [Wed, 30 Apr 2025 16:23:38 +0000 (10:23 -0600)] 
build: separate private headers from installed headers

Create a new list of headers for headers that should never be
installed, such as private headers that should only be available
within the Suricata project.

For now, just the util-device-private.h belongs to this set.

3 months agoexamples: add simple c++ example
Jason Ish [Mon, 28 Apr 2025 17:34:32 +0000 (11:34 -0600)] 
examples: add simple c++ example

For now just used to make sure a C++ variation of our custom example
can build.

3 months agoutil-device: break into public and private definitions
Jason Ish [Tue, 29 Apr 2025 18:01:36 +0000 (12:01 -0600)] 
util-device: break into public and private definitions

util-device.h exposes some details that are particularly problematic
for C++, even when wrapped in 'extern "C"'. To address this, break the
header into public and private parts. The public part exposes
LiveDevice as an opaque data structure, while the private header has
the actual definition.

The idea is that only Suricata C source files should include the
private header, it should not be re-included in any other header
file. And this is the header library users should use, however we
don't enforce it with tecnical means, a library user could still
include the private header, but the clue there is in the name.

3 months agodevice: move LiveDeviceName from header into source
Jason Ish [Mon, 28 Apr 2025 18:43:17 +0000 (12:43 -0600)] 
device: move LiveDeviceName from header into source

This data structure is only used by the C file and has no reason to be
exposed in the header.

3 months agolibsuricata-config: fix static library dependency order
Jason Ish [Mon, 28 Apr 2025 18:20:38 +0000 (12:20 -0600)] 
libsuricata-config: fix static library dependency order

When static linking we have a circular dependency between
libsuricata_rust, and libsuricata_c, so we have to list each twice.

An alternative is to use "-Wl,--start-group", but that isn't portable
outside the GNU toolchain.

3 months agolibsuricata-config: fix type (status -> static)
Jason Ish [Mon, 28 Apr 2025 18:13:41 +0000 (12:13 -0600)] 
libsuricata-config: fix type (status -> static)

3 months agomisc: add c++ support to some headers
Jason Ish [Mon, 28 Apr 2025 17:34:56 +0000 (11:34 -0600)] 
misc: add c++ support to some headers

For now, just the headers required by our examples.

3 months agomisc: only define _GNU_SOURCE if not defined
Jason Ish [Mon, 28 Apr 2025 17:18:03 +0000 (11:18 -0600)] 
misc: only define _GNU_SOURCE if not defined

C++ compilers on Linux (g++, clang++) appear to always define this.

3 months agothreads: rename function to make scope more clear
Victor Julien [Wed, 30 Apr 2025 13:10:50 +0000 (15:10 +0200)] 
threads: rename function to make scope more clear

SCTmThreadsSlotPktAcqLoopFinish ss now used outside of
just pktacq as well.

3 months agothreads: fix autofp shutdown race condition
Victor Julien [Wed, 30 Apr 2025 08:20:10 +0000 (10:20 +0200)] 
threads: fix autofp shutdown race condition

Sometimes a single flow pcap would log 2 flows. It turns out FlowWorkToDoCleanup
ran before all the packet threads had processed their "wire" packets. It then
removed a flow that a wire packet would still have needed, leading to the worker
thread creating a new flow for it.

This could happen due to the logic in TmThreadDisableReceiveThreads which calls
TmThreadDrainPacketThreads to made sure it only returns when all autofp-workers
have processed all the packets the autofp-capture thread fed to them.

However, the way it checked this is by checking the size of the autofp-worker's
input queue. If 0, it assumes it is done.

What this missed, is that a worker thread could have just taken the last packet
from the input queue, but it is not yet done processing it. If then the
FlowWorkToDoCleanup is ran as well, it would race the worker thread to the flow
handling logic. When it won, the flow was evicted and the packet thread
created a new flow.

This patch improves the shutdown logic to force the worker threads to
enter a "flow loop" (THV_FLOW_LOOP) state before moving on to the
FlowWorkToDoCleanup step. This makes sure that any in progress packets
in the worker threads have been processed.

Bug: #7681.

3 months agothreads: remove unused flag
Victor Julien [Wed, 30 Apr 2025 07:10:32 +0000 (09:10 +0200)] 
threads: remove unused flag

3 months agolua: convert hassh function into suricata.hassh lib 13117/head
Philippe Antoine [Mon, 28 Apr 2025 12:23:03 +0000 (14:23 +0200)] 
lua: convert hassh function into suricata.hassh lib

Ticket: 7603

We use suricata.ssh lib but also enable hassh.

3 months agolua/flowvarlib: fix unchecked null
Jason Ish [Tue, 29 Apr 2025 17:26:46 +0000 (11:26 -0600)] 
lua/flowvarlib: fix unchecked null

Use checkudata, instead of testudata which won't return in case of
NULL, but raise an error in the Lua script.

Fixes:

** CID 1646748:  Null pointer dereferences  (NULL_RETURNS)
/src/util-lua-flowvarlib.c: 89 in LuaFlowvarValue()

3 months agolua/flowvarlib: fix formatting inside clang-format off
Jason Ish [Tue, 29 Apr 2025 17:24:49 +0000 (11:24 -0600)] 
lua/flowvarlib: fix formatting inside clang-format off

3 months agogen/typo: Correct configure output grammar 13108/head
Jeff Lucovsky [Tue, 29 Apr 2025 12:56:41 +0000 (08:56 -0400)] 
gen/typo: Correct configure output grammar

Fixup the grammar for the Napatech option -- was "Enabled Napatech".

3 months agodetect/single-buf: helper with more explicit direction 13106/head
Philippe Antoine [Mon, 28 Apr 2025 13:27:00 +0000 (15:27 +0200)] 
detect/single-buf: helper with more explicit direction

3 months agorust: bindgen detect-engine-buffer.h
Philippe Antoine [Tue, 22 Apr 2025 13:42:31 +0000 (15:42 +0200)] 
rust: bindgen detect-engine-buffer.h

Ticket: 7667

And prefix SCDetectBufferSetActiveList to be exported

Allows less use of suricata crate in plugin as we get the functions
prototypes from suricata_sys and they are more correct.

3 months agosrc: new file detect-engine-buffer.h
Philippe Antoine [Tue, 22 Apr 2025 13:11:22 +0000 (15:11 +0200)] 
src: new file detect-engine-buffer.h

Taken from detect-engine.h so that we can bindgen this smaller
unit.

3 months agosdp: use rust join
Philippe Antoine [Mon, 28 Apr 2025 08:44:09 +0000 (10:44 +0200)] 
sdp: use rust join

It is much faster as it does not do an allocation for each element

3 months agowebsocket: limit allocation for small sizes
Philippe Antoine [Mon, 28 Apr 2025 08:11:13 +0000 (10:11 +0200)] 
websocket: limit allocation for small sizes

Fixes: 16f74c68aaa9 ("websocket: use max window bits of 15")
We do not need to allocate 8kbytes for a small message

3 months agolua: convert flowvar functions to lib 13097/head
Jason Ish [Thu, 24 Apr 2025 18:11:28 +0000 (12:11 -0600)] 
lua: convert flowvar functions to lib

New Lua lib, "suricata.flowvar" for working with flowvars from Lua.

Replaces functions:
- SCFlowvarGet (and ScFlowvarGet)
- SCFlowvarSet (and SCFlowvarSet)

Of note, the DetectLuaData has been made available to the init and
thread_init methods, instead of just the match. This is due to an
issue that if a flow variable is not registered in init, it will not
be logged, registering in thread_init is too late.

Ticket: #7486

3 months agodoc/ssh: document hooks 13092/head
Philippe Antoine [Tue, 22 Apr 2025 18:51:18 +0000 (20:51 +0200)] 
doc/ssh: document hooks

Ticket: 7607

3 months agodetect: flow friendly error on hook incompatibility
Philippe Antoine [Fri, 18 Apr 2025 11:46:27 +0000 (13:46 +0200)] 
detect: flow friendly error on hook incompatibility

3 months agossh: rustfmt
Philippe Antoine [Tue, 15 Apr 2025 12:41:37 +0000 (14:41 +0200)] 
ssh: rustfmt

3 months agolua: convert ssh function into suricata.ssh lib
Philippe Antoine [Thu, 3 Apr 2025 14:25:19 +0000 (16:25 +0200)] 
lua: convert ssh function into suricata.ssh lib

Ticket: 7607

3 months agossh: make hooks available
Philippe Antoine [Tue, 15 Apr 2025 12:28:51 +0000 (14:28 +0200)] 
ssh: make hooks available

Allows signature like `alert ssh:request_banner_done`

3 months agorust: derive for AppLayerState
Philippe Antoine [Tue, 15 Apr 2025 12:12:19 +0000 (14:12 +0200)] 
rust: derive for AppLayerState

To enable easily hooks for rust app-layers such as SSH

3 months agodns/lua: remove now unused includes
Philippe Antoine [Tue, 15 Apr 2025 11:48:41 +0000 (13:48 +0200)] 
dns/lua: remove now unused includes

Completes commit 1206c1c5af95479e8fd32f199bc7bfd3bafc56de

3 months agoftp: Apply rustfmt changes
Jeff Lucovsky [Thu, 24 Apr 2025 12:47:32 +0000 (08:47 -0400)] 
ftp: Apply rustfmt changes

3 months agodoc/ftp: Document ftp.dynamic_port keyword
Jeff Lucovsky [Sat, 19 Apr 2025 13:49:45 +0000 (09:49 -0400)] 
doc/ftp: Document ftp.dynamic_port keyword

Document the sticky buffer for ftp.dynamic_port

3 months agodetect/ftp: Add ftp.dynamic_port keyword
Jeff Lucovsky [Thu, 24 Apr 2025 12:46:13 +0000 (08:46 -0400)] 
detect/ftp: Add ftp.dynamic_port keyword

Issue: 7504

Add implementation of the ftp.dynamic_port rule keyword. The
implementation uses the U16 integer matching/parsing and thus supports
the comparison operations such as <, >, <=, >=, !, !=, and range (-).

3 months agoapp/ftp: Use common API naming
Jeff Lucovsky [Thu, 24 Apr 2025 12:32:58 +0000 (08:32 -0400)] 
app/ftp: Use common API naming

Modify the Rust API functions to conform to project naming format:
SCFTP*

Issue: 7504

3 months agodetect/multi-buf: helper with more explicit direction
Philippe Antoine [Tue, 22 Apr 2025 12:31:47 +0000 (14:31 +0200)] 
detect/multi-buf: helper with more explicit direction

3 months agodetect/multi-buf: use only one progress
Philippe Antoine [Tue, 22 Apr 2025 12:21:05 +0000 (14:21 +0200)] 
detect/multi-buf: use only one progress

for both inspect engine and app-layer mpm

3 months agodetect/multi-buf: harmonize wrapper
Philippe Antoine [Tue, 22 Apr 2025 07:28:32 +0000 (09:28 +0200)] 
detect/multi-buf: harmonize wrapper

Introduce DetectGetMultiData which does the generic wrapping,
including the transforms.

And let each keyword do just the getter.

3 months agogithub-ci: update to Fedora 42 13080/head
Victor Julien [Wed, 23 Apr 2025 08:23:43 +0000 (10:23 +0200)] 
github-ci: update to Fedora 42

3 months agoapp-layer: remove obsolete NULL check 13079/head
Philippe Antoine [Tue, 22 Apr 2025 19:15:53 +0000 (21:15 +0200)] 
app-layer: remove obsolete NULL check

Completes commit 833a738dd1429f63c79d95edf25bb86fcc15b51a

Fixes coverity 1646610

3 months agodoc/userguide: document that lua dns rules need hooks
Jason Ish [Tue, 22 Apr 2025 16:43:12 +0000 (10:43 -0600)] 
doc/userguide: document that lua dns rules need hooks

And remove the old "keywords" that a lua Rule can register with for
DNS.

3 months agolua: fix fast.lua example
Jason Ish [Thu, 10 Apr 2025 22:52:40 +0000 (16:52 -0600)] 
lua: fix fast.lua example

This one is a little different as it logs to a file, and is the same
fast.lua used in the new Suricata-Verify test.

Ticket: #7656

3 months agolua: add suricata.rule library
Jason Ish [Wed, 9 Apr 2025 21:19:29 +0000 (15:19 -0600)] 
lua: add suricata.rule library

Add a "suricata.rule" library for accessing rule information from a
Lua rule, or a Lua output script.

This lib replaces the following global Lua functions:
- SCRuleIds
- SCRuleAction
- SCRuleMsg
- SCRuleClass

Ticket: #7490

3 months agodoc/lua/dns: fix typo
Jason Ish [Thu, 10 Apr 2025 22:08:08 +0000 (16:08 -0600)] 
doc/lua/dns: fix typo

3 months agorust: use pure rust helper for registering sticky buffers
Philippe Antoine [Mon, 21 Apr 2025 19:54:48 +0000 (21:54 +0200)] 
rust: use pure rust helper for registering sticky buffers

Mark sdp and sip keywords with flags SIGMATCH_INFO_STICKY_BUFFER
as a side effect.

3 months agoplugin: applayer: do not use suricata JsonError
Philippe Antoine [Sat, 19 Apr 2025 18:57:18 +0000 (20:57 +0200)] 
plugin: applayer: do not use suricata JsonError

We do not need a specific error type

3 months agohttp: fail tx creation if we cannot allocate user data 13073/head
Philippe Antoine [Fri, 18 Apr 2025 19:16:29 +0000 (21:16 +0200)] 
http: fail tx creation if we cannot allocate user data

So, we always have a libhtp.rs htp_tx_t and a Suricata tx
with its AppLayerTxData

Thus AppLayerParserGetTxData cannot return NULL

Ticket: 5739

3 months agorust/htp: remove unused code
Philippe Antoine [Mon, 21 Apr 2025 19:21:06 +0000 (21:21 +0200)] 
rust/htp: remove unused code

3 months agowebsocket: fixes substraction 13064/head
Philippe Antoine [Mon, 21 Apr 2025 19:16:38 +0000 (21:16 +0200)] 
websocket: fixes substraction

Fixes: 16f74c68aaa9 ("websocket: use max window bits of 15")
3 months agogithub-ci: codecov llvm updates 13057/head
Victor Julien [Sun, 20 Apr 2025 13:58:51 +0000 (15:58 +0200)] 
github-ci: codecov llvm updates

Use LLVM 15 with Rust 1.67.1

3 months agogithub-ci: update codecov unittest job
Victor Julien [Sun, 20 Apr 2025 13:57:22 +0000 (15:57 +0200)] 
github-ci: update codecov unittest job

LLVM 19, rust 1.85.1 and Ubuntu 24.04.

3 months agodnp3: mark tx as updated when creating it 13054/head
Philippe Antoine [Sat, 19 Apr 2025 19:28:16 +0000 (21:28 +0200)] 
dnp3: mark tx as updated when creating it

Ticket: 7668

We should set updated_tx when allocating a dnp3 tx

3 months agoftp: mark tx as updated when creating it
Philippe Antoine [Sat, 19 Apr 2025 19:27:01 +0000 (21:27 +0200)] 
ftp: mark tx as updated when creating it

Ticket: 7668

We should set updated_tx when allocating a ftp tx

Was already done right for updated_tc

3 months agohttp1: always mark tx as updated on request/response start
Philippe Antoine [Sat, 19 Apr 2025 19:21:31 +0000 (21:21 +0200)] 
http1: always mark tx as updated on request/response start

Ticket: 7668

We should set updated_tx when allocating HtpTxUserData

3 months agodetect: rust helper to register sticky buffer 13053/head
Philippe Antoine [Mon, 17 Feb 2025 20:13:54 +0000 (21:13 +0100)] 
detect: rust helper to register sticky buffer

3 months agodetect: rename SCSigTableElmt to SCSigTableAppLiteElmt
Philippe Antoine [Mon, 17 Feb 2025 20:41:56 +0000 (21:41 +0100)] 
detect: rename SCSigTableElmt to SCSigTableAppLiteElmt

3 months agodetect: remove never set SIGMATCH_NOT_BUILT
Philippe Antoine [Wed, 5 Mar 2025 16:26:49 +0000 (17:26 +0100)] 
detect: remove never set SIGMATCH_NOT_BUILT

3 months agounittests: more realistic packet from UTHBuildPacketReal
Philippe Antoine [Thu, 6 Feb 2025 12:35:42 +0000 (13:35 +0100)] 
unittests: more realistic packet from UTHBuildPacketReal

So that its contents can be reused when translating unit tests
to SV tests

3 months agodetect/dns: support string for dns.rrtype
Philippe Antoine [Sun, 26 Jan 2025 14:46:34 +0000 (15:46 +0100)] 
detect/dns: support string for dns.rrtype

Ticket: 6723

3 months agodetect/dns: support string for dns.rcode
Philippe Antoine [Sun, 26 Jan 2025 14:35:24 +0000 (15:35 +0100)] 
detect/dns: support string for dns.rcode

Ticket: 6723

3 months agodetect/dns: move keywords to rust
Philippe Antoine [Sun, 26 Jan 2025 14:16:03 +0000 (15:16 +0100)] 
detect/dns: move keywords to rust

Ticket: 7529
Ticket: 3725

Adds url for dns.opcode on the way

3 months agodetect: new helper to register multi-buffer with progress
Philippe Antoine [Tue, 15 Apr 2025 19:08:01 +0000 (21:08 +0200)] 
detect: new helper to register multi-buffer with progress

This allows to use these engines for hook rules needing exact
progress (checked in SigValidate)

3 months agoci: rustc wrapper to disable coverage for external crates
Philippe Antoine [Tue, 15 Apr 2025 14:40:44 +0000 (16:40 +0200)] 
ci: rustc wrapper to disable coverage for external crates

To keep the disk usage good even when we use new crates

3 months agohttp1: brotli decompression
Philippe Antoine [Fri, 11 Apr 2025 19:56:19 +0000 (21:56 +0200)] 
http1: brotli decompression

Ticket: 5692

http2 already used brotli crate for decompression

3 months agooutput: fix leak in case of alloc error 13049/head
Philippe Antoine [Fri, 18 Apr 2025 13:17:58 +0000 (15:17 +0200)] 
output: fix leak in case of alloc error

CID: 1638290

3 months agodefrag: remove unnecessary NULL check
Philippe Antoine [Fri, 18 Apr 2025 12:52:30 +0000 (14:52 +0200)] 
defrag: remove unnecessary NULL check

CID: 727861

3 months agoutil/mpm: prevents double free
Philippe Antoine [Fri, 18 Apr 2025 12:38:48 +0000 (14:38 +0200)] 
util/mpm: prevents double free

CID: 1645545

PatternDatabaseGetCached frees cd on success
So, we should NULL it, so that in case PatternDatabaseGetSize fails
and we goto error, we do not free cd again.

3 months agodetect: explicitly skip check on SCConfGet
Philippe Antoine [Fri, 18 Apr 2025 12:32:27 +0000 (14:32 +0200)] 
detect: explicitly skip check on SCConfGet

CID: 1644571

3 months agodox/userguide: add tx_cnt documentation 13044/head
Eric Leblond [Sun, 30 Mar 2025 15:24:35 +0000 (17:24 +0200)] 
dox/userguide: add tx_cnt documentation

3 months agoeve/schema: remove duplicate fields
Eric Leblond [Sun, 30 Mar 2025 15:24:06 +0000 (17:24 +0200)] 
eve/schema: remove duplicate fields

3 months agoeve/flow: log tx_cnt
Eric Leblond [Mon, 20 Jan 2025 10:17:21 +0000 (11:17 +0100)] 
eve/flow: log tx_cnt

This patch adds a `tx_cnt` field to `netflow` events to give some
context about the underlying protocol activity.

Ticket: #7635

3 months agoeve/netflow: add tx_cnt
Eric Leblond [Fri, 24 Jan 2025 13:44:34 +0000 (14:44 +0100)] 
eve/netflow: add tx_cnt

This patch adds a `tx_cnt` field to `netflow` events to give some
context about the underlying protocol activity.

Ticket: #7635

3 months agoeve/smb: add tx_id to event
Eric Leblond [Wed, 19 Jan 2022 13:56:06 +0000 (14:56 +0100)] 
eve/smb: add tx_id to event

As SMB protocol is using heavily transactions, getting the transaction
ID in SMB events can be really useful for automated analysis.

3 months agowebsocket: use max window bits of 15
Philippe Antoine [Thu, 3 Apr 2025 08:49:38 +0000 (10:49 +0200)] 
websocket: use max window bits of 15

Ticket: 7285

As this is the default for websocket, which is bigger than the
defaut for zlib usage

Also limit the decompressed content to the max-payload-size
configuration parameter also used for non-compressed content.

And also use a stateful decoder to store/remember the compression
state to be able to decompress later messages.

3 months agorust: use flate2 with C zlib
Philippe Antoine [Thu, 3 Apr 2025 08:47:48 +0000 (10:47 +0200)] 
rust: use flate2 with C zlib

move flate2.rs to a backend supporting the setting
of window_bits, which is not the case for miniz-oxide.

This will allow WebSocket to use Sec-WebSocket-Extensions
which can set a non-default window_bits

3 months agowebsocket: decompress single pdu message
Philippe Antoine [Thu, 27 Mar 2025 21:33:30 +0000 (22:33 +0100)] 
websocket: decompress single pdu message

Ticket: 7285

Previously, only messages over multiple PDUs could get decompressed

3 months agooutput/rotate: Remove extra rotation flag register 13035/head
Jeff Lucovsky [Mon, 14 Apr 2025 20:07:24 +0000 (16:07 -0400)] 
output/rotate: Remove extra rotation flag register

Issue: 3436

Remove duplicate register of the rotation flag. Eventually, this will
cause corruption when the file context has been freed and the rotation
flag is deregistered.

3 months agooutput/rotate: Serialize rotation flag handling
Jeff Lucovsky [Mon, 14 Apr 2025 20:06:08 +0000 (16:06 -0400)] 
output/rotate: Serialize rotation flag handling

Issue: 3436

Serialize rotation flag handling to avoid corruption.

3 months agodetect: add email.received keyword
Alice Akaki [Wed, 9 Apr 2025 21:43:42 +0000 (17:43 -0400)] 
detect: add email.received keyword

email.received matches on MIME EMAIL Received
This keyword maps to the EVE field email.received[]
It is a sticky buffer
Supports multiple buffer matching
Supports prefiltering

Ticket: #7599

3 months agodoc: Update bypass docs to use new keyword format
James [Sun, 7 Jul 2024 17:43:02 +0000 (18:43 +0100)] 
doc: Update bypass docs to use new keyword format

Ticket: #7143

Update documentation to reflect new sticky buffer keyword format

3 months agodetect/app-layer-protocol: allow matching on 'unknown'
Victor Julien [Fri, 11 Apr 2025 14:59:05 +0000 (16:59 +0200)] 
detect/app-layer-protocol: allow matching on 'unknown'

3 months agofirewall: detect: set firewall support flag on select keywords
Victor Julien [Fri, 11 Apr 2025 08:22:20 +0000 (10:22 +0200)] 
firewall: detect: set firewall support flag on select keywords

3 months agofirewall: detect: add feature flag for keywords supporting firewall
Victor Julien [Fri, 11 Apr 2025 08:21:54 +0000 (10:21 +0200)] 
firewall: detect: add feature flag for keywords supporting firewall

3 months agofirewall: detect: set per rule table
Victor Julien [Fri, 11 Apr 2025 04:43:48 +0000 (06:43 +0200)] 
firewall: detect: set per rule table

For firewall mode, set the pseudo table in the rule and use this
in alert queue ordering, so that rule actions are applied in the
expected order:

        packet:filter -> packet:td -> app:filter -> app:td

This makes sure that a packet:td drop is applied before a app:filter
accept.

3 months agodetect: don't set conflicting packet/flow actions
Victor Julien [Fri, 11 Apr 2025 04:45:40 +0000 (06:45 +0200)] 
detect: don't set conflicting packet/flow actions

If for the same a packet a drop rule and a pass rule would match,
the applying of actions could be contradictionary:

- the drop would be applied to the packet
- the pass rule would also be considered, not overriding the drop,
  but still setting the flow pass flag.

This would lead to the packet being dropped, but the rest of the
flow getting passed, including retransmissions of the dropped
packet.

This patch only sets drop/pass actions if no conflicting action
has been set on the packet before. It respects the action-order.

Bug: #7653.

3 months agofirewall: detect: add explanation
Victor Julien [Fri, 11 Apr 2025 04:44:58 +0000 (06:44 +0200)] 
firewall: detect: add explanation

3 months agodetect/alert: minor cleanup
Victor Julien [Thu, 10 Apr 2025 08:16:51 +0000 (10:16 +0200)] 
detect/alert: minor cleanup

3 months agodetect: add email.url keyword 13016/head
Alice Akaki [Wed, 9 Apr 2025 19:10:43 +0000 (15:10 -0400)] 
detect: add email.url keyword

email.url matches on URLs extracted from an email
This keyword maps to the EVE field email.url[]
Supports multiple buffer matching
Supports prefiltering

Ticket: #7597

3 months agorust/htp: remove authors; fix homepage
Jason Ish [Wed, 9 Apr 2025 20:33:17 +0000 (14:33 -0600)] 
rust/htp: remove authors; fix homepage

Remove the authors field as it is deprecated.

Update the repository page to the Suricata repository.

Remove the homepage, it can be found via the reposistory page.

3 months agohtp: rename to suricata-htp; allow publishing to crates.io
Jason Ish [Wed, 9 Apr 2025 15:57:48 +0000 (09:57 -0600)] 
htp: rename to suricata-htp; allow publishing to crates.io

As the "suricata" crate depends on htp, we need to publish htp to
crates.io first, however "htp" name is already taken. So rename "htp" to
"suricata-htp".

3 months agosuricatactl: add description to Cargo.toml
Jason Ish [Wed, 9 Apr 2025 15:55:30 +0000 (09:55 -0600)] 
suricatactl: add description to Cargo.toml

For publishing to crates.io.

3 months agorust: always update Cargo.lock.in
Jason Ish [Thu, 10 Apr 2025 15:12:35 +0000 (09:12 -0600)] 
rust: always update Cargo.lock.in

On a normal project where the Cargo.lock is checked in, it would be
normal to see an updated Cargo.lock in git status and the like. As we
use autoconf to generate this file, we should just copy it back to the
input file so we get the same convenience of seeing when it is
updated, which usually means it needs to be checked in.

However, to satisfy "make distcheck", only copy it if the input
template exists, if the input template does not exist we are in an out
of tree build.

3 months agoworkflows: use aggressive-cleanup option w s-v
Shivani Bhardwaj [Thu, 10 Apr 2025 13:29:36 +0000 (18:59 +0530)] 
workflows: use aggressive-cleanup option w s-v

on the Fedora 41 + codecov job to avoid running out of disk space.

3 months agoconfigure: pickup pre-release versions from changelog
Jason Ish [Wed, 9 Apr 2025 15:15:38 +0000 (09:15 -0600)] 
configure: pickup pre-release versions from changelog

Pickup release versions like 8.0.0-beta1 and 8.0.0-rc1 from the
ChangeLog. This version is used in the generated documentation.

3 months agogithub-actions: f41 codecov improvements 12993/head 13003/head
Victor Julien [Tue, 8 Apr 2025 04:34:22 +0000 (06:34 +0200)] 
github-actions: f41 codecov improvements

Add missing gpg package.

Reduce disk space usage.

3 months agodetect/domain: move transform fully to rust
Victor Julien [Tue, 8 Apr 2025 18:19:36 +0000 (20:19 +0200)] 
detect/domain: move transform fully to rust

3 months agodetect/prefilter: fix coverity issue
Victor Julien [Tue, 8 Apr 2025 18:05:22 +0000 (20:05 +0200)] 
detect/prefilter: fix coverity issue

** CID 1646448:  Null pointer dereferences  (NULL_RETURNS)
/src/detect-engine-prefilter.c: 944 in SetupNonPrefilter()

________________________________________________________________________________________________________
*** CID 1646448:  Null pointer dereferences  (NULL_RETURNS)
/src/detect-engine-prefilter.c: 944 in SetupNonPrefilter()
938                 const DetectBufferType *buf = DetectEngineBufferTypeGetById(de_ctx, list_id);
939                 /* for now, exclude app-layer-events, as they are not tied to a specific
940                  * progress value like other keywords. */
941                 SCLogDebug("list_id %d buf %p", list_id, buf);
942                 if (list_id == app_events_list_id)
943                     continue;
>>>     CID 1646448:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "buf", which is known to be "NULL".
944                 if (buf->packet) {
945                     SCLogDebug("packet buf");
946                     /* packet is handled below */
947                     pkt_non_pf = true;
948                 } else if (buf->frame) {
949                     for (DetectEngineFrameInspectionEngine *f = de_ctx->frame_inspect_engines;

3 months agolog-pcap: error out if malloc fails for bpf filter
Jason Ish [Tue, 8 Apr 2025 21:29:03 +0000 (15:29 -0600)] 
log-pcap: error out if malloc fails for bpf filter

3 months agodoc/userguide: type in pfring upgrade notes
Jason Ish [Tue, 8 Apr 2025 14:33:52 +0000 (08:33 -0600)] 
doc/userguide: type in pfring upgrade notes

3 months agoversion: start development towards 8.0.0-rc1
Jason Ish [Tue, 8 Apr 2025 21:21:13 +0000 (15:21 -0600)] 
version: start development towards 8.0.0-rc1