]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 weeks agosmtp: trigger raw stream inspection
Shivani Bhardwaj [Fri, 6 Jun 2025 09:36:11 +0000 (15:06 +0530)] 
smtp: trigger raw stream inspection

Internals
---------
Suricata's stream engine returns data for inspection to the detection
engine from the stream when the chunk size is reached.

Bug
---
Inspection triggered only in the specified chunk sizes may be too late
when it comes to inspection of smaller protocol specific data which
could result in delayed inspection, incorrect data logged with a transaction
and logs misindicating the pkt that triggered an alert.

Fix
---
Fix this by making an explicit call from all respective applayer parsers to
trigger raw stream inspection which shall make the data available for inspection
in the following call of the stream engine. This needs to happen per direction
on the completion of an entity like a request or a response.

Important notes
---------------
1. The above mentioned behavior with and without this patch is
affected internally by the following conditions.
- inspection depth
- stream depth
In these special cases, the inspection window will be affected and
Suricata may not consider all the data that could be expected to be
inspected.
2. This only applies to applayer protocols running over TCP.
3. The inspection window is only considered up to the ACK'd data.
4. This entire issue is about IDS mode only.

SMTP parser can handle multiple command lines per direction, however an
SMTP transaction comprises of the full communication starting from HELO
till there's a RST or QUIT request. Appropriate calls to trigger raw stream
inspection have been added on succesful parsing of each full request and response.

Task 7026
Bug 7004

5 weeks agosip: fix inspection direction
Shivani Bhardwaj [Tue, 27 May 2025 07:32:03 +0000 (13:02 +0530)] 
sip: fix inspection direction

5 weeks agodnp3: trigger raw stream inspection
Shivani Bhardwaj [Fri, 23 May 2025 05:31:45 +0000 (11:01 +0530)] 
dnp3: trigger raw stream inspection

Internals
---------
Suricata's stream engine returns data for inspection to the detection
engine from the stream when the chunk size is reached.

Bug
---
Inspection triggered only in the specified chunk sizes may be too late
when it comes to inspection of smaller protocol specific data which
could result in delayed inspection, incorrect data logged with a transaction
and logs misindicating the pkt that triggered an alert.

Fix
---
Fix this by making an explicit call from all respective applayer parsers to
trigger raw stream inspection which shall make the data available for inspection
in the following call of the stream engine. This needs to happen per direction
on the completion of an entity like a request or a response.

Important notes
---------------
1. The above mentioned behavior with and without this patch is
affected internally by the following conditions.
- inspection depth
- stream depth
In these special cases, the inspection window will be affected and
Suricata may not consider all the data that could be expected to be
inspected.
2. This only applies to applayer protocols running over TCP.
3. The inspection window is only considered up to the ACK'd data.
4. This entire issue is about IDS mode only.

DNP3 parser creates a transaction per direction. Appropriate calls to trigger
raw stream inspection have been added on succesful parsing of each request and
response.

Task 7026
Bug 7004

5 weeks agothreading: add unittests for cpu affinity YAML parsing
Lukas Sismis [Sat, 24 May 2025 10:25:23 +0000 (12:25 +0200)] 
threading: add unittests for cpu affinity YAML parsing

5 weeks agoaffinity: error out on defining CPUs outside valid range
Lukas Sismis [Fri, 6 Jun 2025 06:12:49 +0000 (08:12 +0200)] 
affinity: error out on defining CPUs outside valid range

5 weeks agothreading: let cpu set building callback return a value
Lukas Sismis [Sat, 24 May 2025 10:16:50 +0000 (12:16 +0200)] 
threading: let cpu set building callback return a value

5 weeks agothreading: support thread autopinning and interface-specific affinity
Lukas Sismis [Fri, 3 Jan 2025 15:08:36 +0000 (16:08 +0100)] 
threading: support thread autopinning and interface-specific affinity

Using the new configuration format, it is now possible to set CPU affinity
settings per interface.

The threading.autopin option has been added to automatically use CPUs from the
same NUMA node as the interface. The autopin option requires
hwloc-devel / hwloc-dev to be installed and --enable-hwloc flag in configure
script.

Ticket: 7036

5 weeks agodoc: remove title in threading section with no content
Lukas Sismis [Fri, 3 Jan 2025 12:09:49 +0000 (13:09 +0100)] 
doc: remove title in threading section with no content

5 weeks agothreading: support previous threading configuration format
Lukas Sismis [Fri, 3 Jan 2025 12:08:49 +0000 (13:08 +0100)] 
threading: support previous threading configuration format

