Commit Graph

17756 Commits (2e3dfd318b85cdd98cdebd4d44795583128f9b96)
 

Author SHA1 Message Date
Philippe Antoine 2e3dfd318b file: remove unused flag
FLOWFILE_NO_SIZE_* are unused, whose removal shows that
SIG_GROUP_HEAD_HAVEFILESIZE gets unused, whose removal shows that
SignatureIsFilesizeInspecting gets unused
9 months ago
Lukas Sismis 897cdb8571 doc/dpdK: update RX/TX descriptor note for Connect-X 4
Ticket: 7639
9 months ago
Adam Kiripolsky fe2d64e758 app-layer: fix ippair memcap counters
Fixed counter for ippair.memcap by using the correct function,
IPPairGetMemcap.
Until now IPPairGetMemuse was used both for memuse and memcap.

Ticket: 7827
9 months ago
Jason Ish eaef74af05 lua: document the dnp3 lib
Ticket: #7631
9 months ago
Jason Ish 3b7b908fe2 doc/upgrade: mention that lua rules are enabled by default 9 months ago
Jason Ish 7a65ca10e2 doc/lua-detection: fix example script; remove most buffers
- Reference rule hooks instead

Ticket: #7728
9 months ago
Jason Ish f56bd4db75 doc/lua-output: fix example script for new apis
Ticket: #7728
9 months ago
Jason Ish 7535b5aa1d doc/lua-functions: update lua-function documentation
- cleanup usage and documentation around needs
- mentiond that rule hooks are used instead of "needs" keywords with
  link with rule hooks (which is still in the firewall-design doc)
9 months ago
Jason Ish decf795e94 doc/install: remove reference to --enable-lua
This configure command no longer exists.
9 months ago
Jason Ish 4791f37ca2 doc/lua-detection: update note to mention rules are enabled by default
In 8.0, Lua rules are enabled by default.
9 months ago
Jason Ish ffa1766742 github-ci: finish removing cppclean
Completes commit 2d308c000d.
9 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.
9 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
9 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.
9 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.
9 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.
9 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
9 months ago
Alexandre Iooss 57e0ff0ee0 doc/lua: fix typo in stream toserver and toclient 9 months ago
Philippe Antoine fe9da8acd6 http2: do not log empty objects for request or response
Ticket: 7741
9 months ago
Philippe Antoine c20dddb046 output: fix NULL deref if no app-layer is logged
Ticket: 7815
9 months ago
Philippe Antoine 9a01c1be8e output: fix condition for community id with same ip
Ticket: 5689
9 months ago
Philippe Antoine 271854a3ea counters: hard fail on allocation failure during init
Ticket: 7813
9 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
9 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
9 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
9 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
9 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
9 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.]
9 months ago
Jason Ish 2e69e0d5c1 github-ci: remove debian:10 build, it is EOL 9 months ago
Jeff Lucovsky 07b7f36748 doc/reload: Expand rule-reload discussion
Clarify the resources involved in a rule reload.

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

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

Ticket: 1484
10 months ago