Commit Graph

18061 Commits (841f2b21e652cacfa6c239486b767f61bfed89c4)
 

Author SHA1 Message Date
Andreas Dolp 62d2a69f8a doc: fix doc syntax error in rate_filter example.
(cherry picked from commit 228abb7da0)
6 months ago
Adam Kiripolsky e3433c75fc dpdk: fix assignment of pkt_mempools to ldev
Removed loop around assignment of pkt_mempools
to ldev_instance->dpdk_vars as it is not needed anymore.

Ticket: 7879
(cherry picked from commit 5a4d280461)
6 months ago
Philippe Antoine c8897f4407 scripts: setup app layer rustfmt mod.rs last
Otherwise rustfmt complains that parser.rs does not exist yet

(cherry picked from commit f7f8fbc116)
6 months ago
Victor Julien c12680de1b detect/content: don't leak replace memory
Replace keyword updates a prior content with a heap allocation of the
pattern the content should be replaced with. Make sure this is freed as
well.

Bug: #7997.
(cherry picked from commit ce9c7a024e)
6 months ago
Victor Julien f9cddc004c output: fix long logline test
Fixes: 023a2fe9ab ("unittests: fix format-truncation warning")
(cherry picked from commit b7650a45fa)
6 months ago
Victor Julien 76d6c75634 unittests: disable LogCustomFormatTest01 for MinGW
Test was previously not run so it was missed that it fails.

(cherry picked from commit c8cb029de9)
6 months ago
Victor Julien 62793c573f unittests: don't leak memory with --list-unittests
(cherry picked from commit 57d1f20dfa)
6 months ago
Philippe Antoine 89cbaa7153 detect/files: support protocols only over udp
Ticket: 7973

Files were supported on both TCP and UDP. But file detection keywords
such as file.data made signatures loading fail if the signature
was using an app-layer protocol that enabled on udp only, even
if the signatures could run smoothly.

(cherry picked from commit c99e159341)
6 months ago
Fupeng Zhao 693ca03379 decoder/vxlan: fix VXLAN port detection per RFC 7348
Simplify DecodeVXLANEnabledForPort() to only check destination port
to avoids false positives when identifying VXLAN traffic.

Per RFC 7348 §5, VXLAN identification is based solely on the outer UDP
destination port (4789), regardless of inner packet direction. The
outer UDP source port is used for load balancing via inner packet
hash and should not be considered for VXLAN detection. This ensures
correct VXLAN identification for all encapsulated traffic patterns.

Checking both source and destination ports could incorrectly classify
non-VXLAN UDP traffic as VXLAN when the source port happens to be 4789,
leading to false positives in VXLAN detection and potential decode errors.

(cherry picked from commit 7a04a032b9)
6 months ago
Juliana Fajardini 9a66ac0696 doc/install: fix minor typo 7 months ago
Juliana Fajardini c045a61d53 doc: remove outdated GITGUIDE 7 months ago
Philippe Antoine eef5794e5a mime: retain some stateful data for quoted-printable
In case a sequence like =3D is split over 2 calls to SCSmtpMimeParseLine

Ticket: 7950
(cherry picked from commit 56e08c9134)
7 months ago
Jeff Lucovsky 4e120c0a2d ci/mt: Include MT tests in CI workflows
Add the MT live tests to the CI workflow.

(cherry picked from commit 846eb44a9d)
7 months ago
Jeff Lucovsky 3420968d93 mt/ci: Add MT live test
Add MT live test capability:
- multi-tenant.sh: harness that sets up and steps through MT steps
- suricata-mt.yaml: Adds MT capability to Suricata
- tenant-1.yaml: Per-tenant configuration file

(cherry picked from commit 51c9609c7c)
7 months ago
Victor Julien ef91b8544c github-actions: add validate cherry-pick line check 7 months ago
Cheng Longfei e13fe6a90d lua: fix null dereference in tx HTTP accessor functions
Fix crashes in Lua when calling tx:response_line(), tx:request_line(),
tx:request_uri_raw(), or tx:request_host() on incomplete or malformed
HTTP transactions.

These functions return bstr pointers which may be NULL. Add NULL
checks before calling bstr_ptr() and bstr_len() to avoid segfaults.

