]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
12 months agodecode: fix -Wshorten-64-to-32 warnings 11454/head
Philippe Antoine [Tue, 19 Sep 2023 09:03:55 +0000 (11:03 +0200)] 
decode: fix -Wshorten-64-to-32 warnings

Ticket: #6186

12 months agoflow: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Tue, 25 Jun 2024 07:39:18 +0000 (09:39 +0200)] 
flow: fix -Wshorten-64-to-32 warnings

Ticket: #6186

12 months agofeatures: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Tue, 25 Jun 2024 07:35:15 +0000 (09:35 +0200)] 
features: fix -Wshorten-64-to-32 warnings

Ticket: #6186

12 months agocounters: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Tue, 25 Jun 2024 07:34:08 +0000 (09:34 +0200)] 
counters: fix -Wshorten-64-to-32 warnings

Ticket: #6186

12 months agodoc: state that payload-length includes the gaps
Philippe Antoine [Mon, 24 Jun 2024 20:13:55 +0000 (22:13 +0200)] 
doc: state that payload-length includes the gaps

12 months agooutput/dcerpc: call jb_get_mark just before jb_open_object
Philippe Antoine [Mon, 24 Jun 2024 20:11:17 +0000 (22:11 +0200)] 
output/dcerpc: call jb_get_mark just before jb_open_object

12 months agodoc: update dns section of the eve format documentation
Jason Ish [Fri, 5 Jul 2024 16:57:39 +0000 (10:57 -0600)] 
doc: update dns section of the eve format documentation

12 months agodoc: upgrade guide for dns logging changes
Jason Ish [Fri, 7 Jun 2024 21:30:54 +0000 (15:30 -0600)] 
doc: upgrade guide for dns logging changes

Bug: #6281

12 months agoeve/dns: allow version to be set with environment variable
Jason Ish [Thu, 4 Jul 2024 21:04:58 +0000 (15:04 -0600)] 
eve/dns: allow version to be set with environment variable

There is no sane way to set override the DNS eve version in Suricata
tests without using a copy of the configuration file, and many of the
tests by design use the configuration file of the Suricata under test,
so making a copy would break this assumption.

To get around this, respect the SURICATA_EVE_DNS_VERSION environment
variable as a way to set the version if not explicitly set in the
configuration file.

12 months agodns: add v3 dns logging
Jason Ish [Thu, 27 Jun 2024 21:33:05 +0000 (15:33 -0600)] 
dns: add v3 dns logging

DNS v3 logging fixes the discrepancies between request and response
logging with the main difference being queries always being placed in an
array.

Bug: #6281

12 months agodns: new v3 style logging for alerts
Jason Ish [Thu, 27 Jun 2024 22:54:25 +0000 (16:54 -0600)] 
dns: new v3 style logging for alerts

V3 style DNS logging fixes the discrepancies between request and
response logging better dns records and alert records.

The main change is that queries and answers are always logged as
arrays, and header fields are not logged in array items.

For alerts this means that answers are now logged as arrays, queries
already were.

DNS records will get this new format as well, but with a configuration
parameter.

Bug: #6281

12 months agodns: parse and populate OPT rdata struct
Nathan Scrivens [Thu, 16 May 2024 19:51:51 +0000 (15:51 -0400)] 
dns: parse and populate OPT rdata struct

Feature: 7017
Add DNSRDataOPT struct and DNSRData enum type OPT.
Add OPT parsing function and test function.
Add DNSRData OPT type to lua.rs match.
Log OPT rdata.

12 months agodns log: add additional section
Nathan Scrivens [Thu, 16 May 2024 19:50:24 +0000 (15:50 -0400)] 
dns log: add additional section

Feature: 7011
dns_log_json_answer: log additional section records.
update schema.json with new "additionals" section.

12 months agodns parsing: add additional section
Nathan Scrivens [Thu, 16 May 2024 19:31:38 +0000 (15:31 -0400)] 
dns parsing: add additional section

Feature: 7011
Add additionals to DNSMessage struct.
Add parsing logic to populate additional section data.
Patch dns tests to account for additional section parsing.

12 months agodoc: update MQTT configuration
Sascha Steinbiss [Sun, 12 May 2024 21:14:37 +0000 (23:14 +0200)] 
doc: update MQTT configuration