Provide backward compatibility with the previous configuration
format to allow smooth transition to the new format.
The commit adds docs about the new format and the introduced changes.

5 weeks agothreading: transform *-cpu-set nodes from list items to nodes
Lukas Sismis [Fri, 6 Dec 2024 12:47:43 +0000 (13:47 +0100)] 
threading: transform *-cpu-set nodes from list items to nodes

Part of Ticket 2321 work to remove unnecessary lists from
the config file.

Ticket: 2321

5 weeks agoutil-affinity: move properties of *-cpu-set node one layer up in YAML
Lukas Sismis [Fri, 6 Dec 2024 12:42:21 +0000 (13:42 +0100)] 
util-affinity: move properties of *-cpu-set node one layer up in YAML

5 weeks agothreading: refactor CPU affinity code
Lukas Sismis [Thu, 2 Jan 2025 17:35:52 +0000 (18:35 +0100)] 
threading: refactor CPU affinity code

Split the code into multiple functions for easier readability.

5 weeks agoactions: test hwloc build
Lukas Sismis [Thu, 19 Dec 2024 20:52:20 +0000 (21:52 +0100)] 
actions: test hwloc build

5 weeks agogithub-ci: install hwloc as a mandatory dependency
Lukas Sismis [Tue, 3 Sep 2024 11:23:44 +0000 (13:23 +0200)] 
github-ci: install hwloc as a mandatory dependency

5 weeks agodpdk: move DPDK socket retrieval to utils
Lukas Sismis [Fri, 6 Dec 2024 12:31:13 +0000 (13:31 +0100)] 
dpdk: move DPDK socket retrieval to utils

5 weeks agorunmodes: query the active runmode with a function call
Lukas Sismis [Sun, 8 Dec 2024 14:26:27 +0000 (15:26 +0100)] 
runmodes: query the active runmode with a function call

5 weeks agorust: fix compiler warning for confusing lifetimes 13396/head
Jason Ish [Fri, 6 Jun 2025 15:05:12 +0000 (09:05 -0600)] 
rust: fix compiler warning for confusing lifetimes

For example:

error: lifetime flowing from input to output with different syntax can be confusing
   --> htp/src/headers.rs:475:16
    |
