Commit graph

18851 commits

Author SHA1 Message Date
Tim Wojtulewicz
c0e275604f Fix clang-tidy modernize-loop-convert warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
451b25cfad Fix clang-tidy modernize-macro-to-enum warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
6b34d4d094 Fix clang-tidy performance-unnecessary-copy-initialization warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
e7b89f81e9 Fix clang-tidy performance-noexcept-move-constructor warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
a136159ceb Fix clang-tidy performance-move-const-arg warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
baf00a54e8 Fix clang-tidy performance-inefficient-vector-operation warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
f386deba94 Fix clang-tidy performance-enum-size warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
89ac0cb418 Fix clang-tidy performance-avoid-endl warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
2abb7830a5 Fix clang-tidy bugprone-use-after-move warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
9c3dddfa12 Fix clang-tidy bugprone-suspicious-realloc-usage warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
a58110986d Fix clang-tidy bugprone-unhandled-self-assignment warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
9a3401deee Fix clang-tidy bugprone-suspicious-memory-comparison warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
bdd1909c61 Fix clang-tidy bugprone-sizeof-expression warnings in headers
This one is weird. This checker complains because we tend to use PList,
which sets the type of T to a pointer. The checker is making note that
we're doing sizeof() on a pointer, which always returns the same value
every time. It's asking whether we meant to do that, or if we meant to
pass the actual type to sizeof.
2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
3dae1fa46e Fix clang-tidy bugprone-parent-virtual-call warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
29ca66f494 Fix clang-tidy bugprone-multi-level-implicit-pointer-conversion warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
13b7713889 Fix clang-tidy bugprone-macro-parentheses warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
d327d6388c Fix clang-tidy bugprone-implicit-widening-of-multiplication-result warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
3b7122aadb Fix clang-tidy bugprone-forward-declaration-namespace warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
b27eba6533 Fix clang-tidy bugprone-branch-clone warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
694e53e47b Fix clang-tidy bugprone-bitwise-pointer-cast warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
e452c53ffb Change clang-tidy configuration to also scan headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
d12d0d7a29 Don't pass local source/binary directory to zeek_add_plugin for Redis backend 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
19f4ef03df Update bifcl/binpac/gen-zam submodules with clang-tidy fixes 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
c07519353f Avoid linting headers in external paths 2025-06-23 08:35:24 -07:00
Arne Welzel
b1157e4e03 Merge remote-tracking branch 'origin/topic/bbannier/issue-4594'
* origin/topic/bbannier/issue-4594:
  Align WebSocket error in cluster with one in Broker
2025-06-22 15:49:23 +02:00
Arne Welzel
b0a26eddaa Merge remote-tracking branch 'origin/topic/awelzel/4571-reject-cluster-event-broker-publish'
* origin/topic/awelzel/4571-reject-cluster-event-broker-publish:
  broker: Handle Broker::publish() with non Broker::Event
2025-06-22 15:48:36 +02:00
Arne Welzel
07e9870f34 broker: Handle Broker::publish() with non Broker::Event
Closes #4571
2025-06-22 15:45:31 +02:00
Benjamin Bannier
e1acb246a5 Align WebSocket error in cluster with one in Broker
The schema of cluster WebSocket error messages deviated from the
existing one in Broker which breaks seamless migration from the Broker
WebSocket bindings.

This patch aligns the serialization in cluster with the one in Broker.
This is technically a breaking change of the cluster schema, but since
it never worked like documented and is still experimental this is
probably fine.

Closes #4594.
2025-06-21 18:13:09 +02:00
Arne Welzel
25b5cabab7 DNS: Move extract_char_string() helper around 2025-06-21 13:50:29 +02:00
Evan Typanski
826ed4cef5 Remove list from Zeek grammar
Using it would make Zeek segfault (at least in locals). It has been an
error for 15 years.
2025-06-20 15:53:15 -04:00
Arne Welzel
cf43cf1809 cluster/zeromq/connect: Make failures fatal
The cluster is borked if the initialization fails, so may as well just
completely abort Zeek at that point with a fatal error. There's no real
point in continuing to run.
2025-06-20 13:03:47 +02:00
Arne Welzel
a20a2fe6e0 cluster/zeromq: Move log_push creation to DoInit()
The log_push socket should be affected by the IPV6 option, so need to
delay its creation a bit.
2025-06-20 11:17:49 +02:00
Johanna Amann
0c875220e9 Default canonifier change to only remove first timestamp in line
In the past, we used a default canonifier, which removes everything that
looks like a timestamp from log files. The goal of this is to prevent
logs from changing, e.g., due to local system times ending up in log
files.

This, however, also has the side-effect of removing information that is
parsed from protocols which probably should be part of our tests.
There is at least one test (1999 certificates) where the entire test
output was essentially removed by the canonifier.

GH-4521 was similarly masked by this.

This commit changes the default canonifier, so that only the first
timestamp in a line is removed. This should skip timestamps that are
likely to change while keeping timestamps that are parsed
from protocol information.

A pass has been made over the tests, with some additional adjustments
for cases which require the old canonifier.

