]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
7 weeks agodatajson: fix thread safety violation
Eric Leblond [Mon, 28 Apr 2025 19:29:51 +0000 (21:29 +0200)] 
datajson: fix thread safety violation

7 weeks agodatajson: reduce size length
Eric Leblond [Sun, 6 Apr 2025 09:12:39 +0000 (11:12 +0200)] 
datajson: reduce size length

7 weeks agodatajson: fix string format in error message
Eric Leblond [Sun, 6 Apr 2025 09:05:47 +0000 (11:05 +0200)] 
datajson: fix string format in error message

7 weeks agoeve/schema: remove reference to datajson
Eric Leblond [Sun, 6 Apr 2025 08:39:05 +0000 (10:39 +0200)] 
eve/schema: remove reference to datajson

7 weeks agodoc/userguide: remove left over datajson reference
Eric Leblond [Sun, 6 Apr 2025 08:35:59 +0000 (10:35 +0200)] 
doc/userguide: remove left over datajson reference

7 weeks agodoc/userguide: improve datajson doc
Eric Leblond [Sat, 29 Mar 2025 08:15:56 +0000 (09:15 +0100)] 
doc/userguide: improve datajson doc

Patch adds ``remove_key`` option and clarifies the text.

7 weeks agodatajson: add remove_key option to dataset
Eric Leblond [Sat, 29 Mar 2025 07:49:12 +0000 (08:49 +0100)] 
datajson: add remove_key option to dataset

This option allows to remove the key corresponding to the match
value from the JSON object before creating the JSON object that
will be added to the `extra` data.

For example, matching on the following JSON on the `ip` key:

```json
{"ip": "10.16.1.11", "test": "success", "context":3}
```

with a match like:

```
dataset:isset,src_ip,type ip,load src.lst,format jsonline,enrichment_key src_ip,value_key ip;
```

will produce the following:

```json
"extra": {
  "src_ip": {
    "ip": "10.16.1.11",
    "test": "success",
    "context": 3
  }
```

if we add the `remove_key` option to the match:

```
dataset:isset,src_ip,type ip,load src.lst,format jsonline,enrichment_key src_ip,value_key ip, remove_key;
```

it will produce the following:

```json
"extra": {
  "src_ip": {
    "test": "success",
    "context": 3
  }
```

The option is set to false by default.

Ticket: #7372

7 weeks agodoc/userguide: basic doc for jsonline format
Eric Leblond [Thu, 27 Mar 2025 22:29:42 +0000 (23:29 +0100)] 
doc/userguide: basic doc for jsonline format

7 weeks agodatajson: implement jsonline format
Eric Leblond [Thu, 27 Mar 2025 22:04:48 +0000 (23:04 +0100)] 
datajson: implement jsonline format

This format allows to use a one valid JSON object per line in the
data file.

Ticket: #7372

7 weeks agodatajson: prepare jsonline format
Eric Leblond [Thu, 27 Mar 2025 21:32:31 +0000 (22:32 +0100)] 
datajson: prepare jsonline format

There is just a change in the iterator to go from json to jsonline
so let's factorize the parsing functions.

Ticket: #7372

7 weeks agodoc/userguide: add dataset with json
Eric Leblond [Sun, 2 Mar 2025 16:35:47 +0000 (17:35 +0100)] 
doc/userguide: add dataset with json

7 weeks agoeve/schema: document datajson output
Eric Leblond [Sun, 2 Mar 2025 16:39:42 +0000 (17:39 +0100)] 
eve/schema: document datajson output

7 weeks agoeve/schema: pktvars is a container
Eric Leblond [Sun, 2 Mar 2025 16:38:55 +0000 (17:38 +0100)] 
eve/schema: pktvars is a container

It can contain any vars so need addition properties.

7 weeks agodetect/pcre: add extraction for alert
Eric Leblond [Sun, 2 Mar 2025 16:34:06 +0000 (17:34 +0100)] 
detect/pcre: add extraction for alert

With datajson infrastructure in place, it is now possible to
add data in the extra information section. Following an idea
by Jason Ish, this patch adds the feature for pcre extraction.

A PCRE such as pcre:"/(?P<alert_ua>[a-zA-Z]+)\//" will add the
content of the captured group to alert.extra.ua.

7 weeks agodatajson: introduce feature
Eric Leblond [Sun, 2 Mar 2025 16:34:38 +0000 (17:34 +0100)] 
datajson: introduce feature

This patch introduces new option to dataset keyword.
Where regular dataset allows match from sets, dataset with json
format allows the same but also adds JSON data to the alert
event. This data is coming from the set definition it self.
For example, an ipv4 set will look like:

  [{"ip": "10.16.1.11", "test": "success","context":3}]

