Commit Graph

14994 Commits (suricata-7.0.1)
 

Author SHA1 Message Date
Juliana Fajardini 8553d567d2 release: 7.0.1; update changelog 2 years ago
Philippe Antoine c6afee64d5 smtp: fix null deref with config option body md5
Ticket: #6279

If we have the smtp body beginning without headers, we need to
create the md5 context and right away and supply data to it.
Otherwise, on the next line being processed, md5_ctx will be
NULL but body_begin will have been reset to 0
2 years ago
Victor Julien 00e00254ea spm/hs: don't exit on bad patterns
A bad pattern in a rule that hyperscan would fail to compile would
exit Suricata. This could happen during a rule reload as well.

In case of a untrusted ruleset, this could potentially be used to
shut down the sensor.

Commit 7d0851b0c2 already blocks the only know case, but this patch
is more defensive.

Ticket: #6195.
2 years ago
Jason Ish 2b57179d65 readthedocs: pin theme to sphinx_rtd_theme
ReadTheDocs changed the default theme.
2 years ago
Jason Ish ae3b1a9e36 configure: more idiomatic autoconf for sphinx-build checks
- Use SPHINX_BUILD instead of HAVE_SPHINX_BUILD, as here we're
  actually using the path of the program.

- Wrap some elements in [] as is done in modern idiomatic autoconf
2 years ago
Jason Ish 82758fb09f configure: check for new enough sphinx-build
We need a recent version of Sphinx to build the documentation in
7.0. Check for a minimum version of 3.4.3. If older, do not build the
docs which is the same behavior when sphinx-build is not found.

Bug: #6297
2 years ago
Philippe Antoine 30b5338af3 fuzz: enable by default all protocols
That means DNP3, ENIP and NFS

Ticket: #6189
2 years ago
Jeff Lucovsky e65c052414 build/nss: Remove libnss from CI 2 years ago
Arne Welzel 0ddc44f4c1 community-id: Fix IPv6 address sorting not respecting byte order
When comparing IPv6 addresses based on uint32_t chunks, one needs to
apply ntohl() conversion to the individual parts, otherwise on little
endian systems individual bytes are compared in the wrong order.
Avoid this all and leverage memcmp(), it'll short circuit on the first
differing byte and its return values tells us which address sorts lower.

Bug: #6276
2 years ago
Ralph Eastwood 185f605d11 napatech: fix null-dereference of packet 2 years ago
Ralph Eastwood a4756138cf napatech: print NUMA recommendation early
When thread affinity is set, the NUMA configuration specified in
the napatech.ini configuration could be incorrect and then fail.
This fails before the recommended configuration is printed, which
is pretty unhelpful.
2 years ago
Ralph Eastwood 1e1b3a4eda napatech: fix incorrect fmt specifiers for log 2 years ago
Ralph Eastwood 405fc580ea napatech: remove superfluous log messages 2 years ago
Ralph Eastwood c4059a7f02 napatech: generalise numa config recommending
Previous implementation hardcoded up to 4 NUMA nodes.
We support arbitrary number of NUMA nodes now.

Note that this commit also removes the old SCLog logging
calls.  But since the logic has changed, these have been replaced
directly with new code.
2 years ago
Ralph Eastwood 8c1ccc1cfe napatech: fix shadowed global is_inline warning 2 years ago
Ralph Eastwood 95ecbd1178 configure: move -lntapi to LIBS variable
Previously -lntapi was appended to LDFLAGS which did not work with
all build environments.
2 years ago
Ralph Eastwood d7aa7a063f napatech: fix warnings with ByteExtractStringUint8
The WARN_UNUSED attribute has been added to ByteExtractStringUint8
in commit 6988168114.  The return
value is now handled and appropriate errors printed.
2 years ago
Ralph Eastwood 23e5386513 napatech: fix thread flags with THV_RUNNING
This update the Napatech vendor module with changes introduced in
13beba141c that introduces THV_RUNNING.
2 years ago
Ralph Eastwood 658bbbc078 napatech: fix compilation with SCTIME usage
This replaces the broken compilation due to the change of SCTime_t
into a structure: 9fbe683642.
2 years ago
Ralph Eastwood c6da59d57b napatech: fix missing header includes 2 years ago
Ralph Eastwood 783d07007f napatech: fix compilation errors in SCLog calls
Since f8474344cd, there is an extra
argument to SCLog which indicates the module and subsystem
identifier.  The Napatech vendor code is missing this argument,
which is fixed here.
2 years ago
Philippe Antoine 541cafa40a config/flow: fix division by zero
Fixes: 805b07fa42 ("src: checks to avoid divisions by zero")

Coverity id: 1539152

Ticket: #5920
Ticket: #6255
2 years ago
Yatin Kanetkar b67ff4badf dhcp: Log Vendor Client Identifier (dhcp option 60)
* Log vendor client identifier (dhcp option 60) if extended dhcp
logging is turned on. This required the `vendor_client_identifier` to
be added to the json schema. Validation done using an SV Test
* Added `requested_ip` to the json schema as well, since it was
missed. My SV test failed without it.

Feature #4587
2 years ago
Philippe Antoine 5bdbc1a313 rdp: do not use zero-bit bitflag
cf https://docs.rs/bitflags/latest/bitflags/#zero-bit-flags

