Commit Graph

17846 Commits (main)
 

Author SHA1 Message Date
Jason Ish ffa1766742 github-ci: finish removing cppclean
Completes commit 2d308c000d.
2 months ago
Jason Ish 3c98ea85d6 github-ci: add almalinux 10 build
Based on the current AlmaLinux 9 build, with plugin tests, etc.
Remove cppclean as its not installed and was previously disabled with
commit 2d308c000d.
2 months ago
Lukas Sismis e4a406d375 hyperscan: prevent LTO opmitizing out hash calculation
Since cached_hash was updated through reference (hash), it seems
LTO did not notice this and optimized the whole code block, returning
zero.
This in turn caused all caches to have the same name and to overwrite.
On subsequent runs, only the last cache was loaded for all SGHs
causing wrong MPM assignment.

Ticket: 7824
2 months ago
Jason Ish bb846de074 github-ci: add flto build
Ubuntu and Fedora packing system build with -flto=auto by default, so
update one test to use -flto=auto. Also build with -O2 as that
combination can cause issues such as
https://redmine.openinfosecfoundation.org/issues/7824.

Also adds vectorscan to the build.
2 months ago
Jason Ish 81e7316616 lua/bytevarlib: return luaL_error to suppress warning
Even though luaL_error never returns, use a return to make it
clear. Also prevents a compiler warning about idx being used
uninitialized.
2 months ago
Jason Ish 0e80aca3c3 detect-engine-address: initialize pointer in unit tests
To prevent the compiler warning about "c" being used uninitialized
with LTO.
2 months ago
Jason Ish a1c5e93d45 util-byte: fix usage of util-byte integer parsers
Functions like ByteExtractStringUint8 return 0 or less on
failure. Many usages of this function treat 0 as successful as its our
common pattern.

Ticket: #7836
2 months ago
Alexandre Iooss 57e0ff0ee0 doc/lua: fix typo in stream toserver and toclient 2 months ago
Philippe Antoine fe9da8acd6 http2: do not log empty objects for request or response
Ticket: 7741
2 months ago
Philippe Antoine c20dddb046 output: fix NULL deref if no app-layer is logged
Ticket: 7815
2 months ago
Philippe Antoine 9a01c1be8e output: fix condition for community id with same ip
Ticket: 5689
2 months ago
Philippe Antoine 271854a3ea counters: hard fail on allocation failure during init
Ticket: 7813
2 months ago
Philippe Antoine 9545eab4c8 conf/output: friendly error message on bad configuration
Ticket: 7611

Instead of segfault

output.types expects a sequence of one-key mappings, instead
of directly a mapping
2 months ago
Jeff Lucovsky 1030e4fa92 doc/suricatasc: Mentioned get-flow-stats-by-id cmd
Add get-flow-stats-by-id to the list of commands supported by suricatasc

Issue: 7081
2 months ago
Philippe Antoine 669b651368 build: include first rust/gen
Ticket: 7804

Allows especially to prefer our lua (rust crate) includes over
the system one
2 months ago
Philippe Antoine 7be505e887 doh: do not log dns events when there is no DNS
Ticket: 7740

When we have a pure HTTP2 transaction (such as settings), we want
to log a http event
2 months ago
Philippe Antoine 11c549211e snmp: fix the possibility to disable the parser
Ticket: 7820

Do not register anything, not even ALPROTO_SNMP "snmp" string
if parser is disabled
2 months ago
Philippe Antoine 6bbba953df ci: use debian 12 for xdp
As bullseye is EOL so it is being removed from the mirrors

https://lists.debian.org/debian-backports/2024/07/msg00003.html

[Edit by JI: Add xdp to distcheck build as well.]
2 months ago
Jason Ish 2e69e0d5c1 github-ci: remove debian:10 build, it is EOL 2 months ago
Jeff Lucovsky 07b7f36748 doc/reload: Expand rule-reload discussion
Clarify the resources involved in a rule reload.

Issue: 5078
2 months ago
Eric Leblond a28d544550 doc: add some missing url and desc
Keywords registration should provide a desc and a link to the
documentation. This patch adds desc and/or url for on most keywords
missing that.

