]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
10 months agodoc/configuration: remove mention to prune-flows 11792/head
Juliana Fajardini [Tue, 17 Sep 2024 18:50:37 +0000 (15:50 -0300)] 
doc/configuration: remove mention to prune-flows

Although the `prune-flows` option was removed with a5587fec2eb,
when documentation for the suricata.yaml config file was added with
b252b0d, this option was also included - as has remained until now.

10 months agoci: mov from cifuzz to clusterfuzzlite
Philippe Antoine [Tue, 10 Sep 2024 12:10:30 +0000 (14:10 +0200)] 
ci: mov from cifuzz to clusterfuzzlite

To better support main7 CI fuzzing

Ticket: 7253

10 months agooutput/json: Remove unneeded parameters
Jeff Lucovsky [Sat, 24 Aug 2024 13:02:53 +0000 (09:02 -0400)] 
output/json: Remove unneeded parameters

Issue: 4974

Remove unused parameters in output path for
- AlertJsonMetadata
- AlertJsonHeader

10 months agoconfig: Update reference keys
Jeff Lucovsky [Mon, 10 Jun 2024 20:04:38 +0000 (16:04 -0400)] 
config: Update reference keys

Issue: 4974

1. Use https instead of http everywhere
2. Organize and annotate references by
    - Referenced by ET/Open and ET/Pro
        - URL resolves and works as intended (to provide supplemental
          information regarding a reference value, e.g., bug id, cve
          value)
        - URL no longer resolves
        - URL resolves but doesn't work as intended (to provide
          supplemental information)
    - Not referenced by ET/Open nor ET/Pro
        - URL resolves and works as intended (to provide supplemental
          information regarding a reference value, e.g., bug id, cve
          value)
        - URL no longer resolves
        - URL resolves but doesn't work as intended (to provide
          supplemental information)

10 months agodoc: Document reference config setting
Jeff Lucovsky [Tue, 30 Apr 2024 17:11:50 +0000 (13:11 -0400)] 
doc: Document reference config setting

Issue: 4974

10 months agoalert/reference: Optionally add reference(s)
Jeff Lucovsky [Sat, 27 Apr 2024 13:55:38 +0000 (09:55 -0400)] 
alert/reference: Optionally add reference(s)

Issue: 4974

Optionally include rule references with the alert. Since there can be
multiple reference keywords, they are collected into an array.

10 months agorust: pin serde version 11768/head
Philippe Antoine [Tue, 10 Sep 2024 08:17:16 +0000 (10:17 +0200)] 
rust: pin serde version

because oss-fuzz does not support newer rust nightly
and newer serde does not support oss-fuzz old nightly

10 months agolua: use lua from crates.io rather than github
Jason Ish [Mon, 12 Aug 2024 22:00:23 +0000 (16:00 -0600)] 
lua: use lua from crates.io rather than github

This allows the source override in .cargo/config.toml to apply to the
suricata-lua-sys crate as well fixing offline builds.

Ticket: #7226

10 months agodcerpc: return error on invalid header
Shivani Bhardwaj [Fri, 21 Jul 2023 13:52:45 +0000 (19:22 +0530)] 
dcerpc: return error on invalid header

DCERPC/TCP tends to return the same values for invalid and incomplete
headers. As a result of this, invalid headers and any traffic following
it is buffered and processed later on assumed to be valid DCERPC traffic.
Fix this by clearly defining error and incomplete data and taking
appropriate actions.

Bug 7230

10 months agorunmode: fix coverity warning 11755/head
Philippe Antoine [Tue, 10 Sep 2024 07:24:59 +0000 (09:24 +0200)] 
runmode: fix coverity warning

CID 1619284:  Memory - illegal accesses  (OVERRUN)

In ParseAFXDPConfig, a pointer to bool is cast into a pointer
to int.

Also removing the cast pattern when useless

10 months agorust/detect: fix too_long_first_doc_paragraph clippy warning
Philippe Antoine [Mon, 9 Sep 2024 09:09:52 +0000 (11:09 +0200)] 
rust/detect: fix too_long_first_doc_paragraph clippy warning

warning: first doc comment paragraph is too long
  --> src/detect/iprep.rs:57:1
   |
57 | / /// value matching is done use `DetectUintData` logic.
58 | | /// isset matching is done using special `DetectUintData` value ">= 0"
59 | | /// isnotset matching bypasses `DetectUintData` and is handled directly
60 | | /// in the match function (in C).
   | |_
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
   = note: `#[warn(clippy::too_long_first_doc_paragraph)]` on by default