As warned by clippy 1.72.0
2 years ago
Philippe Antoine b235e85c68 rust: fix clippy warnings for version 1.72.0
Includes using the right prototype for C SRepCatGetByShortname
2 years ago
Thomas Winter a284f01c1d iprep: fix parsing ip-rep data with carriage return
Commit e7c0f0ad91 removed uses of atoi with a new number parsing
functions. This broke parsing ip-reputation data files that contained
trailing carriage returns as it was being included in the number
string to convert.

Bug: #6243.
2 years ago
Victor Julien becb8cefcc threading: set min thread stack size; set it early
Multi-tenancy uses loader threads that initialize detection engines. During
this, esp the AC family of MPM implementations, there is significant stack
usage. In most OS' threads have a lower stack size by default. In Linux, when
using the Musl C library, a thread by default gets 128KiB.

This patch does 2 things:

1. it centralizes the handling of the `threading.stack-size`. It it is not
   longer handled by the runmodes, but called from the global initialization
   logic.

2. it sets a minimum per thread stack size of 512k, unless `threading.stack-size`
   is set.

Ticket: #6265.
2 years ago
Philippe Antoine 92fce2fdc0 mpm: allocate StateQueue on the heap
So that we can have multi-tenant on MacOS without stack
overflows because of the size of the structure...

Ticket: #6263.
2 years ago
Victor Julien f312370fd2 detect/loader: minor code cleanups 2 years ago
Shivani Bhardwaj a4f670622e workflows: use s-v --debug-failed 2 years ago
Victor Julien 04aee5f099 detect: fix path creation in Windows
Fixes file loading for rule files and Lua scripts.

Bug: #6095.
2 years ago
Victor Julien c0201d3212 doc/userguide: add reload-tenant(s) doc 2 years ago
Victor Julien de598f12a6 multi-tenant: add reload-tenants command
Command to reload all tenants. Their original yaml path will be
used.

Ticket: #6267.
2 years ago
Victor Julien 6ba0956a75 multi-tenant: allow reload w/o yaml path
Store yaml path in de ctx, for reloads w/o path.

This allows for a simpler `reload-tenant N`, where the previously
used yaml is reloaded.
2 years ago
Victor Julien 227caf1315 multi-tenant: don't init config twice in tenant reload 2 years ago
Victor Julien c87803ea0e detect: add multi-detect.config-path
Add option to specify path from which to load the tenants.

Mostly meant to be used in testing.
2 years ago
Victor Julien a4d80bc7c4 detect: free all tenant detect engines
Free all tenants registered in the master.
2 years ago
Victor Julien 228caa640b path: new funcs to merge paths
Take windows directory separators into account.

Path is not checked or "resolved".
2 years ago
Victor Julien 269f751d36 stat: add wrappers to isolate OS_WIN32 specifics 2 years ago
Victor Julien 0cc6f4f281 threshold: minor code cleanups 2 years ago
Victor Julien f052b524bc threshold: fix multi-tenant file parsing
Switch to DetectParseRegex and use a local pcre2_match_data to
avoid concurrency issues.

Bug: #6247.
2 years ago
Victor Julien e5e58d5647 output: deinit last so logging can happen until the end 2 years ago
Victor Julien b130234b26 var-names: reimplement var name handling
Implement a new design for handling var name id's. The old logic
was aware of detection engine versions and generally didn't work
well for multi-tenancy cases. Other than memory leaks and crashes,
logging of var names worked or failed based on which tenant was
loaded last.

This patch implements a new approach, where there is a global store
of vars and their id's for the lifetime of the program.

Overall Design:

Base Store: "base"

Used during keyword registration. Operates under lock. Base is shared
between all detect engines, detect engine versions and tenants.
Each variable name is ref counted.

During the freeing of a detect engine / tenant, unregistration decreases
the ref cnt.

Base has both a string to id and a id to string hash table. String to
id is used during parsing/registration. id to string during unregistration.

Active Store Pointer (atomic)

The "active" store atomic pointer points to the active lookup store. The call
to `VarNameStoreActivate` will build a new lookup store and hot swap
the pointer.

Ensuring memory safety. During the hot swap, the pointer is replaced, so
any new call to the lookup functions will automatically use the new store.
This leaves the case of any lookup happening concurrently with the pointer
swap. For this case we add the old store to a free list. It gets a timestamp
before which it cannot be freed.

Free List

The free list contains old stores that are waiting to get removed. They
contain a timestamp that is checked before they are freed.

Bug: #6044.
Bug: #6201.
2 years ago
Victor Julien 575fbdfbf3 detect/pcre: use local match data during parsing
Fixes multi-tenant multi-loader crashes.

Bug: #6247.
2 years ago
Jason Ish 3802a51552 eve/schema: add host
The "host" field is added to EVE events if the "sensor-name" field is
configured in suricata.yaml.
2 years ago
Jason Ish edb8cca825 eve: fix double free of sensor-name on error
Remove the free of "sensor_name" on error in output-json as this is
cleaned up by the LogFileCtx.

Bug: #6256
2 years ago
Shivani Bhardwaj d4dd53c95f af-packet: terminate on same interface & copyiface
If the interface and copy-iface are same for an af-packet IPS device
setting then fataly exit else it leads to a segfault in later stages.

Bug 5870
2 years ago
Shivani Bhardwaj 3d73538a5b af-packet: check out_iface not NULL 2 years ago
Victor Julien c5d83d081e detect/file: use util to turn keyword to nocase
This changes the way the pattern is stored by making it lowercase.
2 years ago
Victor Julien ef936acdba detect/content: cleanup nocase conversion 2 years ago