Commit Graph

15804 Commits (suricata-7.0.17)
 

Author SHA1 Message Date
Jeff Lucovsky 4b103e62d0 output/null: Add the null output device
This commit adds the null output device; to use, set the filetype
to "nullsink" for each output that should discard and never persist
logs/alerts/etc.

This is implemented as an "internal eve output plugin" just like the
syslog eve output type.

(cherry picked from commit ad96382cf2)
10 months ago
Jason Ish 117cf77024 ci: disable schema validate on msrv test
The MSRV test uses Rust 1.63, but schema validation requires 1.67.
11 months ago
Jason Ish c0e46c2714 rust: fix clippy warning for unused import
While debug_validate_bug_on is still used, it does not need to be
imported directly, as that macro is marked with `macro_export`, making
it globally available to the crate.

(cherry picked from commit 50224f2ee5)
11 months ago
Juliana Fajardini 2af9ae4354 devguide: update backports policy for Suricata 7.0
Also remove mentions to `master` and `6.0x`.

Task #7937

(cherry picked from commit 6c06ab6144)
11 months ago
Philippe Antoine 46da609846 detect/ssl: properly handle negation in ssl_version keyword
Ticket: 3220

DetectSslVersionMatch did not handle properly negation.
It could never match on a signatrue with ssl_version: !tls1.3
That is because, if we had such a signature and network traffic
with tls1.1, we were looking into DetectSslVersionData field
for tls1.1, which was not set, instead of looking at field
for tls1.3 which was set with negated flag.

Previous DetectSslVersionData was holding redundant information.
It did not need to have it for each ssl version, but just globally.
Also, it did not need to hold the version as a value in the array,
as it was redundant with the index of the array.

(cherry picked from commit c93e69830a)
11 months ago
Victor Julien 8774212400 exception-policy: rename 'reject-both' to 'rejectboth'
To align it with the rule action.

(cherry picked from commit d3aa4dd85e)
11 months ago
Victor Julien d6577ff5c2 doc/userguide: document reject-both expection policy
Ticket: #5974.
(cherry picked from commit 879561859b)
11 months ago
Victor Julien 4e6f9e4a91 exception-policy: add 'reject-both' option
Allow rejecting both sides of a connection. Has the same support
as regular reject (which is essentially rejectsrc).

Ticket: #5974.
(cherry picked from commit 4905f38470)
11 months ago
Juliana Fajardini dea701b9d2 schema: add descriptions to global memcaps/memuses
For FTP and HTTP.

Related to
Task #6434
11 months ago
Juliana Fajardini c918835026 schema: add additional properties to stats.capture
The `stats.capture` object may have different properties based on the
capture method used.

This adds the ones pertaining to AF_PACKET capture.

Related to
Task #6434

(cherry-picked from commit 2855574a2c)
11 months ago
Juliana Fajardini 81f88d4fdb schema: add desc for each main stats module
Part of the schema documentation effort.

Related to
Task #6434

(cherry-picked from commit 12e0e51864)
11 months ago
Juliana Fajardini c67357f382 schema: allow stats.stream event counters
While the counters exist, they're not present in the schema, causing
validation to fail if stats.stream-events is enabled.

Task #7858

(cherry picked from commit 025ffa6135)
11 months ago
Juliana Fajardini 9307b63c8f schema/stats: flow_mgr is actually flow.mgr
The schema accounts for a stats counters group that is a subgroup of the
flows stats counters. Remove `flow_mgr`, thus.

(cherry-picked from commit 173fec81f8)
11 months ago
Juliana Fajardini 82841d614b doc: remove remaining references to pruned flows
These were removed with a5587fec2e but these mentions went under the
radar.

(cherry picked from commit 1647081b29)
11 months ago
Philippe Antoine cfb488b320 file: fix hash computation for small multipart files
Ticket: 8119