help: add an empty line

10 months agorust/dcerpc: fix single_match clippy warning
Philippe Antoine [Mon, 9 Sep 2024 09:09:18 +0000 (11:09 +0200)] 
rust/dcerpc: fix single_match clippy warning

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
  --> src/dcerpc/log.rs:36:33
   |
36 |               DCERPC_TYPE_BIND => match &state.bind {
   |  _________________________________^
37 | |                 Some(bind) => {
38 | |                     jsb.open_array("interfaces")?;
39 | |                     for uuid in &bind.uuid_list {
...  |
51 | |                 None => {}
52 | |             },
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
   = note: `#[warn(clippy::single_match)]` on by default

10 months agoframes: do not rely on FRAME_STREAM_ID
Philippe Antoine [Wed, 14 Aug 2024 14:17:36 +0000 (16:17 +0200)] 
frames: do not rely on FRAME_STREAM_ID

As it is not always the first frame to be created :
if it is not enabled, it does not get created, and other enabled
frames may be created first. see use of FrameConfigTypeIsEnabled

This resulted that this other frame got its length updated
on stream end, which led to false positives.

Resorting on FRAME_STREAM_TYPE is more consistent.

Ticket: 7213

10 months agohttp2: add frames support
Philippe Antoine [Wed, 14 Aug 2024 12:14:11 +0000 (14:14 +0200)] 
http2: add frames support

Ticket: 5743

Why ? To add detection capabilities

10 months agodcerpc: don't reuse completed tx
Victor Julien [Wed, 31 Jul 2024 11:58:29 +0000 (13:58 +0200)] 
dcerpc: don't reuse completed tx

In the DCERPC over TCP pcap, logging and rule matching is disrupted by adding a simple rule:

        alert tcp any any -> any any (flow:to_server,established; \
                dce_iface:5d2b62aa-ee0a-4a95-91ae-b064fdb471fc; dce_opnum:1; \
                dce_stub_data; content:"|42 77 4E 6F 64 65 49 50 2E 65 78 65 20|"; \
                content:!"|00|"; within:100; distance:97; sid:1; rev:1; )

Works: alert + 3 dcerpc records.

But when adding a trivial rule:

        alert tcp any any -> any any (flow:to_server,established; \
                dce_iface:5d2b62aa-ee0a-4a95-91ae-b064fdb471fc; dce_opnum:1; \
                dce_stub_data; content:"|42 77 4E 6F 64 65 49 50 2E 65 78 65 20|"; \
                content:!"|00|"; within:100; distance:97; sid:1; rev:1; )
        alert tcp any any -> any any (dsize:3; sid:2; rev:1; )

The alert for sid:1 disappears and also there is one dcerpc event less.

In the single rule case we can aggressively free the transactions, as there
is only an sgh in the toserver direction.

This means that when we encounter the 2nd REQUEST, the first 2 transactions
have already been processed and freed. So for the 2nd REQUEST we open a new
TX and run inspection and logging on it.

When the 2nd rule is added, it adds toclient sgh as well. This means that we
will now slightly delay the freeing of the transactions.

As a consequence we still have the TX for the first REQUEST when the 2nd REQUEST
is parsed. This leads to the 2nd REQUEST re-using the TX. Since the TX is
already marked as inspected, it means the toserver rule now no longer matches.
Also we're not logging this TX correctly now.

This commit fixes the issue by not "finding" a TX that as already been
marked complete in the search direction.

Bug #7187.

10 months agodetect/app-layer-proto: don't run detection on ALPROTO_UNKNOWN 11732/head
Victor Julien [Fri, 6 Sep 2024 11:14:48 +0000 (13:14 +0200)] 
detect/app-layer-proto: don't run detection on ALPROTO_UNKNOWN

The `app-layer-protocol` keyword inconsistently checks whether the
alproto is ALPROTO_UNKNOWN. In the regular match function it isn't
checked, in the prefilter function its checked for all but the "either"
mode.

This leads to false positives for negated matching, as an expression
like "!tls" will match if checked against ALPROTO_UNKNOWN.

This patch adds the checking everywhere. The keyword returns no match as
long as the alproto is ALPROTO_UNKNOWN.

Bug: #7241.

10 months agotls/ja3: do not append to ja3 str once ja3 hash is computed
Philippe Antoine [Tue, 3 Sep 2024 13:37:00 +0000 (15:37 +0200)] 
tls/ja3: do not append to ja3 str once ja3 hash is computed

Ticket: 6634

That means take only the first client hello into account.
This way, we do not end with ja3 string with 9 commas...

10 months agorust/base64: upgrade crate to latest
Shivani Bhardwaj [Thu, 29 Aug 2024 08:08:57 +0000 (13:38 +0530)] 
rust/base64: upgrade crate to latest

base64 crate is updated to the latest version 0.22.1. This came with
several API changes which are applied to the code. The old calls have
been replaced with the newer calls.

This was done following the availability of better fns to directly
decode into slices/vectors as needed and also that previous version was
too old.
Along with this change, update the Cargo.lock.in to reflect all changes
in the package versions.

Task 7219

10 months agorust: update Cargo.lock.in
Shivani Bhardwaj [Mon, 2 Sep 2024 05:35:38 +0000 (11:05 +0530)] 
rust: update Cargo.lock.in

to include the latest packages available.

10 months agogithub-actions: bump github/codeql-action from 3.25.15 to 3.26.6
dependabot[bot] [Sun, 1 Sep 2024 19:04:52 +0000 (19:04 +0000)] 
github-actions: bump github/codeql-action from 3.25.15 to 3.26.6

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.15 to 3.26.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.25.15...v3.26.6)

---
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>
10 months agogithub-actions: bump actions/upload-artifact from 4.3.4 to 4.4.0
dependabot[bot] [Sun, 1 Sep 2024 19:04:34 +0000 (19:04 +0000)] 
github-actions: bump actions/upload-artifact from 4.3.4 to 4.4.0

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

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

Signed-off-by: dependabot[bot] <support@github.com>
11 months agooutput-filedata: rename and document registration function 11689/head
Jason Ish [Fri, 30 Aug 2024 19:19:49 +0000 (13:19 -0600)] 
output-filedata: rename and document registration function

Prefix registration function and pointer function type with SC, as
well as document.

Ticket: #7227

11 months agooutput-file: rename and document registration function
Jason Ish [Fri, 30 Aug 2024 19:11:30 +0000 (13:11 -0600)] 
output-file: rename and document registration function

Rename OutputRegisterFileLogger to SCOutputRegisterFileLogger, add
function documentation and include in userguide.

Ticket: #7227

11 months agooutput-streaming: rename and document registration
Jason Ish [Fri, 30 Aug 2024 18:54:28 +0000 (12:54 -0600)] 
output-streaming: rename and document registration

Prefix the registration function and types with "SC", and add function
documentation.

Ticket: #7227

11 months agooutput-file: use void *initdata instead of OutputCtx
Jason Ish [Fri, 30 Aug 2024 15:00:59 +0000 (09:00 -0600)] 
output-file: use void *initdata instead of OutputCtx

Avoids leaking a higher level abstraction into a low level logger.

Ticket: #7227

11 months agooutput-filedata: use void *initdata instead of OutputCtx
Jason Ish [Fri, 30 Aug 2024 14:58:58 +0000 (08:58 -0600)] 
output-filedata: use void *initdata instead of OutputCtx

Avoids leaking a higher level abstraction into a low level logger.

Ticket: #7227

11 months agooutput-streaming: use void *initdata instead of OutputCtx
Jason Ish [Fri, 30 Aug 2024 14:56:39 +0000 (08:56 -0600)] 
output-streaming: use void *initdata instead of OutputCtx

Using OutputCtx leaks a higher level abstraction into the low level
logger.

Ticket: #7227

11 months agooutput: remove remaining ThreadExitPrintStats callbacks
Jason Ish [Fri, 30 Aug 2024 14:11:07 +0000 (08:11 -0600)] 
output: remove remaining ThreadExitPrintStats callbacks

Not used in output modules.

Ticket: #7227

11 months agooutput-stats: remove ThreadExitPrintStats callback
Jason Ish [Fri, 30 Aug 2024 13:52:36 +0000 (07:52 -0600)] 
output-stats: remove ThreadExitPrintStats callback

Not used.

Ticket: #7227

11 months agooutput-streaming: remove ThreadExitPrintStats callback
Jason Ish [Fri, 30 Aug 2024 13:50:59 +0000 (07:50 -0600)] 
output-streaming: remove ThreadExitPrintStats callback

Not used.

Ticket: #7227

11 months agooutput-filedata: remove ThreadExitPrintStats callback
Jason Ish [Fri, 30 Aug 2024 13:45:33 +0000 (07:45 -0600)] 
output-filedata: remove ThreadExitPrintStats callback

Not used.

Ticket: #7227

11 months agooutput-file: remove ThreadExitPrintStats callback
Jason Ish [Fri, 30 Aug 2024 13:39:51 +0000 (07:39 -0600)] 
output-file: remove ThreadExitPrintStats callback

Not used.

Ticket: #7227

11 months agooutput-tx: rename and document transaction logger registration
Jason Ish [Thu, 29 Aug 2024 22:55:57 +0000 (16:55 -0600)] 
output-tx: rename and document transaction logger registration

Rename OutputRegisterTxLogger to SCOutputRegisterTxLogger to make it
part of the public API as well as document.

Ticket: #7227

11 months agooutput-tx.h: include tm-threads.h
Jason Ish [Thu, 29 Aug 2024 22:44:33 +0000 (16:44 -0600)] 
output-tx.h: include tm-threads.h

Required to properly resolve the types in the header without depending
on includes coming before it in C files.

Ticket: #7227

11 months agoexamples: add tx logger to custom logger example
Jason Ish [Thu, 29 Aug 2024 22:33:03 +0000 (16:33 -0600)] 
examples: add tx logger to custom logger example

However, its disabled due to issue
https://redmine.openinfosecfoundation.org/issues/7236.

Ticket: #7227

11 months agooutput-tx: remove ThreadExitPrintStats callback
Jason Ish [Thu, 29 Aug 2024 20:49:53 +0000 (14:49 -0600)] 
output-tx: remove ThreadExitPrintStats callback

After removing the exit stats function from log-tlslog, this callback
is no longer used.

Ticket: #7227

11 months agolog-tlslog: remove unneeded includes
Jason Ish [Thu, 29 Aug 2024 20:39:54 +0000 (14:39 -0600)] 
log-tlslog: remove unneeded includes

Ticket: #7227

11 months agolog-tlslog: remove ThreadExitPrintStats callback
Jason Ish [Thu, 29 Aug 2024 20:35:50 +0000 (14:35 -0600)] 
log-tlslog: remove ThreadExitPrintStats callback

Remove the ThreadExitPrintStats callback, this is the only logger that
was actually using it, and this logger is marked for deprecation. This
allows us to remove the callback from the registration signature.

Ticket: #7227

11 months agotlsstore: remove ThreadExitPrintStats callback
Jason Ish [Thu, 29 Aug 2024 20:33:42 +0000 (14:33 -0600)] 
tlsstore: remove ThreadExitPrintStats callback

Remove the callback to print stats on thread exit.  The counter value
was never being used and this helps us get rid of this callback
altogether as their is only one other usage of it.

Ticket: #7227

11 months agooutput-tx: use void * instead of OutputCtx
Jason Ish [Wed, 28 Aug 2024 23:17:50 +0000 (17:17 -0600)] 
output-tx: use void * instead of OutputCtx

Using OutputCtx results in the low level output-tx packet logger being
aware of Suricata's higher level loggers that use OutputCtx, for the
low level logger this is purely opaque data that may not be an
OutputCtx for custom loggers.

Ticket: #7227

11 months agodevguide: more on low level logging
Jason Ish [Tue, 27 Aug 2024 23:02:41 +0000 (17:02 -0600)] 
devguide: more on low level logging

Use the extending/output section to introduce the low level logging
API.

Ticket: #7227

11 months agooutput-flow: rename register function and document
Jason Ish [Tue, 27 Aug 2024 22:41:34 +0000 (16:41 -0600)] 
output-flow: rename register function and document

Rename OutputRegisterFlowLogger to SCOutputRegisterFlowLogger and
document in the header file.

Mark other functions in the header file as part of the internal API.

Ticket: #7227

11 months agooutput-packet: rename register function and document
Jason Ish [Tue, 27 Aug 2024 22:33:58 +0000 (16:33 -0600)] 
output-packet: rename register function and document

Rename OutputRegisterPacketLogger to SCOutputRegisterPacketLogger as
its part of the public API and document its parameters.

Comment on the other functions in the header that they are part of the
internal API.

Ticket: #7227

11 months agopacket-logger: remove ThreadExitPrintStats
Jason Ish [Tue, 27 Aug 2024 22:18:55 +0000 (16:18 -0600)] 
packet-logger: remove ThreadExitPrintStats

The ThreadExitPrintStats callback was never being used, remove.

Ticket: #7227

11 months agoexamples: add custom logging plugin
Jason Ish [Mon, 26 Aug 2024 22:12:16 +0000 (16:12 -0600)] 
examples: add custom logging plugin

Add an example custom logger that hooks into the low level packet and
flow logging callbacks.

Ticket: #7227

11 months agoprofiling: create a LOGGER_USER id
Jason Ish [Wed, 28 Aug 2024 14:55:35 +0000 (08:55 -0600)] 
profiling: create a LOGGER_USER id

Loggers need an ID uniquely identify them for profiling. To help with
loggers registered at runtime (library, plugins), provide a
LOGGER_USER that can be used. It won't provide per-logger details if
they have more than one, but will provide a total for all their
registered loggers.

Ticket: #7227

11 months agooutput-packet.h: include tm-threads.h and decode.h
Jason Ish [Tue, 27 Aug 2024 21:27:15 +0000 (15:27 -0600)] 
output-packet.h: include tm-threads.h and decode.h

This allows the header to be used without including other headers this
one depends on.

Ticket: #7227

11 months agopgsql: don't expose PgsqlTransactionState to C
Jason Ish [Mon, 26 Aug 2024 22:02:05 +0000 (16:02 -0600)] 
pgsql: don't expose PgsqlTransactionState to C

PgsqlTransactionState has a variant named "Init" which is a little too
generic to export to C. Fortunately this method doesn't need to be
exposed to C, instead remove it as it was only called by
rs_pgsql_tx_get_alstate_progress which also doesn't need to be public
or expose to C.

Ticket: #7227

11 months agooutput-packet: use void * instead of OutputCtx * for initdata
Jason Ish [Mon, 26 Aug 2024 21:54:53 +0000 (15:54 -0600)] 
output-packet: use void * instead of OutputCtx * for initdata

The use of OutputCtx as the data type for initdata was leaking Eve
submodule logic into the low level packet logger. Instead use void *,
as the packet logging module is not concerned with the type of data
here.

Also document this initdata parameter.

Ticket: #7227

11 months agooutput-flow.h: include flow.h and decode.h
Jason Ish [Fri, 15 Sep 2023 20:49:11 +0000 (14:49 -0600)] 
output-flow.h: include flow.h and decode.h

A library/plugin user wanting to register a custom flow logger must
include "output-flow.h", however that depends on some other includes.
One train of thought with respect to include files in libraries, is
that they should include all their dependencies on behalf of the
user. To make a custom flow logger just a little easier, include
"flow.h" and "decode.h".

Ticket: #7227

11 months agooutput-flow: remove ThreadExitPrintStats callback
Jason Ish [Mon, 26 Aug 2024 21:48:32 +0000 (15:48 -0600)] 
output-flow: remove ThreadExitPrintStats callback

The callback, ThreadExitPrintStats is not used in the flow loggers.

Ticket: #7227

11 months agooutput-flow: use void * instead of OutputCtx * for initdata
Jason Ish [Mon, 26 Aug 2024 21:45:07 +0000 (15:45 -0600)] 
output-flow: use void * instead of OutputCtx * for initdata

The use of OutputCtx as the data type for initdata was leaking Eve
submodule logic into the low level flow logger. Instead use void *, as
the flow logging module is not concerned with the type of data here.

Also document this initdata parameter.

Ticket: #7227

11 months agooutput-flow: document the name field as for debugging only
Jason Ish [Fri, 15 Sep 2023 18:35:31 +0000 (12:35 -0600)] 
output-flow: document the name field as for debugging only

Ticket: #7227

11 months agooutput-flow: remove unused initdata argument
Jason Ish [Mon, 26 Aug 2024 21:37:42 +0000 (15:37 -0600)] 
output-flow: remove unused initdata argument

The initdata argument to OutputFlowThreadInit was always NULL, remove
it. Internally the ThreadInit functions still get initdata, but this
is the data provided when that logging instance was registered.

Ticket: #7227

11 months agogithub/pr-template: update contribution checks
Juliana Fajardini [Fri, 30 Aug 2024 16:26:31 +0000 (13:26 -0300)] 
github/pr-template: update contribution checks

We have different types of checks, all in a single list.
Adding a title of sorts to each group in the hopes of highlighting
their purposes.

When we add new items to the json schema, many times we don't add their
descriptions, while this would be the perfect time to also do that.

11 months agouserguide: update Security Onion docs reference
Juliana Fajardini [Fri, 23 Aug 2024 18:56:52 +0000 (15:56 -0300)] 
userguide: update Security Onion docs reference

They have updated their docs domain, leading to the link we had
returning a 404.

Also checked the other links. Although some seem to only contain old
traffic, they all still work.

11 months agouserguide: fix spelling of `security_result` EVE field
Sascha Steinbiss [Wed, 14 Aug 2024 08:11:48 +0000 (10:11 +0200)] 
userguide: fix spelling of `security_result` EVE field

This ensures that the correct spelling of the `security_result` EVE
field for RFB (as opposed to `security-result`) is also reflected in the
documentation.

Ticket: #7210

11 months agodoc/file-extraction: fix highlight syntax
Shivani Bhardwaj [Wed, 14 Aug 2024 06:33:28 +0000 (12:03 +0530)] 
doc/file-extraction: fix highlight syntax

11 months agouserguide: expand documentation for rule profiling
Juliana Fajardini [Sat, 6 Jul 2024 20:28:09 +0000 (17:28 -0300)] 
userguide: expand documentation for rule profiling

The page about performance and rule profiling showed the table generated
by rules profiling but didn't inform how to achieve nor find it.

Task #4359

11 months agosyslog: deprecate 11683/head
Jason Ish [Thu, 29 Aug 2024 14:51:49 +0000 (08:51 -0600)] 
syslog: deprecate

The standalone syslog output is now deprecated for Suricata 8. Display
a warning on use and add notes to the userguide.

Ticket: #6544

11 months agotls-log: deprecate
Jason Ish [Thu, 29 Aug 2024 14:51:24 +0000 (08:51 -0600)] 
tls-log: deprecate

tls-log is now deprecated and will be removed in Suricata 9.0. Display
a deprecation notice on use, and add notes to the user guide.

Ticket: #6542

11 months agohttp-log: deprecate
Jason Ish [Thu, 29 Aug 2024 14:31:05 +0000 (08:31 -0600)] 
http-log: deprecate

http-log is now deprecated and will be removed in Suricata
9.0. Display a deprecation notice on use, and add notes to the
userguide.

Issue: #6543

11 months agoarp: profiling logger id must come before LOGGER_SIZE
Jason Ish [Wed, 28 Aug 2024 02:58:09 +0000 (20:58 -0600)] 
arp: profiling logger id must come before LOGGER_SIZE

Also added comment to make this more clear.

11 months agodatasets: test unix socket ipv6 operations
Philippe Antoine [Tue, 27 Aug 2024 13:26:22 +0000 (15:26 +0200)] 
datasets: test unix socket ipv6 operations

Ticket: 6969

11 months agodatasets: fix parsing of ip4 in ip6
Eric Leblond [Fri, 19 Apr 2024 15:07:48 +0000 (17:07 +0200)] 
datasets: fix parsing of ip4 in ip6

The lookup function was not taking into account that we can have
an IPv4 or an IPv6 address as parameters and that this addresses
need to be converted to Suricata internal storage.
By using the already defined dedicated parsing function, we are
fixing the issue.

Issue: #6969

11 months agoprofiling: use correct conditional on packet profiling data dump
Lukas Sismis [Sun, 18 Aug 2024 11:21:19 +0000 (13:21 +0200)] 
profiling: use correct conditional on packet profiling data dump

Ticket: #7218

11 months agopcap-file: limit setvbuf to linux
Victor Julien [Fri, 12 Jul 2024 08:34:42 +0000 (10:34 +0200)] 
pcap-file: limit setvbuf to linux

As it fails to work correctly on FreeBSD and OpenBSD.

On FreeBSD, these are the errors:

Info: pcap: Pcap-file will use 4096 buffer size [PcapFileGlobalInit:source-pcap-file.c:159]
Error: pcap: failed to get first packet timestamp. pcap_next_ex(): -2 [PeekFirstPacketTimestamp:source-pcap-file-helper.c:186]
Warning: pcap: Failed to init pcap file input.pcap, skipping [ReceivePcapFileThreadInit:source-pcap-file.c:299]
Error: pcap: pcap file reader thread failed to initialize [ReceivePcapFileLoop:source-pcap-file.c:185]

11 months agopcap: implement pcap-file-buffer-size option
Victor Julien [Tue, 9 Jul 2024 07:19:58 +0000 (09:19 +0200)] 
pcap: implement pcap-file-buffer-size option

Allows easy specification of buffer size on the commandline.

Ticket: #7155.

11 months agopcap-file: improve setvbuf implementation
Victor Julien [Tue, 9 Jul 2024 07:12:46 +0000 (09:12 +0200)] 
pcap-file: improve setvbuf implementation

Make optional through `pcap-file.buffer-size` config option.

Make sure to check through configure.

Ticket: #7155.

11 months agopcap-file: use larger buffer for reading pcap files
Jason Ish [Wed, 13 Mar 2024 21:50:57 +0000 (15:50 -0600)] 
pcap-file: use larger buffer for reading pcap files

Inspired by a recent Zeek blog post, this could speed up PCAP
processing by a few percent.

Ticket: #7155.

11 months agopacketpool: allow larger max-pending-packets
Victor Julien [Sun, 7 Jul 2024 17:43:37 +0000 (19:43 +0200)] 
packetpool: allow larger max-pending-packets

Original limit was due to a specific data structure.

11 months agorust: compatibility with cbindgen 0.27 11622/head
Philippe Antoine [Mon, 12 Aug 2024 12:55:22 +0000 (14:55 +0200)] 
rust: compatibility with cbindgen 0.27

Ticket: 7206

Cbindgen 0.27 now handles extern blocks as extern "C" blocks.
The way to differentiate them is to use a special comment
before the block.

11 months agorust/ldap: handle GAPs 11616/head
Giuseppe Longo [Tue, 6 Aug 2024 18:39:46 +0000 (20:39 +0200)] 
rust/ldap: handle GAPs

Following the same logic as for PGSQL, if there is a gap in an LDAP request or
response, the parser tries to sync up again by checking if the message can be
parsed and effectively parses it on the next call.

Ticket #7176

11 months agorust/ldap: add pdu frames
Giuseppe Longo [Thu, 18 Jul 2024 14:53:13 +0000 (16:53 +0200)] 
rust/ldap: add pdu frames

This adds a pdu frame for both request and response, and removes invalid
returns in SCLdapParseRequest and SCLdapParseResponse.

Ticket #7202

11 months agorust/ldap: enable parser for udp
Giuseppe Longo [Thu, 18 Jul 2024 14:00:59 +0000 (16:00 +0200)] 
rust/ldap: enable parser for udp

This introduces a new parser registration function for LDAP/UDP, and update
ldap configuration in order to be able to enable/disable a single parser
independently (such as dns).
Also, GAPs are accepted only for TCP parser and not for UDP.

Ticket #7203

11 months agouserguide: clarify flow:stateless explanation
Juliana Fajardini [Mon, 29 Jul 2024 19:55:30 +0000 (16:55 -0300)] 
userguide: clarify flow:stateless explanation

While not incorrect, the previous wording made the sentence almost
paradoxical. While at it, also highlight a side effect that might not be
so clear to users.

Related to
Bug #6976

11 months agorfb: move app-layer registration code to rust
Philippe Antoine [Wed, 17 Jul 2024 12:50:51 +0000 (14:50 +0200)] 
rfb: move app-layer registration code to rust

Ticket: 7178

11 months agodetect/rfb: move keywords to rust
Philippe Antoine [Wed, 17 Jul 2024 12:31:53 +0000 (14:31 +0200)] 
detect/rfb: move keywords to rust

Ticket: 7178

On the way, convert rfb.secresult to a generic integer with enumeration
cf ticket 6723

11 months agossh/frames: avoid unsigned integer overflow 11608/head
Philippe Antoine [Fri, 2 Aug 2024 08:42:56 +0000 (10:42 +0200)] 
ssh/frames: avoid unsigned integer overflow

Fixes: 0b2ed97f3678 ("ssh: frames support")
11 months agogithub-actions: bump ossf/scorecard-action from 2.3.3 to 2.4.0
dependabot[bot] [Thu, 1 Aug 2024 19:10:21 +0000 (19:10 +0000)] 
github-actions: bump ossf/scorecard-action from 2.3.3 to 2.4.0

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/dc50aa9510b46c811795eb24b2f1ba02a914e534...62b2cac7ed8198b15735ed49ab1e5cf35480ba46)

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