This allows better output for list-keywords command line which
is then use in Suricata Language Server.
2 months ago
Jeff Lucovsky c0d54d838e gen/typo: Misc. typo fixes 2 months ago
Jeff Lucovsky 97b03b4076 doc/netflow: Discuss netflow
Add discussion for netflow configuration, event type and fields
contained in netflow records.

Issue: 5139
2 months ago
Shivani Bhardwaj e4b3b75b23 version: start development towards 8.0.1 2 months ago
Shivani Bhardwaj 9956286fb8 release: 8.0.0; update changelog 2 months ago
Philippe Antoine fa8d3a4ccb http2: do not set file flags for global txs
Global txs means here txs with stream id 0, used for connection control
messages.
3 months ago
Philippe Antoine 349c21af2c http2: mark old txs as updated
As is done in the other case a few lines below
3 months ago
Philippe Antoine 1d6d331752 http2: forbid data on stream 0
Ticket: 7658

Suricata will not handle well if we open a file for this tx,
do not close it, but set the transaction state to completed.

RFC 9113 section 6.1 states:

If a DATA frame is received whose Stream Identifier field is 0x00,
the recipient MUST respond with a connection error (Section 5.4.1)
 of type PROTOCOL_ERROR.
3 months ago
Jason Ish 116d1763d9 lib: opt-in signal handlers
Instead of enabling signal handlers by default, require the user of
the library to opt-in. This is done with the call to
SCEnableDefaultSignalHandlers, which sets a flag to add the default
signal handlers.

This seems like the least invasive way to do this at this time, but it
will require some re-thinking for 9.0, especially if migrate globals
to engine instances, signal handling will need to be re-thought.

Ticket: #6814
3 months ago
dependabot[bot] ed4cf9a803 github-actions: bump github/codeql-action from 3.28.18 to 3.29.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.18 to 3.29.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.18...v3.29.2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 months ago
Lukas Sismis 239de05b9d dpdk: auto threads assign one too many threads
Configuration option `threads: auto` in DPDK's interface node
overassigns available threads to the interface.
Commit 4dfd44d3 changed the signedness of the remaining threads counter,
which caused surpass of the counter initialization.
The if-clause is switched to first initialize and then use the counter.

Ticket: 7798
3 months ago
Jason Ish c204ddb3e5 rust/Makefile: sort filenames
Misc cleanup as these lists are growing.
3 months ago
Jason Ish f68b06798f rust/htp: follow suricata versioning
Have htp follow Suricata versioning so we don't have to worry about
version updates as it changes.

For example, between 8.0.0-beta1 and 8.0.0-rc1 there were changes to
the htp, however the version stayed at 2.0.0 making it impossible to
publish these changes to crates.io.
3 months ago
Boris Tonofa 66e7437bef detect-bytetest: remove meaningless NULL check on data_offset
The condition data_offset == NULL can never be true: data_offset has
already been validated as non-NULL a few lines earlier. The guard seems
to have been intended for the offset argument, yet throughout the
codebase offset is never passed as NULL. (In the unit tests, offset is
NULL, but those tests pass the value parameter as NULL, which causes the
function to return before offset is dereferenced.)

Remove the pointless check to simplify control flow and silence
static-analysis warnings.

No functional change.

Bug 7767
3 months ago
Philippe Antoine 1940454a69 http: do not yield after failed connect if already pipelined
Ticket: 7791
3 months ago
Shivani Bhardwaj 58367149cc doc: add upgrade note about change in inspection 3 months ago
Shivani Bhardwaj e8f78da123 smtp: trigger raw stream inspection
Internals
---------
Suricata's stream engine returns data for inspection to the detection
engine from the stream when the chunk size is reached.

Bug
---
Inspection triggered only in the specified chunk sizes may be too late
when it comes to inspection of smaller protocol specific data which
could result in delayed inspection, incorrect data logged with a transaction
and logs misindicating the pkt that triggered an alert.

