]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
4 months agodoc/userguide: add lua flowlib docs 12854/head
Juliana Fajardini [Wed, 26 Mar 2025 23:08:12 +0000 (16:08 -0700)] 
doc/userguide: add lua flowlib docs

Task #7489

4 months agodoc: remove old lua flow methods
Juliana Fajardini [Thu, 27 Mar 2025 02:07:16 +0000 (19:07 -0700)] 
doc: remove old lua flow methods

Task #7489

4 months agolua: remove old lua flow calls
Juliana Fajardini [Wed, 26 Mar 2025 23:02:06 +0000 (16:02 -0700)] 
lua: remove old lua flow calls

Moving forward, the flowlib is to be used.

Task #7489

4 months agolua: add initial suricata.flow lib
Juliana Fajardini [Tue, 25 Mar 2025 21:53:19 +0000 (14:53 -0700)] 
lua: add initial suricata.flow lib

Methods:
`get` creates the flow object.
`id`  returns the flow id.
`has_alerts` returns a boolean indicating if the flow triggered alerts.
`app_layer_proto` returns various app-layer related fields as 5 strings:
  alproto, alproto_ts, alproto_tc, alproto_orig, alproto_expect.
`stats` returns cnts for bytes and packets to sever and to client, as 4
  numbers.
`tuple` -- returns various fields: srcip, dstip, proto, sp, dp.
`timestamps` returns time as 4 numbers: seconds and microseconds, for
  first and last packet of the flow.
`timestring_legacy` returns the first packet from the flow's timestring
  as a string (like fastlog).
`timestring_iso8601` returns the first packet from the flow's
  timestring as an iso8601 compat timestring (like eve).

Example:

```
name = "lua-scflowstats.log"

local flow = require("suricata.flow")

function init(args)
    local needs = {}
    needs["type"] = "flow"
    return needs
end

function setup(args)
    filename = SCLogPath() .. "/" .. name
    file = assert(io.open(filename, "a"))
    SCLogInfo("lua SCFlowStats Log Filename " .. filename)
end

function log(args)
    local f = flow.get()
    timestring = f:timestring_legacy()
    tscnt, tsbytes, tccnt, tcbytes = f:stats()

   file:write ("[**] " .. timestring .. "\nSCFlowStats is\nPacket count to server:  " .. tscnt .. "\nByte count to server: " .. tsbytes .. "\nPacket count to client: " .. tccnt .. "\nByte count to client: " .. tcbytes .. "\n[**]")
    file:flush()
end

function deinit(args)
    file:close(file)
end
```

Task #7489

4 months agolua: fix typos
Juliana Fajardini [Tue, 25 Mar 2025 21:49:52 +0000 (14:49 -0700)] 
lua: fix typos

4 months agolua/dnp3: convert done and complete to boolean 12847/head
Jason Ish [Thu, 27 Mar 2025 17:24:17 +0000 (11:24 -0600)] 
lua/dnp3: convert done and complete to boolean

These were integers, 1 of true, 0 for false. Convert to boolean as
that is how they are in eve, and Lua has boolean types.

Ticket: #7601

4 months agolua/dnp3: add is_request boolean
Jason Ish [Thu, 27 Mar 2025 17:10:21 +0000 (11:10 -0600)] 
lua/dnp3: add is_request boolean

A DNP3 message can be a request or response, but not both. This is how
the transaction is structured.

Instead of having 2 values, "has_request" and "has_response", just
provide one field, "is_request" as a boolean.

Ticket: #7601

4 months agolua: convert dnp3 to suricata.dnp3 lib
Jason Ish [Thu, 27 Mar 2025 16:46:49 +0000 (10:46 -0600)] 
lua: convert dnp3 to suricata.dnp3 lib

This is an initial 1:1 conversion which is rather simple, as DNP3 only
had one function which converted the whole transaction to a DNP3
table.

Ticket: #7601

4 months agolua: remove buffer type dns.rrname, not needed
Jason Ish [Wed, 26 Mar 2025 23:12:05 +0000 (17:12 -0600)] 
lua: remove buffer type dns.rrname, not needed

DNS is transaction based, Lua scripts need only express interest in
the request or the response.

