]>
git.ipfire.org Git - thirdparty/suricata.git/log
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
Philippe Antoine [Thu, 27 Mar 2025 21:33:30 +0000 (22:33 +0100)]
websocket: decompress single pdu message
Ticket: 7285
Previously, only messages over multiple PDUs could get decompressed
Jeff Lucovsky [Mon, 14 Apr 2025 20:07:24 +0000 (16:07 -0400)]
output/rotate: Remove extra rotation flag register
Issue: 3436
Remove duplicate register of the rotation flag. Eventually, this will
cause corruption when the file context has been freed and the rotation
flag is deregistered.
Jeff Lucovsky [Mon, 14 Apr 2025 20:06:08 +0000 (16:06 -0400)]
output/rotate: Serialize rotation flag handling
Issue: 3436
Serialize rotation flag handling to avoid corruption.
Alice Akaki [Wed, 9 Apr 2025 21:43:42 +0000 (17:43 -0400)]
detect: add email.received keyword
email.received matches on MIME EMAIL Received
This keyword maps to the EVE field email.received[]
It is a sticky buffer
Supports multiple buffer matching
Supports prefiltering
Ticket: #7599
James [Sun, 7 Jul 2024 17:43:02 +0000 (18:43 +0100)]
doc: Update bypass docs to use new keyword format
Ticket: #7143
Update documentation to reflect new sticky buffer keyword format
Victor Julien [Fri, 11 Apr 2025 14:59:05 +0000 (16:59 +0200)]
detect/app-layer-protocol: allow matching on 'unknown'
Victor Julien [Fri, 11 Apr 2025 08:22:20 +0000 (10:22 +0200)]
firewall: detect: set firewall support flag on select keywords
Victor Julien [Fri, 11 Apr 2025 08:21:54 +0000 (10:21 +0200)]
firewall: detect: add feature flag for keywords supporting firewall
Victor Julien [Fri, 11 Apr 2025 04:43:48 +0000 (06:43 +0200)]
firewall: detect: set per rule table
For firewall mode, set the pseudo table in the rule and use this
in alert queue ordering, so that rule actions are applied in the
expected order:
packet:filter -> packet:td -> app:filter -> app:td
This makes sure that a packet:td drop is applied before a app:filter
accept.
Victor Julien [Fri, 11 Apr 2025 04:45:40 +0000 (06:45 +0200)]
detect: don't set conflicting packet/flow actions
If for the same a packet a drop rule and a pass rule would match,
the applying of actions could be contradictionary:
- the drop would be applied to the packet
- the pass rule would also be considered, not overriding the drop,
but still setting the flow pass flag.
This would lead to the packet being dropped, but the rest of the
flow getting passed, including retransmissions of the dropped
packet.
This patch only sets drop/pass actions if no conflicting action
has been set on the packet before. It respects the action-order.
Bug: #7653.
Victor Julien [Fri, 11 Apr 2025 04:44:58 +0000 (06:44 +0200)]
firewall: detect: add explanation
Victor Julien [Thu, 10 Apr 2025 08:16:51 +0000 (10:16 +0200)]
detect/alert: minor cleanup
Alice Akaki [Wed, 9 Apr 2025 19:10:43 +0000 (15:10 -0400)]
detect: add email.url keyword
email.url matches on URLs extracted from an email
This keyword maps to the EVE field email.url[]
Supports multiple buffer matching
Supports prefiltering
Ticket: #7597
Jason Ish [Wed, 9 Apr 2025 20:33:17 +0000 (14:33 -0600)]
rust/htp: remove authors; fix homepage
Remove the authors field as it is deprecated.
Update the repository page to the Suricata repository.
Remove the homepage, it can be found via the reposistory page.
Jason Ish [Wed, 9 Apr 2025 15:57:48 +0000 (09:57 -0600)]
htp: rename to suricata-htp; allow publishing to crates.io
As the "suricata" crate depends on htp, we need to publish htp to
crates.io first, however "htp" name is already taken. So rename "htp" to
"suricata-htp".
Jason Ish [Wed, 9 Apr 2025 15:55:30 +0000 (09:55 -0600)]
suricatactl: add description to Cargo.toml
For publishing to crates.io.
Jason Ish [Thu, 10 Apr 2025 15:12:35 +0000 (09:12 -0600)]
rust: always update Cargo.lock.in
On a normal project where the Cargo.lock is checked in, it would be
normal to see an updated Cargo.lock in git status and the like. As we
use autoconf to generate this file, we should just copy it back to the
input file so we get the same convenience of seeing when it is
updated, which usually means it needs to be checked in.
However, to satisfy "make distcheck", only copy it if the input
template exists, if the input template does not exist we are in an out
of tree build.
Shivani Bhardwaj [Thu, 10 Apr 2025 13:29:36 +0000 (18:59 +0530)]
workflows: use aggressive-cleanup option w s-v
on the Fedora 41 + codecov job to avoid running out of disk space.
Jason Ish [Wed, 9 Apr 2025 15:15:38 +0000 (09:15 -0600)]
configure: pickup pre-release versions from changelog
Pickup release versions like 8.0.0-beta1 and 8.0.0-rc1 from the
ChangeLog. This version is used in the generated documentation.
Victor Julien [Tue, 8 Apr 2025 04:34:22 +0000 (06:34 +0200)]
github-actions: f41 codecov improvements
Add missing gpg package.
Reduce disk space usage.
Victor Julien [Tue, 8 Apr 2025 18:19:36 +0000 (20:19 +0200)]
detect/domain: move transform fully to rust
Victor Julien [Tue, 8 Apr 2025 18:05:22 +0000 (20:05 +0200)]
detect/prefilter: fix coverity issue
** CID
1646448 : Null pointer dereferences (NULL_RETURNS)
/src/detect-engine-prefilter.c: 944 in SetupNonPrefilter()
________________________________________________________________________________________________________
*** CID
1646448 : Null pointer dereferences (NULL_RETURNS)
/src/detect-engine-prefilter.c: 944 in SetupNonPrefilter()
938 const DetectBufferType *buf = DetectEngineBufferTypeGetById(de_ctx, list_id);
939 /* for now, exclude app-layer-events, as they are not tied to a specific
940 * progress value like other keywords. */
941 SCLogDebug("list_id %d buf %p", list_id, buf);
942 if (list_id == app_events_list_id)
943 continue;
>>> CID
1646448 : Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing "buf", which is known to be "NULL".
944 if (buf->packet) {
945 SCLogDebug("packet buf");
946 /* packet is handled below */
947 pkt_non_pf = true;
948 } else if (buf->frame) {
949 for (DetectEngineFrameInspectionEngine *f = de_ctx->frame_inspect_engines;
Jason Ish [Tue, 8 Apr 2025 21:29:03 +0000 (15:29 -0600)]
log-pcap: error out if malloc fails for bpf filter
Jason Ish [Tue, 8 Apr 2025 14:33:52 +0000 (08:33 -0600)]
doc/userguide: type in pfring upgrade notes
Jason Ish [Tue, 8 Apr 2025 21:21:13 +0000 (15:21 -0600)]
version: start development towards 8.0.0-rc1
Shivani Bhardwaj [Tue, 8 Apr 2025 12:36:59 +0000 (18:06 +0530)]
release: 8.0.0-beta1; update changelog
Victor Julien [Tue, 8 Apr 2025 08:15:07 +0000 (10:15 +0200)]
lua: enable lua rules by default
Now that sandboxing is in place, lua rule support is enabled by default.
Alice Akaki [Sun, 2 Mar 2025 23:41:26 +0000 (19:41 -0400)]
detect: add ldap.responses.attribute_type
ldap.responses.attribute_type matches on LDAP attribute type/description
This keyword maps the eve field ldap.responses[].search_result_entry.attributes[].type
It is a sticky buffer
Supports multiple buffer matching
Supports prefiltering
Ticket: #7533
Alice Akaki [Thu, 13 Feb 2025 05:18:37 +0000 (01:18 -0400)]
detect: add ldap.request.attribute_type
ldap.request.attribute_type matches on LDAP attribute type/description
This keyword maps the following eve fields:
ldap.request.search_request.attributes[]
ldap.request.modify_request.changes[].modification.attribute_type
ldap.request.add_request.attributes[].name
ldap.request.compare_request.attribute_value_assertion.description
It is a sticky buffer
Supports multiple buffer matching
Supports prefiltering
Ticket: #7533
Alice Akaki [Fri, 4 Apr 2025 01:24:14 +0000 (21:24 -0400)]
rustfmt: rust/src/ldap/detect.rs
Jeff Lucovsky [Fri, 28 Mar 2025 14:12:59 +0000 (10:12 -0400)]
app/ftp: Eliminate scan-build warning
Scan-build reports that FTPRealloc could be called with size=0. Modify
the logic so it's never passed 0.
Jeff Lucovsky [Fri, 28 Mar 2025 12:55:28 +0000 (08:55 -0400)]
doc/ftp: Document the ftp.reply keyword
Issue: 7508
Jeff Lucovsky [Thu, 27 Mar 2025 14:30:47 +0000 (10:30 -0400)]
detect/ftp: Add ftp.reply rule keyword
Issue: 7508
Add the rule detection keyword "ftp.reply". This is a multi-buffer
command.
Jeff Lucovsky [Fri, 21 Mar 2025 14:01:27 +0000 (10:01 -0400)]
app/ftp: Use Rust FTP response line handling
Use the Rust logic to parse FTP response lines with the goal to support
multi-buffer matches better.
A side effect is that the completion codes are no longer strings; the
schema update reflects this.
Issue: 4082
Jeff Lucovsky [Fri, 21 Mar 2025 13:57:38 +0000 (09:57 -0400)]
app/ftp: Move FTP response handling to rust
Move handling of FTP responses to Rust to improve support for FTP
keyword matching. Parsing the response line when encountered
simplifies multi-buffer matching and metadata output.
Issue: 4082
Juliana Fajardini [Mon, 7 Apr 2025 16:25:08 +0000 (09:25 -0700)]
userguide/pop3: minor typo and formatting fixing
Alex Savage [Mon, 24 Mar 2025 23:41:18 +0000 (23:41 +0000)]
pop3: app-layer parser using sawp-pop3
This module uses the sawp-pop3 crate to parse POP3 requests and responses
Features:
- eve logging
- events for parsable but non-RFC-compliant messages
Ticket: 3243
Eric Leblond [Mon, 31 Mar 2025 14:55:19 +0000 (16:55 +0200)]
doc/userguide: doc domain and tld transforms
Eric Leblond [Wed, 24 Aug 2022 11:57:56 +0000 (13:57 +0200)]
tld: add new transform
Extract the TLD from a buffer.
Ticket: #5639