]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 months agodecode: light refactor on packet cleaning
Eric Leblond [Tue, 10 Jun 2025 09:42:12 +0000 (11:42 +0200)] 
decode: light refactor on packet cleaning

2 months agodatasets: improve lock handling
Eric Leblond [Mon, 9 Jun 2025 09:45:03 +0000 (11:45 +0200)] 
datasets: improve lock handling

DatasetGetOrCreate should now be called with the dataset lock
hold so the lock management is easier to read.

2 months agodetect/dataset: fix locking on datajson
Eric Leblond [Mon, 9 Jun 2025 09:38:22 +0000 (11:38 +0200)] 
detect/dataset: fix locking on datajson

2 months agodetect/dataset: check context_key validity
Eric Leblond [Mon, 9 Jun 2025 09:30:26 +0000 (11:30 +0200)] 
detect/dataset: check context_key validity

As context_key is an user entry and as it is used to build the JSON
string of alert, we could end up with an invalid event if the string
contains improper characters.

2 months agoeve/alert: add comment about string format
Eric Leblond [Mon, 9 Jun 2025 09:17:25 +0000 (11:17 +0200)] 
eve/alert: add comment about string format

2 months agodetect/pcre: fix error handling
Eric Leblond [Mon, 9 Jun 2025 09:14:37 +0000 (11:14 +0200)] 
detect/pcre: fix error handling

2 months agodetect/engine: put datajson related code in a func
Eric Leblond [Mon, 9 Jun 2025 09:10:20 +0000 (11:10 +0200)] 
detect/engine: put datajson related code in a func

2 months agodatasets: use SCLogError for errors
Eric Leblond [Mon, 9 Jun 2025 08:50:19 +0000 (10:50 +0200)] 
datasets: use SCLogError for errors

2 months agodetect/engine: remove unused keyword
Eric Leblond [Mon, 9 Jun 2025 08:35:02 +0000 (10:35 +0200)] 
detect/engine: remove unused keyword

2 months agodatasets: comment to specify usage of field
Eric Leblond [Mon, 9 Jun 2025 08:34:31 +0000 (10:34 +0200)] 
datasets: comment to specify usage of field

2 months agodecode: use pointer for PacketContextData
Eric Leblond [Mon, 9 Jun 2025 08:27:16 +0000 (10:27 +0200)] 
decode: use pointer for PacketContextData

By adding a pointer instead of the structure in the alert info
we spare some memory.

2 months agodecode: rename ExtraDataJsonList
Eric Leblond [Mon, 9 Jun 2025 08:14:27 +0000 (10:14 +0200)] 
decode: rename ExtraDataJsonList

2 months agodatasets: comments about format
Eric Leblond [Mon, 9 Jun 2025 08:09:34 +0000 (10:09 +0200)] 
datasets: comments about format

2 months agodatasets: rename function
Eric Leblond [Mon, 9 Jun 2025 08:07:04 +0000 (10:07 +0200)] 
datasets: rename function

DatasetCreateOrGet was in fact doing get or create.

2 months agodatasets: fix error handling in StringSet
Eric Leblond [Mon, 9 Jun 2025 08:04:35 +0000 (10:04 +0200)] 
datasets: fix error handling in StringSet

2 months agodatasets: factorize set operation
Eric Leblond [Mon, 9 Jun 2025 07:59:17 +0000 (09:59 +0200)] 
datasets: factorize set operation

2 months agodatasjson: fix include barrier name
Eric Leblond [Mon, 9 Jun 2025 07:52:13 +0000 (09:52 +0200)] 
datasjson: fix include barrier name

2 months agodetect/pcre: fix copyright date
Eric Leblond [Mon, 9 Jun 2025 07:50:18 +0000 (09:50 +0200)] 
detect/pcre: fix copyright date

2 months agodatajson: key length fix
Eric Leblond [Sun, 8 Jun 2025 08:17:50 +0000 (10:17 +0200)] 
datajson: key length fix

When using type string, we should not limit the size of the string.

This patch also fixes some implicit cast issues.

2 months agodatajson: value_key is necessary in json format
Eric Leblond [Sun, 8 Jun 2025 07:28:58 +0000 (09:28 +0200)] 
datajson: value_key is necessary in json format

2 months agodoc/userguide: enrichment_key is now context_key
Eric Leblond [Sun, 8 Jun 2025 07:05:13 +0000 (09:05 +0200)] 
doc/userguide: enrichment_key is now context_key

2 months agodatajson: rename enrichment_key to context_key
Eric Leblond [Sun, 8 Jun 2025 07:03:04 +0000 (09:03 +0200)] 
datajson: rename enrichment_key to context_key

2 months agodatajson: factorize code
Eric Leblond [Sat, 7 Jun 2025 20:45:38 +0000 (22:45 +0200)] 
datajson: factorize code