475 | fn null(input: &[u8]) -> IResult<&[u8], ParsedBytes> {
    |                ^^^^^             -----  ----------- the lifetimes get resolved as `'_`
    |                |                 |
    |                |                 the lifetimes get resolved as `'_`
    |                this lifetime flows to the output
    |
note: the lint level is defined here
   --> htp/src/lib.rs:3:9

This currently only happens when using the Rust nightly compiler, which
we use for our fuzz builds.

5 weeks agohs-cache: adjust printing directive to match uint64_t
Lukas Sismis [Fri, 6 Jun 2025 09:22:40 +0000 (11:22 +0200)] 
hs-cache: adjust printing directive to match uint64_t

5 weeks agolua: update to Lua 5.4.8
Jason Ish [Thu, 5 Jun 2025 20:29:22 +0000 (14:29 -0600)] 
lua: update to Lua 5.4.8

Also uses a proper Lua tagged version that is not a pre-release.

Ticket: #7632

5 weeks agorust: update deps
Jason Ish [Thu, 5 Jun 2025 17:47:04 +0000 (11:47 -0600)] 
rust: update deps

Update all deps with cargo update. Additionally, apply the updated
versions to the Cargo.toml, which while not stricly required, does
make it more clear what the version in use is.

5 weeks agorust: fix new clippy issues with MSRV update
Jason Ish [Thu, 5 Jun 2025 17:30:28 +0000 (11:30 -0600)] 
rust: fix new clippy issues with MSRV update

5 weeks agorust: update clap and rustyline
Jason Ish [Thu, 5 Jun 2025 17:23:42 +0000 (11:23 -0600)] 
rust: update clap and rustyline

With a MSRV of 1.75.0 we can now use current Clap. Rustlyline is
updated, but still needs to be held back from the most current
release.

5 weeks agorust: unpin once_cell from old version
Jason Ish [Thu, 5 Jun 2025 17:04:23 +0000 (11:04 -0600)] 
rust: unpin once_cell from old version

We can now update to the current version of once_cell with Rust 1.75.

5 weeks agorust: set MSRV to 1.75.0
Jason Ish [Thu, 5 Jun 2025 16:59:20 +0000 (10:59 -0600)] 
rust: set MSRV to 1.75.0

This is the Rust version found on Ubuntu LTS releases as of today, and
is the oldest we need to support.

Ticket: #6573

5 weeks agodoc/entropy: Document the entropy log output
Jeff Lucovsky [Wed, 4 Jun 2025 13:33:37 +0000 (09:33 -0400)] 
doc/entropy: Document the entropy log output

5 weeks agodetect/entropy: Add calculated entropy value to flowvars
Jeff Lucovsky [Sat, 31 May 2025 14:18:32 +0000 (10:18 -0400)] 
detect/entropy: Add calculated entropy value to flowvars

When the entropy keyword is used, record the calculated entropy value to
a flow variable for logging use.

5 weeks agodoc: Add missing contributors to ack file 13383/head
Jeff Lucovsky [Fri, 30 May 2025 18:59:42 +0000 (14:59 -0400)] 
doc: Add missing contributors to ack file

Add missing contributors as identified by
    git shortlog -s -n --no-merges -- .

5 weeks agodoc/lua: document request_host lua lib
Juliana Fajardini [Thu, 5 Jun 2025 13:55:05 +0000 (10:55 -0300)] 
doc/lua: document request_host lua lib

Seems that we missed bringing this one, when documenting HTTP lua lib
functions.

5 weeks agopop3: install rules
Philippe Antoine [Thu, 5 Jun 2025 11:58:24 +0000 (13:58 +0200)] 
pop3: install rules

5 weeks agopop3: fix event rule
Philippe Antoine [Thu, 5 Jun 2025 11:55:49 +0000 (13:55 +0200)] 
pop3: fix event rule

5 weeks agorust: remove some unneeded cbindgen:ignore
Philippe Antoine [Thu, 5 Jun 2025 09:22:12 +0000 (11:22 +0200)] 
rust: remove some unneeded cbindgen:ignore

Ticket: 7667

5 weeks agorust: bindgen app-layer-detect-proto.h
Philippe Antoine [Thu, 5 Jun 2025 08:29:34 +0000 (10:29 +0200)] 
rust: bindgen app-layer-detect-proto.h

Ticket: 7667

5 weeks agodetect/content: account for distance variables
Jeff Lucovsky [Tue, 17 Dec 2024 12:56:42 +0000 (07:56 -0500)] 
detect/content: account for distance variables

Under some cases (below), the depth and offset values are used
twice. This commit disregards the distance variable (if any), when
computing the final depth.

These rules are logically equivalent::
1. alert tcp any any -> any 8080 (msg:"distance name"; flow:to_server; content:"Authorization:"; content:"5f71ycy"; distance:0; byte_extract:1,0,option_len,string,relative; content:!"|38|"; distance:option_len; within:1; content:"|37|"; distance:-1; within:1; content:"|49|"; distance:option_len; within:1; sid:1;)
2. alert tcp any any -> any 8080 (msg:"distance number"; flow:to_server; content:"Authorization:"; content:"5f71ycy"; distance:0; byte_extract:1,0,option_len,string,relative; content:!"|38|"; distance:7; within:1; content:"|37|"; distance:-1; within:1; content:"|49|"; distance:option_len; within:1; sid:2;)

The differences:
Rule 1: content:!"|38|"; distance:option_len; within:1; //option_len == 7

Rule 2: content:!"|38|"; distance:7; within:1;

Without this commit, rule 2 triggers an alert but rule 1 doesn't.

Issue: 7390

5 weeks agoflow: convert flow_id to uint64 as no signdess is necessary
Lukas Sismis [Sat, 24 May 2025 00:04:21 +0000 (02:04 +0200)] 
flow: convert flow_id to uint64 as no signdess is necessary

5 weeks agodpdk: change thread_id field to uint16_t
Lukas Sismis [Sat, 26 Apr 2025 13:01:36 +0000 (15:01 +0200)] 
dpdk: change thread_id field to uint16_t

5 weeks agodpdk: update types to avoid type-warnings
Lukas Sismis [Sat, 26 Apr 2025 13:00:58 +0000 (15:00 +0200)] 
dpdk: update types to avoid type-warnings

5 weeks agodetect-engine: remove redundant configuration check
Lukas Sismis [Fri, 25 Apr 2025 12:34:58 +0000 (14:34 +0200)] 
detect-engine: remove redundant configuration check

5 weeks agodetect-engine: check return value of SCGetConf
Lukas Sismis [Fri, 25 Apr 2025 12:33:00 +0000 (14:33 +0200)] 
detect-engine: check return value of SCGetConf

Ticket: 7634
coverity id: 1645571

5 weeks agodecode/ipv4: add missing ip-in-ip case handling 13370/head
Juliana Fajardini [Wed, 4 Jun 2025 17:56:25 +0000 (14:56 -0300)] 
decode/ipv4: add missing ip-in-ip case handling

A flow with IPv4 IP in IP traffic won't handle this tunneling case
properly.
This leads to potential malicious traffic not triggering alerts, as well
as other inaccuracies in the logs.

Bug #7725

5 weeks agodecode/ipv4: apply-clang formatting changes
Juliana Fajardini [Wed, 4 Jun 2025 19:33:22 +0000 (16:33 -0300)] 
decode/ipv4: apply-clang formatting changes

5 weeks agodoc/lua: remove reference to removed functions
Jason Ish [Wed, 4 Jun 2025 17:32:11 +0000 (11:32 -0600)] 
doc/lua: remove reference to removed functions

These have all been replaced by libs and already documented in their
lib format.

Ticket: #7728

5 weeks agolua/output: access luastate within lock
Jason Ish [Wed, 4 Jun 2025 17:26:52 +0000 (11:26 -0600)] 
lua/output: access luastate within lock

Fixes Coverity issue:

CID 1648445: (#1 of 1): Data race condition (MISSING_LOCK)
4. missing_lock: Accessing td->lua_ctx->luastate without holding lock
LogLuaCtx_.m. Elsewhere, LogLuaCtx_.luastate is written to with
LogLuaCtx_.m held 41 out of 41 times.

5 weeks agopgsql: fix clippy warnings 13366/head
Juliana Fajardini [Thu, 22 May 2025 13:48:15 +0000 (10:48 -0300)] 
pgsql: fix clippy warnings

5 weeks agopgsql: fix typo in comment that changed meaning
Juliana Fajardini [Tue, 20 May 2025 21:13:18 +0000 (18:13 -0300)] 
pgsql: fix typo in comment that changed meaning

5 weeks agopgsql: debug validation on duplicated request msgs
Juliana Fajardini [Tue, 20 May 2025 15:59:10 +0000 (12:59 -0300)] 
pgsql: debug validation on duplicated request msgs

There shouldn't be duplicated messages in the requests Vec. And thus
the parser shouldn't log duplicated keys nor messages. Add debug
validations to ensure this.

With PGSQL's current state machine, most frontend/ client messages will
lead to the creation of a new transaction - which would prevent
duplicated messages being pushed to the requests array and reaching the
logger.

The current exceptions for that are:

- CopyDataIn
- CopyDone
- CopyFail

Thus, debug statements were added for those cases.

CopyDone and CopyFail, per the documentation, shouldn't be seen
duplicated on the wire for the same transaction. CopyDataIn -- yes, but
we consolidate those, so the expectation is that they won't be
duplicated in the requests array or when reaching the logger either.

Related to
Task #7645

5 weeks agopgsql: separate request completion and state type
Juliana Fajardini [Tue, 20 May 2025 18:56:03 +0000 (15:56 -0300)] 
pgsql: separate request completion and state type

Since some of state types could indicate a request completion, don't
process them in if/else statements.

Related to
Task #7645

5 weeks agopgsql: be more strict with pub usage
Juliana Fajardini [Thu, 22 May 2025 13:28:01 +0000 (10:28 -0300)] 
pgsql: be more strict with pub usage

Review pub visibility to:
Make it pub crate-only wherever possible.
Remove pub altogether where not-needed.

5 weeks agopgsql: reorganize pgsql states for CopyData msgs
Juliana Fajardini [Fri, 16 May 2025 16:17:23 +0000 (13:17 -0300)] 
pgsql: reorganize pgsql states for CopyData msgs

To set apart states that are both for frontend and backend.

5 weeks agopgsql: rename copy in/out response field
Juliana Fajardini [Tue, 13 May 2025 16:33:31 +0000 (13:33 -0300)] 
pgsql: rename copy in/out response field

We used `copy_column_count`, while just `columns` is more accurate with
what PostgreSQL describes, and what Wireshark shows.

Related to
Task #7644
Task #7645

5 weeks agopgsql: rename 'dummy' response variables
Juliana Fajardini [Sat, 10 May 2025 19:35:08 +0000 (16:35 -0300)] 
pgsql: rename 'dummy' response variables

While this could be considered minor, they were not just bad, but
misleading names, as the variables weren't really `dummy` responses,
but consolidating several messages.

5 weeks agopgsql: add initial support to CopyIn mode/subproto
Juliana Fajardini [Tue, 29 Apr 2025 13:33:38 +0000 (10:33 -0300)] 
pgsql: add initial support to CopyIn mode/subproto

This sub-protocol inspects messages sent mainly from the frontend to
the backend after a 'COPY FROM STDIN' has been processed by the
backend.

Parses new messages:
- CopyInResponse -- initiates copy-in mode/sub-protocol
- CopyData (In) -- data transfer message, from frontend to backend
- CopyDone -- signals that no more CopyData messages will be seen from
  the frontend, for the current transaction
- CopyFail -- used by the frontend to signal some failure to proceed
  with sending CopyData messages

Task #7645

5 weeks agoschema/psgql: fix fields order
Juliana Fajardini [Thu, 22 May 2025 16:35:02 +0000 (13:35 -0300)] 
schema/psgql: fix fields order

5 weeks agopgsql: document CopyOut messages
Juliana Fajardini [Thu, 1 May 2025 17:20:41 +0000 (14:20 -0300)] 
pgsql: document CopyOut messages

Related to
Task #7644

5 weeks agopgsql: allow multi-request transactions
Juliana Fajardini [Thu, 1 May 2025 00:48:07 +0000 (21:48 -0300)] 
pgsql: allow multi-request transactions

Important for CopyIn mode/ subprotocol, where the frontend is the one
sending 0 or more messages to the backend as part of a transaction.

Related to
Task #7645

5 weeks agopgsql: make CopyData struct generic
Juliana Fajardini [Tue, 29 Apr 2025 13:31:52 +0000 (10:31 -0300)] 
pgsql: make CopyData struct generic

We have a data structure that can be used both for backend and frontend
messages, but was named as backend only.

Related to
Task #7645

5 weeks agotransforms: move base64 to rust 13361/head
Philippe Antoine [Tue, 3 Jun 2025 11:32:47 +0000 (13:32 +0200)] 
transforms: move base64 to rust

Ticket: 7733

5 weeks agodetect: remove unused transform ids
Philippe Antoine [Tue, 3 Jun 2025 11:32:18 +0000 (13:32 +0200)] 
detect: remove unused transform ids

As they are now dynamic from rust

5 weeks agobase64: use more precise and compact type for mode
Philippe Antoine [Tue, 3 Jun 2025 08:11:02 +0000 (10:11 +0200)] 
base64: use more precise and compact type for mode

5 weeks agotransform: move rust base64 to dedicated subdirectory
Philippe Antoine [Tue, 3 Jun 2025 07:47:01 +0000 (09:47 +0200)] 
transform: move rust base64 to dedicated subdirectory

5 weeks agorust: update brotli crate to latest version
Philippe Antoine [Tue, 3 Jun 2025 18:33:52 +0000 (20:33 +0200)] 
rust: update brotli crate to latest version

Ticket: 7735

New version has a fix for an integer underflow

5 weeks agolua/util: move SCThreadInfo into suricata.util lib
Jason Ish [Mon, 2 Jun 2025 23:23:08 +0000 (17:23 -0600)] 
lua/util: move SCThreadInfo into suricata.util lib

Move the SCThreadInfo global function into the suricata.util library as
thread_info().

This is the last global function to be registered, so remove the
supporting functions.

5 weeks agolua: simplify streaming output setup
Jason Ish [Mon, 2 Jun 2025 22:54:16 +0000 (16:54 -0600)] 
lua: simplify streaming output setup

Setup the init function to simply return:

   {streaming = "tcp"}

or

   {streaming = "http"}

The returned table can have a lot of parameters that don't make sense
together, this should simplify this one case.

5 weeks agolua/streaming: provide streaming buffer as argument
Jason Ish [Mon, 2 Jun 2025 21:47:03 +0000 (15:47 -0600)] 
lua/streaming: provide streaming buffer as argument

When setting up a Lua output script for streaming data, we're
explicitly requesting stream data. Just pass the streaming data as
arguments, rather than requiring the script to make an extra call to
get the stream data.

The streaming data will be passed in the "stream" field of the args
passed to the log function.

Eliminates the SCStreamingBuffer Lua function.

5 weeks agolua/bytevar: convert SCByteVar to Lua lib
Jason Ish [Mon, 2 Jun 2025 20:37:57 +0000 (14:37 -0600)] 
lua/bytevar: convert SCByteVar to Lua lib

Similar to flowvars and flowints, but a byte var cannot be registered
from a Lua script, but it still needs to be setup. Instead provide an
"map" function that sets it up, or errors out if the byte var is
unknown.

This also required passing the signature into the Lua init method, as
the state of the Signature object and the time of loading the Lua
keyword is required.

5 weeks agolua/logging: re-add lua script and line numbers
Jason Ish [Mon, 2 Jun 2025 16:04:19 +0000 (10:04 -0600)] 
lua/logging: re-add lua script and line numbers

Note that while we try to log the Lua function name, its never
logged. Instead "Lua" is logged as the function name.

5 weeks agoutil/debug: expose more raw logging macros
Jason Ish [Mon, 2 Jun 2025 16:03:27 +0000 (10:03 -0600)] 
util/debug: expose more raw logging macros

Add raw logging macros for config, perf and debug.

5 weeks agolua: fix coverity unchecked return
Jason Ish [Mon, 2 Jun 2025 15:07:20 +0000 (09:07 -0600)] 
lua: fix coverity unchecked return

CID 1648351: (#1 of 1): Unchecked return value (CHECKED_RETURN)
1. check_return: Calling lua_getstack without checking return value (as is done elsewhere 9 out of 10 times).

5 weeks agolua: create suricata.config lua lib
Jason Ish [Fri, 30 May 2025 22:54:29 +0000 (16:54 -0600)] 
lua: create suricata.config lua lib

Currently only provides "log_path" as a replacement for SCLogPath.

5 weeks agohttp1: use a blocking cursor for decompression
Philippe Antoine [Tue, 3 Jun 2025 07:11:35 +0000 (09:11 +0200)] 
http1: use a blocking cursor for decompression

Kind of as is done by HTTP2 which limits input data instead of
output data

Ticket: 7732

5 weeks agoci: check cargo fmt for htp
Philippe Antoine [Tue, 3 Jun 2025 07:11:24 +0000 (09:11 +0200)] 
ci: check cargo fmt for htp

5 weeks agodcerpc: use wrapping to prevent u16 overflow
Philippe Antoine [Mon, 2 Jun 2025 20:31:19 +0000 (22:31 +0200)] 
dcerpc: use wrapping to prevent u16 overflow

Otherwise, rust with debug assertion may trigger a panic

5 weeks agogithub-actions: bump github/codeql-action from 3.28.16 to 3.28.18
dependabot[bot] [Sun, 1 Jun 2025 20:06:51 +0000 (20:06 +0000)] 
github-actions: bump github/codeql-action from 3.28.16 to 3.28.18

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.16 to 3.28.18.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.16...v3.28.18)

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

Signed-off-by: dependabot[bot] <support@github.com>
5 weeks agogithub-actions: bump ossf/scorecard-action from 2.4.1 to 2.4.2
dependabot[bot] [Sun, 1 Jun 2025 20:06:36 +0000 (20:06 +0000)] 
github-actions: bump ossf/scorecard-action from 2.4.1 to 2.4.2

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/f49aabe0b5af0936a0987cfb85d86b75731b0186...05b42c624433fc40578a4040d5cf5e36ddca8cde)

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

Signed-off-by: dependabot[bot] <support@github.com>
5 weeks agogithub-actions: bump codecov/codecov-action from 5.4.2 to 5.4.3
dependabot[bot] [Sun, 1 Jun 2025 20:06:32 +0000 (20:06 +0000)] 
github-actions: bump codecov/codecov-action from 5.4.2 to 5.4.3

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/ad3126e916f78f00edff4ed0317cf185271ccc2d...18283e04ce6e62d37312384ff67231eb8fd56d24)

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