12 months agomqtt: run rustfmt
Sascha Steinbiss [Sat, 11 May 2024 23:52:31 +0000 (01:52 +0200)] 
mqtt: run rustfmt

12 months agomqtt: enable limiting of logged message length
Sascha Steinbiss [Sat, 11 May 2024 23:44:07 +0000 (01:44 +0200)] 
mqtt: enable limiting of logged message length

Ticket: #6984

12 months agorust: add JsonBuilder::set_string_limited()
Sascha Steinbiss [Fri, 31 May 2024 09:15:26 +0000 (11:15 +0200)] 
rust: add JsonBuilder::set_string_limited()

12 months agogithub-actions: bump actions/download-artifact from 4.1.4 to 4.1.8 11447/head
dependabot[bot] [Fri, 5 Jul 2024 15:24:50 +0000 (15:24 +0000)] 
github-actions: bump actions/download-artifact from 4.1.4 to 4.1.8

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.4...fa0a91b85d4f404e444e00e005971372dc801d16)

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

Signed-off-by: dependabot[bot] <support@github.com>
12 months agogithub-actions: bump actions/upload-artifact from 4.3.3 to 4.3.4
dependabot[bot] [Fri, 5 Jul 2024 15:24:46 +0000 (15:24 +0000)] 
github-actions: bump actions/upload-artifact from 4.3.3 to 4.3.4

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/65462800fd760344b1a7b4382951275a0abb4808...0b2256b8c012f0828dc542b3febcab082c67f72b)

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

Signed-off-by: dependabot[bot] <support@github.com>
12 months agodetect: Use Option where appropriate
Jeff Lucovsky [Fri, 22 Mar 2024 14:21:52 +0000 (10:21 -0400)] 
detect: Use Option where appropriate

This commit uses Option instead of Result.

Issue: 6873

12 months agodetect/byte_extract: Move keyword parser to Rust
Jeff Lucovsky [Mon, 11 Mar 2024 15:31:10 +0000 (11:31 -0400)] 
detect/byte_extract: Move keyword parser to Rust

Implement the keyword parser in Rust.

Issue: 6873

12 months agodetect/byte: Refactor endian, base
Jeff Lucovsky [Sun, 10 Mar 2024 14:04:07 +0000 (10:04 -0400)] 
detect/byte: Refactor endian, base

Issue: 6873

Refactor the enums for endian and base handling for broader use.

13 months agoutil/thash: decrease memuse if array was allocated 11431/head
Philippe Antoine [Thu, 4 Jul 2024 11:55:27 +0000 (13:55 +0200)] 
util/thash: decrease memuse if array was allocated

THashInitConfig may not allocate array and increase memuse.
Such a failure leads to THashShutdown which should not decrease
the memuse.

Ticket: 7135

13 months agodpdk: replace TSC clock with GetTime (gettimeofday) function
Lukas Sismis [Wed, 26 Jun 2024 21:33:52 +0000 (23:33 +0200)] 
dpdk: replace TSC clock with GetTime (gettimeofday) function

Getting clock through Time Stamp Counter (TSC) can be precise and fast,
however only for a short duration of time.
The implementation across CPUs seems to vary. The original idea is to
increment the counter with every tick. Then dividing the delta of CPU ticks
by the CPU frequency can return the time that passed.
However, the CPU clock/frequency can change over time, resulting in uneven
incrementation of TSC. On some CPUs this is handled by extra logic.
As a result, obtaining time through this method might drift from the real
time.

This commit therefore substitues TSC time retrieval by the standard system
call wrapped in GetTime function - on Linux it is gettimeofday.

Ticket: 7115

13 months agoapplayer/htp-range: fix off by one in expiry check 11414/head
Shivani Bhardwaj [Mon, 10 Jun 2024 11:58:33 +0000 (17:28 +0530)] 
applayer/htp-range: fix off by one in expiry check

13 months agodoc: add note about datasets string memcaps
Shivani Bhardwaj [Thu, 9 May 2024 15:51:25 +0000 (21:21 +0530)] 
doc: add note about datasets string memcaps

Bug 3910

13 months agodatasets: fix memuse to include string len
Shivani Bhardwaj [Thu, 23 May 2024 10:13:51 +0000 (15:43 +0530)] 
datasets: fix memuse to include string len