Fix
---
Fix this by making an explicit call from all respective applayer parsers to
trigger raw stream inspection which shall make the data available for inspection
in the following call of the stream engine. This needs to happen per direction
on the completion of an entity like a request or a response.

Important notes
---------------
1. The above mentioned behavior with and without this patch is
affected internally by the following conditions.
- inspection depth
- stream depth
In these special cases, the inspection window will be affected and
Suricata may not consider all the data that could be expected to be
inspected.
2. This only applies to applayer protocols running over TCP.
3. The inspection window is only considered up to the ACK'd data.
4. This entire issue is about IDS mode only.

SMTP parser can handle multiple command lines per direction. Appropriate calls
to trigger raw stream inspection have been added on succesful parsing of each
request line and response line.

For the requests, the call to trigger inspection has been added in the
beginning rather than the completion of transactions. This does not
affect the inspection as it is actually triggered in the following call.
This covers the case for anomaly as well. There are two benefits for
this:
- immediate inspection for anomalous data
- flushing of the anomalous data making next data's inspection cleaner

Bug 7783
3 months ago
Shivani Bhardwaj 379f04cdd1 smtp: revert ab01a1b
to build the correct behavior. As a part of ab01a1b, in order to match
the behavior in master, the calls for triggering raw stream inspection
were made when communication in one direction for a transaction was
completed. However, it was incorrect to do so. Reliable inspection
requires any request line/response line to be completed.

Bug 7783
3 months ago
Philippe Antoine ad0f6e388e src: remove BUG_ON in packet path
Transforms them into debug validations

Ticket: 1484

Packet path is here considered FlowWorker and all lines
covered by SV tests are here fixed
3 months ago
Philippe Antoine 366b969463 src: remove direct calls to abort
use BUG_ON macros instead

Ticket: 1484
3 months ago
Philippe Antoine 055d270b98 ci: test with latest rust stable version 1.88 3 months ago
Philippe Antoine 10150e95ad rust: allow collapsible_else_if for debug logs
see https://github.com/rust-lang/rust-clippy/issues/15158
3 months ago
Philippe Antoine a22b2f06fe rust/htp: fix clippy uninlined_format_args
--> htp/src/decompressors.rs:703:64
    |
703 |                 std::io::Error::new(std::io::ErrorKind::Other, format!("{}", e))
    |                                                                ^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
3 months ago
Fupeng Zhao b8ee6513cc configure: remove unused strtoul check
strtoul is no longer used in the codebase, so the check was removed from AC_CHECK_FUNCS.
3 months ago
Fupeng Zhao f11949ca47 detect/byte: update comments to reflect current parsing logic 3 months ago
Fupeng Zhao d618585c4f util/coredump: refactor parsing and respect zero core dump limit
- Replaced strtoul/strtoull with ByteExtractString* for safer and more consistent parsing.
- Allowed max-dump to be set to 0, and correctly apply a core dump limit of 0, maintaining behavior consistent with the commented default in suricata.yaml.in.
- Added and registered unit tests to validate the updated logic.

Ticket: #7212
3 months ago
Fupeng Zhao e740307cd5 detect: replace strtoul with ByteExtractStringUint32
Also added and updated unit tests to ensure correctness.

Ticket: #7212
3 months ago
Jeff Lucovsky c7a642c7c2 misc/debug: Use SCConfDump
The API entrypoint for ConfDump has changed so update the #ifdef'd
code to use it.
3 months ago
Lukas Sismis f471de51b8 dpdk: complete function prototype definition
Ticket: 7789
3 months ago
Lukas Sismis acbd02699e affinity: initialize CPU sets with online CPUs only
When no CPU set is explicitly defined, switch from
UtilCpuGetNumProcessorsConfigured() (which counts all existing CPU
cores, even offline ones) to UtilCpuGetNumProcessorsOnline() (only
the available cores).
If Suricata initializes more threads than online CPUs it oversubscribes
the system. As Suricata does not support any runtime live reconfiguration
Suricata initializes only as many cores as online CPU cores.

Ticket: 7790
3 months ago