Signed-off-by: dependabot[bot] <support@github.com>
5 weeks agodoc/payload: fix typo, minor formatting changes 13356/head
Juliana Fajardini [Mon, 2 Jun 2025 14:30:41 +0000 (11:30 -0300)] 
doc/payload: fix typo, minor formatting changes

5 weeks agodocs/exceptions: minor improvements
Juliana Fajardini [Tue, 27 May 2025 21:13:54 +0000 (18:13 -0300)] 
docs/exceptions: minor improvements

Add section label and doc reference, add another term to Common terms
section.

Tried to also improve readability for the Midstream behavior tables:
- Highlight key-words when differences are only in `do` vs `no`.
- Change order of sentences in certain descriptions, to align with the
  steps those happen for the engine.

5 weeks agodoc/exceptions: clarify ambiguous terminology
Juliana Fajardini [Tue, 6 May 2025 17:52:19 +0000 (14:52 -0300)] 
doc/exceptions: clarify ambiguous terminology

The terms 'inspection' and 'detection' were being used to signify
different engine actions in this document, while throughout the
documentation and code they're many times interchangeable.

Replace 'inspection' with 'parsing' or even 'decoding and parsing' as
more appropriate.

Add a small glossary to clarify what we mean with those terms.

5 weeks agodoc/exceptions: standardize page section markdown
Juliana Fajardini [Tue, 6 May 2025 17:07:40 +0000 (14:07 -0300)] 
doc/exceptions: standardize page section markdown