So far, when the data size was passed to the THash API, it was sent as
a sizeof(Struct) which works fine for the other data types as they have
a fixed length but not for the StringType.
However, because of the sizeof construct, the length of a string type
dataset was always taken to be 16 Bytes which is only the size of the struct
itself. It did not accomodate the actual size of the string that the
StringType holds. Fix this so that the memuse that is used to determine
whether memcap was reached also takes into consideration the size of the
actual string.

Bug 3910

13 months agoutil/thash: add a length getter fn
Shivani Bhardwaj [Mon, 13 May 2024 10:35:19 +0000 (16:05 +0530)] 
util/thash: add a length getter fn

In order to have access to the length of datatypes with variable lengths
to correctly update memuse to calculate memcaps.

Bug 3910

13 months agobypass: really bypass udp flow from first packet
Philippe Antoine [Thu, 30 May 2024 07:56:43 +0000 (09:56 +0200)] 
bypass: really bypass udp flow from first packet

Ticket: 7053

As flow state would be overwritten by established...

13 months agogithub-actions: bump actions/checkout from 3.6.0 to 4.1.7 11310/head 11413/head
dependabot[bot] [Wed, 3 Jul 2024 15:27:51 +0000 (15:27 +0000)] 
github-actions: bump actions/checkout from 3.6.0 to 4.1.7

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.6.0...692973e3d937129bcbf40652eb9f2f61becf3332)

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

Signed-off-by: dependabot[bot] <support@github.com>
13 months agogithub-ci: add non-bundled libhtp build 11408/head
Jason Ish [Tue, 25 Jun 2024 19:03:18 +0000 (13:03 -0600)] 
github-ci: add non-bundled libhtp build

13 months agogithub-ci/builds: don't run if only doc changes
Jason Ish [Tue, 25 Jun 2024 18:51:33 +0000 (12:51 -0600)] 
github-ci/builds: don't run if only doc changes

A new workflow, "docs" has been created for only doc changes.

Factor out prepare-deps into a reusable action.

13 months agodetect: parse units for integer for every cases
Philippe Antoine [Thu, 27 Jun 2024 11:42:34 +0000 (13:42 +0200)] 
detect: parse units for integer for every cases

Ticket: #6423

Not just equality, but also >3MB should work
For example flow.bytes_toserver>3MB

13 months agosmb/ntlmssp: improve version check
Victor Julien [Tue, 25 Jun 2024 08:35:35 +0000 (10:35 +0200)] 
smb/ntlmssp: improve version check

Don't assume the ntlmssp version field is always present if the flag is
set. Instead keep track of the offsets of the data of the various blobs
and see if there is space for the version.

Inspired by how Wireshark does the parsing.

Bug: #7121.

13 months agogithub-actions: bump github/codeql-action from 3.25.7 to 3.25.11 11403/head
dependabot[bot] [Mon, 1 Jul 2024 19:30:49 +0000 (19:30 +0000)] 
github-actions: bump github/codeql-action from 3.25.7 to 3.25.11

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.7 to 3.25.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.25.7...v3.25.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
13 months agogithub-actions: bump codecov/codecov-action from 4.4.1 to 4.5.0
dependabot[bot] [Mon, 1 Jul 2024 19:30:31 +0000 (19:30 +0000)] 
github-actions: bump codecov/codecov-action from 4.4.1 to 4.5.0

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/125fc84a9a348dbcf27191600683ec096ec9021c...e28ff129e5465c2c0dcc6f003fc735cb6ae0c673)

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

Signed-off-by: dependabot[bot] <support@github.com>
13 months agogithub-actions: remove centos:7 build due to EOL
Victor Julien [Mon, 1 Jul 2024 12:07:06 +0000 (14:07 +0200)] 
github-actions: remove centos:7 build due to EOL

13 months agoqa: remove depcrecated files
Philippe Antoine [Thu, 27 Jun 2024 09:26:52 +0000 (11:26 +0200)] 
qa: remove depcrecated files

lgtm has been superseded by codeql github action
docker and travis are obsolete

Preparatory work for ticket 2696 libhtp rust conversion

13 months agooutput/tx: use dynamic number of app-layer protos
Philippe Antoine [Fri, 21 Jun 2024 17:32:32 +0000 (19:32 +0200)] 
output/tx: use dynamic number of app-layer protos

