Commit Graph

17728 Commits (master)
 

Author SHA1 Message Date
Jason Ish 2e69e0d5c1 github-ci: remove debian:10 build, it is EOL 2 days ago
Jeff Lucovsky 07b7f36748 doc/reload: Expand rule-reload discussion
Clarify the resources involved in a rule reload.

Issue: 5078
6 days 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.
6 days ago
Jeff Lucovsky c0d54d838e gen/typo: Misc. typo fixes 6 days ago
Jeff Lucovsky 97b03b4076 doc/netflow: Discuss netflow
Add discussion for netflow configuration, event type and fields
contained in netflow records.

Issue: 5139
6 days ago
Shivani Bhardwaj e4b3b75b23 version: start development towards 8.0.1 1 week ago
Shivani Bhardwaj 9956286fb8 release: 8.0.0; update changelog 1 week 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.
2 weeks ago
Philippe Antoine 349c21af2c http2: mark old txs as updated
As is done in the other case a few lines below
2 weeks 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.
2 weeks 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
2 weeks 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>
2 weeks 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
2 weeks ago
Jason Ish c204ddb3e5 rust/Makefile: sort filenames
Misc cleanup as these lists are growing.
2 weeks 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.
2 weeks 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
2 weeks ago
Philippe Antoine 1940454a69 http: do not yield after failed connect if already pipelined
Ticket: 7791
2 weeks ago
Shivani Bhardwaj 58367149cc doc: add upgrade note about change in inspection 2 weeks 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
2 weeks 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
2 weeks 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
2 weeks ago
Philippe Antoine 366b969463 src: remove direct calls to abort
use BUG_ON macros instead

Ticket: 1484
2 weeks ago
Philippe Antoine 055d270b98 ci: test with latest rust stable version 1.88 3 weeks ago
Philippe Antoine 10150e95ad rust: allow collapsible_else_if for debug logs
see https://github.com/rust-lang/rust-clippy/issues/15158
3 weeks 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 weeks 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 weeks ago
Fupeng Zhao f11949ca47 detect/byte: update comments to reflect current parsing logic 3 weeks 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 weeks ago
Fupeng Zhao e740307cd5 detect: replace strtoul with ByteExtractStringUint32
Also added and updated unit tests to ensure correctness.

Ticket: #7212
3 weeks 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 weeks ago
Lukas Sismis f471de51b8 dpdk: complete function prototype definition
Ticket: 7789
3 weeks 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 weeks ago
Jeff Lucovsky bb12f197bc detect/analyzer: Include ICMP icode information
Issue: 6359

Extend the rules analysis to include ICMP icode information.
3 weeks ago
Jeff Lucovsky 7e713cb45a detect/analyzer: Support u8 types
Issue: 6359

Support JSON output of u8 types
3 weeks ago
Philippe Antoine f4378eb306 doc/devguide: document app-layer protocol detection
Ticket: 6022
3 weeks ago
Philippe Antoine 4d4eb84eca doc: document krb5 event type
Ticket: 6566
3 weeks ago
Philippe Antoine f907216e1a doc: do not have bittorrent in the middle of SMB events 3 weeks ago
Philippe Antoine 68827a4ace schema: document kerberos fields
Ticket: 6566
3 weeks ago
Philippe Antoine 8ba16e2813 ci: do not run workflows for etc/schema.json
As it is rather a documentation file than code
3 weeks ago
Victor Julien ba4d4f8694 nfq: suppress coverity thread warning
CID 1593187: (#1 of 1): Data race condition (MISSING_LOCK)
2. missing_lock: Accessing (*p).nfq_v.mark without holding lock Packet_.persistent.tunnel_lock. Elsewhere, NFQPacketVars_.mark is written to with Packet_.persistent.tunnel_lock held 2 out of 5 times (2 of these accesses strongly imply that it is necessary).

No concurrency happening on non-tunnel packet, so no locking needed.
3 weeks ago
Victor Julien 7f5d1f4c79 util/var-store: suppress coverity warnings 3 weeks ago
Victor Julien 2bea5af2c8 detect/multi-tenant: address various thread safety warnings 3 weeks ago
Victor Julien f26f7505db packetpool: improve thread safety
lock_acquire: Calling pthread_mutex_lock acquires lock PktPoolLockedStack_.mutex.
 87        SCMutexLock(&my_pool->return_stack.mutex);

CID 1554228: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock PktPoolLockedStack_.mutex. This can cause a deadlock if the notification happens before the lock is acquired.
      Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.
4 weeks ago
Victor Julien 65ff3dfa88 detect/loader: add threading coverity warning
lock_acquire: Calling pthread_mutex_lock acquires lock ThreadVars_.ctrl_mutex.
725        SCCtrlMutexLock(th_v->ctrl_mutex);

CID 1554214: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock ThreadVars_.ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.
      Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.
4 weeks ago
Victor Julien 5aaef39c8c flow/manager: fix threading/locking coverity warnings
In flow manager and recycler timed condition wait loops.

First check loop break conditions before entiring the timed wait.

CID 1638284: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock flow_manager_ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.

CID 1638293: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock flow_recycler_ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.
4 weeks ago
Victor Julien f332b3e571 defrag: improve thread safety in config logging
CID 1554235: (#1 of 1): Data race condition (MISSING_LOCK)
missing_lock: Accessing defragtracker_spare_q.len without holding lock DefragTrackerStack_.m. Elsewhere, DefragTrackerStack_.len is written to with DefragTrackerStack_.m held 2 out of 2 times.
4 weeks ago
Victor Julien a472b24d17 datasets: use locking wrappers everywhere
To assist coverity, which got confused:

CID 1649393: (#1 of 1): Data race condition (MISSING_LOCK)
missing_lock: Accessing sets without holding lock sets_lock. Elsewhere, sets is written to with sets_lock held 2 out of 3 times.
4 weeks ago
Jason Ish ddb77d061e eve/schema: map mdns properties that have keywords
Also add descriptions for the EVE index.
4 weeks ago
Jason Ish 933127a9a8 rules: add mdns rules 4 weeks ago
Jason Ish 5f37fd4db0 .gitignore: don't ignore rule files in rules/
These are rules we want to track edits to, as well as new and removed
files.
4 weeks ago