Commit Graph

16748 Commits (7d5c170dd2ad9b9b31c67dd6f2f57997c71cd561)
 

Author SHA1 Message Date
Victor Julien 543429f176 smb: use lru for ssn2vec_map
Generic ssn2vec_map was a HashMap used for mapping session key to
different types of vector data:
- GUID
- filename
- share name

Turn this into a bounded LruCache. Rename to ssn2vec_cache.

Size of the cache is 512 by default, and can be configured using:

`app-layer.protocols.smb.max-session-cache-size`

Ticket: #5672.
4 months ago
Victor Julien ba7a4ece76 smb: use lru for ssnguid2vec_map; rename
Reimplement the ssnguid2vec_map HashMap as a LruCache.

Since this is a DCERPC record cache, name it as such.

Default size is 128. Can be controlled by
`app-layer.protocols.smb.max-dcerpc-frag-cache-size`.

Ticket: #5672.
4 months ago
Victor Julien 0f23557ef7 smb: use lru for ssn2tree; rename
Turn the map mapping the smb session key to smb tree into a lru cache,
limited to 1024 by default.

Add `app-layer.protocols.smb.max-tree-cache-size` option to control the
limit.

Ticket: #5672.
4 months ago
Victor Julien ce44d38ca8 smb: use lru for ssn2vecoffset_map; rename
Rename to read_offset_cache.

Add `app-layer.protocols.smb.max-read-offset-cache-size` option to
control the limit.

Ticket: #5672.
4 months ago
Victor Julien 91828ec00b smb: use lru for guid2name map; rename
Use `lru` crate. Rename to reflect this.

Add `app-layer.protocols.smb.max-guid-cache-size` to control the max
size of the LRU cache.

Ticket: #5672.
4 months ago
Victor Julien 23f2317c6a smb1: remove name on close
Ticket: #5672.
4 months ago
Victor Julien 85987aaad6 smb2: remove filename on close
Ticket: #5672.
4 months ago
Victor Julien c2124f0b9e smb: update to GAP handling
Don't tag the session as gap'd when the GAP is in a precise location:

1. in "skip" data, where the GAP just fits the skip data

2. in file data, where we pass the GAP on to the file

This reduces load of GAP post-processing that is unnecessary in these
case.
4 months ago
Victor Julien d535d7f768 smb2: use if let for read/write parsing 4 months ago
Victor Julien 5bd2289008 rust: update crates 4 months ago
Philippe Antoine 63324b7368 transforms: move urldecode to rust
Ticket: 7229
4 months ago
Philippe Antoine 8984bc6801 transforms: move xor to rust
Ticket: 7229
4 months ago
Philippe Antoine 45e0acf772 transforms: move http headers transforms to rust
Ticket: 7229
4 months ago
Philippe Antoine f0414570d2 transforms: move casechange to rust
Ticket: 7229
4 months ago
Philippe Antoine 0e5b49d20f transforms: move hash transforms to rust
md5, sha1 and sha256

Ticket: 7229
4 months ago
Philippe Antoine 71da38e702 transforms: move dotprefix to rust
Ticket: 7229
4 months ago
Philippe Antoine 966f659201 transforms: move compress_whitespace to rust
Ticket: 7229
4 months ago
Philippe Antoine 4985ebc0e0 transforms: move strip_whitespace to rust
Ticket: 7229
4 months ago
Philippe Antoine dd71ef0af2 suricata/bpf: fix -Wshorten-64-to-32 warning
Ticket: 7366
Ticket: 6186
4 months ago
Jason Ish b1c26dccf3 http2: rename event variant to match rule
Rename InvalidHTTP1Settings to InvalidHttp1Settings so it gets the
expected name transformation of "invalid_http1_settings".

Ticket: #7361
4 months ago
Jason Ish a55960e6ba rules/modbus: remove rule for event that not longer exists
The event "modbus.invalid_unit_identifier" no longer exists.

Ticket: #7361
4 months ago
Jason Ish b44ba3224f rules/ike: fix ike event names that have changed
- weak_crypto_nodh -> weak_crypto_no_dh
- weak_crypto_noauth -> weak_crypto_no_auth

Ticket: #7361
4 months ago
Jason Ish 833c7c64be rules/dns: fix dns event names that have changed
- not_a_request to not_request
- not_a_response to not_reponse