OutputTxLoggerThreadData gets allocated after the number of app-layer
protos is definite

13 months agodetect/profiling: use dynamic number of app-layer protos
Philippe Antoine [Fri, 21 Jun 2024 17:22:10 +0000 (19:22 +0200)] 
detect/profiling: use dynamic number of app-layer protos

13 months agoapp-layer: use already defined constant
Philippe Antoine [Fri, 21 Jun 2024 17:14:23 +0000 (19:14 +0200)] 
app-layer: use already defined constant

FLOW_PROTO_APPLAYER_MAX

13 months agodetect/file-data: use dynamic number of app-layer protos
Philippe Antoine [Fri, 21 Jun 2024 17:10:42 +0000 (19:10 +0200)] 
detect/file-data: use dynamic number of app-layer protos

13 months agodetect: helper function for multibuffer
Philippe Antoine [Fri, 5 Apr 2024 11:37:46 +0000 (13:37 +0200)] 
detect: helper function for multibuffer

13 months agodoc/userguide: document threshold backoff type 11388/head 11394/head
Victor Julien [Wed, 26 Jun 2024 07:36:49 +0000 (09:36 +0200)] 
doc/userguide: document threshold backoff type

13 months agostream: enable backoff on event rules
Victor Julien [Mon, 24 Jun 2024 10:34:44 +0000 (12:34 +0200)] 
stream: enable backoff on event rules

Enable backoff for most rules. The rules looking at the session start up
use a count of 1 and a multiplier of 2.

Post-3whs rules use a count of 1 and a multiplier of 10.

13 months agodetect/threshold: implement backoff type
Victor Julien [Mon, 24 Jun 2024 08:55:45 +0000 (10:55 +0200)] 
detect/threshold: implement backoff type

Implement new `type backoff` for thresholding. This allows alerts to be
limited.

A count of 1 with a multiplier of 10 would generate alerts for matching packets:
1, 10, 100, 1000, 10000, 100000, etc.

A count of 1 with a multiplier of 2 would generate alerts for matching packets:
1, 2, 4, 8, 16, 32, etc.

Like with other thresholds, rule actions like drop and setting of
flowbits will still be performed for each matching packet.

Current implementation is only for the by_flow tracker and for per rule
threshold statements.

Tracking is done using uint32_t. When it reaches this value, the rest of
the packets in the tracker will use the silent match.

Ticket: #7120.

13 months agodetect/threshold: regex cleanup
Victor Julien [Mon, 24 Jun 2024 09:06:10 +0000 (11:06 +0200)] 
detect/threshold: regex cleanup

13 months agodetect/threshold: format file
Victor Julien [Mon, 24 Jun 2024 08:08:45 +0000 (10:08 +0200)] 
detect/threshold: format file

13 months agodoc/userguide: document new threshold config options
Victor Julien [Wed, 15 May 2024 09:12:45 +0000 (11:12 +0200)] 
doc/userguide: document new threshold config options

13 months agodetect/threshold: make hash size and memcap configurable
Victor Julien [Wed, 15 May 2024 09:02:29 +0000 (11:02 +0200)] 
detect/threshold: make hash size and memcap configurable

13 months agodetect/threshold: includes cleanup
Victor Julien [Sat, 20 Apr 2024 05:41:00 +0000 (07:41 +0200)] 
detect/threshold: includes cleanup

13 months agodetect/threshold: expand cache support for rule tracking
Victor Julien [Fri, 19 Apr 2024 16:57:32 +0000 (18:57 +0200)] 
detect/threshold: expand cache support for rule tracking

Use the same hash key as for the regular threshold storage,
so include gid, rev, tentant id.

13 months agodetect/threshold: consider tenant id in tracking
Victor Julien [Fri, 19 Apr 2024 16:31:39 +0000 (18:31 +0200)] 
detect/threshold: consider tenant id in tracking

Ticket: #6967.

13 months agodetect/threshold: include rev in threshold tracking
Victor Julien [Fri, 19 Apr 2024 16:27:57 +0000 (18:27 +0200)] 
detect/threshold: include rev in threshold tracking