The syntax is a JSON array but it can also be a JSON object
with an array inside. The idea is to directly used data coming
from the API of a threat intel management software.

The syntax of the keyword is the following:

  dataset:isset,src_ip,type ip,load src.lst,format json, \
       enrichment_key src_ip, value_key ip;

Compare to dataset, it just have a supplementary option key
that is used to indicate in which subobject the JSON value
should be added.

The information is added in the even under the alert.extra
subobject:

  "alert": {
    "extra": {
      "src_ip": {
        "ip": "10.6.1.11",
        "test": "success",
        "context": 3
      },

The main interest of the feature is to be able to contextualize
a match. For example, if you have an IOC source, you can do

 [
   {"buffer": "value1", "actor":"APT28","Country":"FR"},
   {"buffer": "value2", "actor":"APT32","Country":"NL"}
 ]

This way, a single dataset is able to produce context to the
event where it was not possible before and multiple signatures
had to be used.

The format introduced in datajson is an evolution of the
historical datarep format. This has some limitations. For example,
if a user fetch IOCs from a threat intel server there is a large
change that the format will be JSON or XML. Suricata has no support
for the second but can support the first one.

Keeping the key value may seem redundant but it is useful to have it
directly accessible in the extra data to be able to query it
independantly of the signature (where it can be multiple metadata
or even be a transformed metadata).

In some case, when interacting with data (mostly coming from
threat intel servers), the JSON array containing the data
to use is not at the root of the object and it is ncessary
to access a subobject.

This patch implements this with support of key in level1.level2.
This is done via the `array_key` option that contains the path
to the data.

Ticket: #7372

7 weeks agoutil/byte: add HexToRaw function
Eric Leblond [Sun, 2 Mar 2025 16:31:08 +0000 (17:31 +0100)] 
util/byte: add HexToRaw function

7 weeks agoutil/ip: add IPv4 and IPv6 length
Eric Leblond [Sun, 2 Mar 2025 16:30:41 +0000 (17:30 +0100)] 
util/ip: add IPv4 and IPv6 length

7 weeks agodetect: replace DetectEngineCtx flag with EngineModeIsFirewall
Victor Julien [Wed, 11 Jun 2025 13:57:46 +0000 (15:57 +0200)] 
detect: replace DetectEngineCtx flag with EngineModeIsFirewall

7 weeks agodetect/config: supported for firewall rules
Victor Julien [Wed, 11 Jun 2025 13:47:34 +0000 (15:47 +0200)] 
detect/config: supported for firewall rules

7 weeks agohelp: group and reorder help/usage output
Victor Julien [Wed, 11 Jun 2025 10:48:47 +0000 (12:48 +0200)] 
help: group and reorder help/usage output

7 weeks agocommandline: add --help option
Victor Julien [Wed, 11 Jun 2025 10:48:16 +0000 (12:48 +0200)] 
commandline: add --help option

Acts same as -h.

7 weeks agofirewall: add --firewall and firewall.enabled
Victor Julien [Wed, 11 Jun 2025 09:00:50 +0000 (11:00 +0200)] 
firewall: add --firewall and firewall.enabled

Allows for enabling firewall mode

7 weeks agofirewall: move config into yaml object
Victor Julien [Wed, 11 Jun 2025 07:25:44 +0000 (09:25 +0200)] 
firewall: move config into yaml object

To make it easier to group settings or include them.

7 weeks agoldap: avoid unneeded renaming of variables
Pierre Chifflier [Wed, 11 Jun 2025 07:29:05 +0000 (09:29 +0200)] 
ldap: avoid unneeded renaming of variables

7 weeks agoldap: fix clippy warnings (unneded conversions)
Pierre Chifflier [Thu, 5 Jun 2025 12:39:29 +0000 (14:39 +0200)] 
ldap: fix clippy warnings (unneded conversions)

7 weeks agoldap: factorize code and remove duplicated structs, use ldap_parser where relevant
Pierre Chifflier [Wed, 4 Jun 2025 12:36:46 +0000 (14:36 +0200)] 
ldap: factorize code and remove duplicated structs, use ldap_parser where relevant

7 weeks agoldap: update ldap-parser to 0.5.0
Pierre Chifflier [Wed, 4 Jun 2025 08:30:22 +0000 (10:30 +0200)] 
ldap: update ldap-parser to 0.5.0

7 weeks agojson/schema: link file.name to email.attachment 13423/head
Alice Akaki [Wed, 4 Jun 2025 00:26:48 +0000 (20:26 -0400)] 
json/schema: link file.name to email.attachment

As a Suricata keyword.

Ticket: #7683

8 weeks agodoc/upgrade: note about dns address swap on responses 13419/head
Jason Ish [Tue, 10 Jun 2025 15:08:01 +0000 (09:08 -0600)] 
doc/upgrade: note about dns address swap on responses

Document the change in DNS addresses for ticket 6400.

Ticket: https://redmine.openinfosecfoundation.org/issues/6400

8 weeks agofuzz: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Thu, 22 May 2025 15:41:36 +0000 (17:41 +0200)] 
fuzz: fix -Wshorten-64-to-32 warnings

Ticket: #6186

8 weeks agoutil: fix -Wshorten-64-to-32 warnings for afpacket
Philippe Antoine [Thu, 22 May 2025 12:59:16 +0000 (14:59 +0200)] 
util: fix -Wshorten-64-to-32 warnings for afpacket

Ticket: #6186

8 weeks agoconfigure: add -Wshorten-64-to-32 to the flags
Philippe Antoine [Tue, 20 May 2025 09:12:59 +0000 (11:12 +0200)] 
configure: add -Wshorten-64-to-32 to the flags

when configure is run with --enable-warnings

Ticket: 6186

Also add -Wimplicit-int-conversion to the flags

Both are not compatible with unit tests

8 weeks agodetect/engine: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Tue, 20 May 2025 09:11:21 +0000 (11:11 +0200)] 
detect/engine: fix -Wshorten-64-to-32 warnings