Following the discussion on #7396, use those symbols for to keep the
standard.
Remove the repeting `Exception Policies` section header, too.

Related to
Task #7396

5 weeks agodoc/rule-types: fix typo
Juliana Fajardini [Tue, 27 May 2025 20:43:28 +0000 (17:43 -0300)] 
doc/rule-types: fix typo

5 weeks agotransform: fix identity function for base64 xfrom
Philippe Antoine [Sun, 18 May 2025 20:37:31 +0000 (22:37 +0200)] 
transform: fix identity function for base64 xfrom

As SCDetectTransformFromBase64Data is not a flat structure,
because it has pointers to other buffers, we cannot use it simply
for TransformId

We need to compute a serialization of the data hold by
SCDetectTransformFromBase64Data and own it.

6 weeks agolua: convert log functions to suricata.log lib 13339/head
Jason Ish [Fri, 30 May 2025 17:02:44 +0000 (11:02 -0600)] 
lua: convert log functions to suricata.log lib

Convert the Lua global functions for logging (SCLogInfo, etc) to a Lua
lib names "suricata.log".

Ticket: #7727

6 weeks agodetect/analyzer: use note instead of warning
Shivani Bhardwaj [Thu, 29 May 2025 09:04:57 +0000 (14:34 +0530)] 
detect/analyzer: use note instead of warning