Fixes: f68e2f5537 ("files: append data on closing even with
FILE_NOSTORE")

(cherry picked from commit 8b9a779a16)
11 months ago
Victor Julien 3a54ff6653 unix-socket/hostbits: fix ipv6 address parsing
In `add-hostbit`, `remove-hostbit` and `list-hostbit` commands, the IPv6
address parsing was not using the correct variable:

                 from /usr/include/dirent.h:25,
                 from suricata-common.h:73,
                 from runmode-unix-socket.c:18:
In function ‘inet_pton’,
    inlined from ‘UnixSocketHostbitAdd’ at runmode-unix-socket.c:1316:13:
/usr/include/x86_64-linux-gnu/bits/inet-fortified.h:56:10: warning: call to ‘__inet_pton_chk_warn’ declared with attribute warning: inet_pton called with a destination buffer size too small [-Wattribute-warning]
   56 |   return __glibc_fortify (inet_pton, __sz, sizeof (char),
      |          ^~~~~~~~~~~~~~~
In function ‘inet_pton’,
    inlined from ‘UnixSocketHostbitRemove’ at runmode-unix-socket.c:1403:13:
/usr/include/x86_64-linux-gnu/bits/inet-fortified.h:56:10: warning: call to ‘__inet_pton_chk_warn’ declared with attribute warning: inet_pton called with a destination buffer size too small [-Wattribute-warning]
   56 |   return __glibc_fortify (inet_pton, __sz, sizeof (char),
      |          ^~~~~~~~~~~~~~~
In function ‘inet_pton’,
    inlined from ‘UnixSocketHostbitList’ at runmode-unix-socket.c:1476:13:
/usr/include/x86_64-linux-gnu/bits/inet-fortified.h:56:10: warning: call to ‘__inet_pton_chk_warn’ declared with attribute warning: inet_pton called with a destination buffer size too small [-Wattribute-warning]
   56 |   return __glibc_fortify (inet_pton, __sz, sizeof (char),
      |          ^~~~~~~~~~~~~~~

Bug: #8102.
(cherry picked from commit 874a0e8d3d)
11 months ago
Victor Julien 2caed317c3 thresholds: fix unittest compile warning
In file included from decode.h:33,
                 from host.h:27,
                 from util-threshold-config.c:34:
util-threshold-config.c: In function 'SCThresholdConfInitContext':
util-debug.h:260:5: warning: '%s' directive argument is null [-Wformat-overflow=]
  260 |     SCLogErr(SC_LOG_WARNING, __FILE__, __FUNCTION__, __LINE__, _sc_module, __VA_ARGS__)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util-threshold-config.c:190:9: note: in expansion of macro 'SCLogWarning'
  190 |         SCLogWarning("Error loading threshold configuration from %s", filename);
      |         ^~~~~~~~~~~~
util-threshold-config.c:190:66: note: format string is defined here
  190 |         SCLogWarning("Error loading threshold configuration from %s", filename);
      |                                                                  ^~

(cherry picked from commit 3a0f4dde07)
11 months ago
Philippe Antoine 900ed28b39 fuzz/conf: bail out on long sequence of scalars
Ticket: 8105
(cherry picked from commit 9d164d8794)
11 months ago
Jeff Lucovsky 3e1f76ade3 nfs: Support EXCLUSIVE4_1 flag
Issue: 8006

Support the EXCLUSIVE4_1 create mode added to NFS 4.1

(cherry picked from commit e1bf5cb1f3)
12 months ago
Shivani Bhardwaj 5e9ded4a50 version: start development towards 7.0.14 12 months ago
Shivani Bhardwaj 090542709c release: 7.0.13; update changelog 12 months ago
Philippe Antoine 128242373a unix-socket: return after closing on too long
Avoids later use after free

Ticket: 8063
(cherry picked from commit acc051ac94)
12 months ago
Juliana Fajardini 5d6c24cc2c output/alert: fix alert index access for verdict
The engine uses p.alerts.cnt as an index to access the packet alert that
has the `pass` action for the verdict.
For IDS/IPS mode, a `pass` will always be the last signature in the
alert queue. However, that position could be either `p.alerts.cnt` or
`p.alerts.cnt-1`, depending on whether the `pass` rule has the `alert`
keyword or not.
This patch fix corner-case scenarios of:
- accessing an index out of boundaries
- off-by-one access
Without changing how the engine increments the alerts.cnt, as this is
used in many places, and would be a more invasive change.
It checks the two different scenarios, plus the case when there is only
a single match as a silent `pass` rule.

Bug #8021
Bug #7630
12 months ago
Philippe Antoine 4b1d284bb5 output/http: log content-type like other headers
Ticket: 8056

Avoid stack allocation.
Do not handle null and ; especially

(cherry picked from commit b8411fcc8d)
12 months ago
Philippe Antoine f67d72702a util/swf: move allocation from stack to heap
As it can overflow the stack

Ticket: 8055
(cherry picked from commit a84addb771)
12 months ago
Philippe Antoine 5abf9b81e7 output/jsonbuilder: helper function SCJbSetPrintAsciiString
To replace C PrintStringsToBuffer and avoid a stack alloc
+ copy

Ticket: 8004
(cherry picked from commit 7447651fa0)
12 months ago
Victor Julien a7ff4c9ba5 lua: remove luajit pushlstring workaround
81ee6f5aad ("lua: push correct length back through ScFlowvarGet, work around valgrind warning")
added a workaround for valgrind warnings in pushing a string buffer
into the lua state. This is no longer needed as tested with both
address sanitizer and valgrind.

(cherry picked from commit 52fd61dffd)
12 months ago
Jason Ish 05ab70acfe requirements.txt: update to suricata-update 1.3.7 1 year ago
Lukas Sismis 28dff4e157 github-ci: build-test DPDK v23.11.x and v24.11.x
Ticket: 6522
(cherry picked from commit 7ca95eeec0)
1 year ago
Lukas Sismis 05741a32be github-ci: bump up tested DPDK versions
Ubuntu 20.04, supported distro for 7.0.x, still contains
DPDK 19.11 in the pkg repository, so it keeps being build-tested as
opposed to the 9.0.x version.

(cherry picked from commit ee0b08692c)
1 year ago
Lukas Sismis 2db0203407 dpdk: supress a warning of the bond function
DPDK Bonding API has been changed in DPDK version 23.11 where
the old *slave* API was marked as deprecated and the new *member*
API was marked as experimental.
This was unfortunately executed by marking both API variants
at the same time. The deprecated version is removed from the follow
up versions while the experimental version will become stable
in the next DPDK releases. This is based on a policy in DPDK where
an API change needs to merged in main for 1 stable release before
removing the experimental flag.

In DPDK 24.11 this has been fixed and warning supression is not
added.

Ticket: 8013
(cherry picked from commit 27383f878d)
1 year ago
Lukas Sismis e965320c9a dpdk: fix the CPU exclude logic
The exclude function incorrectly performs a XOR operation. While it
works when the worker cores occupy all cores, it is not the correct
operation. For example, when a core is affined to only management
and not worker threads, the XOR operation affines it to the worker set.
(1 XOR 0 -> 1, where in fact the desired outcome is 0)

Ticket: 7977
(cherry picked from commit 8f63094744)
1 year ago
Jason Ish 4952744dec qa/validate-cp: check main-8.0.x branch as well
For the 7.0.x, allow cherry pick's from main as well as main-8.0.x.
1 year ago
Jason Ish 94b5135d26 doc/userguide: add a known issues page
The idea of this page is to track known issues on a release branch
that we do not plan to fix.

(cherry picked from commit a4f722fca0)
1 year ago
Jason Ish f85944511a ike: don't log duplicate attributes
Track what attributes have been logged and skip over duplicate
attributes to avoid having duplicate fields in the JSON object, which
is invalid JSON.

This is lossy, subsequent attributes are lost.

Ticket: #7923
(cherry picked from commit 35464150de)
1 year ago
Jason Ish fa15ebf7ff ike/detect: info log message should be debug
(cherry picked from commit b543e28402)
1 year ago
Victor Julien 5f04a2cf09 output: fix long logline test
Fixes: 023a2fe9ab ("unittests: fix format-truncation warning")
(cherry picked from commit b7650a45fa)
1 year ago
Victor Julien 676c07a2b8 unittests: disable LogCustomFormatTest01 for MinGW
Test was previously not run so it was missed that it fails.

(cherry picked from commit c8cb029de9)
1 year ago
Victor Julien a82d6f4652 unittests: don't leak memory with --list-unittests
(cherry picked from commit 57d1f20dfa)
1 year ago
Victor Julien 060d3c1e36 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)
1 year ago
Philippe Antoine 6bebd73d71 http2: add INTERNAL_ERROR for http2.error_code keyword 1 year ago
Philippe Antoine 4e0ca599c4 http2: fix parsing of goaway frames
There was a last stream id before the error code
As per section 6.8 of RFC 7540

Ticket: 7991
(cherry picked from commit 9a4a29e218)
1 year ago
Philippe Antoine 170761f62b mime: retain some stateful data for quoted-printable
In case a sequence like =3D is split over 2 calls to SCSmtpMimeParseLine

Ticket: 7950
(adapted from commit 56e08c9134)
1 year ago
Juliana Fajardini a55f3a591e devguide: complement info on branches to work on
With the change from master to main, ensure that we still list examples
of stable branches, as the text also refers to those.
1 year ago
Victor Julien 0ce0a06e17 github-actions: use main branch for cherry-pick check 1 year ago
Shivani Bhardwaj df444e3b60 doc: remove outdated GITGUIDE 1 year ago
Shivani Bhardwaj d7cc656c6f doc: adjust for master to main rename 1 year ago
Shivani Bhardwaj 0223db3ddf workflows: use main-7.0.x branch 1 year ago
Shivani Bhardwaj 8c97aa0d10 clang-format: fix the base branch 1 year ago
Shivani Bhardwaj f2fcdee667 version: start development towards 7.0.13 1 year ago