Commit Graph

18684 Commits (b6fa3c8e8c2df8d3568b13d5ea4daa4ed0c860bc)
 

Author SHA1 Message Date
Juliana Fajardini 723aa21e6f misc: update copyright years
For files edited during

Task #7885
6 months ago
Juliana Fajardini dc4d805908 exceptions: s/DEBUG/QA_SIMULATION build flag
Task #7885
6 months ago
Juliana Fajardini 5edb5a5d1a build-scopes: add QA_SIMULATION mode
For qa-simulation scenarios, especially for testing purposes.

Task #7885
6 months ago
Victor Julien e7c9be07e6 af-xdp: add missing unlock in error path
CID 1638288: (#1 of 1): Missing unlock (LOCK)
4. missing_unlock: Returning without unlocking xsk_protect.queue_protect.
6 months ago
Victor Julien b84ae80146 affinity: address coverity warning
CID 1667318: (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: hwloc_obj_t non_io_ancestor....
6 months ago
Sven Cuyt 1246f1cf8c doc/userguide: add link to differences-from-snort
Ticket: #8031.
6 months ago
Sven Cuyt a0cc534471 doc/userguide: fix table showing example payload
Ticket: #8031.
6 months ago
Sven Cuyt 2d662538e5 doc/userguide: add example with non-zero offset for relative isdataat
Ticket: #8031.
6 months ago
Victor Julien 7c5285e5e6 doc/userguide: explain isdataat absolute vs relative difference
Ticket: #8031.
6 months ago
dependabot[bot] fe5c2250e1 github-actions: bump github/codeql-action from 4.32.0 to 4.32.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.0 to 4.32.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v4.32.0...v4.32.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
6 months ago
Philippe Antoine b37b2b6bd6 decode: use compact uint8_t instead of enum in struct
to save memory

also move it to the first cacheline, as there is a 2 byte gap there
and this field should also not change after it has been set.
6 months ago
Philippe Antoine 9807fe4326 decode/xvlan: treat as its own tunnel
Ticket: 7717

Allows for instance to process/log ARP packets over VXLAN.

That means we need to decode the ethernet layer above vxlan
instead of skipping it as part of the vxlan, even if the vxlan
decoder still checks the ethernet layer to avoid FPs.
6 months ago
Philippe Antoine efb6daa1ae decode: use PacketIsTunnelChild
Instead of directly accessing the field

Will allow PacketTunnelType to hold the precise tunnel type like
DECODE_TUNNEL_ERSPANII with a modification of PacketIsTunnelChild
6 months ago
Philippe Antoine dc29ab46ed ebpf: check maps compatibility
ebpf program does not handle 3 layers of vlan
6 months ago
Philippe Antoine d378610e93 stream: non infinite default value for reassembly.depth
So that empty config have a safer default.

Ticket: 8290
6 months ago
Victor Julien db2e97ab5f detect/iprep: mark as supported for firewall mode
Ticket: #8285.
6 months ago
Ofer Dagan e1f9d8a067 pcap: refactor delete-when-done to support non-alerts
Refactor pcap file deletion to use a single delete-when-done option
with three values instead of separate boolean options:
- false (default): No deletion
- true: Always delete files
- "non-alerts": Delete only files with no alerts

Also account for alerts produced by pseudo packets (flow timeout / shutdown flush):
- Introduce small capture hooks and invoke on pseudo-packet creation so the
  capture layer can retain references and observe alerts emitted after the last
  live packet
- Call the hook from both TmThreadDisableReceiveThreads and TmThreadDrainPacketThreads

Key changes:
- Replace should_delete/delete_non_alerts_only bools with enum
- Move alert counter from global to per-file PcapFileFileVars
- Relocate alert counting from PacketAlertFinalize to pcap module
- Ensure thread safety for both single and continuous pcap modes
- Add unit tests for configuration parsing and pseudo-packet alert path

The --pcap-file-delete command line option overrides YAML config
and forces "always delete" mode for backward compatibility.

Documentation updated to reflect the new three-value configuration.

Fixes OISF#7786
6 months ago
Philippe Antoine 539e4ee665 detect/transforms: add zlib_deflate transform
Ticket: 7846
6 months ago
Philippe Antoine dbea660729 detect/transforms: add gunzip transform
Ticket: 7846
6 months ago
Philippe Antoine 751ef1fe9b detect: add debug validation about nlists
To avoid stack overflow

A single signature should not have more than 65k buffers

Ticket: 8001
6 months ago
Philippe Antoine f4d83f29a9 detect: allocate sids_array on the heap
To be able to load 1M signatures and not have a stack overflow

Ticket: 8001
6 months ago
Philippe Antoine 256c6a99b8 datasets: adds safety check before stack allocation
Even if current caller does not provide too big data.

Ticket: 8001
6 months ago
Victor Julien 336a9d05ca krb5: fix TCP record parsing
A logic error in multi-record parsing meant only the first record was parsed.

Bug: #8278.
6 months ago
Jason Ish eab5931074 github-ci: merge rust.yml into existing builds.yml build
The Rust build in rust.yml was just an AlmaLinux 9 build with some extra
checks.  Instead, use an existing AlmaLinux 9 build in builds.yml, make
it use Rustup (there are other AlmaLinux 9 builds that use the RPM), and
add the checks.

Saves us one build in CI.
6 months ago
Jason Ish 77d96851f5 pfring: use static functions; add void arg to SCPluginRegister
Minor cleanups.
6 months ago
Jason Ish a60e93c2cd pfring: fix typo in StringParseUint16
StringParseUnt16 -> StringParseUint16

Ticket: #8271
6 months ago
Jason Ish 828d105cea pfring: copy cflags over from src/
This should cause the following warning to error out:

runmode-pfring.c: In function 'OldParsePfringConfig':
runmode-pfring.c:118:17: error: implicit declaration of function 'StringParseUnt16'; did you mean 'StringParseInt16'? [-Wimplicit-function-declaration]
  118 |             if (StringParseUnt16(&pfconf->threads, 10, 0, threadsstr) < 0) {
      |                 ^~~~~~~~~~~~~~~~
      |                 StringParseInt16

Ticket: #8271
6 months ago
Jason Ish d230a760e6 examples/altemplate: update to use jsonbuilder from ffi crate 6 months ago
Jason Ish 6b850dddb8 rust/ffi: JsonBuilder wrapper around C JsonBuilder API
For use by plugins that need to work with JsonBuilder.
6 months ago
Jason Ish f6b11ac855 output-eve: finish exposing to bindgen
As all out output-eve.h is now exposed, merge output-eve.h and
output-eve-bindgen.h back into one file, output-eve.h.
6 months ago
Jason Ish f79158ae55 rust/sys: generate jsonbuilder bindings in sys
Bindgen the Rust bindings to the C JsonBuilder API along with the rest
of the Rust bindings to C. Breaking it out was probably the wrong
idea.

This should make it easier, and more correct to bindgen C functions
that use SCJsonBuilder types.
6 months ago
Jason Ish f951477461 rust/debug: use functions from ffi crate where possible
It's not possible to use all the functions and macros from the ffi crate
in the main Suricata crate, as there are conditionals around when
running in test mode, and "cargo test" doesn't propagate the "cfg(test)"
to test crates.

Which for now means duplicating the macros and some functions.
6 months ago
Jason Ish 8b69089cb8 rust/ffi: more rust friendly plugin registration
A plugin can now create a "Plugin" struct with Rust strings.  The
`into_raw` method converts it to a raw pointer suitable for returning
during plugin registration.
6 months ago
Jason Ish 0999530726 rust/ffi: rust wrapper around eve filetype registration 6 months ago
Jason Ish 2d0bf9a2ed output-eve: bindgen SCEveFileType callback types 6 months ago
Jason Ish 8e3bd1ca55 examples/altemplate: use suricata-ffi for logging macros 6 months ago
Jason Ish b4db7bdaee rust/ffi: add logging (debug) wrappers
Mostly a copy of Suricata core's logging wrappers into the ffi crate.

These are not yet used by Suricata-core as they do require the
Suricata library to be available, which is not the case with tests. And
the `cfg(test)` parameter is not passed through to sub-crates.

However, this does allow a plugin (or library) to call the logging
macros without depending on the "suricata" crate.

Ticket: #7666
6 months ago
Jason Ish 2c51744ccc rust/ffi: stub out a rust ffi crate
This crate is for Rust wrappers around the -sys crate which includes
only raw bindings. This is the place to add nice wrappers around those
bindings, however it should remain clear of dependencies on the main
Suricata core crates.

Ticket: #7666
6 months ago
Jason Ish e9611a4d7c output-eve: bindgen SCRegisterEveFileType to Rust
Used by Rust output plugins.
6 months ago
Jason Ish 1b182025bc output-eve: expose SCEveFileType to Rust with bindgen
There is an unfortunate side-affect that one has to read
output-eve-bindgen.h for the documentation on this type, however, I
think we can resolve that in time.
6 months ago
Jason Ish 7bfb63363e output-eve: cleanup usage of output-eve-bindgen.h
As output-eve-bindgen.h exists to support bindgen, its odd to see
other Suricata C files using it. Instead Suricata C code should import
"output-eve.h", which itself includes "output-eve-bindgen.h", only
broken out to support the external tool bindgen.
6 months ago
Jason Ish 8ea103031c output-eve: cleanup include guards to reflect filename 6 months ago
Jason Ish 2defd5ae5a userguide/Makefile: don't add "install" to EXTRA_DIST
Adding the directory "install" to EXTRA_DIST, actually triggers make
to run "make install", which is not what we want. Instead, avoid this
magic keyword and list the files in the install directory
individually.

If the user doesn't have permission to install files to the prefix,
like "/usr", then "make dist" can fail. Worse, even they do have
permission to write into the prefix, a "make dist" will install files
there when it shouldn't.

Ticket: #8279
6 months ago
Philippe Antoine a079d1c68a src: remove unused enum values 6 months ago
Philippe Antoine 536242341b detect/smb: move smb.version keyword to rust
Ticket: 8267
6 months ago
Philippe Antoine df495d7e22 rust: bindgen SCDetectGetLastSMFromLists
to use it from rust keywords
6 months ago
Philippe Antoine 697c641400 detect/smb: move smb share and named_pipe keywords to rust
Ticket: 8267
6 months ago
Philippe Antoine 667f8b2eb7 detect/smb: move smb ntlmssp keywords to rust
Ticket: 8267
6 months ago
Philippe Antoine c48819e61f detect/sip: remove obsolete keyword ids
as they are now dynamically generated
6 months ago
Victor Julien e69c801a12 flow: reshuffle fields to avoid mutex in 2 cachelines 6 months ago