Signed-off-by: dependabot[bot] <support@github.com>
11 months agogithub-actions: bump github/codeql-action from 3.25.11 to 3.25.15
dependabot[bot] [Thu, 1 Aug 2024 19:10:18 +0000 (19:10 +0000)] 
github-actions: bump github/codeql-action from 3.25.11 to 3.25.15

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

---
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>
12 months agodetect: make events prefilterable 11607/head
Philippe Antoine [Thu, 13 Jun 2024 19:52:09 +0000 (21:52 +0200)] 
detect: make events prefilterable

Ticket: 6728

12 months agodetect: minor optimization for tx
Philippe Antoine [Tue, 4 Jun 2024 06:56:53 +0000 (08:56 +0200)] 
detect: minor optimization for tx

do not bother to clean the buffers, if we did not run detection
for this transaction.

12 months agodetect/tx: avoid a call to memset
Philippe Antoine [Tue, 4 Jun 2024 06:55:54 +0000 (08:55 +0200)] 
detect/tx: avoid a call to memset

just initialize the small struct to zero

12 months agodoc/userguide: document logging changes from 6 to 7
Victor Julien [Fri, 26 Jul 2024 08:05:29 +0000 (10:05 +0200)] 
doc/userguide: document logging changes from 6 to 7

Minor other logging related improvements like clarifying language and
improving formatting for pdf output.