4 months agolua: allow for real booleans in "needs" expression
Jason Ish [Wed, 26 Mar 2025 22:16:03 +0000 (16:16 -0600)] 
lua: allow for real booleans in "needs" expression

In addition to

    function init (args)
        local needs = {}
        needs["dnp3"] = tostring(true)
        return needs
    end

allow for

    function init (args)
        return {dnp3=true}
    end

with the idea that the former will be completely removed for 8.0.

This works with all existing SV tests and as a string value, any value
is considered "truthy".

4 months agoscript/dnp3_gen.py: use current clang style
Jason Ish [Wed, 26 Mar 2025 18:29:48 +0000 (12:29 -0600)] 
script/dnp3_gen.py: use current clang style

4 months agoscript/dnp3-gen.py: update for newer versions of Python
Jason Ish [Wed, 26 Mar 2025 18:25:58 +0000 (12:25 -0600)] 
script/dnp3-gen.py: update for newer versions of Python

More recent yaml loaders require the loader as an argument.

4 months agodetect: add email.cc keyword 12840/head
Alice Akaki [Sat, 22 Mar 2025 01:25:48 +0000 (21:25 -0400)] 
detect: add email.cc keyword

email.cc matches on MIME EMAIL Carbon Copy
This keyword maps to the EVE field email.cc[]
It is a sticky buffer
Supports prefiltering

Ticket: #7588

4 months agodetect-email.c: don't return NULL for empty buffer
Alice Akaki [Mon, 24 Mar 2025 21:08:31 +0000 (17:08 -0400)] 
detect-email.c: don't return NULL for empty buffer

Just return NULL if tx->mime_state is NULL or if SCDetectMimeEmailGetData return 0

Fixes:
09db7c7 ("detect: add mime email.subject keyword")
90aab0d ("detect: add email.from")

4 months agodoc: add keywords to the multi-buffer-matching list
Alice Akaki [Mon, 24 Mar 2025 21:29:28 +0000 (17:29 -0400)] 
doc: add keywords to the multi-buffer-matching list

4 months agorust: fixes for breaking change on deranged crate
Jason Ish [Tue, 25 Mar 2025 22:02:29 +0000 (16:02 -0600)] 
rust: fixes for breaking change on deranged crate

Deranged v0.4.1 (a dependency of the time crate) has implemented
PartialOrd for some integer types that conflict with the
implementation in the standard library creating an ambiguity as such
implementation are global. For more info see
https://github.com/jhpratt/deranged/issues/18.

To fix, use "::from" directly, instead of using .into() which is where
we run into amgibuity.

4 months agodoc/userguide: group af-packet upgrade notes together
Jason Ish [Tue, 25 Mar 2025 17:17:54 +0000 (11:17 -0600)] 
doc/userguide: group af-packet upgrade notes together

Also fix the rendering of the sip nest list.

4 months agodoc/userguide: upgrade note about defrag now off for inline use
Jason Ish [Tue, 25 Mar 2025 17:08:36 +0000 (11:08 -0600)] 
doc/userguide: upgrade note about defrag now off for inline use

Ticket: #7617

4 months agoaf-packet: don't default to defrag when inline
Jason Ish [Mon, 24 Mar 2025 01:39:26 +0000 (19:39 -0600)] 
af-packet: don't default to defrag when inline

Don't default to defrag true when inline. It can still be enabled by
setting defrag to true however it is not recommended.

Ticket: #7617

4 months agodoc/userguide: upgrade note about tpacket-v3 default for ids
Jason Ish [Sun, 23 Mar 2025 16:55:45 +0000 (10:55 -0600)] 
doc/userguide: upgrade note about tpacket-v3 default for ids

Ticket: #4798

4 months agoapplayer: fix alp_ctx indexing in tests
Binghui Niu [Tue, 25 Mar 2025 06:35:48 +0000 (14:35 +0800)] 
applayer: fix alp_ctx indexing in tests

Fix problem that some app-layer unittests regist failed.

4 months agodetect: add email.to keyword 12836/head
Alice Akaki [Wed, 26 Mar 2025 08:36:29 +0000 (04:36 -0400)] 
detect: add email.to keyword

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

Ticket: #7596