It is invalid to issue a warning based purely on pattern matching
between the matched content and certain http methods. Without a check
for which keyword exists in the rule, it makes more sense to issue this
as a general note.

Bug 5177

6 weeks agoutil/flow-rate: fix sum calc on index next to base
Shivani Bhardwaj [Thu, 10 Apr 2025 06:36:05 +0000 (12:06 +0530)] 
util/flow-rate: fix sum calc on index next to base

When the buffer is wrapped around, for any new index, the calculation
must subtract the previous value stored in the buffer. So far, the code
ended up adding to the existing buffer value on the index unless it was
the first index after wrapping around. This is incorrect and would end
up flagging a flow as elephant a lot before than it should be.

Harden the Test06 by checking for such a case.

Bug 7694

6 weeks agomdns: add mdns parser, logger and detection 13334/head
Jason Ish [Wed, 28 May 2025 18:43:05 +0000 (12:43 -0600)] 
mdns: add mdns parser, logger and detection

The mDNS support is based heavily on the DNS support, reusing the
existing DNS parser where possible. This meant adding variations on
DNS, as mDNS is a little different. Mainly being that *all* mDNS
traffic is to_server, yet there is still the concept of request and
responses.

Keywords added are:
- mdns.queries.rrname
- mdns.answers.rrname
- mdns.additionals.rrname
- mdns.authorities.rrname
- mdns.response.rrname