Code was duplicated and a build error was reported so factorizing
was the best way to clean it.

2 months agodatajson: add sanity check on length
Eric Leblond [Sat, 7 Jun 2025 20:19:03 +0000 (22:19 +0200)] 
datajson: add sanity check on length

Also cast to avoid compilation error.

2 months agodatajson: use systematic allocation
Eric Leblond [Sat, 7 Jun 2025 19:34:50 +0000 (21:34 +0200)] 
datajson: use systematic allocation

2 months agodatajson: more explicit memory handling
Eric Leblond [Sat, 7 Jun 2025 17:24:48 +0000 (19:24 +0200)] 
datajson: more explicit memory handling

2 months agodoc/userguide: fix some typos
Eric Leblond [Fri, 6 Jun 2025 11:35:00 +0000 (13:35 +0200)] 
doc/userguide: fix some typos

Suggestions from Juliana.

Co-authored-by: Juliana Fajardini Reichow <jufajardini@gmail.com>
2 months agoeve/schema: fix ordering
Eric Leblond [Sun, 1 Jun 2025 20:24:12 +0000 (22:24 +0200)] 
eve/schema: fix ordering

2 months agodatasets: remove comment about unused return value
Eric Leblond [Thu, 29 May 2025 09:00:14 +0000 (11:00 +0200)] 
datasets: remove comment about unused return value

2 months agodatajson: simplify memory handling
Eric Leblond [Thu, 29 May 2025 08:31:02 +0000 (10:31 +0200)] 
datajson: simplify memory handling

DatajsonAdd function is now responsible of the handling of the mem
of datajsontype passed as argument.

2 months agodatajson: use wrapper
Eric Leblond [Tue, 27 May 2025 20:33:53 +0000 (22:33 +0200)] 
datajson: use wrapper

2 months agodatajson: fix potential leak in error handling
Eric Leblond [Tue, 27 May 2025 20:08:27 +0000 (22:08 +0200)] 
datajson: fix potential leak in error handling

2 months agodatajson: remove unnecessary abstraction
Eric Leblond [Tue, 27 May 2025 19:53:56 +0000 (21:53 +0200)] 
datajson: remove unnecessary abstraction

2 months agogithub: upload scan-build artifacts
Eric Leblond [Fri, 23 May 2025 18:49:54 +0000 (20:49 +0200)] 
github: upload scan-build artifacts

2 months agodatajson: use more broadly supported formatter
Eric Leblond [Sun, 18 May 2025 16:19:09 +0000 (18:19 +0200)] 
datajson: use more broadly supported formatter

2 months agodatajson: fix formatting
Eric Leblond [Wed, 7 May 2025 14:43:49 +0000 (16:43 +0200)] 
datajson: fix formatting

2 months agodatasets: factorize dataset creation
Eric Leblond [Fri, 2 May 2025 18:48:59 +0000 (20:48 +0200)] 
datasets: factorize dataset creation

Factorize DatasetGet and DatajsonGet to only have the difference
between the two in the respective function.

2 months agodatasets: separate DatasetGet in 2 functions
Eric Leblond [Fri, 2 May 2025 15:30:14 +0000 (17:30 +0200)] 
datasets: separate DatasetGet in 2 functions

This will be used to factorize the code with datajson.

2 months agodatasets/context: rename the datajson files
Eric Leblond [Fri, 2 May 2025 09:36:18 +0000 (11:36 +0200)] 
datasets/context: rename the datajson files

They are is renamed to datasets-context-json.* so we see that
it is about context and not about a new datasets type.

2 months agodoc/userguide: jsonline is now standard ndjson
Eric Leblond [Thu, 1 May 2025 07:05:31 +0000 (09:05 +0200)] 
doc/userguide: jsonline is now standard ndjson

2 months agodatajson: rename jsonline to ndjson
Eric Leblond [Thu, 1 May 2025 07:03:45 +0000 (09:03 +0200)] 
datajson: rename jsonline to ndjson

2 months agodoc/userguide: improve datajson doc
Eric Leblond [Tue, 29 Apr 2025 09:17:29 +0000 (11:17 +0200)] 
doc/userguide: improve datajson doc

2 months agodatajson: output context to "context"
Eric Leblond [Tue, 29 Apr 2025 08:51:23 +0000 (10:51 +0200)] 
datajson: output context to "context"

Using `alert.extra` was not really reflecting the nature of what
was added. So renaming it to `alert.context`.

2 months agodatajson: fix thread safety violation
Eric Leblond [Mon, 28 Apr 2025 19:29:51 +0000 (21:29 +0200)] 
datajson: fix thread safety violation

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Ticket: 7667

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

Ticket: 7667

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

Ticket: 7667

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

Ticket: 7667

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

Ticket: 7667

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

Ticket: 7667

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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