]>
git.ipfire.org Git - thirdparty/suricata.git/log
Alice Akaki [Thu, 20 Feb 2025 22:32:35 +0000 (18:32 -0400)]
ldap: refactor function aux_ldap_parse_protocol_resp_op
Split code to create a generic function that parses LdapIndex
Alice Akaki [Mon, 10 Feb 2025 15:56:23 +0000 (11:56 -0400)]
ldap: rename DetectLdapRespData struct to be more specific
Alice Akaki [Mon, 3 Mar 2025 22:52:39 +0000 (18:52 -0400)]
ldap: return empty buffer in ldap_tx_get_responses_dn
Funciton ldap_tx_get_responses_dn returns empty buffer in case
the response doesn't contain the distinguished name field
Fixes: 73ae6e997f6c ("detect: add ldap.responses.dn")
Alice Akaki [Fri, 28 Feb 2025 00:09:17 +0000 (20:09 -0400)]
ldap: fix LDAPDN nits
Change variable name 'req' to 'resp' in function ldap_tx_get_responses_dn and documentation nits
Fixes:
73ae6e997f6c ("detect: add ldap.responses.dn")
16dcee46fc8a ("detect: add ldap.request.dn")
Alice Akaki [Mon, 3 Mar 2025 22:57:41 +0000 (18:57 -0400)]
ldap: apply rustfmt
Fixes: 4554c4778d67 ("rust: use AppProto from generated bindings instead of duplicating")
Philippe Antoine [Tue, 4 Mar 2025 10:11:58 +0000 (11:11 +0100)]
ci: fix clusterfuzzlite build
dependabot[bot] [Sat, 1 Mar 2025 19:22:33 +0000 (19:22 +0000)]
github-actions: bump actions/upload-artifact from 4.6.0 to 4.6.1
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/
65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 ...
4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Sat, 1 Mar 2025 19:22:31 +0000 (19:22 +0000)]
github-actions: bump codecov/codecov-action from 5.3.1 to 5.4.0
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.3.1 to 5.4.0.
- [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/
13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 ...
0565863a31f2c772f9f0395002a31e3f06189574 )
---
updated-dependencies:
- dependency-name: codecov/codecov-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Sat, 1 Mar 2025 19:22:28 +0000 (19:22 +0000)]
github-actions: bump github/codeql-action from 3.28.8 to 3.28.10
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.8 to 3.28.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.8...v3.28.10)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Sat, 1 Mar 2025 19:22:13 +0000 (19:22 +0000)]
github-actions: bump actions/download-artifact from 4.1.8 to 4.1.9
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.8 to 4.1.9.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/
fa0a91b85d4f404e444e00e005971372dc801d16 ...
cc203385981b70ca67e1cc392babf9cc229d5806 )
---
updated-dependencies:
- dependency-name: actions/download-artifact
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Sat, 1 Mar 2025 19:22:11 +0000 (19:22 +0000)]
github-actions: bump ossf/scorecard-action from 2.4.0 to 2.4.1
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/
62b2cac7ed8198b15735ed49ab1e5cf35480ba46 ...
f49aabe0b5af0936a0987cfb85d86b75731b0186 )
---
updated-dependencies:
- dependency-name: ossf/scorecard-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Jason Ish [Thu, 27 Feb 2025 21:23:25 +0000 (15:23 -0600)]
mqtt: naming and visibility cleanups
- remove rs_prefix, replace with SC if needed
- remove pub and no_mangle where not needed
- remove some unused functions and fields
Related to ticket: #7498
Jason Ish [Thu, 27 Feb 2025 21:14:38 +0000 (15:14 -0600)]
enip: remove rs_ prefix
Related to ticket: #7498
Jason Ish [Thu, 27 Feb 2025 21:09:12 +0000 (15:09 -0600)]
dcerpc: visibility and naming cleanups
- replace rs_ prefixed names with SC
- remove no_mangle and pub where not needed
- remove some unused functions
Related to ticket: #7498
Jason Ish [Thu, 27 Feb 2025 17:30:07 +0000 (11:30 -0600)]
bittorrent: no_mangle, pub and naming cleanups
- Remove rs_prefix
- Remove no_mangle and pub when not needed
Related to ticket: #7498
Jason Ish [Thu, 27 Feb 2025 17:05:26 +0000 (11:05 -0600)]
rust: use CBINDGEN variable and not "cbindgen"
This uses the cbindgen found during ./configure, and not the one
found on the path during "make", which while often the same, aren't
always the same.
Ticket: #6384
Jason Ish [Thu, 27 Feb 2025 16:02:23 +0000 (10:02 -0600)]
github-ci: re-enable RPM builds
The RPM has been updated to handle the conversion of suricatasc and
suricatactl to Rust.
Also fixes the "if" expression to prevent one job running both upload
sections.
Jeff Lucovsky [Thu, 27 Feb 2025 16:49:05 +0000 (11:49 -0500)]
applayer/ftp: Misc cleanup
Issue: 4082
Small fixups.
Jeff Lucovsky [Thu, 27 Feb 2025 16:48:16 +0000 (11:48 -0500)]
applayer/ftp: Move MPM declaration
This commit moves the MPM fn declaration into core.rs making it
available for other Rust modules.
Issue: 4082
Jeff Lucovsky [Thu, 27 Feb 2025 16:41:53 +0000 (11:41 -0500)]
app-layer/ftp: Fixup state values
Issue: 4082
Fixup the incorrect state values -- they should be the default enum
values to match the pre-Rust implementation.
Jason Ish [Tue, 25 Feb 2025 16:53:44 +0000 (10:53 -0600)]
github-ci: skip rpm builds for now
RPMs will need to be fixed after merge.
Jason Ish [Tue, 11 Feb 2025 23:09:23 +0000 (17:09 -0600)]
github-ci: add var to disable rpm builds
There will be changes in our development branch that the RPMs need to
adapt to, but that can't be done until the changes have been merged to
master, then the RPM can catchup.
This gives us a single variable to turn off RPM building.
Jason Ish [Mon, 10 Feb 2025 22:09:23 +0000 (16:09 -0600)]
doc: add upgrade note about suricatasc and suricatactl
Jason Ish [Mon, 10 Feb 2025 21:21:20 +0000 (15:21 -0600)]
dist: include generate-evedoc.sh
Without this script `make distcheck` fails on a system with
documentation tooling installed, as its required to build the EVE
appendix.
Jason Ish [Mon, 10 Feb 2025 19:47:57 +0000 (13:47 -0600)]
github-ci: add check for update to date Cargo.lock.in
After a build, check if Cargo.lock.in and Cargo.lock differ, if so,
Cargo.lock.in needs an update as part of a depedency update.
Jason Ish [Thu, 6 Feb 2025 21:12:39 +0000 (15:12 -0600)]
doc: remove python references related to suricatasc
These should probably be removed even without the rewrite, and
suricatasc has been installed as a proper program for many releases.
Jason Ish [Sun, 22 Dec 2024 16:46:28 +0000 (10:46 -0600)]
qa: fix suricatasc path
Jason Ish [Thu, 16 Nov 2023 22:19:23 +0000 (16:19 -0600)]
python: remove python implementation of suricatasc/suricatactl
Jason Ish [Tue, 27 Jun 2023 06:28:07 +0000 (00:28 -0600)]
suricatactl: rust version of suricatactl
Jason Ish [Thu, 4 May 2023 17:40:13 +0000 (11:40 -0600)]
github-ci: do one Windows build from dist archive
As we have 2 Windows builds, do one using the release-style
distribution file.
Jason Ish [Fri, 3 Mar 2023 14:54:07 +0000 (08:54 -0600)]
suricatasc: a Rust implementation of suricatasc
This is a re-implementation of suricatasc program in Rust that
attempts to be a 100% drop-in replacement.
Jason Ish [Mon, 24 Feb 2025 22:47:28 +0000 (16:47 -0600)]
rust: remove allow of static mutables
As references to static mutables are highly discouraged, remove the
global suppressing of the compiler warning. Each use case can be
suppressed as needed.
Ticket: #7417
Jason Ish [Wed, 26 Feb 2025 15:29:40 +0000 (09:29 -0600)]
smb: wrap read access to static mutables in function
Simply wrapping in a function removes static_mut_refs compiler
warning.
Ticket: #7417
Jason Ish [Tue, 25 Feb 2025 16:18:12 +0000 (10:18 -0600)]
smtp: suppress static_mut_refs where needed
Allows us to get rid of the global supression.
Ticket: #7417
Jason Ish [Tue, 25 Feb 2025 16:15:57 +0000 (10:15 -0600)]
smtp: remove SCMimeSmtpConfigExtractUrlsSchemeReset
It doesn't appear to be needed. The vec being cleared is only set once
per run, so never needs to be cleared.
Removes one point where we have to supress the static_mut_refs compiler
warning.
Ticket: #7417
Philippe Antoine [Tue, 25 Feb 2025 20:14:51 +0000 (21:14 +0100)]
dns: move unit tests to suricata-verify
Ticket: 3725
Ticket: 7529
Jeff Lucovsky [Sat, 7 Oct 2023 21:08:27 +0000 (17:08 -0400)]
main/flush: Support periodic flush logs
Issue: 3449
Jeff Lucovsky [Sat, 7 Oct 2023 21:06:52 +0000 (17:06 -0400)]
detect/flag: Pseudo pkt "flush log" flag
Issue: 3449
Add a flush directive to the packet that is distinct from the existing
"log flush" flag as the new flag is to distinguish between the 2 use
cases.
Jeff Lucovsky [Tue, 30 Apr 2024 14:44:54 +0000 (10:44 -0400)]
output/log: Add flushing infrastructure
Issue: 3449
Add flushing functions and infrastructure. This includes:
- Flushing functions for packet loggers
- Log file flushing support
Jeff Lucovsky [Mon, 2 Oct 2023 15:01:45 +0000 (11:01 -0400)]
output: Support buffer-size value
Issue: 3449
Jeff Lucovsky [Sat, 14 Oct 2023 13:00:14 +0000 (09:00 -0400)]
doc/output: EVE output buffering related settings
Jeff Lucovsky [Mon, 2 Oct 2023 15:00:46 +0000 (11:00 -0400)]
conf/output: Buffering related config settings
This commit adds 2 EVE output buffering settings
- buffer-size value which specifies the amount of buffering, if any,
for regular/file output types.
- flush-interval Specifies the cadence at which Suricata will direct
detect threads to flush EVE output.
Issue: 3449
Jeff Lucovsky [Tue, 30 Apr 2024 13:45:25 +0000 (09:45 -0400)]
output/log: Add flush function, collapse params
Issue: 3449
Add a flush function to packet logger registration and collapse the
parameter count for registration functions.
Philippe Antoine [Tue, 25 Feb 2025 09:12:48 +0000 (10:12 +0100)]
flow: remove unused definition
Fixes: 3f3964555e4e ("detect/iponly: use flow first flags")
Victor Julien [Sun, 23 Feb 2025 11:04:17 +0000 (12:04 +0100)]
detect/alert: optimize no-alert path
Skip qsort call if no alerts are queued. Move logic into inline helper func.
Victor Julien [Sun, 23 Feb 2025 11:03:03 +0000 (12:03 +0100)]
detect: constify arguments
Victor Julien [Mon, 11 Sep 2023 15:04:15 +0000 (17:04 +0200)]
detect/tx: improve branch prediction
Victor Julien [Mon, 11 Sep 2023 07:22:16 +0000 (07:22 +0000)]
app-layer: optimize pstate check
To assist branch prediction, which showed a 100% miss rate, assume pstate
is non-NULL. Code review suggests all paths leading to the function actually
check pstate first, or alstate which can only be non-NULL if pstate was first
initialized. For now add a debug check.
Victor Julien [Mon, 11 Sep 2023 07:21:47 +0000 (07:21 +0000)]
threads/flow: assist branch prediction
Victor Julien [Mon, 11 Sep 2023 07:21:28 +0000 (07:21 +0000)]
detect/pmq: assist branch prediction
Jeff Lucovsky [Sun, 2 Feb 2025 16:10:59 +0000 (11:10 -0500)]
ftp: Move config file handling to Rust
Issue: 4082
Move the configuration file handling to Rust.
These changes will no longer terminate Suricata when there's an invalid
value for ftp.memcap. Like earlier Suricata releases, an error message
is logged "Invalid value <value> for ftp.memcap" but Suricata will no
longer terminate execution. It will use a default value of "0" instead.
Jeff Lucovsky [Sun, 2 Feb 2025 14:12:59 +0000 (09:12 -0500)]
ftp: convert enumerations to Rust
As part of the effort to convert the FTP/FTPDATA parser to rust, move
the enums from C to rust.
Issue: 4082
Philippe Antoine [Thu, 20 Feb 2025 22:36:27 +0000 (23:36 +0100)]
dcerpc: consume bytes after gap resync
Ticket: 7567
After a gap, we search a new record that may start later than
the beginning of current stream slice.
If so, consume the first bytes before the start of the record,
so that AppLayerResult::incomplete can be consistent and not
trigger assertion !((res.needed + res.consumed < input_len))
Philippe Antoine [Fri, 21 Feb 2025 10:22:27 +0000 (11:22 +0100)]
rust: fix clippy 1.85 precedence warnings
warning: operator precedence can trip the unwary
--> src/jsonbuilder.rs:781:36
|
781 | buf[offset] = HEX[(x >> 4 & 0xf) as usize];
| ^^^^^^^^^^^^ help: consider parenthesizing your expression: `(x >> 4) & 0xf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
= note: `#[warn(clippy::precedence)]` on by default
Philippe Antoine [Fri, 21 Feb 2025 09:38:06 +0000 (10:38 +0100)]
quic: discard late retry packets
Ticket: 7556
See RFC 9000 section 17.2.5.2 :
After the client has received and processed an Initial
or Retry packet from the server,
it MUST discard any subsequent Retry packets that it receives.
Jeff Lucovsky [Thu, 10 Oct 2024 13:31:12 +0000 (09:31 -0400)]
detect/transform: Refactor setup/apply pattern
git grep -A 1 -w InspectionBufferSetup shows many cases of the following
call patterns:
- InspectionBufferSetup
- InspectionBufferApplyTransforms
Refactor the implementations of those functions into
InspectionBufferSetupAndApplyTransforms to reduce function call count.
Issue: 2290 (related to changed for this issue)
Shivani Bhardwaj [Wed, 19 Feb 2025 07:58:47 +0000 (13:28 +0530)]
dcerpc: add iface to dcerpc request event
so as to avoid extra steps for correlation among events to find
this information.
Feature 7565
Jason Ish [Wed, 19 Feb 2025 21:31:31 +0000 (15:31 -0600)]
rust/bindgen: use temp file to generating bindings
Prefixing a file with sed doesn't appear to be portable. Instead, make
use of a temporary file.
Fixes generating the bindings on FreeBSD and Mac.
Alice Akaki [Thu, 6 Feb 2025 04:16:20 +0000 (00:16 -0400)]
detect: add ldap.responses.dn
ldap.responses.dn matches on LDAPDN from responses operations
This keyword maps the following eve fields:
ldap.responses[].search_result_entry.base_object
ldap.responses[].bind_response.matched_dn
ldap.responses[].search_result_done.matched_dn
ldap.responses[].modify_response.matched_dn
ldap.responses[].add_response.matched_dn
ldap.responses[].del_response.matched_dn
ldap.responses[].mod_dn_response.matched_dn
ldap.responses[].compare_response.matched_dn
ldap.responses[].extended_response.matched_dn
It is a sticky buffer
Supports prefiltering
Ticket: #7471
Alice Akaki [Tue, 4 Feb 2025 02:37:15 +0000 (22:37 -0400)]
detect: add ldap.request.dn
ldap.request.dn matches on LDAPDN from request operations
This keyword maps the following eve fields:
ldap.request.bind_request.name
ldap.request.add_request.entry
ldap.request.search_request.base_object
ldap.request.modify_request.object
ldap.request.del_request.dn
ldap.request.mod_dn_request.entry
ldap.request.compare_request.entry
It is a sticky buffer
Supports prefiltering
Ticket: #7471
Alice Akaki [Wed, 19 Feb 2025 00:00:36 +0000 (20:00 -0400)]
doc: use the ldap protocol in rule examples in the LDAP keywords documentation
Alice Akaki [Tue, 18 Feb 2025 23:56:43 +0000 (19:56 -0400)]
doc: replace 'eve' with 'EVE' in the LDAP keywords documentation
Alice Akaki [Sun, 9 Feb 2025 04:50:25 +0000 (00:50 -0400)]
misc: fix name prefix in detect register functions
Philippe Antoine [Tue, 19 Sep 2023 12:45:47 +0000 (14:45 +0200)]
util: fix -Wshorten-64-to-32 warnings
Ticket: #6186
Philippe Antoine [Wed, 19 Feb 2025 09:08:58 +0000 (10:08 +0100)]
quic: decrypt only initial packets
Ticket: 7556
Avoids failed_decrypt events when the first packet seen is not
a Quic Initial packet
Philippe Antoine [Wed, 19 Feb 2025 12:01:36 +0000 (13:01 +0100)]
quic: handle retry packets
Ticket: 7556
Philippe Antoine [Mon, 17 Feb 2025 10:13:20 +0000 (11:13 +0100)]
quic: handle fragmented hello over multiple packets
Ticket: 7556
To do so, we need to add 2 buffers (one for each direction)
to the QuicState structure, so that on parsing the second packet
with hello/crypto fragment, we still have the data of the first
hello/crypto fragment.
Use a hardcoded limit so that these buffers cannot grow indefinitely
and set an event when reaching the limit
Philippe Antoine [Mon, 17 Feb 2025 14:04:59 +0000 (15:04 +0100)]
quic: parse ack frame number 3
cf rfc9000 section 19.3. ACK Frames
Ticket: 7556
Philippe Antoine [Mon, 17 Feb 2025 10:04:50 +0000 (11:04 +0100)]
quic: move all_consuming check to callee
Will alow to have decode_frames accept one additional parameter
with past fragment data
Philippe Antoine [Mon, 17 Feb 2025 09:27:49 +0000 (10:27 +0100)]
quic: rustfmt
Philippe Antoine [Tue, 18 Feb 2025 20:23:19 +0000 (21:23 +0100)]
htp: macro hygiene
make clang-tidy happy even if unneeded for the temporary workaround
Philippe Antoine [Thu, 6 Feb 2025 15:09:10 +0000 (16:09 +0100)]
http: aliases for htp log code
In preparation of libhtp rust
Philippe Antoine [Thu, 6 Feb 2025 13:51:28 +0000 (14:51 +0100)]
http: constify some variables
In preparation of libhtp rust
Philippe Antoine [Thu, 6 Feb 2025 13:31:40 +0000 (14:31 +0100)]
http: aliases for opaque htp_conn_t
In preparation of libhtp rust
Philippe Antoine [Thu, 6 Feb 2025 13:26:14 +0000 (14:26 +0100)]
http: aliases for opaque htp_tx_data_t
In preparation of libhtp rust
Jason Ish [Tue, 18 Feb 2025 21:15:43 +0000 (15:15 -0600)]
build: use expanded localstatedir for #define
Use the expanded form of localstatedir in autoconf.h instead of the
unexpanded one, the difference being:
#define LOCAL_STATE_DIR "${prefix}/var"
and
#define LOCAL_STATE_DIR "/usr/local/var"
assuming default ./configure arguments.
Fixes commit
b6a610df2669336756c67f77eb857b190b77770a .
Juliana Fajardini [Tue, 18 Feb 2025 20:17:13 +0000 (17:17 -0300)]
pgsql/parser: fix type complexity clippy warning
Cf https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
Juliana Fajardini [Mon, 17 Feb 2025 19:50:38 +0000 (16:50 -0300)]
pgsql/logger: don't log empty transactions
This may happen in some situations if the app-layer parser only sees
unknown messages and sets an event: there will be an empty transaction,
but nothing to log.
Related to
Task #5566
Juliana Fajardini [Mon, 17 Feb 2025 15:06:39 +0000 (12:06 -0300)]
pgsql: add case for Unknown response message state
No state change, but since we added Unknown responses, we should handle
that case -- should we have a specific state for such cases?
Related to
Bug #5524
Task #5566
Juliana Fajardini [Mon, 17 Feb 2025 15:05:09 +0000 (12:05 -0300)]
pgsql: add events
Events for:
- parsing error when parsing pgsql packet length
- parsing error for pgsql requests (post length parsing)
- parsing error for pgsql responses (post length parsing)
- too many transactions
Include `pgsql-events.rules` file, and PGSQL events SID range definition
Task #5566
Juliana Fajardini [Fri, 14 Feb 2025 17:46:00 +0000 (14:46 -0300)]
pgsql/parser: add more debug statements
Juliana Fajardini [Fri, 14 Feb 2025 16:29:33 +0000 (13:29 -0300)]
pgsql: apply rustfmt changes
Juliana Fajardini [Thu, 15 Sep 2022 15:19:43 +0000 (12:19 -0300)]
pgsql: don't always return error for parsing errors
This allows the app-proto to continue onto parsing next PDUs, if
possible.
Bug #5524
Juliana Fajardini [Fri, 7 Feb 2025 21:40:08 +0000 (18:40 -0300)]
pgsql: don't fail if proto parses unknown message
Even if unknown, if the message is properly parsed, allow the parser to
proceed.
Related to
Bug #5524
Juliana Fajardini [Mon, 17 Feb 2025 22:13:50 +0000 (19:13 -0300)]
pgsql/parser: always use fn for parsing PDU length
Some inner parsers were using it, some weren't. Better to standardize
this. Also take the time to avoid magic numbers for representing the
expected lengths for pgsql PDUs.
Also throwing PgsqlParseError and allowing for incomplete results.
Related to
Task #5566
Bug #5524
Juliana Fajardini [Mon, 17 Feb 2025 22:24:22 +0000 (19:24 -0300)]
pgsql: add PgsqlParserError
Building on top of work done by Jason Ish.
Related to
Bug #5524
Juliana Fajardini [Fri, 7 Feb 2025 20:57:50 +0000 (17:57 -0300)]
pgsql/parser: simplify response parsing
The initial parsing for message type checking was more complex than
needed be.
Related to
Bug #5524
Juliana Fajardini [Fri, 7 Feb 2025 15:16:53 +0000 (12:16 -0300)]
pgsql/parser: fix response message length
Some backend messages can be the shortest pgsql length possible,
4 bytes, but the parser expectd all messages to be longer than that.
Related to
Bug #5524
Jeff Lucovsky [Mon, 17 Feb 2025 17:08:00 +0000 (12:08 -0500)]
gen/typo: Improve grammar
Jeff Lucovsky [Mon, 17 Feb 2025 14:11:03 +0000 (09:11 -0500)]
gen/bool: Clarify bool checks
Remove comparisons with true or false with C bools.
Philippe Antoine [Mon, 17 Feb 2025 11:49:59 +0000 (12:49 +0100)]
detect/flow: move keyword parsing code to rust
for flow.pkts and flow.bytes keywords
Ticket: 7562
Avoid null deref when parsing flow.bytes:toserver;
Philippe Antoine [Mon, 17 Feb 2025 08:08:54 +0000 (09:08 +0100)]
detect/krb5: avoid integer underflow with krb5.ticket_encryption
Ticket: 7560
When passing INT32_MIN aka 0x80000000, we cannot compute -vali
as it does not fit into a i32
Juliana Fajardini [Fri, 17 Jan 2025 20:43:34 +0000 (17:43 -0300)]
analysis: report rule state altered by other rule
Flowbits can make a rule such as a packet rule be treated as a stateful
rule, without actually changing the rule type.
Add a flag to allow reporting such cases via engine analysis.
Task #7456
Juliana Fajardini [Fri, 17 Jan 2025 20:41:19 +0000 (17:41 -0300)]
detect/flowbits: only walk over array if needed
For setting s->init_data for flowbit rules impacted by `set`, we can
first check whether this will be needed, and *then* walk over the
flowbits array.
Jason Ish [Fri, 24 Jan 2025 15:56:58 +0000 (09:56 -0600)]
rust: add bindings to SCPlugin.* to sys crate
Also disable bindgen's generated layout tests. They are valid for the
platform generating the tests, but may not be valid for other
platforms. For example, if the tests are generated on a 64 bit
platform the tests will not be valid when run on a 32 bit platform as
pointers are a different size.
However, the generating bindings are valid for both platform.
Ticket: #7341
Jason Ish [Fri, 24 Jan 2025 15:05:03 +0000 (09:05 -0600)]
rust: add auto-generated header to sys.rs
We don't keep bindgen's autogenerated do not edit line as it contains
the bindgen version which could break the CI check for out of date
bindings. So add our own do not edit line.
Ticket: #7341
Jason Ish [Fri, 24 Jan 2025 14:59:39 +0000 (08:59 -0600)]
github-ci: test that bindgen bindings are up to date
Regenerates the `sys.rs` and looks for any difference. Check will fail
if there is a difference.
Ticket: #7341
Jason Ish [Thu, 23 Jan 2025 22:40:22 +0000 (16:40 -0600)]
rust: use AppProto from generated bindings instead of duplicating
Have bindgen generate bindings for app-layer-protos.h, then use the
generated definitions of AppProto/AppProtoEnum instead if defining
them ourselves.
This header was chosen as its used by Rust, and its a simple header
with no circular dependencies.
Ticket: #7341
Jason Ish [Thu, 23 Jan 2025 22:26:25 +0000 (16:26 -0600)]
rust: integrate bindgen to generate Rust bindings to C
Bindgen works by processing a header file which includes all other
header files it should generate bindings for. For this I've created
bindgen.h which just includes app-layer-protos.h for now as an
example.
These bindings are then generated and saved in the "suricata-sys"
crate and become availale as "suricata_sys::sys".
Ticket: #7341
Jason Ish [Thu, 23 Jan 2025 22:19:09 +0000 (16:19 -0600)]
rust/sys: stub in suricata-sys crate for Rust bindings to C
Follow Rust convention of using a "sys" crate for bindings to C
functions. The bindings don't exist yet, but will be generated by
bindgen and put into this crate.
Ticket: #7341