Commit Graph

16399 Commits (285cc29ec029dea68f74bbdba5f421d80de21e6c)
 

Author SHA1 Message Date
Jason Ish a5e13d0dee github-ci: break out cbindgen installation to action 5 months ago
Jeff Lucovsky c9e4524b3c misc: Eliminate compiler warnings
Issue: 7314

Fixup macro usages to eliminate compiler warnings.
5 months ago
Philippe Antoine 76527dde79 http: fix condition check
Ticket: 7309

Do not use a constant expression in a condition
5 months ago
Alice Akaki d5dd549bcd detect/address: convert ipv4 unittests to FAIL/PASS
Ticket: OISF#6318
5 months ago
Philippe Antoine 40e97423b4 transform/base64: check for 0-sized buffer
So as to avoid undefined behavior with a 0-sized variable length
array

Ticket: #7296
5 months ago
Zemeteri Kamimizu adcac9ee0f 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
5 months ago
Jason Ish 6ae5ae701b doc/userguide: generate eve documentation
Add EVE documentation for QUIC and Pgsql to their respective sections of
the userguide.

Also add a complete EVE reference as an appendix.

Other protocols can be done, but its a manual process to document in the
schema, then add the glue to pull them into the documentation.

The documentation is generated during "make dist", or if it doesn't
exist, "conf.py" will attempt to generate the eve documentation for
building on Readthedocs.
5 months ago
Jason Ish 2626895a93 evedoc.py: script to generate rst doc from eve schema
Also supports a "--flat" command line option to produce a "dot"
separated version of all the fields in the EVE schema.
5 months ago
Jason Ish 2b16369071 github-ci: run macos python jobs in virtualenv
With the latest brew changes, a virtualenv is required to install
pyyaml.
5 months ago
Jason Ish d8f73c9215 tm-modules: minor code cleanups
- includes
- loops
5 months ago
Jason Ish 415c5786de threading: remove TM_FLAG_LOGAPI_TM as its not used
This flag is never set, remove.
5 months ago
Philippe Antoine 3f0512ebeb rust: unpin serde
As oss-fuzz uses a newer compatible rustc version
5 months ago
Jason Ish 75b760b450 github-ci: add rpm build job
Build RPMs for Fedora 40 and EPEL 9 (using AlmaLinux).
5 months ago
Jason Ish c9369641f8 ebpf: include llvm_bpfload.h in distribution
Otherwise we fail to build ebpf from a release archive.
5 months ago
Jason Ish 9816a795dd github-ci: cache deb packages on Ubuntu dist builder
Should speed up setup a little.
5 months ago
Shivani Bhardwaj 501f79c0ed detect/engine: deduplicate fn definitions 5 months ago
dependabot[bot] 06dd6bacb0 github-actions: bump actions/checkout from 4.1.7 to 4.2.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](692973e3d9...d632683dd7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
dependabot[bot] 0ffd33ab92 github-actions: bump codecov/codecov-action from 4.5.0 to 4.6.0
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](e28ff129e5...b9fd7d16f6)

---
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>
5 months ago
dependabot[bot] 908ff2faa3 github-actions: bump github/codeql-action from 3.26.6 to 3.26.10
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.6...v3.26.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>
5 months ago
Alexey Simakov c72404e554 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
5 months ago
Liam Wilson 592d860434 configure: clear cached header value
Unset ac_cv_header_hs_h before checking for header. This allows
hyperscan to be included in compilation when switching from a non-hs
build to a hs build.
5 months ago
Jason Ish 3b6f709331 threads: don't drop capabilities for packet threads
Remove the call to SCDropCaps for packet processing threads. This
logic in this function is required to setup packet processing even
when the thread is provided by a library user, in which case Suricata
should not be touching is capabilities.

As SCDropCaps is currently a no-op its clear this feature needs to
be (re)designed properly, taking into consideration library users as
well.

Related ticket: https://redmine.openinfosecfoundation.org/issues/2375
5 months ago
Ilya Bakhtin 976dec7f33 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.
5 months ago
Philippe Antoine 26da953f6d util/hash: use randomized hash algorithm
For datasets and http ranges

Ticket: 7209

Prevents abusive hash collisions from known djb2 algorithm
5 months ago
Philippe Antoine bb714c9178 http: have a headers limit
Ticket: 7191

So as to avoid quadratic complexity in libhtp.
Make the limit configurable from suricata.yaml,
and have an event when network traffic goes over the limit.
5 months ago
Philippe Antoine 1e152d1f10 ja4: handles non alphanumeric alpn
Ticket: 7267

Follows more closely the specification :
https://github.com/FoxIO-LLC/ja4/blob/main/technical_details/JA4.md#alpn-extension-value

Also fixes the case with a single-char alpn.
5 months ago
Philippe Antoine 9203656496 defrag: fix off by one
Ticket: 7067

This off by one could lead to an empty fragment being inserted
in the rb tree, which led to integer underflow
5 months ago
Victor Julien 45eb7e4881 stream: improve 3whs completed by ACK with data
If the ACK packet completing the 3whs is received, the stream engine will
transition to "established". However, the packet itself will not be tagged
as "established". This will only happen for the next packet after the 3whs,
so that `flow:established` only matches after the 3whs.

