]>
git.ipfire.org Git - thirdparty/suricata.git/log
jason taylor [Wed, 30 Aug 2023 18:50:19 +0000 (18:50 +0000)]
detect: update smb.version keyword
Signed-off-by: jason taylor <jtfas90@gmail.com>
jason taylor [Wed, 30 Aug 2023 18:44:07 +0000 (18:44 +0000)]
rust: fix rustfmt warnings for smb detect
Signed-off-by: jason taylor <jtfas90@gmail.com>
Eloy Pérez González [Thu, 28 Apr 2022 10:59:03 +0000 (12:59 +0200)]
smb: add smb.keyword documentation
Eloy Pérez González [Thu, 28 Apr 2022 10:57:51 +0000 (12:57 +0200)]
smb: add smb.version keyword
Ticket: #5075
Signed-off-by: jason taylor <jtfas90@gmail.com>
Juliana Fajardini [Thu, 18 Jan 2024 20:24:33 +0000 (17:24 -0300)]
userguide: clarify midstream exception policy
The description of behavior when midstream is enabled and exception
policy is set to ignore wasn't descriptive enough.
Fix typos.
Lukas Sismis [Mon, 11 Dec 2023 00:47:55 +0000 (01:47 +0100)]
doc: remove references to prehistoric versions
Remove references that are mentioning Suricata 3 or less
As a note - only one Suricata 4 reference found:
(suricata-yaml.rst:"In 4.1.x")
Fast pattern selection criteria can be internally found by inspecting
SupportFastPatternForSigMatchList and SigTableSetup functions.
Ticket: #6570
Lukas Sismis [Wed, 27 Sep 2023 12:38:36 +0000 (14:38 +0200)]
dpdk: add interrupt (power-saving) mode
When the packet load is low, Suricata can run in interrupt
mode. This more resembles the classic approach of processing
packets - CPU cores run low and only fetch packets
on interrupt.
Ticket: #5839
Lukas Sismis [Mon, 30 Oct 2023 11:33:57 +0000 (12:33 +0100)]
dpdk: rework hugepage hints to use per-numa information
Previous integration of hugepage analysis only fetched data
from /proc/meminfo. However this proved to be often
deceiving mainly for providing only global information and
not taking into account different hugepage sizes (e.g. 1GB
hugepages) and different NUMA nodes.
Ticket: #6419
Stephen Donnelly [Wed, 10 Jan 2024 03:39:34 +0000 (16:39 +1300)]
source/erf-dag: compiler warnings
Bug: #6667.
Fix compiler warnings for function pointer parameters missing const with --enable-dag
Shivani Bhardwaj [Tue, 16 Jan 2024 08:41:34 +0000 (14:11 +0530)]
detect: make SigMatch.is_last bool
It is used like bool so much so that nothing needs to be changed even
after changing its type.
Shivani Bhardwaj [Tue, 16 Jan 2024 08:40:59 +0000 (14:10 +0530)]
detect: remove unneeded size in DetectEngineCtx
sig_array_size can easily be calculated with length and is only used at
one place for debugging purposes. Remove it from the DetectEngineCtx
struct to avoid making it unnecessarily heavy.
Shivani Bhardwaj [Tue, 16 Jan 2024 08:39:57 +0000 (14:09 +0530)]
detect/alert: remove unnecessary else
Jeff Lucovsky [Tue, 16 Jan 2024 15:36:07 +0000 (10:36 -0500)]
htp/swf: Remove flash deprecation notice
Issue: 6605
Flash decompression will remain so the deprecation notice is not needed.
Jeff Lucovsky [Tue, 16 Jan 2024 14:11:36 +0000 (09:11 -0500)]
doc/pcap-log: Remove squil documentation
Issue: 6347
Jeff Lucovsky [Tue, 16 Jan 2024 14:08:44 +0000 (09:08 -0500)]
log/pcap: Remove sguil mode
Issue: 6347
Remove sguil-mode pcap logging capability.
Jeff Lucovsky [Tue, 16 Jan 2024 13:30:25 +0000 (08:30 -0500)]
conf/log: Remove sguil mode
Issue: 6347
Jason Ish [Tue, 9 Jan 2024 17:40:48 +0000 (11:40 -0600)]
eve/schema: allow authorities in dns.answers in alert
Factor out dns.authorities to a definition.
Vincent Li [Fri, 4 Aug 2023 17:49:35 +0000 (17:49 +0000)]
flow-bypass: Set bypass thread to running state
When running Suricata in XDP bypass mode (bypass: yes),
Suricata started up with error:
Error: threads: thread "FB" failed to start in time: flags 0003
"FB" thread does not transition from THV_INIT_DONE to THV_RUNNING.
Set "FB" thread THV_RUNNING state in BypassedFlowManager().
Bug: #6254
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
Philippe Antoine [Fri, 5 Jan 2024 09:18:46 +0000 (10:18 +0100)]
rust: update test_case crate
fixes unused_unit
warning: unneeded unit expression
--> src/bittorrent_dht/parser.rs:590:5
|
590 | / #[test_case(
591 | | b"",
592 | | "Error: discovered Dict but expected EOF" ;
593 | | "test parse bittorrent dht packet err 1"
594 | | )]
| |______^
Philippe Antoine [Sat, 6 Jan 2024 21:16:24 +0000 (22:16 +0100)]
ci: run clippy on test code as well
Philippe Antoine [Sat, 6 Jan 2024 21:15:11 +0000 (22:15 +0100)]
rust: fix single_binding
error: this match could be written as a `let` statement
--> src/nfs/nfs3_records.rs:747:9
|
747 | / match result {
748 | | (r, request) => {
749 | | assert_eq!(r.len(), 0);
750 | | assert_eq!(request.handle, expected_handle);
751 | | assert_eq!(request.name_vec, br#"bln"#);
752 | | }
753 | | }
| |_________^
Philippe Antoine [Fri, 5 Jan 2024 09:30:33 +0000 (10:30 +0100)]
rust: fix single_match
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/http2/parser.rs:882:17
|
882 | / match ctx.value {
883 | | Some(_) => {
884 | | panic!("Unexpected value");
885 | | }
886 | | None => {}
887 | | }
| |_________________^
Philippe Antoine [Fri, 5 Jan 2024 09:27:34 +0000 (10:27 +0100)]
rust: fix vec_init_then_push
warning: calls to `push` immediately after creation
--> src/pgsql/parser.rs:1179:9
|
1179 | / let mut database_param: Vec<PgsqlParameter> = Vec::new();
1180 | | database_param.push(database);
| |______________________________________^
help: consider using the `vec![]` macro: `let database_param: Vec<PgsqlParameter> = vec![..];`
Philippe Antoine [Fri, 5 Jan 2024 09:22:39 +0000 (10:22 +0100)]
rust: fix zero_prefixed_literal
warning: this is a decimal constant
--> src/mqtt/parser.rs:888:19
|
888 | 0x00, 06, /* Topic Length: 6 */
| ^^
|
Philippe Antoine [Thu, 4 Jan 2024 11:48:12 +0000 (12:48 +0100)]
rust: fix assertions_on_constants for assert!(false)
using panic! instead with a string message
Philippe Antoine [Thu, 4 Jan 2024 10:48:32 +0000 (11:48 +0100)]
rust: fix assertions_on_constants for assert!(true)
Which will be optimized away by the compiler
Gleb Smirnoff [Thu, 11 Jan 2024 21:35:21 +0000 (13:35 -0800)]
ipfw: close(2) instead shutdown(2) of the divert(4) socket
The shutdown(2) syscall would always return ENOTCONN for FreeBSD 11,
FreeBSD 12, FreeBSD 13 and FreeBSD 14. It could do some action on the
socket in the kernel in FreeBSD 10 and before, did not test.
Philippe Antoine [Tue, 12 Dec 2023 08:34:04 +0000 (09:34 +0100)]
detect: strip_pseudo_headers transform
Ticket: 6546
Victor Julien [Mon, 8 Jan 2024 08:02:46 +0000 (09:02 +0100)]
eve/http: add location header independent of status availability
Victor Julien [Mon, 8 Jan 2024 08:02:15 +0000 (09:02 +0100)]
eve/http: use numeric status code by default
To avoid costly string operations.
Victor Julien [Mon, 8 Jan 2024 06:43:04 +0000 (07:43 +0100)]
eve/email: improve logging binary data
Use jb_append_string_from_bytes() as it works better than
BytesToString+jb_append_string when logging binary data.
Bug: #6664.
Victor Julien [Wed, 3 Jan 2024 11:16:25 +0000 (12:16 +0100)]
flow: minor optimization
Most of the time FlowGetFlowFromHash will succeed.
Victor Julien [Wed, 3 Jan 2024 11:09:59 +0000 (12:09 +0100)]
detect: consolidate per rule group file loops
Don't loop multiple times over the per group sig array.
Victor Julien [Sun, 31 Dec 2023 07:17:24 +0000 (08:17 +0100)]
detect: remove DCERPC mask logic
Added nothing over alproto check already in place.
Victor Julien [Wed, 3 Jan 2024 09:50:04 +0000 (10:50 +0100)]
detect/rule-header: use bool type
Update frame prototype as well, to match already returned true/false values.
Victor Julien [Wed, 3 Jan 2024 09:44:09 +0000 (10:44 +0100)]
detect/rule-header: minor code cleanups
Victor Julien [Sun, 31 Dec 2023 09:22:13 +0000 (10:22 +0100)]
detect/address: refactor match array building
Victor Julien [Sun, 31 Dec 2023 09:17:38 +0000 (10:17 +0100)]
detect/address: minor cleanup
Victor Julien [Fri, 29 Dec 2023 17:27:17 +0000 (18:27 +0100)]
mpm/ac: pointer hygene
Victor Julien [Fri, 29 Dec 2023 09:59:43 +0000 (10:59 +0100)]
mpm/hs: improve pointer hygene
Victor Julien [Fri, 29 Dec 2023 08:22:14 +0000 (09:22 +0100)]
detect/mpm: minor cleanup
Victor Julien [Wed, 27 Dec 2023 18:08:29 +0000 (19:08 +0100)]
detect: shrink sgh to have all runtime members on one cache line
Victor Julien [Wed, 27 Dec 2023 16:12:33 +0000 (17:12 +0100)]
detect: constify flow flags in tx rule inspect
Victor Julien [Wed, 27 Dec 2023 16:01:42 +0000 (17:01 +0100)]
detect: minor cleanup for rule group get function
Victor Julien [Wed, 27 Dec 2023 16:01:18 +0000 (17:01 +0100)]
app-layer: micro optimization for AppProtoEquals
Add most common condition first.
Victor Julien [Fri, 22 Dec 2023 09:51:24 +0000 (10:51 +0100)]
detect/bsize: constify keyword args during size check
Victor Julien [Fri, 22 Dec 2023 07:43:46 +0000 (08:43 +0100)]
detect/content: limits prop comment cleanup
Victor Julien [Fri, 22 Dec 2023 07:31:22 +0000 (08:31 +0100)]
detect/dsize: minor code cleanup
Victor Julien [Thu, 21 Dec 2023 10:35:22 +0000 (11:35 +0100)]
detect: use do { } while loop for app engine loop
Victor Julien [Wed, 20 Dec 2023 20:40:47 +0000 (21:40 +0100)]
detect/content: fix offset for negative distance
Fix offset calculation on sigs with negative distance. Can lead to FN
in certain cases.
Bug: #6661.
Victor Julien [Fri, 6 Oct 2023 10:52:54 +0000 (12:52 +0200)]
detect/content-inspect: add more tests
Victor Julien [Wed, 20 Dec 2023 13:38:01 +0000 (14:38 +0100)]
spm/bm: minor code cleanups; constification
Victor Julien [Tue, 19 Dec 2023 10:31:48 +0000 (11:31 +0100)]
mpm: UNITTESTS guard for RegisterUnittests func
Victor Julien [Tue, 19 Dec 2023 10:11:10 +0000 (11:11 +0100)]
mpm: remove unused flags field
Victor Julien [Tue, 19 Dec 2023 13:41:21 +0000 (14:41 +0100)]
detect/http_server_body: modernize test
Victor Julien [Sun, 17 Dec 2023 09:24:56 +0000 (10:24 +0100)]
detect: implement --qa-skip-prefilter
Option meant for testing performance of rule engine w/o prefilter
optimizations.
Victor Julien [Tue, 19 Dec 2023 06:52:45 +0000 (07:52 +0100)]
detect/content-inspect: add negation tests
Test mixing of negation, endswith and depth.
Victor Julien [Sun, 17 Dec 2023 18:54:43 +0000 (19:54 +0100)]
detect/bytetest: remove unused Match function
All matching is done as part of content inspection.
Victor Julien [Mon, 18 Dec 2023 10:29:01 +0000 (11:29 +0100)]
detect/pcre: remove unused match member
pcre2_match_data is created per thread when needed.
Victor Julien [Mon, 18 Dec 2023 07:04:52 +0000 (08:04 +0100)]
detect/bytemath: fix u32 buffer size logic
Remove u16 cast. Remove debug assert for u16 size.
In
83ed2c3b97925d390c2a57fdc8eea52f7d3d2e4c the input was changed to
u32
Victor Julien [Wed, 20 Dec 2023 08:42:53 +0000 (09:42 +0100)]
detect/pcre: localize match limit option parsing
No need to put it into a per ctx flag.
Victor Julien [Wed, 20 Dec 2023 08:33:20 +0000 (09:33 +0100)]
detect/pcre: remove unused opts field
Victor Julien [Sun, 17 Dec 2023 20:55:42 +0000 (21:55 +0100)]
detect/pcre: put commonly used members on first cache line
Victor Julien [Sun, 17 Dec 2023 17:02:35 +0000 (18:02 +0100)]
detect/content-inspect: use of replace keyword is rare
Hint compiler about this.
Victor Julien [Sat, 16 Dec 2023 15:45:00 +0000 (16:45 +0100)]
detect/profiling: improve pcap reading performance
When reading a pcap, packet time can move much faster than wall
clock time. This would trigger many more profile syncs than before.
As the sync is using a lock to synchronize with other threads, this
is an expensive operation.
Bug: #6619.
Fixes: b591813b8690 ("profiling/rules: reduce sync logic scope")
Juliana Fajardini [Wed, 11 Oct 2023 20:24:45 +0000 (17:24 -0300)]
pgsql: fix u16 overflow in query data_row
Found by oss-fuzz with quadfuzz.
Cf https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63113
According to PostgreSQL documentation the maximum number of rows can be
the maximum of tuples that can fit onto max u32 pages - 4,294,967,295 (cf
https://www.postgresql.org/docs/current/limits.html). Some rough
calculations for that indicate that this could go over max u32, so
updating the data_row data type to u64.
Bug #6389
Philippe Antoine [Wed, 6 Dec 2023 19:32:50 +0000 (20:32 +0100)]
doc: fix byte_test examples
As this keyword has 4 mandatory arguments, and some examples
had only three...
Ticket: 6629
Juliana Fajardini [Thu, 30 Nov 2023 15:16:27 +0000 (12:16 -0300)]
devguide: explain example-rule container usage
Have these options documented, so that whoever writes rule-related
documentation can easily know what they could use to make the doc look
better.
Philippe Antoine [Thu, 4 Jan 2024 10:42:55 +0000 (11:42 +0100)]
detect: case-insensitive comparison for requires
Ticket: 6656
Philippe Antoine [Thu, 4 Jan 2024 08:51:33 +0000 (09:51 +0100)]
rust: allow clippy::items_after_test_module
As clippy began to complain about jsonbuilder.rs
Juliana Fajardini [Fri, 24 Nov 2023 14:46:41 +0000 (11:46 -0300)]
devguide: fix main channels list
Sphinx and RtD sometimes render lists in weird ways. The communication
channels list barely looked like one, at all...
Juliana Fajardini [Fri, 24 Nov 2023 13:07:05 +0000 (10:07 -0300)]
devguide: update branches, refer to backports guide
Update the list of active branches to include 7 renaming and new master,
link to backports document.
Juliana Fajardini [Wed, 22 Nov 2023 17:56:56 +0000 (14:56 -0300)]
devguide: add chapter with backports guide
Task #6568
Juliana Fajardini [Fri, 24 Nov 2023 11:29:06 +0000 (08:29 -0300)]
devguide: doc from behavior changes needs ticket #
If a commit introduces code that changes Suricata behavior, the related
documentation changes should go in a separate commit, but refer to the
same ticket number.
This reduces the chances of said changes being lost if there are backports
while still keeping the backporting process a bit less bulky, for each
commit.
Related to
Task #6568
Juliana Fajardini [Wed, 22 Nov 2023 15:52:59 +0000 (12:52 -0300)]
devguide: reorganize pr-workflow section
This section seemed to aim both at PR reviewers and PR authors at the
same time, even though some info is probably of low value for
contributors.
Created new section for PR reviewers and maintainers, and kept the info
for PR authors separated. Also highlighted information on requested
changes and stale PRs.
Juliana Fajardini [Wed, 22 Nov 2023 17:03:27 +0000 (14:03 -0300)]
devguide: make 'contributing' a chapter
This could be justified from a semantic point of view, and also can help
in bringing more attention to where this information is, as it is less
hidden, now.
Also add Dev Guide as one of our resources in our Readme.
Jeff Lucovsky [Thu, 21 Dec 2023 14:41:29 +0000 (09:41 -0500)]
mqtt: Move conf code to rust
Issue: 6387
This commit moves the configuration logic to Rust.
Jason Ish [Tue, 19 Dec 2023 18:13:23 +0000 (12:13 -0600)]
stats: add rules skipped
Rule skipped is a count of the number of rules that are skipped due to
missing requirements.
Feature: #6637
Jason Ish [Thu, 14 Dec 2023 18:32:59 +0000 (12:32 -0600)]
rust.h: don't include util-file.h, not needed
Jason Ish [Wed, 29 Nov 2023 18:57:23 +0000 (12:57 -0600)]
detect-parse: parse sid in pre-scan
During the pre-scan for "requires", also parse the SID if possible. If
the rule fails high level parsing (syntax), the SID will not be
parsed.
But every keyword other than "sid" and "requires" should expect to be
provided with a parsed sid.
Jason Ish [Wed, 29 Nov 2023 16:54:54 +0000 (10:54 -0600)]
requires: pre-scan rule for requires expressions
Add a "pre-scan" rule parse that will check for requires statement. It
will return a special error code (-4) if the requires fails due to
missing requirements.
Syntactic errors will also abort parsing here.
Feature: #5972
Jason Ish [Tue, 28 Nov 2023 21:35:09 +0000 (15:35 -0600)]
requires: add requires keyword
Add a new rule keyword "requires" that allows a rule to require specific
Suricata versions and/or Suricata features to be enabled.
Example:
requires: feature geoip, version >= 7.0.0, version < 8;
requires: version >= 7.0.3 < 8
requires: version >= 7.0.3 < 8 | >= 8.0.3
Feature: #5972
Co-authored-by: Philippe Antoine <pantoine@oisf.net>
Jason Ish [Fri, 15 Dec 2023 00:19:41 +0000 (18:19 -0600)]
feature: provide a Rust binding to the feature API
As the feature module is not available for Rust unit tests, a mock
version is also provided.
Juliana Fajardini [Fri, 15 Dec 2023 16:57:01 +0000 (13:57 -0300)]
pgsql: remove unused msg field
The `ConsolidatedDataRow` struct had a `length` field that wasn't truly
used.
Related to
Bug #6389
Philippe Antoine [Thu, 14 Dec 2023 10:31:37 +0000 (11:31 +0100)]
stats: incr app-proto flow counter for detection-only
Ticket: 6633
Philippe Antoine [Mon, 11 Sep 2023 07:51:24 +0000 (09:51 +0200)]
schema: adds missing modbus field
./stats/app_layer/error/modbus
Philippe Antoine [Mon, 20 Nov 2023 13:54:45 +0000 (14:54 +0100)]
stats: always use tcp/udp prefix
Even when on detection-only mode.
So that we always have enip_tcp and enip_udp in stats
and never just `enip`.
Ticket: 6304
Juliana Fajardini [Mon, 11 Dec 2023 20:10:54 +0000 (17:10 -0300)]
schema: apply clang formatting changes
Juliana Fajardini [Mon, 11 Dec 2023 20:55:37 +0000 (17:55 -0300)]
userguide/eve: explain pgsql requests & responses
Add a more visible explanation of that requests, responses, frontend and
and backend are, in Pgsql context, to avoid having to repeat that over
different portions of the docs.
Juliana Fajardini [Mon, 11 Dec 2023 20:10:13 +0000 (17:10 -0300)]
pgsql: add cancel request message
A CanceldRequest can occur after any query request, and is sent over a
new connection, leading to a new flow. It won't take any reply, but, if
processed by the backend, will lead to an ErrorResponse.
Task #6577
Juliana Fajardini [Mon, 11 Dec 2023 20:26:31 +0000 (17:26 -0300)]
doc/eve-format: break pgsql section to char limit
Juliana Fajardini [Thu, 30 Nov 2023 21:55:13 +0000 (18:55 -0300)]
pgsql: extract length validation into function
This is called so many times that it seems to make sense that we use a
function for this.
Victor Julien [Wed, 13 Dec 2023 07:45:06 +0000 (08:45 +0100)]
detect/byte: remove unneeded SIG_FLAG_APPLAYER sets
Flag will be set during list(s) setup if needed.
Victor Julien [Tue, 12 Dec 2023 13:54:41 +0000 (14:54 +0100)]
detect/byte_extract: modernize tests
Victor Julien [Thu, 7 Dec 2023 16:07:04 +0000 (17:07 +0100)]
detect/bytemath: bump length to uint32_t
This puts the logic in line with the other payload inspection
functions.
Victor Julien [Fri, 8 Dec 2023 11:45:06 +0000 (12:45 +0100)]
detect/bytejump: test cleanup
Just one used during debugging.
Victor Julien [Fri, 8 Dec 2023 08:38:38 +0000 (09:38 +0100)]
detect/bytejump: don't reuse content flag
To avoid future problems with overlapping flag values, give bytejump
its own DETECT_BYTEJUMP_OFFSET_VAR flag.
The values are currently not overlapping, so this patch should have
no side effects.
Victor Julien [Fri, 8 Dec 2023 09:31:21 +0000 (10:31 +0100)]
detect/analyzer: print int keyword values correctly
To avoid negative values to be misrepresented.
Bug: #6615.
Victor Julien [Fri, 8 Dec 2023 09:30:25 +0000 (10:30 +0100)]
jsonbuilder: add set_int for signed ints
Bug: #6615
Victor Julien [Thu, 28 Sep 2023 12:41:20 +0000 (14:41 +0200)]
eve/stream: add sb main region size; segment count
Gives more detail about memory use.