]>
git.ipfire.org Git - thirdparty/suricata.git/log
Jason Ish [Fri, 2 May 2025 23:01:10 +0000 (17:01 -0600)]
rust/quic: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 22:54:22 +0000 (16:54 -0600)]
rust/ike: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 22:29:42 +0000 (16:29 -0600)]
rust/http2: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 22:16:24 +0000 (16:16 -0600)]
rust/modbus: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 21:53:51 +0000 (15:53 -0600)]
rust/sip: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 17:38:26 +0000 (11:38 -0600)]
rust/tftp: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 17:33:55 +0000 (11:33 -0600)]
rust/telnet: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 17:27:20 +0000 (11:27 -0600)]
rust/detect: replace rs_ naming with SC
Jason Ish [Fri, 2 May 2025 17:21:57 +0000 (11:21 -0600)]
rust/asn1: replace rs_ naming with SC naming
Jason Ish [Fri, 2 May 2025 17:17:41 +0000 (11:17 -0600)]
rust/krb: rust format
Jason Ish [Fri, 2 May 2025 17:14:40 +0000 (11:14 -0600)]
rust/krb: remove rs_ prefix; visibility fixes
- remove pub/no_mangle where not needed
- replace rs_ naming with SC naming
Jason Ish [Fri, 2 May 2025 17:05:40 +0000 (11:05 -0600)]
rust/dns: rs_ prefix name cleanup
Victor Julien [Thu, 1 May 2025 08:29:17 +0000 (10:29 +0200)]
detect/flow: don't overwrite hook direction
Victor Julien [Tue, 29 Apr 2025 12:45:47 +0000 (14:45 +0200)]
firewall: apply action again for stateful matches
For "stateful rules", don't drop packets after the initial match as long
as the tx state doesn't change.
An example of how this could happen was:
accept:hook ssh:request_started any any -> any any (alert; sid:2000;)
accept:hook ssh:request_banner_wait_eol any any -> any any (alert; sid:2001;)
accept:hook ssh:request_banner_done any any -> any any ( \
ssh.software; content:"OpenSSH_8.2p1"; alert; sid:2002;)
As the ssh session reached the request_banner_done state, it would
remain in this state. So additional packets would again review the rules
for this state. The rule 2002 is stored in the tx state as fully
matched, and would be skipped for the additional packets. This meant
that the `accept:hook` action was not applied and the default drop
policy was triggered.
This is addressed by updating the stateful logic:
If an accept rule has the DE_STATE_FLAG_FULL_INSPECT flag set, and the
tx progress is not progressed beyond the rule, apply the rule accept
acction.
Victor Julien [Tue, 29 Apr 2025 12:45:07 +0000 (14:45 +0200)]
firewall: move app action setting into helper func
In preparation of adding another callsite.
dependabot[bot] [Thu, 1 May 2025 19:59:40 +0000 (19:59 +0000)]
github-actions: bump actions/download-artifact from 4.2.1 to 4.3.0
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/
95815c38cf2ff2164869cbab79da8d1f422bc89e ...
d3f86a106a0bac45b974a628896c90dbdf5c8093 )
---
updated-dependencies:
- dependency-name: actions/download-artifact
dependency-version: 4.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Thu, 1 May 2025 19:59:36 +0000 (19:59 +0000)]
github-actions: bump github/codeql-action from 3.28.13 to 3.28.16
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.16.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.13...v3.28.16)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 3.28.16
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Thu, 1 May 2025 19:59:20 +0000 (19:59 +0000)]
github-actions: bump codecov/codecov-action from 5.4.0 to 5.4.2
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.0 to 5.4.2.
- [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/
0565863a31f2c772f9f0395002a31e3f06189574 ...
ad3126e916f78f00edff4ed0317cf185271ccc2d )
---
updated-dependencies:
- dependency-name: codecov/codecov-action
dependency-version: 5.4.2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Jason Ish [Thu, 1 May 2025 16:10:34 +0000 (10:10 -0600)]
doc/devguide: document the rate filter callback
Ticket: #7673
Jason Ish [Thu, 1 May 2025 15:37:41 +0000 (09:37 -0600)]
doc: add rst header order recommendation
Ticket: #7396
Jason Ish [Tue, 22 Apr 2025 23:15:12 +0000 (17:15 -0600)]
detect: add callback for when rate filter changes action
This callback will be called when alert action has been changed due to a
rate filter. The user can then reset or customize the action in their
callback per their own logic.
As the callback is added to the current detection engine, make sure its
copied to the new detection engine on reload.
Ticket: #7673
Jason Ish [Tue, 22 Apr 2025 18:55:51 +0000 (12:55 -0600)]
decode: documentation group for packet alert flags
As #define's like this can't be logically grouped into an enum, try
Doxygen documentation groups, which create a group just of these flag
values and documents them together on a page.
Jason Ish [Tue, 22 Apr 2025 18:23:14 +0000 (12:23 -0600)]
decode: use BIT macros for flags; consistent naming
Use the BIT_U8 macros for packet alert flags and rename
PACKET_ALERT_RATE_FILTER_MODIFIED to
PACKET_ALERT_FLAG_RATE_FILTER_MODIFIED for consistency.
Victor Julien [Fri, 2 May 2025 13:00:04 +0000 (15:00 +0200)]
detect/ftpbounce: reuse generic hook
Victor Julien [Thu, 1 May 2025 21:47:00 +0000 (23:47 +0200)]
ftp: per direction tx progress
For request side, having a tx means the request is done.
For response, wait for tx to be marked complete.
Remove unused states.
Jason Ish [Fri, 2 May 2025 15:23:54 +0000 (09:23 -0600)]
github-ci: pin bindgen test to bindgen v0.66.0
Jason Ish [Thu, 1 May 2025 22:42:23 +0000 (16:42 -0600)]
doc/userguide: fix typo in lua flowvar lib
Was importing suricata.flow, not suricata.flowvar.
Jason Ish [Thu, 1 May 2025 22:33:19 +0000 (16:33 -0600)]
lua: convert lua flowint functions to lib: suricata.flowintlib
Ticket: #7487
Jason Ish [Wed, 30 Apr 2025 16:23:38 +0000 (10:23 -0600)]
build: separate private headers from installed headers
Create a new list of headers for headers that should never be
installed, such as private headers that should only be available
within the Suricata project.
For now, just the util-device-private.h belongs to this set.
Jason Ish [Mon, 28 Apr 2025 17:34:32 +0000 (11:34 -0600)]
examples: add simple c++ example
For now just used to make sure a C++ variation of our custom example
can build.
Jason Ish [Tue, 29 Apr 2025 18:01:36 +0000 (12:01 -0600)]
util-device: break into public and private definitions
util-device.h exposes some details that are particularly problematic
for C++, even when wrapped in 'extern "C"'. To address this, break the
header into public and private parts. The public part exposes
LiveDevice as an opaque data structure, while the private header has
the actual definition.
The idea is that only Suricata C source files should include the
private header, it should not be re-included in any other header
file. And this is the header library users should use, however we
don't enforce it with tecnical means, a library user could still
include the private header, but the clue there is in the name.
Jason Ish [Mon, 28 Apr 2025 18:43:17 +0000 (12:43 -0600)]
device: move LiveDeviceName from header into source
This data structure is only used by the C file and has no reason to be
exposed in the header.
Jason Ish [Mon, 28 Apr 2025 18:20:38 +0000 (12:20 -0600)]
libsuricata-config: fix static library dependency order
When static linking we have a circular dependency between
libsuricata_rust, and libsuricata_c, so we have to list each twice.
An alternative is to use "-Wl,--start-group", but that isn't portable
outside the GNU toolchain.
Jason Ish [Mon, 28 Apr 2025 18:13:41 +0000 (12:13 -0600)]
libsuricata-config: fix type (status -> static)
Jason Ish [Mon, 28 Apr 2025 17:34:56 +0000 (11:34 -0600)]
misc: add c++ support to some headers
For now, just the headers required by our examples.
Jason Ish [Mon, 28 Apr 2025 17:18:03 +0000 (11:18 -0600)]
misc: only define _GNU_SOURCE if not defined
C++ compilers on Linux (g++, clang++) appear to always define this.
Victor Julien [Wed, 30 Apr 2025 13:10:50 +0000 (15:10 +0200)]
threads: rename function to make scope more clear
SCTmThreadsSlotPktAcqLoopFinish ss now used outside of
just pktacq as well.
Victor Julien [Wed, 30 Apr 2025 08:20:10 +0000 (10:20 +0200)]
threads: fix autofp shutdown race condition
Sometimes a single flow pcap would log 2 flows. It turns out FlowWorkToDoCleanup
ran before all the packet threads had processed their "wire" packets. It then
removed a flow that a wire packet would still have needed, leading to the worker
thread creating a new flow for it.
This could happen due to the logic in TmThreadDisableReceiveThreads which calls
TmThreadDrainPacketThreads to made sure it only returns when all autofp-workers
have processed all the packets the autofp-capture thread fed to them.
However, the way it checked this is by checking the size of the autofp-worker's
input queue. If 0, it assumes it is done.
What this missed, is that a worker thread could have just taken the last packet
from the input queue, but it is not yet done processing it. If then the
FlowWorkToDoCleanup is ran as well, it would race the worker thread to the flow
handling logic. When it won, the flow was evicted and the packet thread
created a new flow.
This patch improves the shutdown logic to force the worker threads to
enter a "flow loop" (THV_FLOW_LOOP) state before moving on to the
FlowWorkToDoCleanup step. This makes sure that any in progress packets
in the worker threads have been processed.
Bug: #7681.
Victor Julien [Wed, 30 Apr 2025 07:10:32 +0000 (09:10 +0200)]
threads: remove unused flag
Philippe Antoine [Mon, 28 Apr 2025 12:23:03 +0000 (14:23 +0200)]
lua: convert hassh function into suricata.hassh lib
Ticket: 7603
We use suricata.ssh lib but also enable hassh.
Jason Ish [Tue, 29 Apr 2025 17:26:46 +0000 (11:26 -0600)]
lua/flowvarlib: fix unchecked null
Use checkudata, instead of testudata which won't return in case of
NULL, but raise an error in the Lua script.
Fixes:
** CID
1646748 : Null pointer dereferences (NULL_RETURNS)
/src/util-lua-flowvarlib.c: 89 in LuaFlowvarValue()
Jason Ish [Tue, 29 Apr 2025 17:24:49 +0000 (11:24 -0600)]
lua/flowvarlib: fix formatting inside clang-format off
Jeff Lucovsky [Tue, 29 Apr 2025 12:56:41 +0000 (08:56 -0400)]
gen/typo: Correct configure output grammar
Fixup the grammar for the Napatech option -- was "Enabled Napatech".
Philippe Antoine [Mon, 28 Apr 2025 13:27:00 +0000 (15:27 +0200)]
detect/single-buf: helper with more explicit direction
Philippe Antoine [Tue, 22 Apr 2025 13:42:31 +0000 (15:42 +0200)]
rust: bindgen detect-engine-buffer.h
Ticket: 7667
And prefix SCDetectBufferSetActiveList to be exported
Allows less use of suricata crate in plugin as we get the functions
prototypes from suricata_sys and they are more correct.
Philippe Antoine [Tue, 22 Apr 2025 13:11:22 +0000 (15:11 +0200)]
src: new file detect-engine-buffer.h
Taken from detect-engine.h so that we can bindgen this smaller
unit.
Philippe Antoine [Mon, 28 Apr 2025 08:44:09 +0000 (10:44 +0200)]
sdp: use rust join
It is much faster as it does not do an allocation for each element
Philippe Antoine [Mon, 28 Apr 2025 08:11:13 +0000 (10:11 +0200)]
websocket: limit allocation for small sizes
Fixes: 16f74c68aaa9 ("websocket: use max window bits of 15")
We do not need to allocate 8kbytes for a small message
Jason Ish [Thu, 24 Apr 2025 18:11:28 +0000 (12:11 -0600)]
lua: convert flowvar functions to lib
New Lua lib, "suricata.flowvar" for working with flowvars from Lua.
Replaces functions:
- SCFlowvarGet (and ScFlowvarGet)
- SCFlowvarSet (and SCFlowvarSet)
Of note, the DetectLuaData has been made available to the init and
thread_init methods, instead of just the match. This is due to an
issue that if a flow variable is not registered in init, it will not
be logged, registering in thread_init is too late.
Ticket: #7486
Philippe Antoine [Tue, 22 Apr 2025 18:51:18 +0000 (20:51 +0200)]
doc/ssh: document hooks
Ticket: 7607
Philippe Antoine [Fri, 18 Apr 2025 11:46:27 +0000 (13:46 +0200)]
detect: flow friendly error on hook incompatibility
Philippe Antoine [Tue, 15 Apr 2025 12:41:37 +0000 (14:41 +0200)]
ssh: rustfmt
Philippe Antoine [Thu, 3 Apr 2025 14:25:19 +0000 (16:25 +0200)]
lua: convert ssh function into suricata.ssh lib
Ticket: 7607
Philippe Antoine [Tue, 15 Apr 2025 12:28:51 +0000 (14:28 +0200)]
ssh: make hooks available
Allows signature like `alert ssh:request_banner_done`
Philippe Antoine [Tue, 15 Apr 2025 12:12:19 +0000 (14:12 +0200)]
rust: derive for AppLayerState
To enable easily hooks for rust app-layers such as SSH
Philippe Antoine [Tue, 15 Apr 2025 11:48:41 +0000 (13:48 +0200)]
dns/lua: remove now unused includes
Completes commit
1206c1c5af95479e8fd32f199bc7bfd3bafc56de
Jeff Lucovsky [Thu, 24 Apr 2025 12:47:32 +0000 (08:47 -0400)]
ftp: Apply rustfmt changes
Jeff Lucovsky [Sat, 19 Apr 2025 13:49:45 +0000 (09:49 -0400)]
doc/ftp: Document ftp.dynamic_port keyword
Document the sticky buffer for ftp.dynamic_port
Jeff Lucovsky [Thu, 24 Apr 2025 12:46:13 +0000 (08:46 -0400)]
detect/ftp: Add ftp.dynamic_port keyword
Issue: 7504
Add implementation of the ftp.dynamic_port rule keyword. The
implementation uses the U16 integer matching/parsing and thus supports
the comparison operations such as <, >, <=, >=, !, !=, and range (-).
Jeff Lucovsky [Thu, 24 Apr 2025 12:32:58 +0000 (08:32 -0400)]
app/ftp: Use common API naming
Modify the Rust API functions to conform to project naming format:
SCFTP*
Issue: 7504
Philippe Antoine [Tue, 22 Apr 2025 12:31:47 +0000 (14:31 +0200)]
detect/multi-buf: helper with more explicit direction
Philippe Antoine [Tue, 22 Apr 2025 12:21:05 +0000 (14:21 +0200)]
detect/multi-buf: use only one progress
for both inspect engine and app-layer mpm
Philippe Antoine [Tue, 22 Apr 2025 07:28:32 +0000 (09:28 +0200)]
detect/multi-buf: harmonize wrapper
Introduce DetectGetMultiData which does the generic wrapping,
including the transforms.
And let each keyword do just the getter.
Victor Julien [Wed, 23 Apr 2025 08:23:43 +0000 (10:23 +0200)]
github-ci: update to Fedora 42
Philippe Antoine [Tue, 22 Apr 2025 19:15:53 +0000 (21:15 +0200)]
app-layer: remove obsolete NULL check
Completes commit
833a738dd1429f63c79d95edf25bb86fcc15b51a
Fixes coverity
1646610
Jason Ish [Tue, 22 Apr 2025 16:43:12 +0000 (10:43 -0600)]
doc/userguide: document that lua dns rules need hooks
And remove the old "keywords" that a lua Rule can register with for
DNS.
Jason Ish [Thu, 10 Apr 2025 22:52:40 +0000 (16:52 -0600)]
lua: fix fast.lua example
This one is a little different as it logs to a file, and is the same
fast.lua used in the new Suricata-Verify test.
Ticket: #7656
Jason Ish [Wed, 9 Apr 2025 21:19:29 +0000 (15:19 -0600)]
lua: add suricata.rule library
Add a "suricata.rule" library for accessing rule information from a
Lua rule, or a Lua output script.
This lib replaces the following global Lua functions:
- SCRuleIds
- SCRuleAction
- SCRuleMsg
- SCRuleClass
Ticket: #7490
Jason Ish [Thu, 10 Apr 2025 22:08:08 +0000 (16:08 -0600)]
doc/lua/dns: fix typo
Philippe Antoine [Mon, 21 Apr 2025 19:54:48 +0000 (21:54 +0200)]
rust: use pure rust helper for registering sticky buffers
Mark sdp and sip keywords with flags SIGMATCH_INFO_STICKY_BUFFER
as a side effect.
Philippe Antoine [Sat, 19 Apr 2025 18:57:18 +0000 (20:57 +0200)]
plugin: applayer: do not use suricata JsonError
We do not need a specific error type
Philippe Antoine [Fri, 18 Apr 2025 19:16:29 +0000 (21:16 +0200)]
http: fail tx creation if we cannot allocate user data
So, we always have a libhtp.rs htp_tx_t and a Suricata tx
with its AppLayerTxData
Thus AppLayerParserGetTxData cannot return NULL
Ticket: 5739
Philippe Antoine [Mon, 21 Apr 2025 19:21:06 +0000 (21:21 +0200)]
rust/htp: remove unused code
Philippe Antoine [Mon, 21 Apr 2025 19:16:38 +0000 (21:16 +0200)]
websocket: fixes substraction
Fixes: 16f74c68aaa9 ("websocket: use max window bits of 15")
Victor Julien [Sun, 20 Apr 2025 13:58:51 +0000 (15:58 +0200)]
github-ci: codecov llvm updates
Use LLVM 15 with Rust 1.67.1
Victor Julien [Sun, 20 Apr 2025 13:57:22 +0000 (15:57 +0200)]
github-ci: update codecov unittest job
LLVM 19, rust 1.85.1 and Ubuntu 24.04.
Philippe Antoine [Sat, 19 Apr 2025 19:28:16 +0000 (21:28 +0200)]
dnp3: mark tx as updated when creating it
Ticket: 7668
We should set updated_tx when allocating a dnp3 tx
Philippe Antoine [Sat, 19 Apr 2025 19:27:01 +0000 (21:27 +0200)]
ftp: mark tx as updated when creating it
Ticket: 7668
We should set updated_tx when allocating a ftp tx
Was already done right for updated_tc
Philippe Antoine [Sat, 19 Apr 2025 19:21:31 +0000 (21:21 +0200)]
http1: always mark tx as updated on request/response start
Ticket: 7668
We should set updated_tx when allocating HtpTxUserData
Philippe Antoine [Mon, 17 Feb 2025 20:13:54 +0000 (21:13 +0100)]
detect: rust helper to register sticky buffer
Philippe Antoine [Mon, 17 Feb 2025 20:41:56 +0000 (21:41 +0100)]
detect: rename SCSigTableElmt to SCSigTableAppLiteElmt
Philippe Antoine [Wed, 5 Mar 2025 16:26:49 +0000 (17:26 +0100)]
detect: remove never set SIGMATCH_NOT_BUILT
Philippe Antoine [Thu, 6 Feb 2025 12:35:42 +0000 (13:35 +0100)]
unittests: more realistic packet from UTHBuildPacketReal
So that its contents can be reused when translating unit tests
to SV tests
Philippe Antoine [Sun, 26 Jan 2025 14:46:34 +0000 (15:46 +0100)]
detect/dns: support string for dns.rrtype
Ticket: 6723
Philippe Antoine [Sun, 26 Jan 2025 14:35:24 +0000 (15:35 +0100)]
detect/dns: support string for dns.rcode
Ticket: 6723
Philippe Antoine [Sun, 26 Jan 2025 14:16:03 +0000 (15:16 +0100)]
detect/dns: move keywords to rust
Ticket: 7529
Ticket: 3725
Adds url for dns.opcode on the way
Philippe Antoine [Tue, 15 Apr 2025 19:08:01 +0000 (21:08 +0200)]
detect: new helper to register multi-buffer with progress
This allows to use these engines for hook rules needing exact
progress (checked in SigValidate)
Philippe Antoine [Tue, 15 Apr 2025 14:40:44 +0000 (16:40 +0200)]
ci: rustc wrapper to disable coverage for external crates
To keep the disk usage good even when we use new crates
Philippe Antoine [Fri, 11 Apr 2025 19:56:19 +0000 (21:56 +0200)]
http1: brotli decompression
Ticket: 5692
http2 already used brotli crate for decompression
Philippe Antoine [Fri, 18 Apr 2025 13:17:58 +0000 (15:17 +0200)]
output: fix leak in case of alloc error
CID:
1638290
Philippe Antoine [Fri, 18 Apr 2025 12:52:30 +0000 (14:52 +0200)]
defrag: remove unnecessary NULL check
CID: 727861
Philippe Antoine [Fri, 18 Apr 2025 12:38:48 +0000 (14:38 +0200)]
util/mpm: prevents double free
CID:
1645545
PatternDatabaseGetCached frees cd on success
So, we should NULL it, so that in case PatternDatabaseGetSize fails
and we goto error, we do not free cd again.
Philippe Antoine [Fri, 18 Apr 2025 12:32:27 +0000 (14:32 +0200)]
detect: explicitly skip check on SCConfGet
CID:
1644571
Eric Leblond [Sun, 30 Mar 2025 15:24:35 +0000 (17:24 +0200)]
dox/userguide: add tx_cnt documentation
Eric Leblond [Sun, 30 Mar 2025 15:24:06 +0000 (17:24 +0200)]
eve/schema: remove duplicate fields
Eric Leblond [Mon, 20 Jan 2025 10:17:21 +0000 (11:17 +0100)]
eve/flow: log tx_cnt
This patch adds a `tx_cnt` field to `netflow` events to give some
context about the underlying protocol activity.
Ticket: #7635
Eric Leblond [Fri, 24 Jan 2025 13:44:34 +0000 (14:44 +0100)]
eve/netflow: add tx_cnt
This patch adds a `tx_cnt` field to `netflow` events to give some
context about the underlying protocol activity.
Ticket: #7635
Eric Leblond [Wed, 19 Jan 2022 13:56:06 +0000 (14:56 +0100)]
eve/smb: add tx_id to event
As SMB protocol is using heavily transactions, getting the transaction
ID in SMB events can be really useful for automated analysis.
Philippe Antoine [Thu, 3 Apr 2025 08:49:38 +0000 (10:49 +0200)]
websocket: use max window bits of 15
Ticket: 7285
As this is the default for websocket, which is bigger than the
defaut for zlib usage
Also limit the decompressed content to the max-payload-size
configuration parameter also used for non-compressed content.
And also use a stateful decoder to store/remember the compression
state to be able to decompress later messages.
Philippe Antoine [Thu, 3 Apr 2025 08:47:48 +0000 (10:47 +0200)]
rust: use flate2 with C zlib
move flate2.rs to a backend supporting the setting
of window_bits, which is not the case for miniz-oxide.
This will allow WebSocket to use Sec-WebSocket-Extensions
which can set a non-default window_bits