Commit Graph

15414 Commits (suricata-7.0.7)
 

Author SHA1 Message Date
Victor Julien 304fe41762 profiling: allow absolute paths
Ticket #6490.

(cherry picked from commit 855cc89636)
11 months ago
Philippe Antoine d72ec89c37 rust: compatibility with cbindgen 0.27
Ticket: 7206

Cbindgen 0.27 now handles extern blocks as extern "C" blocks.
The way to differentiate them is to use a special comment
before the block.

(cherry picked from commit 304271e63a)
12 months ago
Jason Ish 926a7dae48 configure: require cbindgen version of 0.16.0 or newer 12 months ago
Jason Ish 1e0c64187f rust/dcerpc: fix rustdoc indentation
Fixes clippy lint:

error: doc list item missing indentation
   --> src/dcerpc/dcerpc.rs:511:9
    |
511 |     ///  description: direction of the flow
    |         ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
12 months ago
Jason Ish 5ce35f581a rust/conf: collapse match pattern into if
Fixes clippy lint for collapsible_match.

error: this `match` can be collapsed into the outer `if let`
  --> src/conf.rs:85:9
   |
85 | /         match val {
86 | |             "1" | "yes" | "true" | "on" => {
87 | |                 return true;
88 | |             },
89 | |             _ => {},
90 | |         }
   | |_________^
   |
help: the outer pattern can be modified to include the inner pattern
  --> src/conf.rs:84:17
   |