Ticket: #6186

Especially take care of the case where byte_extract extracts a u64
value that does not fit in a u32

8 weeks agotime: replace usleep by SleepUsec/SleepMsec
Victor Julien [Tue, 10 Jun 2025 10:47:25 +0000 (12:47 +0200)] 
time: replace usleep by SleepUsec/SleepMsec

Helps cross platform support, esp Windows

8 weeks agothreads: clean up module flags
Victor Julien [Tue, 10 Jun 2025 10:40:21 +0000 (12:40 +0200)] 
threads: clean up module flags

Remove unused TM_FLAG_STREAM_TM.

Rename TM_FLAG_DETECT_TM to TM_FLAG_FLOWWORKER_TM as it was mostly used
to check if a thread is a flow worker. TM_FLAG_DETECT_TM was always set
for a flow worker, even when there was no detection in use.

8 weeks agothreading: fix shutdown of IPS autofp modes
Victor Julien [Tue, 10 Jun 2025 09:33:03 +0000 (11:33 +0200)] 
threading: fix shutdown of IPS autofp modes

For IPS modes with a verdict thread in autofp there was an issue with
the verdict thread not shutting down, leading to a long shutdown time
until an error condition was reached.

The problem was that when the packet threads, of which the verdict
thread is one, were told to enter their flow timeout loop the verdict
thread got stuck as it immediately progressed to THV_RUNNING_DONE
instead of the expected THV_FLOW_LOOP.

This patch updates the shutdown logic to only apply the flow timeout
logic to the relevant threads, and skip the verdict thread(s).

Add TM_FLAG_VERDICT_TM to indicate a thread has a verdict module to more
explicitly shut it down.

Fixes: 12f8f03532e5 ("threads: fix autofp shutdown race condition")
Bug: #7681.

8 weeks agorust: bindgen AppLayerParserConfParserEnabled
Philippe Antoine [Tue, 10 Jun 2025 08:08:57 +0000 (10:08 +0200)] 
rust: bindgen AppLayerParserConfParserEnabled

Ticket: 7667

8 weeks agorust: bindgen SCAppLayerParserRegisterLogger
Philippe Antoine [Tue, 10 Jun 2025 08:01:15 +0000 (10:01 +0200)] 
rust: bindgen SCAppLayerParserRegisterLogger

Ticket: 7667

8 weeks agorust: bindgen AppLayerParserRegisterParserAcceptableDataDirection
Philippe Antoine [Tue, 10 Jun 2025 07:53:45 +0000 (09:53 +0200)] 
rust: bindgen AppLayerParserRegisterParserAcceptableDataDirection

Ticket: 7667

8 weeks agorust: bindgen AppLayerParserSetStreamDepth
Philippe Antoine [Tue, 10 Jun 2025 07:49:10 +0000 (09:49 +0200)] 
rust: bindgen AppLayerParserSetStreamDepth

Ticket: 7667

8 weeks agorust: bindgen SCAppLayerParserStateIssetFlag
Philippe Antoine [Tue, 10 Jun 2025 07:33:19 +0000 (09:33 +0200)] 
rust: bindgen SCAppLayerParserStateIssetFlag