4 months agofuzz: set flow flags as in Suricata 12821/head
Philippe Antoine [Mon, 24 Mar 2025 15:11:44 +0000 (16:11 +0100)] 
fuzz: set flow flags as in Suricata

Fixes: d8ddef4c1485 ("detect: delay tx cleanup in some edge case")
4 months agodetect: add mime email.subject keyword 12815/head
Alice Akaki [Thu, 20 Mar 2025 21:32:58 +0000 (17:32 -0400)] 
detect: add mime email.subject keyword

email.subject matches on MIME EMAIL SUBJECT
This keyword maps to the EVE field email.subject
It is a sticky buffer
Supports prefiltering

Ticket: #7595

4 months agoaf-packet: use tpacket v3 by default for ids mode
Jason Ish [Wed, 19 Feb 2025 05:07:40 +0000 (23:07 -0600)] 
af-packet: use tpacket v3 by default for ids mode

If "tpacket-v3" is not present in the configuration file, and we are
in IDS mode, default to "tpacket-v3".

Required moving the check for tpacket-v3 after the copy-mode
configuration, so the warning about tpacket-v3 in active modes has
been moved as well.

Ticket: #4798

4 months agoaf-packet: remove use-mmap option
Jason Ish [Thu, 20 Mar 2025 22:35:49 +0000 (16:35 -0600)] 
af-packet: remove use-mmap option