12 months agorust/ike: fix collapsible_match clippy warning 11595/head
Philippe Antoine [Wed, 31 Jul 2024 12:15:14 +0000 (14:15 +0200)] 
rust/ike: fix collapsible_match clippy warning

warning: this `match` can be collapsed into the outer `match`
help: the outer pattern can be modified to include the inner pattern

12 months agorust: fix byte_char_slices clippy warnings
Philippe Antoine [Wed, 31 Jul 2024 12:10:17 +0000 (14:10 +0200)] 
rust: fix byte_char_slices clippy warnings

warning: can be more succinctly written as a byte str
   --> src/mime/smtp.rs:762:37
    |
762 |     mime_smtp_find_url_strings(ctx, &[b'\n']);
    |                                     ^^^^^^^^ help: try: `b"\n"`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices
    = note: `#[warn(clippy::byte_char_slices)]` on by default

12 months agofuzz: make confyaml.c an explicit source
Philippe Antoine [Mon, 29 Jul 2024 14:10:11 +0000 (16:10 +0200)] 
fuzz: make confyaml.c an explicit source

Ticket: 7181

Allows confyaml.c to be in the release archive

12 months agosource: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Mon, 29 Jul 2024 19:57:01 +0000 (21:57 +0200)] 
source: fix -Wshorten-64-to-32 warnings