Ticket: 7667

8 weeks agorust: bindgen AppLayerParserStateSetFlag
Philippe Antoine [Mon, 9 Jun 2025 20:12:44 +0000 (22:12 +0200)] 
rust: bindgen AppLayerParserStateSetFlag

Ticket: 7667

8 weeks agosrc: clean includes for app-layer-parser.h
Philippe Antoine [Mon, 9 Jun 2025 20:05:12 +0000 (22:05 +0200)] 
src: clean includes for app-layer-parser.h

To prepare bindgening

8 weeks agodetect/config: add flow tracking doc 13410/head
Victor Julien [Sat, 24 May 2025 07:23:01 +0000 (09:23 +0200)] 
detect/config: add flow tracking doc

8 weeks agodetect/config: remove unused include
Victor Julien [Sat, 24 May 2025 07:22:36 +0000 (09:22 +0200)] 
detect/config: remove unused include

8 weeks agodetect/config: add func docs
Victor Julien [Sat, 24 May 2025 05:44:48 +0000 (07:44 +0200)] 
detect/config: add func docs

8 weeks agodetect/config: remove filestore reference from comments
Victor Julien [Sat, 24 May 2025 05:43:14 +0000 (07:43 +0200)] 
detect/config: remove filestore reference from comments

8 weeks agodetect/config: add support for skipping flow tracking
Victor Julien [Wed, 21 May 2025 10:17:01 +0000 (12:17 +0200)] 
detect/config: add support for skipping flow tracking

Allow rules in the `pre_flow` hook to disable flow tracking for a
packet:

    config:packet tcp:pre_flow any any <> any 12345 (           \
        config: tracking disable, type flow, scope packet;      \
        sid:1;)

This rule will be evaluated before a packet is handled by the flow
engine, and a match will ensure that the flow engine is skipped.

Ticket: #7715.

8 weeks agodetect: set detect table for non-firewall mode as well
Victor Julien [Thu, 5 Jun 2025 08:43:22 +0000 (10:43 +0200)] 
detect: set detect table for non-firewall mode as well

This also exposed a difference between the handling of TD alerts in
firewall vs non-firewall mode. In firewall mode the table/hook is also
part of the alert ordering to make sure actions from packet:td are
applied before app:td. Handle that explicitly for now.

8 weeks agodetect/config: allow setting a scope for action config
Victor Julien [Wed, 21 May 2025 10:15:03 +0000 (12:15 +0200)] 
detect/config: allow setting a scope for action config

8 weeks agoutil/config: comment out unused types
Victor Julien [Wed, 21 May 2025 10:11:56 +0000 (12:11 +0200)] 
util/config: comment out unused types

8 weeks agodetect/config: clean up keyword value parsing
Victor Julien [Wed, 21 May 2025 08:47:52 +0000 (10:47 +0200)] 
detect/config: clean up keyword value parsing

8 weeks agodetect: clean up signature validate logic
Victor Julien [Thu, 5 Jun 2025 07:48:26 +0000 (09:48 +0200)] 
detect: clean up signature validate logic

`SigValidate` was doing more than just validation. Break out the
function into validation steps and consolidation steps.

8 weeks agodetect: tables support per keyword
Victor Julien [Thu, 29 May 2025 12:56:02 +0000 (14:56 +0200)] 
detect: tables support per keyword

Allow keywords to specify in which detect table they can function.

E.g. the pre_flow table will not support flow keywords, as no flow is
availble at this time.

8 weeks agodetect: use accept:hook policy for pre_* hooks
Victor Julien [Wed, 21 May 2025 10:13:22 +0000 (12:13 +0200)] 
detect: use accept:hook policy for pre_* hooks

Set firewall policy in scratch pad. Default to drop:packet for filter tables,
use accept:hook for pre_stream and pre_hook.

8 weeks agodetect: add pre_flow hook
Victor Julien [Tue, 20 May 2025 14:15:15 +0000 (16:15 +0200)] 
detect: add pre_flow hook

Allows dropping of packets before a flow is created/updated.
Directionless as direction is inferred from the flow.

Ticket: #7714.

8 weeks agodetect: add pre_stream hook
Victor Julien [Wed, 14 May 2025 10:16:46 +0000 (12:16 +0200)] 
detect: add pre_stream hook

Meant to be used from the detection engine, to allow rules to drop
traffic before it modifies the stream state.

Ticket: #7712.