They are mostly in-line with the DNS keywords, except
mdns.answers.rdata which is a better than that mdns.response.rrname,
as its actually looking at the rdata, and not rrnames.

mDNS has its own logger that differs from the DNS logger:

- No grouped logging

- In answers/additionals/authorities, the rdata is logged in a field
  that is named after the rdata type. For example, "txt" data is no
  longer logged in the "rdata" field, but instead a "txt" field. We
  currently already did this in DNS for fields that were not a single
  buffer, like SOA, SRV, etc. So this makes things more consistent. And
  gives query like semantics that the "grouped" object was trying to
  provide.

- Types are logged in lower case ("txt" instead of "TXT")

- Flags are logged as an array: "flags": ["aa", "z"]

Ticket: #3952

6 weeks agodns: parse multiple txt segments into an array
Jason Ish [Tue, 27 May 2025 17:27:23 +0000 (11:27 -0600)] 
dns: parse multiple txt segments into an array

A DNS TXT answer record can actually be made of up multiple TXT
entries in a single record. Suricata currently expands these into
multiple TXT records, however that is not very representative of the
actualy DNS message.

Instead, if a TXT record contains multiple labels, parse them into an
array.

We still expand multiple TXT segements into multiple TXT records at
logging time for compatibility, but this will allow something like
MDNS to log more accurately to the protocol.

6 weeks agopgsql: add query keyword 13331/head
Juliana Fajardini [Sun, 25 May 2025 21:58:40 +0000 (18:58 -0300)] 
pgsql: add query keyword

Add the `pgsql.query` rule keyword to match on PGSQL's query
request message contents. This currently matches on the EVE field:

pgsql.request.simple_query

`pgsql.query` is a sticky buffer and can be used as a fast_pattern.