Ticket: #7361
4 months ago
dependabot[bot] 11d9fef1fb github-actions: bump github/codeql-action from 3.26.13 to 3.27.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.13 to 3.27.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.13...v3.27.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
dependabot[bot] 1c9ca6cf19 github-actions: bump actions/checkout from 4.2.1 to 4.2.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](eef61447b9...11bd71901b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
Philippe Antoine cca59cdaa9 detect/http: fix progress for headers keywords
Ticket: 7326

Having a lower progress than one where we actually can get
occurences of the multibuffer made prefilter
bail out too early, not having found a buffer in the multi-buffer
that matiched the prefilter.

For example, we registered http_request_header with progress 0
instad of progress HTP_REQUEST_HEADERS==2, and if the first
packet had only the request line, we would consider
that signatures with http_request_header as prefilter/fast_pattern
could not match for this transaction, even if they in fact
could have a later packet with matching headers.

Hence, we got false negatives, if http.request_header or
http.response_header was used as fast pattern, and if the request
or response came in multiple packets, and the first of these packets
did not have enough data (like only http request line),
and the next packets did have the matching data.
4 months ago
Nancy Enos 56e10fd3b2 misc: Remove duplicate function declarations
Ticket: #7297
4 months ago
Nancy Enos 98cd2411b6 detect/analyzer: add more details for the tcp window keyword
Ticket: 6352
4 months ago
Sascha Steinbiss 5d8252117f mqtt: double-check detection directions
Ticket: #7323
4 months ago
Sascha Steinbiss 377d4705e1 mqtt: add reason code support for SUBACK
Ticket: #7323
4 months ago
Jason Ish b1e7917d4f eve: threadinit/deinit callbacks are optional for filetypes
Only call ThreadInit and ThreadDeinit for custom eve filetypes if they
exist. They are not required by all filetypes.

Ticket: #7359
4 months ago
Philippe Antoine 292c218a48 app-layer: remove ALPROTO_TEST and tests
These tests purpose seems to have been lost.
Registering a alproto with a parser function that always fails,
and just testing that AppLayerParserParse returned -1...
We would get the same result  without registering a parser function,
or using ALPROTO_FAILED as argument to AppLayerParserParse

The comment says "Test the deallocation of app layer parser memory
on occurrence of error in the parsing process."
but I do not see how this is tested.
4 months ago
Jason Ish 3a7eef8121 lua: update to newer lua crate
This crate lets us instruct it where to copy the header files instead
of our Makefile trying to find the correct ones and copying them into
place.

Can prevent the simultaneous copy errors sometimes seen on a make
without a clean.
4 months ago
Eric Leblond 9ffb2cd7dd misc: fix build of rules profiling
The patch a0fc2b8628 has removed the
declaration of functions used when building with ruleset profiling
only (without --enable-profiling). This is causing a build failure.

This patch moves the declaration to the rules profiling section to
be sure it is always there.
4 months ago
Jason Ish 89aa5253d6 Makefile.cvs: remove, not used 4 months ago
Nancy Enos a0fc2b8628 misc: Remove duplicate function declarations
Ticket: #7297
4 months ago
Victor Julien e44b2effd0 util/var-name: switch to SCTime_t 4 months ago
Victor Julien 0e21c71490 threads: track wall clock time precisely
Issue warning if thread sleeps for a long time.
4 months ago
Victor Julien 5bb2132bb8 time: add SCTIME_CMP_EQ 4 months ago
Victor Julien f0c4f9d64b util/hash-string: fix compile warning
Clang 19:

util-hash-string.c:41:16: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
   41 |     int len1 = strlen((char *)data1);
      |         ~~~~   ^~~~~~~~~~~~~~~~~~~~~
util-hash-string.c:42:16: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
   42 |     int len2 = strlen((char *)data2);
      |         ~~~~   ^~~~~~~~~~~~~~~~~~~~~
2 errors generated.
4 months ago
Victor Julien 270e19191b time: add gettimeofday wrapper for SCTime_t 4 months ago
Victor Julien bdc0df8454 time: remove unused function
It tripped up cppcheck:

src/util-time.h:124:35: error: syntax error [syntaxError]
    return !timercmp(first, second, >);
4 months ago
Victor Julien 3f85addaac stream: track pcap log segments timestamp with SCTime_t
This is a more compact time format.
4 months ago
Jason Ish a739d7623b eve/tls: don't construct const from other const
Some compiler/platform combinations don't like creating one const from
another as it can't guarantee the other is defined, resulting in the
following compile error:

output-json-tls.c:102:5: error: initializer element is not constant
     BASIC_FIELDS |
     ^~~~~~~~~~~~

Fixes commit 377989df6c
4 months ago
Adam Kiripolsky 175e690222 dpdk/hw_offload: add support for vlan stripping
Utilize DPDK API for hardware vlan stripping if supported by NIC.

Ticket: 7330
4 months ago
Nancy Enos e22c2a2332 applayer/htp: convert to new FAIL/PASS API
Ticket: #6935
4 months ago
Jason Ish d4a3ee163d misc: remove unneeded headers
Remove unneeded headers from worked on in previous commits, just
simple ones flagged by clangd.
4 months ago
Jason Ish ab6dcb3fc1 app-layer: use uint8_t consistent for event IDs
Introduce a common function for mapping names to IDs that performs
bounds checking.

Note: For event IDs in the enum that are larger than a uint8_t, -1
will be returned instead of -4. -4 has special meaning during
signature parsin that means requirements were not met. -4 has no
special handling prior to requirements, or the meaning has been lost.
4 months ago
Alice Akaki 5e563b0c8b detect/analyzer: add more details for flow_age
Ticket: #6312
4 months ago
Sascha Steinbiss 285cc29ec0 redis: add automatic trimming support for streams 4 months ago