Ticket: #6186

12 months agolog: fix -Wshorten-64-to-32 warnings
Philippe Antoine [Mon, 29 Jul 2024 19:50:36 +0000 (21:50 +0200)] 
log: fix -Wshorten-64-to-32 warnings

Ticket: #6186

12 months agooutput/tx: use dynamic number of app-layer protos
Philippe Antoine [Thu, 4 Jul 2024 13:11:53 +0000 (15:11 +0200)] 
output/tx: use dynamic number of app-layer protos

Ticket: 5053

12 months agooutput: use dynamic number of app-layer protos
Philippe Antoine [Thu, 4 Jul 2024 13:31:18 +0000 (15:31 +0200)] 
output: use dynamic number of app-layer protos

Ticket: 5053

12 months agorunmodes: use dynamic number of app-layer protos
Philippe Antoine [Thu, 4 Jul 2024 13:07:01 +0000 (15:07 +0200)] 
runmodes: use dynamic number of app-layer protos

Ticket: 5053

12 months agoframes: remove unneeded comments
Philippe Antoine [Tue, 9 Jul 2024 08:28:24 +0000 (10:28 +0200)] 
frames: remove unneeded comments

Used by documentation with the SIP frames only

12 months agossh: avoid panic in packet path
Philippe Antoine [Thu, 4 Jul 2024 07:21:29 +0000 (09:21 +0200)] 
ssh: avoid panic in packet path