13 months agodetect/threshold: improve hash function
Victor Julien [Fri, 19 Apr 2024 16:17:33 +0000 (18:17 +0200)] 
detect/threshold: improve hash function

13 months agothresholds: use dedicated storage
Victor Julien [Tue, 9 Jan 2024 15:00:08 +0000 (16:00 +0100)] 
thresholds: use dedicated storage

Instead of a Host and IPPair table thresholding layer, use a dedicated
THash to store both. This allows hashing on host+sid+tracker or
ippair+sid+tracker, to create more unique hash keys.

This allows for fewer hash collisions.

The per rule tracking also uses this, so that the single big lock is no
longer a single point of contention.

Reimplement storage for flow thresholds to reuse as much logic as
possible from the host/ippair/rule thresholds.

Ticket: #426.

13 months agorange: use thash expiry API for timeout
Victor Julien [Tue, 9 Jan 2024 15:14:10 +0000 (16:14 +0100)] 
range: use thash expiry API for timeout

13 months agothash: add expiration logic
Victor Julien [Wed, 10 Jan 2024 08:49:10 +0000 (09:49 +0100)] 
thash: add expiration logic

Add a callback and helper function to handle data expiration.

Update datasets to explicitly not use expiration.

13 months agodetect/address: constify ipv6 cmp funcs
Victor Julien [Tue, 9 Jan 2024 20:53:35 +0000 (21:53 +0100)] 
detect/address: constify ipv6 cmp funcs

13 months agodetect/threshold: minor rate filter cleanup
Victor Julien [Tue, 9 Jan 2024 19:18:21 +0000 (20:18 +0100)] 
detect/threshold: minor rate filter cleanup

13 months agodetect/threshold: minor code cleanup
Victor Julien [Tue, 9 Jan 2024 15:39:22 +0000 (16:39 +0100)] 
detect/threshold: minor code cleanup

Packet pointer is not used during allocation.

13 months agodetect/threshold: minor cleanup
Victor Julien [Tue, 9 Jan 2024 15:10:30 +0000 (16:10 +0100)] 
detect/threshold: minor cleanup

13 months agodetect/threshold: implement per thread cache
Victor Julien [Mon, 11 Sep 2023 19:17:36 +0000 (21:17 +0200)] 
detect/threshold: implement per thread cache

Thresholding often has 2 stages:

1. recording matches
2. appling an action, like suppress

E.g. with something like:
threshold:type limit, count 10, seconds 3600, track by_src;
the recording state is about counting 10 first hits for an IP,
then followed by the "suppress" state that might last an hour.

By_src/by_dst are expensive, as they do a host table lookup and lock
the host. If many threads require this access, lock contention becomes
a serious problem.

This patch adds a thread local cache to avoid the synchronization
overhead. When the threshold for a host enters the "apply" stage,
a thread local hash entry is added. This entry knows the expiry
time and the action to apply. This way the action can be applied
w/o the synchronization overhead.

A rbtree is used to handle expiration.

Implemented for IPv4.

13 months agodetect: add ticket id to var related todos
Victor Julien [Wed, 13 Mar 2024 10:03:01 +0000 (11:03 +0100)] 
detect: add ticket id to var related todos

13 months agodetect/detection_filter: add support for track by_flow
Victor Julien [Wed, 13 Mar 2024 10:01:28 +0000 (11:01 +0100)] 
detect/detection_filter: add support for track by_flow

13 months agodoc: add thresholding by_flow
Victor Julien [Fri, 8 Mar 2024 10:50:14 +0000 (11:50 +0100)] 
doc: add thresholding by_flow

13 months agodetect/content: fix wrong value for depth check
Victor Julien [Tue, 5 Mar 2024 09:03:15 +0000 (10:03 +0100)] 
detect/content: fix wrong value for depth check

Limits propegation checked for DETECT_DEPTH as a content flag,
which appears to have worked by chance. After reshuffling the
keyword id's it no longer worked. This patch uses the proper
flag DETECT_CONTENT_DEPTH.

13 months agodetect: group content inspect keyword id's
Victor Julien [Tue, 5 Mar 2024 09:02:53 +0000 (10:02 +0100)] 
detect: group content inspect keyword id's

13 months agodetect: group types used in traffic variables
Victor Julien [Mon, 4 Mar 2024 11:53:35 +0000 (12:53 +0100)] 
detect: group types used in traffic variables