There are some cases in which we probably could go further and not
remove timestamps at all - that, however, seems like a follow-up
project.
2025-06-18 15:41:48 +01:00
Johanna Amann
6e1097a423 Align SMB timestamp calculation between operating systems
The way that SMB timestamps were calculated used a "long double" for
the conversion calculation.

OS-X and Linux seem to have different sizes for long doubles. On the
Linux distributions that I have available, a long double is 128bits, vs
64 bits in OS-X.

This leads to slight discrepancies in the timestamps. This commit
changes this calculation to use a double on both systems, which is 64
bits and eliminates this difference.
2025-06-18 15:41:40 +01:00
Johanna Amann
a22837536d Merge remote-tracking branch 'origin/topic/johanna/gh-4521'
* origin/topic/johanna/gh-4521:
  Change x509 not_before/not_after to not be based on local timezone
2025-06-18 13:27:57 +01:00
Johanna Amann
e797e15d38 Change x509 not_before/not_after to not be based on local timezone
Not the not_before/not_after fields output GMT based times.

Also adds a new btest diff canonifier which only removes the first
timestamp in a line.

Fixes GH-4521
2025-06-18 13:21:35 +01:00
Johanna Amann
ea23581ef7 Merge remote-tracking branch 'origin/topic/timw/deprecate-zeekstring-vector-methods'
* origin/topic/timw/deprecate-zeekstring-vector-methods:
  Mark ZeekString vector helper methods deprecated
2025-06-18 12:29:47 +01:00
Benjamin Bannier
2866934792 Merge branch 'topic/bbannier/spicy-ssl-refs' 2025-06-18 13:14:13 +02:00
Benjamin Bannier
bf4dce5e5f Enable Spicy SSL analyzer in nightly CI job against Spicy HEAD 2025-06-18 11:00:18 +02:00
Benjamin Bannier
ea4d30eb6a Clean up use of references in Spicy SSL analyzer
The Spicy SSL analyzer was using references pretty heavily, probably to
work around now fixed issues with `inout` parameters in older Spicy
versions. At least for units this seems not needed anymore, and was also
partially incorrect, e.g., the Spicy docs call out that when using
`inout` parameters, passed and expected types should match exactly so
passing a reference as an `inout` value seems incorrect. Additionally,
one use case for references in Spicy is to use their interior
mutability, i.e., a reference never needs to be passed `inout` since
their can always be mutated.

Internally units are stored as reference-counted values, and references
to units are not much cheaper since they also need to be refcounted.
With that there seems litle reason to use references in this analyzer at
all, and this patch drops their use completely; instead we either pass
values, or values declared `inout`.

We leave the use of references for sharing sinks in place.
2025-06-18 10:49:38 +02:00
Benjamin Bannier
1c3b7273d6 Add workaround for zeek/spicy#2091 2025-06-18 10:49:38 +02:00
Arne Welzel
19f2621f7b Merge remote-tracking branch 'origin/topic/awelzel/4573-remove-is-packet-source'
* origin/topic/awelzel/4573-remove-is-packet-source:
  IOSource: Remove IsPacketSource
2025-06-17 09:25:39 +02:00
Arne Welzel
2bc320cf11 IOSource: Remove IsPacketSource
This wasn't used in tree and even the PktSrc class doesn't override this
to return true, so just remove it outright without deprecation.

Closes #4573
2025-06-17 09:25:03 +02:00
Arne Welzel
f4357485d2 Merge remote-tracking branch 'origin/topic/awelzel/4562-post-proc-lookup-failure'
* origin/topic/awelzel/4562-post-proc-lookup-failure:
  btest/logging: Fly-by cleanup
  logging/Ascii: Fix abort() for non-existing postrotation functions
2025-06-16 14:58:49 +02:00
Arne Welzel
bcca7702cd btest/logging: Fly-by cleanup 2025-06-16 14:56:30 +02:00
Arne Welzel
45f5a4c1b8 logging/Ascii: Fix abort() for non-existing postrotation functions
When looking up the postprocessor function from shadow files, id::find_func()
would abort() if the function wasn't available instead of falling back
to the default postprocessor.

Fix by using id::find() and checking the type explicitly and also adding a
strict type check while at it.

This issue was tickled by loading the json-streaming-logs package,
Zeek creating shadow files containing its custom postprocessor function,
then restarting Zeek without the package loaded.

Closes #4562
2025-06-16 14:55:49 +02:00
Benjamin Bannier
e35fc1b7b1 Merge branch 'topic/bbannier/bump-spicy' 2025-06-16 14:39:52 +02:00
Arne Welzel
99155f6ec6 Merge remote-tracking branch 'origin/topic/awelzel/add-ws-tls-nocert-btest'
* origin/topic/awelzel/add-ws-tls-nocert-btest:
  btest/cluster/websocket: Add cert-less test
2025-06-16 13:48:08 +02:00
Arne Welzel
77f1337b4c btest/cluster/websocket: Add cert-less test 2025-06-16 13:47:33 +02:00
Benjamin Bannier
fe27962836 Bump auxil/spicy to latest development snapshot 2025-06-16 10:39:21 +02:00