Ticket: #7829
(cherry picked from commit 9fb33bbaf6)
7 months ago
Philippe Antoine dae9264120 doc: really enforce more the completeness of json schema
Completes commit f1f32a39ee

End better describe exception_policy
7 months ago
dependabot[bot] cf4a86185d github-actions: bump codecov/codecov-action from 5.5.0 to 5.5.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.0 to 5.5.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](fdcc847654...5a1091511a)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months ago
dependabot[bot] 5aa30fccc8 github-actions: bump actions/github-script from 7.0.1 to 8.0.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](60a0d83039...ed597411d8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months ago
dependabot[bot] f18c8883cf github-actions: bump github/codeql-action from 3.30.0 to 3.30.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.0 to 3.30.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.30.0...v3.30.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
7 months ago
Shivani Bhardwaj 0d65d35c92 version: start development towards 8.0.2 7 months ago
Victor Julien 46203de0e9 doc: adjust for master to main rename 7 months ago
Victor Julien b58c8461c3 clang-format: adjust for master to main rename 7 months ago
Victor Julien 63767252be github-action: adjust for master to main rename 7 months ago
Jason Ish 2444feed0d release: 8.0.1; update changelog 7 months ago
Jason Ish 708874053f detect/mpm: prevent format string truncation warnings
- Declare the profiling name variable once we know the actual size allowed
for the name instead of before. Prevents an snprintf truncation warning.

- Account for the null byte when calculating how much space is left to
avoid an snprintf format string truncation warning.
7 months ago
Victor Julien 2b6df6381a detect/mpm: improve profiling name for frame/pkt buffers 7 months ago
Victor Julien 6655283d2d detect/mpm: improve profiling name creation
The (p)name is used in profiling and will now always have the full id.

Ticket: #7861.
7 months ago
Victor Julien 38a2cba5c3 misc: harden string shortener
Ticket: #7861.
7 months ago
Philippe Antoine d590fdfe42 detect/tls: fix null deref with subjectaltname
Ticket: 7881
7 months ago
Jeff Lucovsky 9f32550e18 detect/entropy: Ensure entropy matcher has flow
Make sure that the flow is available to the entropy matcher so it can
handle content that's not anchored to a sticky buffer.

Issue: 7838
7 months ago
Victor Julien e62eb00459 doc/userguide: add ips chapter; add concept
Move setup guides into the new chapter as well.

Explain `stream.inline` logic.

Ticket: #5513.
Ticket: #6284.
7 months ago
Philippe Antoine 9146fc8957 doc: upgrade note about keyword tls.cert_subject
Following commit 5379b52af2
rules that use multiple times the keyword tls.cert_subject
will result in

Warning: detect: duplicate instance for tls.cert_subject

These rules likely meant to use a multi-buffer which is not the
case for tls.cert_subject (even if it was documented so).

Ticket: 7890

This is put in a new section of upgrade notes for
upgrading to 8.0.1
7 months ago
Juliana Fajardini 27e165f760 doc/rules/index: keep rule types doc near the end
As this chapter is more meta than about rule keywords, keep it by the
end of the index, to have some semantic separation from the other
sections.
7 months ago
Juliana Fajardini d5810a42e1 userguide: document how suricata processes rules
Added a page that explains how rules are prioritized by Suri, as well
as what main different types of inspection happen and what elements are
involved when ordering rules.

Task #5449
7 months ago
Victor Julien 39dfcaf1b3 unix-socket: address scan-build warning
CC       unix-manager.o
unix-manager.c:258:13: warning: Use of memory after it is freed [unix.Malloc]
  258 |         if (item->fd == fd) {
      |             ^~~~~~~~
1 warning generated.
7 months ago
Victor Julien f963c408bd unix-socket: fix memory leak on client disconnect
If a client loses the connection during a reload it initiated there is
a small memory leak.

Bug: #7891.
7 months ago
Philippe Antoine 266809a0f2 ci: check json schema sets always additionalProperties
Even if it is set to true.
Avoids forgetting adding fields and thinking it is tested
7 months ago
Philippe Antoine 2028a3f9f8 doc: complete json schema with integer keywords 7 months ago
Philippe Antoine f1f32a39ee doc: enforce more the completenes of json schema
see jq 'paths( objects | (.type == "object" and (has("additionalProperties") | not) )) | join(".")' etc/schema.json

fix and complete bittorrent on the way
7 months ago
Philippe Antoine 421fb8ac31 doc/ldap: complete json schema 7 months ago
Shivani Bhardwaj b21f737aee doc: add doc on internals of inspection of raw data
Explain briefly the internals of inspection of raw data in the following order:
- Stream Engine
- Stream reassembly
- Role of Detection Engine and Applayer Parsers
- High level communication between Stream and Detection Engine
- Relevant suricata.yaml settings

alongwith some diagrams.

Ticket 4351
7 months ago
Shivani Bhardwaj 9ed5ac7669 doc: make firewall table names consistent 8 months ago
Shivani Bhardwaj 7fec1883cd doc: add more info to firewall design
Add information about:
- available tables, default policies and rule ordering
- Packet layer and applayer tables and hooks
- engine analysis output
- commandline options available
- how to load firewall rules

Also, reorganize sections and content to assist the definitions.
8 months ago
Shivani Bhardwaj 5820b52b0a detect: remove redundant fw rule path log 8 months ago
Victor Julien f333a528f3 stream: workaround scan-build warnings
stream-tcp.c:1938:16: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'tail') [core.NullDereference]
 1938 |     tail->next = old_head;
      |     ~~~~       ^
1 warning generated.

stream-tcp.c:1982:5: warning: Potential leak of memory pointed to by 'q' [unix.Malloc]
 1982 |     ssn->queue_len++;
      |     ^~~
1 warning generated.
8 months ago
Victor Julien d352b75ac6 stream: add more liberal timestamp behavior in 3WHS
RFC 7323 forbids a server to respond with a timestamp option in the
SYN/ACK when the SYN didn't have a timestamp option:

   A TCP MAY send the TSopt in an initial <SYN> segment (i.e., segment
   containing a SYN bit and no ACK bit), and MAY send a TSopt in
   <SYN,ACK> only if it received a TSopt in the initial <SYN> segment
   for the connection.

   Once TSopt has been successfully negotiated, that is both <SYN> and
   <SYN,ACK> contain TSopt, the TSopt MUST be sent in every non-<RST>
   segment for the duration of the connection, and SHOULD be sent in an
   <RST> segment (see Section 5.2 for details).

However, in the real world this pattern happens on benign traffic. This
would lead to missing logs and detection, and in IPS mode such sessions
would be blocked.

This patch allows this pattern when the `stream.liberal-timestamps` is
enabled (enabled by default).

Bug #4702.
8 months ago
Victor Julien be6315dba0 stream: improve SYN and SYN/ACK retransmission handling
Take SEQ and ACK into account for more scenarios.

SYN on SYN_SENT

In this case the SYN packets with different SEQ and other properties are
queued up. Each packet updates the ssn to reflect the last packet to
come in. The old ssn data is added to a TcpStateQueue entry in
TcpSession::queue. If the max queue length is exceeded, the oldest entry
is evicted. The queue is actually a single linked list, where the list
head reflects the oldest entry.

SYN/ACK on SYN_SENT

In this case the first check is if the SYN/ACK matches the session. If
it doesn't, the queue is checked to see if there SYN's stored. If one is
found that matches, it is used and the session is updated to reflect
that.

SYN/ACK on SYN_RECV

SYN/ACK resent on the SYN_RECV state. In this case the ssn is updated
from the current packet. The old settings are stored in a TcpStateQueue
entry in the TcpSession::queue.

ACK on SYN_RECV

Checks any stored SYN/ACKs before checking the session. If a queued
SYN/ACK was sound, the session is updated to match it.

Ticket: #3844.
Ticket: #7657.
8 months ago
Victor Julien d815d0748c stream: avoid ineffective state bump in TFO
Do not set session state to established, as it is unconditionally
overwritten to syn_recv afterwards.
8 months ago
Victor Julien 49b98ab3bf stream: minor improvement to timestamp debug messages
Add pcap_cnt for easier debugging.
8 months ago