Commit Graph

15462 Commits (a8f358066397b68dd4075d175157ee97f0bf7e11)
 

Author SHA1 Message Date
Victor Julien a8f3580663 detect: fix decoder only events
Add missing setup part of the decoder event sgh.

Bug: #7414.
(cherry picked from commit b23fa51e33)
2 years ago
Jason Ish ccc61f6294 requires: add option to ignore unknown requirements
The new behavior in 8, and backported is to treat unknown requirements
as unsatisfied requirements.

For 7.0.8, add a configuration option, "ignore-unknown-requirements"
to completely ignore unknown requirements, effectively treating them
as available.

Ticket: #7434
2 years ago
Jason Ish eac4854636 requires: treat unknown requires keywords as unmet requirements
For example, "requires: foo bar" is an unknown requirement, however
its not tracked, nor an error as it follows the syntax. Instead,
record these unknown keywords, and fail the requirements check if any
are present.

A future version of Suricata may have new requires keywords, for
example a check for keywords.

Ticket: #7418
(cherry picked from commit 820a3e51b7)
2 years ago
Jason Ish 825eadf1c5 rust: remove unnecessary lifetimes
Fix provided by cargo clipy --fix.

Backport of 7bdbe7ed32.
2 years ago
Jason Ish 60dd1d566c rust/smb: fix rustdoc line
'///' style rust comments/documentation come before the item being
documented.

Spotted by clippy.

(cherry picked from commit aa6e94fc73)
2 years ago
Jason Ish a502c188c5 rust: allow static_mut_refs for now
But we should fix all these soon.

(cherry picked from commit 4c12165816)
2 years ago
Jason Ish 9edac554eb rust: update num-derive to 0.4.2
Includes Cargo.lock.in generated for just this single crate update
(minimal atomic update to keep Cargo.lock in sync with Cargo.toml).