8 weeks agodetect: add tcp.wscale keyword
Victor Julien [Sat, 17 May 2025 19:37:50 +0000 (21:37 +0200)] 
detect: add tcp.wscale keyword

Allows matching on wscale option value in TCP header options.

Ticket: #7713.

8 weeks agoflow-worker: use explicit type for DetectEngineThreadCtx
Victor Julien [Tue, 20 May 2025 08:00:03 +0000 (10:00 +0200)] 
flow-worker: use explicit type for DetectEngineThreadCtx

8 weeks agodetect: only reset packet alert things in unittest mode
Victor Julien [Sat, 17 May 2025 10:21:57 +0000 (12:21 +0200)] 
detect: only reset packet alert things in unittest mode

8 weeks agodetect: pass de_ctx around as const
Victor Julien [Fri, 16 May 2025 14:19:33 +0000 (16:19 +0200)] 
detect: pass de_ctx around as const

8 weeks agodetect/bsize: constify signature pointer in callback
Victor Julien [Wed, 4 Jun 2025 08:51:54 +0000 (10:51 +0200)] 
detect/bsize: constify signature pointer in callback

8 weeks agodetect/absent: constify signature pointer in callback
Victor Julien [Wed, 4 Jun 2025 08:50:39 +0000 (10:50 +0200)] 
detect/absent: constify signature pointer in callback

8 weeks agoeve/schema: reformat with clang-format
Victor Julien [Wed, 21 May 2025 14:44:13 +0000 (16:44 +0200)] 
eve/schema: reformat with clang-format

8 weeks agorust: allow some lints in suricatactl and suricatasc
Jason Ish [Mon, 9 Jun 2025 15:28:53 +0000 (09:28 -0600)] 
rust: allow some lints in suricatactl and suricatasc

These are lints we allow in the Suricata Rust source code for style
reasons.

8 weeks agosuricatasc: reconnect on loss of connection
Jason Ish [Mon, 9 Jun 2025 01:43:24 +0000 (19:43 -0600)] 
suricatasc: reconnect on loss of connection

If the connection is lost (for example, Suricata is restarted), try to
re-open the connect and re-execute the command.

This was the behavior of the Python implementation.

Ticket: #7746

8 weeks agoaffinity: avoid zero-division in the CPU selector
Lukas Sismis [Mon, 9 Jun 2025 08:29:11 +0000 (10:29 +0200)] 
affinity: avoid zero-division in the CPU selector

Ticket: 7747

8 weeks agorunmodes: remove redundant NULL check
Lukas Sismis [Mon, 9 Jun 2025 08:05:54 +0000 (10:05 +0200)] 
runmodes: remove redundant NULL check

Ticket: 7747

8 weeks agodetect: Ensure byte* variable usages is for same buffers
Jeff Lucovsky [Sat, 7 Jun 2025 13:25:52 +0000 (09:25 -0400)] 
detect: Ensure byte* variable usages is for same buffers

Issue: 7549

Use the active buffer list to fetch SM variables to ensure that they are
part of the same list so a variable created with bytemath or byteextract
will have context when used with bytejump, e.g

Not needed for content modifiers.

8 weeks agodns: log addresses in order of packet
Jason Ish [Thu, 5 Jun 2025 15:20:08 +0000 (09:20 -0600)] 
dns: log addresses in order of packet

DNS logs have always been logged in flow direction, this can be
confusing as DNS responses have a src_ip of the client, but it makes
more sense to have the src_ip for the server, as that is the src_ip of
the response packet.

As this is a breaking change, limit it DNS v3 logging which was
introduced, and is the default for Suricata 8.0.

Ticket: #6400

8 weeks agooutput: delayed initialization for custom loggers 13397/head
Jason Ish [Thu, 5 Jun 2025 21:41:40 +0000 (15:41 -0600)] 
output: delayed initialization for custom loggers

When a plugin is first initialized, it is too early to register
transaction loggers. Instead, a plugin can register a callback to be
called when Suricata is ready for outputs like transaction loggers to
be registered.

Likewise for library users, there is a window in SuricataInit where
transaction loggers can be registered that library users don't have
access to. So a lifecycle callback useful here as well.

Ticket #7236

8 weeks agopgsql: install rules
Juliana Fajardini [Fri, 6 Jun 2025 18:35:58 +0000 (15:35 -0300)] 
pgsql: install rules

8 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

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

8 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

8 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

8 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

8 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

8 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

8 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

8 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.

8 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

8 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

8 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.

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

8 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

8 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

8 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

8 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.

8 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

8 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

8 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.

8 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

8 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.

8 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.

8 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

8 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

8 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.

2 months 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 -- .

2 months 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.