Task #6259

6 weeks agogithub-ci: enable asan for suricata-lua-sys in fuzz build
Jason Ish [Wed, 21 May 2025 20:09:15 +0000 (14:09 -0600)] 
github-ci: enable asan for suricata-lua-sys in fuzz build

6 weeks agogithub-ci/macos: don't pass CFLAGS to make
Jason Ish [Tue, 20 May 2025 20:53:57 +0000 (14:53 -0600)] 
github-ci/macos: don't pass CFLAGS to make

With autoconf, CFLAGS should only need to be passed to
./configure. They're then memorized in the generated Makefiles.

6 weeks agogithub-ci: cache npcap binary download
Jason Ish [Tue, 20 May 2025 17:32:35 +0000 (11:32 -0600)] 
github-ci: cache npcap binary download

6 weeks agorust: pass CC to to cargo
Jason Ish [Tue, 20 May 2025 20:41:13 +0000 (14:41 -0600)] 
rust: pass CC to to cargo

This is required for crates that use a C compiler to use the same one as
used by Suricata. Important for cross compiling.

Also pass AR and RANLIB which are often used for cross compiling.

6 weeks agolua: update to suricata-lua-sys 0.1.0-alpha.9
Jason Ish [Tue, 20 May 2025 17:03:23 +0000 (11:03 -0600)] 
lua: update to suricata-lua-sys 0.1.0-alpha.9

This version supports picking up CFLAGS either passed with CFLAGS or
SURICATA_LUA_SYS_CFLAGS.

6 weeks agodoc: move upgrade note to correct section 13328/head
Shivani Bhardwaj [Tue, 27 May 2025 13:17:43 +0000 (18:47 +0530)] 
doc: move upgrade note to correct section

The PR for the behavior change of dealing with spaces in http URI and
protocol was started in 2019 and merged in 2024. When the PR was
created, it belonged to the correct upgrade section, however, by the
time it was merged, it was 8.0.x branch already.
Move it to upgrade notes from 7 to 8 for correctness.

6 weeks agodetect/vlan: fix leak with bad signature
Philippe Antoine [Tue, 27 May 2025 13:16:02 +0000 (15:16 +0200)] 
detect/vlan: fix leak with bad signature

6 weeks agodecode/sll2: Support PCAPs encoded with Linux SLL ver 2
Jeff Lucovsky [Sat, 24 May 2025 15:27:40 +0000 (11:27 -0400)] 
decode/sll2: Support PCAPs encoded with Linux SLL ver 2

Support Linux Cooked mode v2 -- DLT 276

6 weeks agoclang-format: don't reformat schema on rewrite-branch
Jason Ish [Fri, 23 May 2025 15:42:18 +0000 (09:42 -0600)] 
clang-format: don't reformat schema on rewrite-branch

Add --extensions c,h flag to git clang-format when reformatting
commits on a branch. This prevents clang-format from modifying
non-C files like JSON schemas.

The extensions is used elsewhere in this script, so I suspect it was
just an oversight.

Also, ./scripts/schema-order.py --in-place will consistently format the
schema, while sorting the keys.

6 weeks agorust: use bindgened Flow definition
Philippe Antoine [Thu, 22 May 2025 08:34:11 +0000 (10:34 +0200)] 
rust: use bindgened Flow definition

Ticket: 7667

6 weeks agorust: bindgen part of util-debug.h
Philippe Antoine [Thu, 22 May 2025 08:04:20 +0000 (10:04 +0200)] 
rust: bindgen part of util-debug.h

Ticket: 7667

Especially SCLogLevel whose enum redef is removed in rust

7 weeks agodetect/files: increment local_file_id even if buffer is NULL 13292/head
Philippe Antoine [Wed, 21 May 2025 13:34:26 +0000 (15:34 +0200)] 
detect/files: increment local_file_id even if buffer is NULL

Ticket: 7579

Otherwise, we will keep on calling again and again GetDataCallback
with the same local_file_id, and we will always get a NULL
buffer even if the next local_file_id would return a non-NULL buffer.

7 weeks agooutput: error on payload-buffer-size 0
Philippe Antoine [Wed, 21 May 2025 12:54:53 +0000 (14:54 +0200)] 
output: error on payload-buffer-size 0

Ticket: 7479

It makes no sense to ask for payload, but then want 0 bytes of it.

7 weeks agosnmp: probing parser returns unknown if not enough data
Philippe Antoine [Wed, 21 May 2025 12:48:15 +0000 (14:48 +0200)] 
snmp: probing parser returns unknown if not enough data

Ticket: 7019