It is possible that the ACK packet completing the 3whs was lost. Since the
ACK packets themselves are not acknowledged, there will be no retransmission
of them. Instead, the next packet can have the expected ACK flag as well as
data.

This case was mishandled in a subtle way. The stream engine state transition
was done correctly, as well as the data handling and app-layer updates.
However, the packet itself was not tagged as "established", which meant
that `flow:established` would not yet match.

This patch detects this case and tags the packet as established if ACK
with data is received that completes the 3whs.

Bug: #7264.
5 months ago
Philippe Antoine 521928e2a3 sip: use pure rust function
For internal function that is not part of C FFI
5 months ago
Philippe Antoine c55c7d6c27 detect/dataset: abort only in debug mode
Ticket: 7195
5 months ago
Philippe Antoine e47598110a detect/datasets: implement unset command
Ticket: 7195

Otherwise, Suricata aborted on such a rule
5 months ago
Philippe Antoine 1352ed68c7 datasets: restrict scope of macro/enum 5 months ago
Philippe Antoine 1d32f11745 ssl/ja3: better check for ja3 being enabled
Ticket: 6634

Completes commit 84735251b5

Avoids error log in Ja3BufferAddValue about NULL buffer
5 months ago
Noah Liu 951bcff970 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.
5 months ago
Juliana Fajardini 18e0d23ed3 docs: remove mentions to Suricata-6
Task #7262
5 months ago
Juliana Fajardini d1d1c8cdac doc/conf/yaml: replace underscore with dashes
Use sed + regex to replace all occurrences of suricata.yaml terms that
used underscore for their up-to-date dash version.

Also search for such terms in the eve-log.yaml partials file, as that
is referenced in the configuration section.

commands used:

sed -i 's/\(^ *[a-z]*\)_\([a-z]*:\)/\1-\2/g'
sed -i 's/\(^ *[a-z]*\)_\([a-z]*\)_\([a-z]*:\)/\1-\2-\3/g'

Some other instances were found manually.

Task #7260
5 months ago
Shivani Bhardwaj 6ff0f72f4d detect/base64: minor cleanups
1. decode_len can be u32 as it stores min of two u32s.
2. Add defensive check for payload_len calculation underflow.
5 months ago
Shivani Bhardwaj 86eec116eb transform/base64: add explicit mode to test
Without any mode setting, the test would take up the mode to be 0 which
used to be the relax mode for base64 decoder in C. However, there was no
code corresponding to that mode and it was never used so nothing
happened when this test was run.

Add an explicit strict mode as per the expectation of the test from its
comments.
5 months ago
Shivani Bhardwaj cbb571a61c rust/base64: add decoder
Add a pure rust base64 decoder. This supports 3 modes of operation just
like the C decoder as follows.
1. RFC 2045
2. RFC 4648
3. Strict

One notable change is that "strict" mode is carried out by the rust
base64 crate instead of native Rust. This crate was already used for
encoding in a few places like datasets of string type. As a part of this
mode, now, only the strings that can be reliably converted back are
decoded.

The decoder fn is available to C via FFI.

Bug 6280
Ticket 7065
Ticket 7058
5 months ago
Philippe Antoine 7ab833471e doc/rfb: mention accidental fix for security_result log
Ticket: 7198
5 months ago
Giuseppe Longo 036b68b0a9 doc: add new sip keywords 5 months ago
Giuseppe Longo d43154adbe sip: add sip.content_length sticky buffer
This adds a sticky (multi) buffer to match the "Content-Length" header field in
both requests and responses.

Ticket #6374
5 months ago
Giuseppe Longo 6f727ab970 sip: add sip.content_type sticky buffer
This adds a sticky (multi) buffer to match the "Content-Type" header field in
both requests and responses.

Ticket #6374
5 months ago
Giuseppe Longo 5e8e61bb3b sip: add sip.user_agent sticky buffer
This adds a sticky (multi) buffer to match the "User-Agent" header field in
both requests and responses.

Ticket #6374
5 months ago
Giuseppe Longo 6ddc7d6223 sip: add sip.via sticky buffer
This adds a sticky (multi) buffer to match the "Via" header field in
both requests and responses.

Ticket #6374
5 months ago
Giuseppe Longo c205e87911 sip: add sip.to sticky buffer
This adds a sticky (multi) buffer to match the 'To' header field in
both requests and responses.

Ticket #6374
5 months ago
Giuseppe Longo e3fefcf55c sip: add sip.from sticky buffer
This adds a sticky (multi) buffer to match the "From" header field
in both requests and responses.

Ticket #6374
5 months ago
Giuseppe Longo fbc3cd1b3f rust/sip: store response headers
To match on response SIP headers, those headers must be stored.

Ticket #6374
5 months ago
Giuseppe Longo cfb793ce28 rust/sip: store multiple header values
According to RFC 3261, a single header can be repeated one or more times,
and its name can also be specified using the 'compact form.'

This patch updates the hashmap used for storing headers to accommodate multiple
values instead of just one.

Additionally, if a header name is defined in the compact form, it is expanded
into its long form (i.e., the standard name).

This conversion simplifies the logic for matching a given header
and ensures 1:1 parity with keywords.

Ticket #6374
5 months ago
Giuseppe Longo 969f4d131f sip: rustify sticky buffers
Ticket #7204
5 months ago