Traffic variables (flowvars, flowbits, xbits, etc) use a smaller int for
their type than detection types. As a workaround make sure the values fit
in a uint8_t.

13 months agothreshold: add by_flow support for global thresholds
Victor Julien [Sat, 2 Mar 2024 06:58:30 +0000 (07:58 +0100)] 
threshold: add by_flow support for global thresholds

Allow rate_filter and thresholds from the global config to specify
tracking "by_flow".

13 months agodetect/threshold: implement tracking 'by_flow'
Victor Julien [Tue, 27 Feb 2024 10:06:47 +0000 (11:06 +0100)] 
detect/threshold: implement tracking 'by_flow'

Add support for 'by_flow' track option. This allows using the various
threshold options in the context of a single flow.

Example:

    alert tcp ... stream-event:pkt_broken_ack; \
        threshold:type limit, track by_flow, count 1, seconds 3600;

The example would limit the number of alerts to once per hour for
packets triggering the 'pkt_broken_ack' stream event.

Implemented as a special "flowvar" holding the threshold entries. This
means no synchronization is required, making this a cheaper option
compared to the other trackers.

Ticket: #6822.

13 months agoutil/var: add comments explaining types
Victor Julien [Mon, 4 Mar 2024 11:29:24 +0000 (12:29 +0100)] 
util/var: add comments explaining types

13 months agoutil/var: remove printf; add assert
Victor Julien [Fri, 1 Mar 2024 12:30:09 +0000 (13:30 +0100)] 
util/var: remove printf; add assert

13 months agohttp2: do not expand duplicate headers
Philippe Antoine [Mon, 17 Jun 2024 14:30:49 +0000 (16:30 +0200)] 
http2: do not expand duplicate headers

Ticket: 7104

As this can cause a big mamory allocation due to the quadratic
nature of the HPACK compression.

13 months agomodbus: abort flow parsing on flood
Philippe Antoine [Thu, 25 Apr 2024 19:24:33 +0000 (21:24 +0200)] 
modbus: abort flow parsing on flood

Ticket: 6987

Let's not spend more resources for a flow which is trying to
make us do it...

13 months agodetect: remove unnecessary detect thread flags stores 11365/head
Victor Julien [Sun, 10 Sep 2023 06:21:02 +0000 (08:21 +0200)] 
detect: remove unnecessary detect thread flags stores

13 months agodetect/nfs: do not free a null pointer
Philippe Antoine [Sun, 23 Jun 2024 20:57:11 +0000 (22:57 +0200)] 
detect/nfs: do not free a null pointer

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69840

13 months agodetect/base64: Use Rust defined modes everywhere 11353/head
Jeff Lucovsky [Thu, 21 Mar 2024 14:23:36 +0000 (10:23 -0400)] 
detect/base64: Use Rust defined modes everywhere

Issue: 6487

To avoid ambiguity, a single definition for base 64 decoding modes will
be used. The Rust base64 transform contains the definitions for the
existing mode types: Strict, RFC2045, RFC4648

13 months agodoc/transform: Correct typo
Jeff Lucovsky [Sun, 25 Feb 2024 15:00:45 +0000 (10:00 -0500)] 
doc/transform: Correct typo

13 months agodoc/transform: Describe the from_base64 transform
Jeff Lucovsky [Fri, 23 Feb 2024 13:51:56 +0000 (08:51 -0500)] 
doc/transform: Describe the from_base64 transform

Issue: 6487

Document the new transform and indicate that it's the preferred way to
perform base64 decoding (preferred over base64_decode)

13 months agodetect/transform: Add from_base64 transform
Jeff Lucovsky [Thu, 22 Feb 2024 15:41:37 +0000 (10:41 -0500)] 
detect/transform: Add from_base64 transform

Issue: 6487

Implement the from_base64 transform:
    [bytes value] [offset value] [mode strict|rfc4648|rfc2045]

    The value for bytes and offset may be a byte_ variable or an
    unsigned integer.

13 months agodetect/transform: from_base64 option parsing
Jeff Lucovsky [Thu, 22 Feb 2024 14:47:18 +0000 (09:47 -0500)] 
detect/transform: from_base64 option parsing

Issue: 6487