use debug_validate_bug_on instead

12 months agodetect: run frames on pseudo flush packets
Philippe Antoine [Thu, 20 Jun 2024 20:43:57 +0000 (22:43 +0200)] 
detect: run frames on pseudo flush packets

for SSH packets that mark the end of plaintext

12 months agossh: frames support
Philippe Antoine [Thu, 20 Jun 2024 15:10:24 +0000 (17:10 +0200)] 
ssh: frames support

Ticket: 5734

Adds frames for SSH records, that come after banner, and before
the data is encrypted.
These records may contain cipher lists for instance.

12 months agorust: bump time to most recent 11571/head
Victor Julien [Sat, 27 Jul 2024 19:17:11 +0000 (21:17 +0200)] 
rust: bump time to most recent

Fixes build on rustc 1.80.

Bumps the MSRV to 1.67.1.

Bug: #7130.

12 months agorust: set MSRV to 1.67.1
Victor Julien [Sat, 27 Jul 2024 20:33:12 +0000 (22:33 +0200)] 
rust: set MSRV to 1.67.1

This is needed for updating the ``time`` crate.

12 months agogithub-actions: switch dist builders to ubuntu 22.04
Victor Julien [Sun, 28 Jul 2024 05:26:36 +0000 (07:26 +0200)] 
github-actions: switch dist builders to ubuntu 22.04

Part of bumping MSRV.

22.04 is the first Ubuntu release to ship a new enough Sphinx.