84 |     if let Some(val) = conf_get(key) {
   |                 ^^^ replace this binding
85 |         match val {
86 |             "1" | "yes" | "true" | "on" => {
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
12 months ago
Jason Ish 2c92b12e19 rust/http2: remove redundant pattern match
Fix clippy lint for if_let_redundant_pattern_matching by using
.is_some().
12 months ago
Jason Ish 8e93ae0a22 rust/dcerpc: clippy fix for match
error: this `match` can be collapsed into the outer `match`
   --> src/dcerpc/detect.rs:215:20
    |
215 |           Some(x) => match x {
    |  ____________________^
216 | |             DCERPC_TYPE_REQUEST | DCERPC_TYPE_RESPONSE => {}
217 | |             _ => {
218 | |                 return 0;
219 | |             }
220 | |         },
    | |_________^
    |
help: the outer pattern can be modified to include the inner pattern
   --> src/dcerpc/detect.rs:215:14
    |
215 |         Some(x) => match x {
    |              ^ replace this binding
216 |             DCERPC_TYPE_REQUEST | DCERPC_TYPE_RESPONSE => {}
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
12 months ago
Jason Ish fcc1da0144 rust/ssh: fix clippy warning, reference can be used
Fix done by clippy --fix.
12 months ago
Jason Ish f3f7bcc091 rust: fix clippy warnings for match as if statements
Fix done by clippy --fix.
12 months ago
Philippe Antoine 33783269ae fuzz: make confyaml.c an explicit source
Ticket: 7181

Allows confyaml.c to be in the release archive

(cherry picked from commit 3f8251bd47)
12 months ago
Jeff Lucovsky a3af0e98a1 output/json: Close jb object on error
Issue: 7194

Ensure that the jb object is closed on errors.
12 months ago
Philippe Antoine 67311e3d47 detect/integers: harmonize parser return handling
Ticket: 7172

When parsing an integer for a rule keyword fails, we return error
straight away, without bothering to try to free the NULL pointer.

On the way, remove some one-line wrapper around DetectUxParse

(cherry picked from commit daad7f2d41)
12 months ago
Lukas Sismis ee9aad22f7 dpdk: replace TSC clock with GetTime (gettimeofday) function
Getting clock through Time Stamp Counter (TSC) can be precise and fast,
however only for a short duration of time.
The implementation across CPUs seems to vary. The original idea is to
increment the counter with every tick. Then dividing the delta of CPU ticks
by the CPU frequency can return the time that passed.
However, the CPU clock/frequency can change over time, resulting in uneven
incrementation of TSC. On some CPUs this is handled by extra logic.
As a result, obtaining time through this method might drift from the real
time.

This commit therefore substitues TSC time retrieval by the standard system
call wrapped in GetTime function - on Linux it is gettimeofday.

Ticket: 7116

(cherry picked from commit 35dffc6b32)
1 year ago
Juliana Fajardini f74fa898cf dns: allow triggering raw stream reassembly
For TCP streams, app proto stream reassembly can start earlier, instead
of waiting and queueing up data before doing so.

Task #7018
Related to
Bug #7004

(cherry picked from commit bb45ac71ef)
1 year ago
Victor Julien ff8d9ca1a1 smb/ntlmssp: improve version check
Don't assume the ntlmssp version field is always present if the flag is
set. Instead keep track of the offsets of the data of the various blobs
and see if there is space for the version.

Inspired by how Wireshark does the parsing.

Bug: #7121.
(cherry picked from commit f59c43b1c7)
1 year ago
Philippe Antoine c9dbc565d9 util/thash: decrease memuse if array was allocated
THashInitConfig may not allocate array and increase memuse.
Such a failure leads to THashShutdown which should not decrease
the memuse.

Ticket: 7135
(cherry picked from commit eeec609ac8)
1 year ago
Victor Julien 6824a4bc5f doc/userguide: document iprep isset/isnotset
(cherry picked from commit 8b42182fee)
1 year ago
Victor Julien b014b1e8e6 doc/userguide: add more operators to iprep
(cherry picked from commit 2f74d435d3)
1 year ago
Victor Julien d2ee5a1e9e detect/iprep: implement isset and isnotset
Implement special "isset" and "isnotset" modes.

"isset" matches if an IP address is part of an iprep category with any
value.

It is internally implemented as ">=,0", which should always be true if
there is a value to evaluate, as valid reputation values are 0-127.

"isnotset" matches if an IP address is not part of an iprep category.

Internally it is implemented outside the uint support.

Ticket: #6857.
(cherry picked from commit 83976a4cd4)
1 year ago
Victor Julien 524ee70cfa reputation: minor cleanup
No need to init ptrs to NULL after SCCalloc.

(cherry picked from commit 3e46c51651)
1 year ago
Victor Julien b4acd71b8b detect/iprep: update keyword parser for extendibility
(cherry picked from commit 539ab3a404)
1 year ago
Philippe Antoine f653a4ee3f bypass: really bypass udp flow from first packet
Ticket: 7053

As flow state would be overwritten by established...

(cherry picked from commit df5dcfef5f)
1 year ago
Philippe Antoine ea215902d5 filestore: do not try to store a file set to nostore
Ticket: 6390

This can happen with keyword filestore:both,flow
If one direction does not have a signature group with a filestore,
the file is set to nostore on opening, until a signature in
the other direction tries to set it to store.
Subsequent files will be stored in both directions as flow flags
are now set.

(cherry picked from commit 5f35035928)
1 year ago
Philippe Antoine 4f91c629f4 detect/snmp: do not bother to free a null pointer
Ticket: 7134
1 year ago
Victor Julien 27deff0790 github-actions: remove build for EOL centos:7 1 year ago
Victor Julien 104ec011c0 detect/noalert: point noalert/alert to new doc
(cherry picked from commit d02054fa31)
1 year ago
Victor Julien e04d8f3045 doc/userguide: add noalert/alert keyword docs
(cherry picked from commit 50ef646d45)
1 year ago
Victor Julien 8fdbb0b17d doc/userguide: give pcre1 to pcre2 proper heading
(cherry picked from commit c83e3285ae)
1 year ago
Victor Julien b3fa19fe28 detect: implement 'alert' keyword as a companion to 'noalert'
This can be used to implement alert then pass logic.

Add support for alert-then-pass to alert handling routines.

Ticket: #5466.
(cherry picked from commit d5fb8204b6)
1 year ago
Victor Julien 5bcbbf3569 detect: set ACTION_ALERT for rules that should alert
Replaces default "alert" logic and removed SIG_FLAG_NOALERT.

Instead, "noalert" unsets ACTION_ALERT. Same for flowbits:noalert and
friends.

In signature ordering rules w/o action are sorted as if they have 'alert',
which is the same behavior as before, but now implemented explicitly.

Ticket: #5466.
(cherry picked from commit 92581dbc06)
1 year ago
Shivani Bhardwaj 1f69d6cded detect/flowbits: remove DETECT_FLOWBITS_CMD_NOALERT
DETECT_FLOWBITS_CMD_NOALERT is misleading as it gives an impression that
noalert is a flowbit specific command that'll be used and dealt with at
some point but as soon as noalert is found in the rule lang, signature
flag for noalert is set and control is returned. It never gets added to
cmd of the flowbits object.

(cherry picked from commit 75471dd69b)
1 year ago
Victor Julien 6fbcab4af1 detect/alert: minor loop cleanup
(cherry picked from commit 8f72a04973)
1 year ago
Victor Julien c016843e97 detect/noalert: minor cleanup
(cherry picked from commit 44e7fdc3ca)
1 year ago
Shivani Bhardwaj 270e49da60 changelog: update 7.0.6 CVEs and titles 1 year ago
Shivani Bhardwaj 561d2d32c6 version: start development towards 7.0.7 1 year ago
Shivani Bhardwaj 9db8668166 release: 7.0.6; update changelog 1 year ago
Philippe Antoine c82fa5ca0d http2: do not expand duplicate headers
Ticket: 7104

As this can cause a big mamory allocation due to the quadratic
nature of the HPACK compression.

(cherry picked from commit 5bd17934df)
1 year ago
Philippe Antoine a753cdbe84 modbus: abort flow parsing on flood
Ticket: 6987

Let's not spend more resources for a flow which is trying to
make us do it...

(cherry picked from commit 37509e8e0e)
1 year ago
Victor Julien aab7f35c76 defrag: don't use completed tracker
When a Tracker is set up for a IPID, frags come in for it and it's
reassembled and complete, the `DefragTracker::remove` flag is set. This
is mean to tell the hash cleanup code to recyle the tracker and to let
the lookup code skip the tracker during lookup.

A logic error lead to the following scenario:

1. there are sufficient frag trackers to make sure the hash table is
   filled with trackers
2. frags for a Packet with IPID X are processed correctly (X1)
3. frags for a new Packet that also has IPID X come in quickly after the
   first (X2).
4. during the lookup, the frag for X2 hashes to a hash row that holds
   more than one tracker
5. as the trackers in hash row are evaluated, it finds the tracker for
   X1, but since the `remove` bit is not checked, it is returned as the
   tracker for X2.
6. reassembly fails, as the tracker is already complete

The logic error is that only for the first tracker in a row the `remove`
bit was checked, leading to reuse to a closed tracker if there were more
trackers in the hash row.

Ticket: #7042.
1 year ago
Philippe Antoine b47c351d70 detect: add to signature mask for decode events
Ticket: 6291
(cherry picked from commit 0a953fe1ce)
1 year ago
Philippe Antoine 0ed4d29d42 detect: fix check for app_layer events
Ticket: 7106
(cherry picked from commit 4e584ed201)
1 year ago
Lukas Sismis 7cc86938fc doc: port user install and build instruction from master-6.0.x
Ticket: #6685
(cherry picked from commit bd9608771e)
1 year ago
Lukas Sismis 2101573c14 github-ci: add minimal build for Ubuntu and AlmaLinux
(cherry picked from commit cd7c35eb5a)
1 year ago
Lukas Sismis 8216b5b229 github-ci: remove gosu from installed packages
(cherry picked from commit 6d663ec885)
1 year ago
Lukas Sismis 77997941ae doc: update eBPF compilation instructions
Ticket: #6599
(cherry picked from commit 521d1cb8e7)
1 year ago
Jason Ish 82b502ec25 rust/ike: prefix never read field names with _
New warning from rustc.

The other option is to allow dead code, however this is more explicit,
and when they are read, its obvious they should be renamed.
1 year ago
Jason Ish 192ef5bb90 rust: fix clippy lint for legacy_numeric_constants
https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
1 year ago
Jason Ish 97409fe37b rust: rename .cargo/config to .cargo/config.toml
Addresses this warning from the Rust compiler:

warning: `../rust/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
(cherry picked from commit 8560564657)
1 year ago
Jason Ish 9c9181ee19 cargo: use default-features instead of default_features
"default_features" is being deprecated in Rust 2024.
1 year ago
Jason Ish d88eb343af rust: simply matches with unwrap_or_default
New default clippy warning:
https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
1 year ago