Implement from_base64 option parsing in Rust. The Rust module also
contains unit tests.

13 months agodetect/parser: Refactor utility routines
Jeff Lucovsky [Thu, 22 Feb 2024 14:40:28 +0000 (09:40 -0500)] 
detect/parser: Refactor utility routines

Refactor utility functions/definitions from the byte_math module into
the parser module. This includes parse_var and ResultValue

Issue: 6487

13 months agoflow: declare and use constansts where possible
Shivani Bhardwaj [Fri, 21 Jun 2024 08:25:59 +0000 (13:55 +0530)] 
flow: declare and use constansts where possible

13 months agoflow/manager: make fn calls only when necessary
Shivani Bhardwaj [Fri, 21 Jun 2024 08:12:24 +0000 (13:42 +0530)] 
flow/manager: make fn calls only when necessary

13 months agoflow/timeout: cleanup fn names and comments
Shivani Bhardwaj [Mon, 17 Jun 2024 10:30:13 +0000 (16:00 +0530)] 
flow/timeout: cleanup fn names and comments

13 months agoflow: remove unneeded args to fn
Shivani Bhardwaj [Thu, 13 Jun 2024 14:01:02 +0000 (19:31 +0530)] 
flow: remove unneeded args to fn

13 months agoflow/manager: add fn docs
Shivani Bhardwaj [Thu, 13 Jun 2024 13:45:54 +0000 (19:15 +0530)] 
flow/manager: add fn docs

13 months agoflow: add defensive check
Shivani Bhardwaj [Thu, 13 Jun 2024 13:05:31 +0000 (18:35 +0530)] 
flow: add defensive check

13 months agopacketpool: use DEBUG_VALIDATE statement
Shivani Bhardwaj [Thu, 13 Jun 2024 13:04:40 +0000 (18:34 +0530)] 
packetpool: use DEBUG_VALIDATE statement

13 months agoflow: use bool wherever possible
Shivani Bhardwaj [Thu, 13 Jun 2024 13:03:30 +0000 (18:33 +0530)] 
flow: use bool wherever possible

13 months agodetect/icmp: require real packet in signature
Philippe Antoine [Fri, 21 Jun 2024 07:27:50 +0000 (09:27 +0200)] 
detect/icmp: require real packet in signature

Fixes: 956c8bebd1 ("detect/prefilter: use sig mask to exclude pkt engines")
13 months agodetect: add to signature mask for decode events
Philippe Antoine [Wed, 19 Jun 2024 11:42:32 +0000 (13:42 +0200)] 
detect: add to signature mask for decode events

Ticket: 6291

13 months agodetect: fix check for app_layer events
Philippe Antoine [Wed, 19 Jun 2024 11:39:08 +0000 (13:39 +0200)] 
detect: fix check for app_layer events

Ticket: 7106

13 months agoaf-packet: Remove unused preprocessor define
Jeff Lucovsky [Tue, 18 Jun 2024 13:45:06 +0000 (09:45 -0400)] 
af-packet: Remove unused preprocessor define

Remove unused preprocessor value; exposed by compilation warning

13 months agooutput: configurable payload_length field for alerts
Philippe Antoine [Thu, 20 Jun 2024 14:18:25 +0000 (16:18 +0200)] 
output: configurable payload_length field for alerts

Ticket: 7098

13 months agodcerpc: add app-layer metadata in alerts
Philippe Antoine [Thu, 20 Jun 2024 13:09:16 +0000 (15:09 +0200)] 
dcerpc: add app-layer metadata in alerts

Ticket: 6090

13 months agofilestore: do not try to store a file set to nostore
Philippe Antoine [Thu, 7 Dec 2023 09:32:03 +0000 (10:32 +0100)] 
filestore: do not try to store a file set to nostore

Ticket: 6390

This can happen with keyword filestore:both,flow
If one direction does not have a signature group with a filestore,
the file is set to nostore on opening, until a signature in
the other direction tries to set it to store.
Subsequent files will be stored in both directions as flow flags
are now set.

13 months agoapp-layer: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Thu, 29 Jun 2023 13:41:31 +0000 (15:41 +0200)] 
app-layer: fix -Wshorten-64-to-32 warnings

Ticket: #6186

Warnings about downcast from 64 to 32 bits