This prevents the clippy warning:

    508 | #[derive(FromPrimitive, Debug)]
        |          ^------------
        |          |
        |          `FromPrimitive` is not local
        |          move the `impl` block outside of this constant `_IMPL_NUM_FromPrimitive_FOR_IsakmpPayloadType`
    509 | pub enum IsakmpPayloadType {
        |          ----------------- `IsakmpPayloadType` is not local
        |
        = note: the derive macro `FromPrimitive` defines the non-local `impl`, and may need to be changed
        = note: the derive macro `FromPrimitive` may come from an old version of the `num_derive` crate, try updating your dependency with `cargo update -p num_derive`
        = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
        = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
        = note: this warning originates in the derive macro `FromPrimitive` (in Nightly builds, run with -Z macro-backtrace for more info)

Backport of 8e408d3730.
2 years ago
Jason Ish 4632510308 rust: sync Cargo.lock with Cargo.toml
This just updates some internal dependencies to our own crates in the
work-space.
2 years ago
Jason Ish 093397f6b3 util-buffer: expand by multiples of 4k
(cherry picked from commit 287d8360e7)
2 years ago
Jason Ish 3715fe3da0 output-json: drop eve records that are too long
In the situation where the mem buffer cannot be expanded to the
requested size, drop the log message.

For each JSON log context, a warning will be emitted once with a partial
bit of the log record being dropped to identify what event types may be
leading to large log records.

This also fixes the call to MemBufferExpand which is supposed be
passed the amount to expand by, not the new size required.

Ticket: #7300
(cherry picked from commit d39e42728a)
2 years ago
Philippe Antoine 1bae761818 mqtt: look for a reason code in all messages
instead of stopping on the first message if it does not
have a reason code, like conn and conn_ack

Was fixed in master by big refactor 0a1062fad2
2 years ago
Jason Ish 552dea9f5b mqtt: double-check detection directions
Backport of commit 5d8252117f.

Ticket: 7323
2 years ago
Sascha Steinbiss 378b9bb55d mqtt: add reason code support for SUBACK
Ticket: #7323
(cherry picked from commit 377d4705e1)
2 years ago
Philippe Antoine c3a6abf601 detect/transform: handle overlapping dotprefix
If there is a transform before dotprefix, it operates in place
in a single buffer, and must therefore use memmove instead of memcpy
to avoid UB.

Ticket: 7229
2 years ago
Jeff Lucovsky fccb3280d3 detect/sip.stat_code: Correct sticky buffer name
Issue: 7295

The sticky buffer name was incorrectly set to method; this commit fixes
the name typo with stat_code.
2 years ago
Philippe Antoine f80ebd5a30 detect/transforms: write directly in inspect buffer
instead of writing to a temporary buffer and then copying,
to save the cost of copying.

Ticket: 7229

Not a cherry-pick as we do not put the transforms in rust,
but just do this optimization in C
2 years ago
Jason Ish c3aa3ae102 http2: rename event variant to match rule
Rename InvalidHTTP1Settings to InvalidHttp1Settings so it gets the
expected name transformation of "invalid_http1_settings".

Ticket: #7361
(cherry picked from commit b1c26dccf3)
2 years ago
Jason Ish 1f8682c05c rules/modbus: remove rule for event that not longer exists
The event "modbus.invalid_unit_identifier" no longer exists.

Ticket: #7361
(cherry picked from commit a55960e6ba)
2 years ago
Jason Ish 553fd1d329 rules/ike: fix ike event names that have changed
- weak_crypto_nodh -> weak_crypto_no_dh
- weak_crypto_noauth -> weak_crypto_no_auth

Ticket: #7361
(cherry picked from commit b44ba3224f)
2 years ago
Jason Ish bffd289050 rules/dns: fix dns event names that have changed
- not_a_request to not_request
- not_a_response to not_reponse

Ticket: #7361
(cherry picked from commit 833c7c64be)
2 years ago
Jason Ish bcd3523cc7 rust/applayer: return -1 if event info was not found
The returned event_id was being set to -1, but the function wasn't
returning -1 to indicate error.

Ticket: #7361
2 years ago
Philippe Antoine 4bb19f776e detect/http: fix progress for headers keywords
Ticket: 7326

Having a lower progress than one where we actually can get
occurences of the multibuffer made prefilter
bail out too early, not having found a buffer in the multi-buffer
that matiched the prefilter.

For example, we registered http_request_header with progress 0
instad of progress HTP_REQUEST_HEADERS==2, and if the first
packet had only the request line, we would consider
that signatures with http_request_header as prefilter/fast_pattern
could not match for this transaction, even if they in fact
could have a later packet with matching headers.

Hence, we got false negatives, if http.request_header or
http.response_header was used as fast pattern, and if the request
or response came in multiple packets, and the first of these packets
did not have enough data (like only http request line),
and the next packets did have the matching data.

(cherry picked from commit cca59cdaa9)
2 years ago
Philippe Antoine 470795e65b suricata/bpf: fix -Wshorten-64-to-32 warning
Ticket: 7366
Ticket: 6186
(cherry picked from commit dd71ef0af2)
2 years ago
Jason Ish 3000e963d5 rust/applayer: use c_int as return type for get_info_by_id
Rust was using i8 as the return type, while C uses int. As of Rust
1.82, the return value is turned to garbage over the FFI boundary.

Ticket: #7338
(cherry picked from commit 45384ef969)
2 years ago
Jason Ish 10225bdee2 eve/schema: add missing field "code" anomaly events
(cherry picked from commit b44fc62e60)
2 years ago
Noah Liu ede115fbc1 stream/reassembly: optimize GetBlock
Current GetBlock degrees the sbb search from rb tree to
line, which costs much cpu time, and could be replaced by
SBB_RB_FIND_INCLUSIVE. It reduces time complexity from
O(nlogn) to O(logn).

Ticket: 7208.
(cherry picked from commit 951bcff970)
2 years ago
Jeff Lucovsky 4015b3ec5d profiling: Correct profiling data array size
The profiling arrays are incorrectly sized by the number of thread
modules. Since they contain app-layer protocol data, they should be
sized by ALPROTO_MAX.

(cherry picked from commit 799822c3db)
2 years ago
Juliana Fajardini 490931c166 schema/tls: add missing custom fields chain/cert
Task #7287

(cherry picked from commit 2eefc4dac8)
2 years ago
Zemeteri Kamimizu 4f80cb5f69 conf: init parser after check with stat()
Commit changes are made to avoid possible memory leaks. If the parser
is initialized before configuration file checking, there was no deinit
call before function return. Do check config file existance and type
before YAML parser initialization, so we don't need to deinit parser
before exiting the function.

Bug: #7302
(cherry picked from commit 87e6e9374f)
2 years ago
Zemeteri Kamimizu 1bf55502dc detect: add new_de_ctx release in case of errors in initialization
Detect engine tenant reloading function hasn't got engine release call
under error label, so it is possible memory leak in case of errors in
further new detect engine initialization.

Bug: #7303
(cherry picked from commit adcac9ee0f)
2 years ago
Jason Ish 8810d7f190 github-ci: don't install cbindgen on centos stream 9
Not needed as this is a build from make dist, and providing cbindgen
will force regeneration of the bindings.
2 years ago
Jason Ish a60017a56e github-ci: pin actions/upload-artifact to newer version
Required for the newer version of download-artifact in use due to sync
with master.
2 years ago
Jason Ish 54e629f93c github-ci: sync almalinux builds with master 2 years ago
Jason Ish 441239b9e5 github-ci: pin missed actions/checkout
Pin actions missed as part of the sync with master as they most likely
don't exist in master.
2 years ago
Jason Ish d66c5ce7d8 github-ci: pin missed actions/cache
In job: ubuntu-22-04-cov-fuzz
2 years ago
Jason Ish cde3edf0f1 github-ci: add ubuntu 24.04 cocci build
As cocci was removed from the Fedora builds due to issues in Cocci on
Fedora.
2 years ago
Jason Ish b5a109bb9d github-ci: remove Fedora 38, add Fedora 40
Sync with master on Fedora builds.
2 years ago
Jason Ish 7198c0516c github-ci: sync with master branch
Mainly hashes of actions and other minor changes.
2 years ago
Victor Julien 04929d875e github-action: share cargo registry cache
(cherry picked from commit 97d525d18d)
2 years ago
Victor Julien f4d066f681 github-action: share cargo cache for windows jobs
Modification by Jason Ish: Keep removal of duplicate checkout action
while resolving conflict.

(cherry picked from commit d574d88bca)
2 years ago
Jason Ish b83d336d7d github-ci: install prepared cbindgen on rpm distros
Currently cbindgen from system packages is broken, for now use the
cbindgen artifact we build.

(cherry picked from commit 09d604f7c3)
2 years ago
Jason Ish 5c26f2afa5 github-ci: break out cbindgen installation to action
(cherry picked from commit a5e13d0dee)
2 years ago
Jason Ish 9dd3994bdf github-ci: run macos python jobs in virtualenv
With the latest brew changes, a virtualenv is required to install
pyyaml.

(cherry picked from commit 2b16369071)
2 years ago
Alexey Simakov 91ae28e3d3 yaml: Add check of allocation for node object
Fix potential dereference of nullptr in case
of unsuccessful allocation of memory for
list node

Bug: #7270
(cherry picked from commit c72404e554)
2 years ago
Philippe Antoine e5c4dc3944 http: fix condition check
Ticket: 7309

Do not use a constant expression in a condition

(cherry picked from commit 76527dde79)
2 years ago
Philippe Antoine 9371133e0e template: remove -rust references
Ticket: 7315

Completes commit 4a7567b3f0

Allows keyword template.buffer to work properly when template
protocol is enabled

(cherry picked from commit 58556b7f8b)
2 years ago
Shivani Bhardwaj 09d3ff9980 util/thash: fix formatting 2 years ago
Shivani Bhardwaj cd7d785267 version: start development towards 7.0.8 2 years ago
Shivani Bhardwaj 572a16fb5a release: 7.0.7; update changelog 2 years ago
Ilya Bakhtin f8f65de937 detect: pseudo-packets inherit inspect flags from parent packet
Instead of inheriting from flow, because encrypted protocols like TLS
and SSH may have just set the flow flags to indicate rest of stream is
encrypted and does not need to run stream inspection. But inspection
still needs to be run detection on this last flushing packet.

Ticket: #7235.
(cherry picked from commit 976dec7f33)
2 years ago