This option is obsolete and was not used in 7.0 as tpacket-v1 support
was removed (see ticket #4796).

4 months agoaf-packet: remove build conditional for tpacket-v3
Jason Ish [Fri, 21 Mar 2025 22:04:31 +0000 (16:04 -0600)] 
af-packet: remove build conditional for tpacket-v3

All kernels on supported distrubtions should now support tpacket-v3,
so only enable af-packet if v2 and v3 are available.

4 months agopgsql/parser: use fn for length parsing... 12811/head
Juliana Fajardini [Fri, 21 Mar 2025 18:55:44 +0000 (11:55 -0700)] 
pgsql/parser: use fn for length parsing...

... there was still one parser missing this conversion.

4 months agoutil/exception: fix coverity warning
Juliana Fajardini [Fri, 21 Mar 2025 18:20:09 +0000 (11:20 -0700)] 
util/exception: fix coverity warning

CID 1644862:  Control flow issues  (UNREACHABLE)

In ExceptionPolicyTargetFlagToString, a statement cannot be reached
(line 113).

4 months agouserguide/exceptions: clarify when stats are logged 12805/head
Juliana Fajardini [Wed, 26 Feb 2025 19:38:36 +0000 (16:38 -0300)] 
userguide/exceptions: clarify when stats are logged

The stats for exception policies are only logged/ present when any of
the exception policies are enabled (which means any value other than
"auto" or "ignore" in IDS mode, or "ignore" in IPS mode).

This wasn't clearly stated in the docs.

4 months agoflow/output: log triggered exception policies
Juliana Fajardini [Fri, 28 Feb 2025 22:18:47 +0000 (19:18 -0300)] 
flow/output: log triggered exception policies

To accompany the Exception Policy stats, also add information about any
Exception Policy triggered and for which target to the flow log event.

Task #6215

4 months agotls: implement alert parser
Victor Julien [Fri, 18 Oct 2024 09:55:40 +0000 (11:55 +0200)] 
tls: implement alert parser

Fatal alerts set the tx state to 'finished'.

Add event for malformed alerts.

4 months agodns: stop renaming DNSTransaction to RSDNSTransaction 12799/head
Jason Ish [Wed, 19 Mar 2025 21:00:38 +0000 (15:00 -0600)] 
dns: stop renaming DNSTransaction to RSDNSTransaction

Not needed anymore as there is no DNSTransaction in the C src to
conflict.

4 months agolua: document new suricata.dns lua library
Jason Ish [Wed, 12 Mar 2025 15:52:54 +0000 (09:52 -0600)] 
lua: document new suricata.dns lua library

Ticket: #7602

4 months agolua: convert dns function into suricata.dns lib
Jason Ish [Tue, 11 Mar 2025 22:52:09 +0000 (16:52 -0600)] 
lua: convert dns function into suricata.dns lib

Notable changes from the previous API:
- rcode will return the rcode as an integer
- rcode_string will return the string representation

Also fixes an issue where an rcode of 0 was returned as nil.

Ticket: #7602

4 months agodetect: add email.from
Alice Akaki [Sat, 15 Mar 2025 02:32:54 +0000 (22:32 -0400)] 
detect: add email.from

email.from matches on MIME EMAIL FROM
This keyword maps to the EVE field email.from
It is a sticky buffer
Supports prefiltering

Ticket: #7592

4 months agorustfmt: rust/src/mime/smtp.rs
Alice Akaki [Sat, 15 Mar 2025 02:39:06 +0000 (22:39 -0400)] 
rustfmt: rust/src/mime/smtp.rs

4 months agoEve: use mac addresses from flow for flow timeout
Joyce Yu [Mon, 17 Mar 2025 18:58:50 +0000 (14:58 -0400)] 
Eve: use mac addresses from flow for flow timeout

Ethernet metadata is missing for events triggered on flow timeout
pseudopackets. Use the first set of mac addresses stored with the
flow to fill in the ether field.

Ticket: #5486

4 months agoDoc: update eve-json-output ethernet description
Joyce Yu [Mon, 17 Mar 2025 18:57:48 +0000 (14:57 -0400)] 
Doc: update eve-json-output ethernet description

Document getting mac addresses from flow when flow timeout.

4 months agoaf-packet: use actual snaplen in bpf 12783/head
Victor Julien [Wed, 19 Mar 2025 06:03:01 +0000 (07:03 +0100)] 
af-packet: use actual snaplen in bpf

Avoids setting a 0 snaplen in BPF, leading to an error.

Fixes: b8b6ed550a6f ("af-packet: delay setting default-packet-size for af-packet")
Ticket: #7618.

4 months agodatasets: work around scan-build warning
Victor Julien [Tue, 18 Mar 2025 21:26:53 +0000 (22:26 +0100)] 
datasets: work around scan-build warning

datasets.c:493:27: warning: Dereference of null pointer [core.NullDereference]
  493 |     DEBUG_VALIDATE_BUG_ON(set->hash->config.hash_size != hashsize);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./util-validate.h:95:44: note: expanded from macro 'DEBUG_VALIDATE_BUG_ON'
   95 | #define DEBUG_VALIDATE_BUG_ON(exp) BUG_ON((exp))
      |                                            ^~~
./suricata-common.h:307:36: note: expanded from macro 'BUG_ON'
  307 |         #define BUG_ON(x) assert(!(x))
      |                                    ^
/usr/include/assert.h:109:7: note: expanded from macro 'assert'
  109 |     ((expr)                                                             \
      |       ^~~~
1 warning generated.

4 months agodoc: explain priority port setting
Shivani Bhardwaj [Tue, 25 Feb 2025 06:30:36 +0000 (12:00 +0530)] 
doc: explain priority port setting

Ticket 7329

4 months agodoc: format and align suricata.yaml section
Shivani Bhardwaj [Tue, 25 Feb 2025 06:07:12 +0000 (11:37 +0530)] 
doc: format and align suricata.yaml section

4 months agoupgrade: list inspection recursion default limit
Juliana Fajardini [Mon, 17 Mar 2025 15:54:49 +0000 (08:54 -0700)] 
upgrade: list inspection recursion default limit

As the yaml indicated before that if no value was specified there were
no limits, and now there will be one.

4 months agodoc/upgrade: add datasets hash size limit note
Juliana Fajardini [Mon, 17 Mar 2025 15:52:20 +0000 (08:52 -0700)] 
doc/upgrade: add datasets hash size limit note

4 months agodetect: add configurable limits for datasets
Philippe Antoine [Tue, 18 Mar 2025 09:55:39 +0000 (10:55 +0100)] 
detect: add configurable limits for datasets

Ticket: 7615

Avoids signatures setting extreme hash sizes, which would lead to very
high memory use.

Default to allowing:
- 65536 per dataset
16777216 total

To override these built-in defaults:

```yaml
datasets:
  # Limits for per rule dataset instances to avoid rules using too many
  # resources.
  limits:
    # Max value for per dataset `hashsize` setting
    #single-hashsize: 65536
    # Max combined hashsize values for all datasets.
    #total-hashsizes: 16777216
```

4 months agodatasets: improve default hashsize handling
Victor Julien [Tue, 18 Mar 2025 09:55:39 +0000 (10:55 +0100)] 
datasets: improve default hashsize handling

Make hashsize default local to dataset code, instead of relying on the
thash code.

Use the same default value as before.

4 months agodoc/userguide: af-packet upgrade notes
Jason Ish [Mon, 17 Mar 2025 15:35:16 +0000 (09:35 -0600)] 
doc/userguide: af-packet upgrade notes

Add note about increased block size and how to change it back to old
defaults if needed.

Ticket: #7458

4 months agoaf-packet: delay setting default-packet-size for af-packet
Jason Ish [Mon, 17 Mar 2025 16:35:57 +0000 (10:35 -0600)] 
af-packet: delay setting default-packet-size for af-packet

AF_PACKET needs more information about its configuration before we can
set the default packet size, so on startup, leave unset in suricata.c
if in AF_PACKET mode.

If defrag is enabled, use a default packet size of 9k for tpacket-v2.
This can still lead to truncation events, then the user can increase
their 'default-packet-size'.

Tpacket-v3 does not need an increased packet size as it will handle
any size of packet that is smaller than the configured block size
which now has a default of 128k.

9k for the snap is somewhat arbitrary but is large enough for the
common 9000 jumbo frame plus some extra headers including tpacket
headers.

Ticket: #7458

4 months agoaf-packet: warn that tpacket-v3 is better for non-inline usage
Jason Ish [Thu, 13 Mar 2025 18:14:26 +0000 (12:14 -0600)] 
af-packet: warn that tpacket-v3 is better for non-inline usage

Ticket: #7458

4 months agoaf-packet: add event for packets truncated by af-packet
Jason Ish [Thu, 13 Mar 2025 16:36:08 +0000 (10:36 -0600)] 
af-packet: add event for packets truncated by af-packet

Ticket: #7458

4 months agoaf-packet: warn if v3 block size is not large enough for defrag
Jason Ish [Wed, 12 Mar 2025 22:20:38 +0000 (16:20 -0600)] 
af-packet: warn if v3 block size is not large enough for defrag

If using tpacket-v3 and defrag, warn if the block size is not large
enough for a fully defragmented packet.

Ticket: #7458

4 months agoaf-packet: warn if v2 block size not large enough for defrag
Jason Ish [Wed, 12 Mar 2025 22:13:40 +0000 (16:13 -0600)] 
af-packet: warn if v2 block size not large enough for defrag

If using tpacket-v2, defrag and a user provided v2-block-size, warn if
the block size is not large enough to hold one fully defragmented
packet.

Ticket: #7458

4 months agoaf-packet: make tpacket-v2 block size configurable
Jason Ish [Wed, 12 Mar 2025 21:58:43 +0000 (15:58 -0600)] 
af-packet: make tpacket-v2 block size configurable

With the change of the default tpacket-v2 block size from 32k to 128k,
allow it to be configurable for users who may want to make it larger,
or revert it back to the pre 7.0.9 default of 32k.

Ticket: #7458

4 months agoaf-packet: increase default block size
Jason Ish [Wed, 12 Mar 2025 21:56:40 +0000 (15:56 -0600)] 
af-packet: increase default block size

Increase the default block size from 32k to 128k. This allows for a
fully defragmented packet to fit in the buffer.

Ticket: #7458

4 months agoaf-packet: warn if defrag not suitable for mode
Jason Ish [Wed, 12 Mar 2025 18:34:31 +0000 (12:34 -0600)] 
af-packet: warn if defrag not suitable for mode

AF_PACKET defrag should not be used for inline modes. Its possible that
a packet received could be larger than can be set when defrag is
enabled, so warn if disabled for inline use.

Likewise, warn if defrag is disabled for IDS use, or non-inline mode.

Ticket: #7458

4 months agoaf-packet: check defrag value even if cluster-type not set
Jason Ish [Wed, 12 Mar 2025 18:31:08 +0000 (12:31 -0600)] 
af-packet: check defrag value even if cluster-type not set

If cluster-type was not set we default to "cluster_flow" with defrag
always on. Instead check for defrag value and disable defrag if disabled
by the user.

Ticket: #7458

4 months agodetect: limit base64_decode `bytes` to 64KiB
Philippe Antoine [Tue, 17 Dec 2024 14:06:25 +0000 (15:06 +0100)] 
detect: limit base64_decode `bytes` to 64KiB

Ticket: 7613

Avoids potential large per-thread memory allocation. A buffer with the
size of the largest decode_base64 buffer size setting would be allocated
per thread. As this was a u32, it could mean a per-thread 4GiB memory
allocation.

64KiB was already the built-in default for cases where bytes size wasn't
specified.

4 months agodetect: non infinite default value for inspection-recursion-limit
Philippe Antoine [Thu, 20 Feb 2025 22:40:08 +0000 (23:40 +0100)] 
detect: non infinite default value for inspection-recursion-limit

So that empty config are protected by this setting as was intended.

Set to unlimited for fuzz testing.

4 months agodetect/pcre: avoid infinite loop after negated pcre
Philippe Antoine [Tue, 28 Jan 2025 14:02:45 +0000 (15:02 +0100)] 
detect/pcre: avoid infinite loop after negated pcre

Ticket: 7526

The usage of negated pcre, followed by other relative payload
content keywords could lead to an infinite loop.

This is because regular (not negated) pcre can test multiple
occurences, but negated pcre should be tried only once.

4 months agorust: pin once_cell to work with Rust 1.67.1 12752/head 12757/head
Jason Ish [Tue, 11 Mar 2025 12:16:28 +0000 (06:16 -0600)] 
rust: pin once_cell to work with Rust 1.67.1

Clap uses once_cell which recently released v1.20 which updated its
MSRV to 1.70. Locally pin once_cell to 1.20.3 to maintain our MSRV.

4 months agopcap: skip pcap-config if pkgconfig in use 12749/head
Victor Julien [Mon, 10 Mar 2025 09:01:04 +0000 (10:01 +0100)] 
pcap: skip pcap-config if pkgconfig in use

4 months agodetect/action: minor action parsing cleanup
Victor Julien [Thu, 27 Feb 2025 11:21:50 +0000 (12:21 +0100)] 
detect/action: minor action parsing cleanup

Preparation for explicit action scope parsing.

4 months agodetect/loader: minor code cleanup
Victor Julien [Wed, 26 Feb 2025 10:38:21 +0000 (11:38 +0100)] 
detect/loader: minor code cleanup

4 months agodetect: constify rule file and lines in parsing and analyzer
Victor Julien [Wed, 26 Feb 2025 10:37:54 +0000 (11:37 +0100)] 
detect: constify rule file and lines in parsing and analyzer

4 months agotls: fix handshake handling being too strict
Victor Julien [Fri, 17 Jan 2025 06:00:51 +0000 (07:00 +0100)] 
tls: fix handshake handling being too strict

e.g. server hello done has no data

4 months agoapp-layer: constify AppLayerGetProtoByName
Victor Julien [Mon, 13 Jan 2025 19:46:58 +0000 (20:46 +0100)] 
app-layer: constify AppLayerGetProtoByName

4 months agodetect/tls: don't double register tls_validity generic list
Victor Julien [Thu, 13 Feb 2025 09:32:32 +0000 (10:32 +0100)] 
detect/tls: don't double register tls_validity generic list

4 months agodetect/nfs: don't double register nfs_request generic list
Victor Julien [Mon, 27 Jan 2025 10:17:34 +0000 (11:17 +0100)] 
detect/nfs: don't double register nfs_request generic list

4 months agodetect: don't register duplicate app inspect engines
Victor Julien [Mon, 27 Jan 2025 09:55:46 +0000 (10:55 +0100)] 
detect: don't register duplicate app inspect engines

4 months agodetect/analyzer: add policy
Victor Julien [Thu, 25 May 2023 08:37:05 +0000 (10:37 +0200)] 
detect/analyzer: add policy

Example output:

    "match_policy": {
        "actions": [
            "alert",
            "drop"
        ],
        "scope": "flow"
    },

4 months agosmtp/events: set direction on rules
Victor Julien [Sat, 15 Feb 2025 10:23:44 +0000 (11:23 +0100)] 
smtp/events: set direction on rules

Several rules matched on both directions even if events are set in a single direction.

4 months agogithub-ci: don't run builds on PR if only docs changed
Jason Ish [Sun, 9 Mar 2025 09:27:18 +0000 (10:27 +0100)] 
github-ci: don't run builds on PR if only docs changed

4 months agogithub-ci: stop caching system packages
Jason Ish [Sun, 9 Mar 2025 09:19:28 +0000 (10:19 +0100)] 
github-ci: stop caching system packages

4 months agolua: remove script_api_ver 12747/head
Victor Julien [Sun, 9 Mar 2025 19:19:53 +0000 (20:19 +0100)] 
lua: remove script_api_ver

Not documented and never set to new values despite updates.

Ticket: #7492.

4 months agocontrib: remove suri-graphite
Victor Julien [Sun, 9 Mar 2025 14:07:57 +0000 (15:07 +0100)] 
contrib: remove suri-graphite

Built for py2.

Remove now empty contrib dir.

Ticket: #6888.

4 months agocontrib: remove file_processor
Victor Julien [Sun, 9 Mar 2025 14:02:23 +0000 (15:02 +0100)] 
contrib: remove file_processor

Has been developed for a now obsolete file log format.

Ticket: #6888.

4 months agodetect/dcerpc.iface: remove commented out unittest
Victor Julien [Sun, 9 Mar 2025 13:54:16 +0000 (14:54 +0100)] 
detect/dcerpc.iface: remove commented out unittest

4 months agoeve/schema: map tls fields to keywords
Victor Julien [Fri, 7 Mar 2025 16:42:04 +0000 (17:42 +0100)] 
eve/schema: map tls fields to keywords

4 months agoschema: add rule keyword mapping for dcerpc
Shivani Bhardwaj [Fri, 7 Mar 2025 11:06:56 +0000 (16:36 +0530)] 
schema: add rule keyword mapping for dcerpc

4 months agouserguide/header-keywords: fix typos, adjust format
Juliana Fajardini [Mon, 17 Feb 2025 15:58:53 +0000 (12:58 -0300)] 
userguide/header-keywords: fix typos, adjust format

4 months agodoc/rule-types: remove trailing underscore
Juliana Fajardini [Mon, 17 Feb 2025 15:26:39 +0000 (12:26 -0300)] 
doc/rule-types: remove trailing underscore

And other minor fixes that were overseen.

4 months agouserguide/suricatactl: use suricata community page
Juliana Fajardini [Fri, 7 Mar 2025 08:31:58 +0000 (05:31 -0300)] 
userguide/suricatactl: use suricata community page

We were mentioning "Suricata Support" page, which could be a bit
misleading -- and also used a link that is actually redirected to the
Suricata Community page, anyways.

4 months agogithub-ci: pin rust version for clippy tests 12743/head
Jason Ish [Sat, 8 Mar 2025 16:12:50 +0000 (17:12 +0100)] 
github-ci: pin rust version for clippy tests

Prevents CI breakage after a new Rust release until we're ready to make
the changes.

4 months agogithub-ci: update rpm builder to fedora 41
Jason Ish [Thu, 6 Mar 2025 13:49:25 +0000 (14:49 +0100)] 
github-ci: update rpm builder to fedora 41

4 months agogithub-ci: update Fedora non-root build to Fedora 41
Jason Ish [Thu, 6 Mar 2025 13:48:09 +0000 (14:48 +0100)] 
github-ci: update Fedora non-root build to Fedora 41

4 months agogithub-ci: remove fedora 40 builds where 41 exists
Jason Ish [Thu, 6 Mar 2025 13:46:48 +0000 (14:46 +0100)] 
github-ci: remove fedora 40 builds where 41 exists

Remove Fedora 40 builds where there is a Fedora 41 equivalent.

4 months agoeve-parity: merge $ref props into current object
Jason Ish [Fri, 7 Mar 2025 17:05:05 +0000 (18:05 +0100)] 
eve-parity: merge $ref props into current object

Allows for a "suricata" entry along with a "$ref".

4 months agoeve-parity: handle arrays of scalars
Jason Ish [Fri, 7 Mar 2025 16:55:50 +0000 (17:55 +0100)] 
eve-parity: handle arrays of scalars

And add an example with "client_alpns".

4 months agorust: Update sawp dependencies to 0.13.1 due to SPDX license compatibility.
Bryan Benson [Wed, 8 Jan 2025 17:54:06 +0000 (09:54 -0800)] 
rust: Update sawp dependencies to 0.13.1 due to SPDX license compatibility.

4 months agodetect/lua: Fix max value displayed in error msg
Jeff Lucovsky [Wed, 8 Jan 2025 14:27:10 +0000 (09:27 -0500)] 
detect/lua: Fix max value displayed in error msg

This commit corrects an error message displayed when the key length is
out of range.

4 months agovar: Use 16-bit container for type
Jeff Lucovsky [Fri, 1 Nov 2024 14:45:56 +0000 (10:45 -0400)] 
var: Use 16-bit container for type

Issue: 6855: Match sigmatch type field in var and bit structs

Align the size and datatype of type, idx, and next members across:
- FlowVarThreshold
- FlowBit
- FlowVar
- GenericVar
- XBit
- DetectVarList

Note that the FlowVar structure has been intentionally constrained to
match the structure size prior to this commit. To achieve this, the
keylen member was restricted to 8 bits after it was confirmed its value
is checked against a max of 0xff.

4 months agodetect: delay tx cleanup in some edge case 12730/head
Philippe Antoine [Tue, 25 Feb 2025 09:54:13 +0000 (10:54 +0100)] 
detect: delay tx cleanup in some edge case

Ticket: 7552

f->sgh_toserver may be NULL but because FLOW_SGH_TOSERVER is unset
and thus, we want to delay cleanup until detection has really been
run with the right signature group head.

This may happen for a rule using
`alert tcp any any -> any any` and
a app-layer keyword to client
with a app-layer supporting both udp and tcp
with stream.midstream=true
and with the first packet of a flow being a server response

In this case, we swap the flow and reset its signature group heads

4 months agodetect: reset signature groups when reversing flow
Philippe Antoine [Tue, 25 Feb 2025 09:49:41 +0000 (10:49 +0100)] 
detect: reset signature groups when reversing flow

Ticket: 7552

When we use midstream, and the first packet we see of a flow is
a response from server, and we want to match on some signature
to client :
- we had first set sgh_toserver/FLOW_SGH_TOSERVER as we first
  thought this was a packet to server
- we then swap/reverse the flow, so sgh_toclient becomes sgh_toserver
  but it contains signatures to server and cannot match our
  to_client signature

The detect engine with DetectRunSetup will set again the
signatures group heads properly

4 months agoeve-parity: skip transform keywords 12717/head
Jason Ish [Fri, 21 Feb 2025 20:58:47 +0000 (14:58 -0600)] 
eve-parity: skip transform keywords

4 months agoschema: mark dns.version and dns.grouped as having no keywords
Jason Ish [Thu, 20 Feb 2025 22:13:03 +0000 (16:13 -0600)] 
schema: mark dns.version and dns.grouped as having no keywords

4 months agoschema: mark "stats" and "drop" as having no keywords
Jason Ish [Thu, 20 Feb 2025 22:05:03 +0000 (16:05 -0600)] 
schema: mark "stats" and "drop" as having no keywords

4 months agodetect-dns-response: remove unit tests
Jason Ish [Thu, 20 Feb 2025 18:05:44 +0000 (12:05 -0600)] 
detect-dns-response: remove unit tests

Should have coverage by S-V now.

4 months agoscript/eve-parity: add script for checking eve/keyword parity
Jason Ish [Wed, 19 Feb 2025 22:36:57 +0000 (16:36 -0600)] 
script/eve-parity: add script for checking eve/keyword parity

Currently this script has two commands: "missing" and "having".

"missing" will show eve fields that do not map to any keywords.

"having" will sohw eve fields along with their keyword mappsings,
while also validating that those keywords really exist.

Related to tickets: #6463, #4772

4 months agoschema: add an object for mapping fields to keywords
Jason Ish [Wed, 19 Feb 2025 22:34:22 +0000 (16:34 -0600)] 
schema: add an object for mapping fields to keywords

To some EVE fields and a "suricata" object that contains an array of
keywords. These are the keywords that map directly to this field, or
somehow cover this field.

This is an attempt at tooling to help with EVE and keyword parity.

Related to tickets: #5642, #6463, #4772