Compare commits

..

1455 commits

Author SHA1 Message Date
Arne Welzel
4de7a2b947 Merge remote-tracking branch 'origin/topic/awelzel/4845-get-current-packet-header-fragmented-syn'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/4845-get-current-packet-header-fragmented-syn:
  iosource/Packet: Allow ToRawPktHdrVal() for reassembled packets
2025-10-02 14:12:22 +02:00
Arne Welzel
ca58c5e6b4 iosource/Packet: Allow ToRawPktHdrVal() for reassembled packets
Closes #4845
2025-10-02 14:10:09 +02:00
Arne Welzel
4e9b40f290 Merge remote-tracking branch 'origin/topic/awelzel/conn-class-layout-packing'
* origin/topic/awelzel/conn-class-layout-packing:
  Conn: Improve packing, drop bitfields and boolenize
  Conn: Lazily initialize weird_state when needed
2025-10-02 09:15:33 +02:00
Arne Welzel
d1051df887 Conn: Improve packing, drop bitfields and boolenize
There's a few holes in Conn, particularly now that TransportProto has
become a uint8_t. Pack things a bit more neatly.
2025-10-02 09:13:03 +02:00
Arne Welzel
d5045e08e3 Conn: Lazily initialize weird_state when needed
A std::unordered_map takes 56 bytes on my system. Switch to a unique_ptr
an initialize weird_state lazily. That saves ~48 bytes per connection.
Particularly for scan or non-weird traffic, this should allow some
memory savings.
2025-10-02 09:13:03 +02:00
Tim Wojtulewicz
8b4707a284 Merge remote-tracking branch 'origin/topic/vern/id-redecl'
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
* origin/topic/vern/id-redecl:
  fixes for re-declaring type identifiers in inconsistent ways - addresses GH-2686
2025-09-30 20:46:38 +00:00
Tim Wojtulewicz
99fa163db2 Merge remote-tracking branch 'origin/topic/vern/standalone-BiF-access'
* origin/topic/vern/standalone-BiF-access:
  Fix for standalone initializations that require BiFs, and streamlining of standalone BiF-tracking
2025-09-30 20:45:28 +00:00
Tim Wojtulewicz
63291eca75 Merge remote-tracking branch 'origin/topic/vern/opt-skip-file-fix'
* origin/topic/vern/opt-skip-file-fix:
  fixed bug in logic for including/excluding files for script optimization
2025-09-30 20:12:24 +00:00
Tim Wojtulewicz
85b4cec76e Merge remote-tracking branch 'origin/topic/timw/remove-checks-for-very-old-openssl-versions'
* origin/topic/timw/remove-checks-for-very-old-openssl-versions:
  Remove checks for OpenSSL 1.x versions
  Remove some additional LibreSSL checks
2025-09-30 19:12:16 +00:00
Vern Paxson
6471a7bf7b Fix for standalone initializations that require BiFs, and streamlining of standalone BiF-tracking 2025-09-30 11:11:50 -07:00
Vern Paxson
fada719620 fixed bug in logic for including/excluding files for script optimization 2025-09-30 10:40:01 -07:00
Tim Wojtulewicz
a27cc89335 Remove checks for OpenSSL 1.x versions 2025-09-29 10:23:28 -07:00
Tim Wojtulewicz
686f100f0d Remove some additional LibreSSL checks 2025-09-29 10:23:28 -07:00
Arne Welzel
6af1459f5e Merge remote-tracking branch 'origin/topic/awelzel/4849-supervisor-signal-handle-tsan'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/4849-supervisor-signal-handle-tsan:
  Supervisor: Make last_signal atomic to squelch data race
2025-09-29 18:04:49 +02:00
Tim Wojtulewicz
3c16ee9667 Update docs submodule [nomail] 2025-09-29 08:21:10 -07:00
Arne Welzel
31d7df915e Supervisor: Make last_signal atomic to squelch data race
When the stem process terminates and SIGCHLD is sent to the supervisor,
the signal might be handled by the main thread or any other threads that
aren't blocking SIGCHLD explicitly. Convert last_signal to a std::atomic<int>
such that non-main threads can safely set last_signal without triggering
data race as reported by TSAN. This doesn't make it less racy to work
last_signal, but it appears we only use it for debug printing anyhow and
another option might have been to just remove last_signal altogether.

Follow-up for #4849
2025-09-29 14:50:20 +02:00
Arne Welzel
3abc1116a1 Merge remote-tracking branch 'origin/topic/awelzel/zeromq-fix-block-subscribe-before-init'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/zeromq-fix-block-subscribe-before-init:
  cluster/zeromq: Fix Cluster::subscribe() block if not initialized
2025-09-29 13:08:32 +02:00
Vern Paxson
941ecee692 fixes for re-declaring type identifiers in inconsistent ways - addresses GH-2686 2025-09-27 22:23:57 -07:00
Tim Wojtulewicz
0700427bac Merge remote-tracking branch 'origin/topic/vern/standalone-fixes2'
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
* origin/topic/vern/standalone-fixes2:
  Fixes for -O gen-standalone-C++ for tracking BiFs, lambdas, attribute types, and independent globals
2025-09-26 14:19:49 -07:00
Tim Wojtulewicz
483d9a3a93 Merge remote-tracking branch 'klemensn/openbsd-libressl'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* klemensn/openbsd-libressl:
  OpaqueVal, OCSP, X509: drop outdated LibreSSL guards to fix OpenBSD build
2025-09-26 11:21:17 -07:00
Tim Wojtulewicz
83f05dde34 Merge remote-tracking branch 'origin/topic/timw/merge-3rdparty-repo-into-main'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/timw/merge-3rdparty-repo-into-main: (30 commits)
  Ignore src/3rdparty for pre-commit
  src/3rdparty: Port doctest fix for including <ciso646> from upstream
  src/3rdparty: Update doctest to v2.4.12
  src/3rdparty: Move jthread/stop_token out of std namespace to prevent collisions
  src/3rdparty: Fix clang-tidy bugprone-casting-through-void warning
  src/3rdparty: Add jthread and stop_token headers
  src/3rdparty: Update SQLite to 3.47.1
  src/3rdparty: Upgrade sqlite3 to 3.45.0
  src/3rdparty: modp: Disable deprecation warning for sprintf
  src/3rdparty: Update SQLite to 3.41.2
  src/3rdparty: Handle zeek-inet-ntop snprintf() return value correctly
  src/3rdparty: Rework inet-ntop change to build on Windows
  src/3rdparty: Use snprintf in zeek_inet_ntop.c to silence macOS compiler warnings
  src/3rdparty: Use snprintf in patricia.cc to silence macOS compiler warnings
  src/3rdparty: Update ConvertUTF Unicode license as per request from LLVM upstream
  src/3rdparty: Update doctest to 2.4.9 and sqlite to 3.39.4
  src/3rdparty: Fix rampant off-by-one error in last change
  src/3rdparty: numeric conversion functions now return the number of characters added
  src/3rdparty: Fix GCC 12.2 warning in access to patricia_t members
  src/3rdparty: Rebase patricia.{h,c} on upstream version
  ...
2025-09-26 02:57:42 +00:00
Tim Wojtulewicz
7627022f92 Ignore src/3rdparty for pre-commit 2025-09-25 18:39:07 -07:00
Tim Wojtulewicz
663fc2931c src/3rdparty: Port doctest fix for including <ciso646> from upstream
This has been failing on our weekly builds for a bit. It's fixed upstream
but there's no idea when they'll release a new version that includes it.

This cherry-picks 5eb20178ba
2025-09-25 18:39:07 -07:00
Tim Wojtulewicz
08b018cc61 src/3rdparty: Update doctest to v2.4.12 2025-09-25 18:39:07 -07:00
Tim Wojtulewicz
21fc299131 src/3rdparty: Move jthread/stop_token out of std namespace to prevent collisions 2025-09-25 18:39:07 -07:00
Tim Wojtulewicz
3046be57da src/3rdparty: Fix clang-tidy bugprone-casting-through-void warning 2025-09-25 18:39:07 -07:00
Tim Wojtulewicz
b2746226d5 src/3rdparty: Add jthread and stop_token headers 2025-09-25 18:39:07 -07:00
Christian Kreibich
d6d0fe0ff0 src/3rdparty: Update SQLite to 3.47.1 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
1cb75ffff3 src/3rdparty: Upgrade sqlite3 to 3.45.0 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
6a060588c2 src/3rdparty: modp: Disable deprecation warning for sprintf 2025-09-25 18:39:03 -07:00
Johanna Amann
dfd32b3b37 src/3rdparty: Update SQLite to 3.41.2 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
ee0c73f8f6 src/3rdparty: Handle zeek-inet-ntop snprintf() return value correctly 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
6936364b3c src/3rdparty: Rework inet-ntop change to build on Windows 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
b8248d07e9 src/3rdparty: Use snprintf in zeek_inet_ntop.c to silence macOS compiler warnings 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
a2abb40af6 src/3rdparty: Use snprintf in patricia.cc to silence macOS compiler warnings 2025-09-25 18:39:03 -07:00
Christian Kreibich
2d9eb155d5 src/3rdparty: Update ConvertUTF Unicode license as per request from LLVM upstream
This replicates the following commit in our copy of ConvertUTF:
20451cb06b
2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
942450c293 src/3rdparty: Update doctest to 2.4.9 and sqlite to 3.39.4 2025-09-25 18:39:03 -07:00
Vern Paxson
ce75863344 src/3rdparty: Fix rampant off-by-one error in last change 2025-09-25 18:39:03 -07:00
Vern Paxson
790e920d66 src/3rdparty: numeric conversion functions now return the number of characters added 2025-09-25 18:39:03 -07:00
Christian Kreibich
3e4512bc80 src/3rdparty: Fix GCC 12.2 warning in access to patricia_t members
Access to members of the larger prefix_t, while safe, throws warnings
when the compiler knows it previously allocated the smaller prefix4_t.

Adapted from 11ae12079ca716f8cfac42cccfd905dad45da18f in the upstream repo.
2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
01c31e9917 src/3rdparty: Rebase patricia.{h,c} on upstream version
This updates to a clang-formatted version that was merged recently.
2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
c4d015369b src/3rdparty: Deprecate bro_inet_ntop.{c,h} 2025-09-25 18:39:03 -07:00
Johanna Amann
fa88e30796 src/3rdparty: Update SQLite to 3.38.4 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
ea7e91857a src/3rdparty: Update doctest to v2.4.8 2025-09-25 18:39:03 -07:00
Tim Wojtulewicz
c1598a33c4 src/3rdparty: Add missing externs in bsd-getopt-long.h 2025-09-25 18:39:03 -07:00
Benjamin Bannier
982d3b56a1 src/3rdparty: Add 3rdparty files from Zeek's src/ 2025-09-25 18:39:03 -07:00
Robin Sommer
f0cfaaaa78 src/3rdparty: Update doctest to 2.4.6.
Our old version didn't support compilation on Apple's M1 yet.
2025-09-25 18:39:03 -07:00
Johanna Amann
2dbd912088 src/3rdparty: Update SQLite to 3.36.0 2025-09-25 18:38:55 -07:00
Dominik Charousset
eb3aeb75ab src/3rdparty: Add doctest header 2025-09-25 18:38:24 -07:00
Bernhard Amann
3c65c3ecb0 src/3rdparty: Update sqlite to 3.28.0 2025-09-25 18:38:24 -07:00
Tim Wojtulewicz
086416706d Remove zeek-3rdparty submodule 2025-09-25 18:37:24 -07:00
Arne Welzel
01666df3d7 cluster/zeromq: Fix Cluster::subscribe() block if not initialized
If Cluster::init() hasn't been invoked yet, Cluster::subscribe() with the
ZeroMQ backend would block because the main_inproc socket didn't
yet have a connection from the child thread. Prevent this by connecting
the main and child socket pair at construction time.

This will queue the subscriptions and start processing them once the
child thread has started.
2025-09-25 18:58:35 +02:00
Arne Welzel
d2cda5a68c Merge remote-tracking branch 'origin/topic/awelzel/zeromq-handle-eintr'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/awelzel/zeromq-handle-eintr:
  cluster/zeromq: Improve EINTR handling
2025-09-25 13:53:04 +02:00
Arne Welzel
a318463c1c cluster/zeromq: Improve EINTR handling
When using ZeroMQ also within the Supervisor process, zmq::poll() and
recv() were observed to return EINTR, handle these.
2025-09-25 13:52:12 +02:00
Vern Paxson
550c7eb0a7 Fixes for -O gen-standalone-C++ for tracking BiFs, lambdas, attribute types, and independent globals 2025-09-24 17:34:35 -07:00
Tim Wojtulewicz
69b7bcc323 Merge remote-tracking branch 'origin/topic/vern/no-opt'
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
* origin/topic/vern/no-opt:
  BTests & baselines for testing selective skipping of script optimization
  added &no_ZAM_opt/&no_CPP_opt attributes and --no-opt-files/--no-opt-funcs for controlling skipping script optimization
2025-09-23 09:06:02 -07:00
Vern Paxson
dc7f4dca1c BTests & baselines for testing selective skipping of script optimization 2025-09-23 09:05:40 -07:00
Vern Paxson
441baaf2c1 added &no_ZAM_opt/&no_CPP_opt attributes and --no-opt-files/--no-opt-funcs for controlling skipping script optimization 2025-09-23 09:05:40 -07:00
Arne Welzel
2bde66c9d6 Merge remote-tracking branch 'origin/topic/awelzel/4842-decompose-uri-ipv6'
* origin/topic/awelzel/4842-decompose-uri-ipv6:
  utils/decompose_uri: Support URIs containing IPv6 addresses
2025-09-23 13:08:14 +02:00
Arne Welzel
b3b0c3db7d utils/decompose_uri: Support URIs containing IPv6 addresses
An URI containing a bracketed or non-bracketed IPv6 address of the form
http://[::1]:42 was previously split on the first colon for port extraction,
causing a subsequent to_count() call to fail. Harden this to check for a
digits in the last :[0-9]+ component.

Fixes #4842
2025-09-23 13:04:29 +02:00
Klemens Nanni
54634ae241
OpaqueVal, OCSP, X509: drop outdated LibreSSL guards to fix OpenBSD
build

Whatever is used with recent OpenSSL is also available with latest LibreSSL
on OpenBSD 7.8-beta as of today.

Some of these hunks have been in the net/bro port for years, others I
recently added whilst gradually updating from 6.0.5 to 8.0.1.
2025-09-23 01:51:49 +03:00
Tim Wojtulewicz
416d997263 Merge remote-tracking branch 'origin/topic/timw/restore-settype-methods'
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
* origin/topic/timw/restore-settype-methods:
  Restore the SetType constructor and destructor
2025-09-22 07:46:06 -07:00
Tim Wojtulewicz
c741e8f489 Merge remote-tracking branch 'origin/topic/timw/update-libkqueue'
* origin/topic/timw/update-libkqueue:
  Bump libkqueue to latest upstream master
2025-09-22 07:34:03 -07:00
Tim Wojtulewicz
5f8a89ea40 Bump libkqueue to latest upstream master 2025-09-22 07:33:13 -07:00
Tim Wojtulewicz
210737f36e Restore the SetType constructor and destructor 2025-09-21 17:13:14 +00:00
zeek-bot
d6c7a479e2 Update doc submodule [nomail] [skip ci] 2025-09-20 00:13:40 +00:00
Tim Wojtulewicz
9fb0f5e76d Fix clang-tidy finding in recent script_opt changes 2025-09-17 16:34:26 -07:00
Tim Wojtulewicz
ef9ffda2ef Merge remote-tracking branch 'origin/topic/vern/standalone-event-groups'
* origin/topic/vern/standalone-event-groups:
  tracking of event groups for compilation to standalone-C++
2025-09-17 14:28:44 -07:00
Vern Paxson
973cc00c42 tracking of event groups for compilation to standalone-C++ 2025-09-17 14:28:13 -07:00
Tim Wojtulewicz
1567fe8c09 Merge remote-tracking branch 'origin/topic/vern/remove-SetType'
* origin/topic/vern/remove-SetType:
  Deprecate SetType, as it can be replaced by TableType
2025-09-17 14:26:42 -07:00
Vern Paxson
b442c25389 Deprecate SetType, as it can be replaced by TableType 2025-09-17 14:09:58 -07:00
Tim Wojtulewicz
938073dfed Merge remote-tracking branch 'origin/topic/timw/4742-skip-storage-thread'
* origin/topic/timw/4742-skip-storage-thread:
  Avoid starting up storage expiration thread with zero backends
  Remove a couple of obsolete TODOs in storage manager
2025-09-17 08:44:55 -07:00
Tim Wojtulewicz
067c257480 Merge remote-tracking branch 'origin/topic/timw/windows-zeromq-support'
* origin/topic/timw/windows-zeromq-support:
  Reword comment about when ZeroMQ is required for the build
  CI: Add label for enabling the Windows build in PRs
  Enable building ZeroMQ support on Windows
2025-09-16 13:31:48 -07:00
Tim Wojtulewicz
723b64d81f Reword comment about when ZeroMQ is required for the build 2025-09-16 13:30:14 -07:00
Tim Wojtulewicz
37cc4999b3 CI: Add label for enabling the Windows build in PRs 2025-09-16 13:30:14 -07:00
Tim Wojtulewicz
4705537002 Enable building ZeroMQ support on Windows 2025-09-16 13:30:14 -07:00
Tim Wojtulewicz
5cc5f2a275 Merge remote-tracking branch 'origin/topic/timw/4285-sqlite-threadsafe-check'
* origin/topic/timw/4285-sqlite-threadsafe-check:
  Force SQLite to be in thread-safe mode during CMake
2025-09-16 12:42:04 -07:00
Tim Wojtulewicz
dd14e380a1 Force SQLite to be in thread-safe mode during CMake
This allows us to remove the need to check for thread-safe mode in the
various SQLite plugins. See https://www.sqlite.org/compile.html#threadsafe
for why `1` is a good choice here.
2025-09-16 12:19:09 -07:00
Tim Wojtulewicz
bd60c6fc15 Merge remote-tracking branch 'origin/topic/vern/gen-C++-global-characteristics'
* origin/topic/vern/gen-C++-global-characteristics:
  full tracking of the characteristics of globals when compiling scripts to C++
2025-09-16 11:31:13 -07:00
Tim Wojtulewicz
71eca7c9e6 Merge remote-tracking branch 'origin/topic/vern/standalone-CPP-global-attrs'
* origin/topic/vern/standalone-CPP-global-attrs:
  fix for associating attributes with globals for -O gen-standalone-C++
2025-09-16 11:02:44 -07:00
Tim Wojtulewicz
aebeae8f8a Merge remote-tracking branch 'origin/topic/vern/standalone-id-tracking-fix'
* origin/topic/vern/standalone-id-tracking-fix:
  fix for tracking identifiers and aggregates when compiling to standalone-C++
2025-09-16 10:53:11 -07:00
Tim Wojtulewicz
00ba3483bb Merge remote-tracking branch 'origin/topic/vern/gen-CPP-precedence-fix'
* origin/topic/vern/gen-CPP-precedence-fix:
  fix for '?' operator precedence when compiling scripts to C++
2025-09-16 10:52:53 -07:00
Vern Paxson
0e5042e451 fix for associating attributes with globals for -O gen-standalone-C++ 2025-09-15 14:28:07 -07:00
Vern Paxson
bfc6508dff full tracking of the characteristics of globals when compiling scripts to C++ 2025-09-15 14:21:32 -07:00
Vern Paxson
6a9175da7d fix for '?' operator precedence when compiling scripts to C++ 2025-09-15 14:18:16 -07:00
Tim Wojtulewicz
50581bfd3c Avoid starting up storage expiration thread with zero backends 2025-09-15 14:18:03 -07:00
Tim Wojtulewicz
8bc849d425 Remove a couple of obsolete TODOs in storage manager 2025-09-15 14:17:41 -07:00
Vern Paxson
18d435ac12 fix for tracking identifiers and aggregates when compiling to standalone-C++ 2025-09-15 13:57:35 -07:00
Tim Wojtulewicz
b25a844210 Merge remote-tracking branch 'origin/topic/vern/standalone-skip-fatal'
* origin/topic/vern/standalone-skip-fatal:
  for -O gen-standalone-C++, make the presence of uncompilable functions fatal unless -O allow-cond is used
2025-09-12 09:24:58 -07:00
Tim Wojtulewicz
489681e0c3 Merge remote-tracking branch 'origin/topic/timw/bump-zeekctl'
* origin/topic/timw/bump-zeekctl:
  Bump zeekctl for new trace-summary/pysubnettree versions
2025-09-12 09:24:26 -07:00
Tim Wojtulewicz
3750fb11f4 Bump zeekctl for new trace-summary/pysubnettree versions 2025-09-12 09:23:55 -07:00
Vern Paxson
e5210160ea for -O gen-standalone-C++, make the presence of uncompilable functions fatal unless -O allow-cond is used 2025-09-11 13:30:40 -06:00
Tim Wojtulewicz
e1c8cbe25a Merge remote-tracking branch 'origin/topic/timw/dns-analyzer-type-consistency'
* origin/topic/timw/dns-analyzer-type-consistency:
  Clean up initialization of DNS_Interpreter
  Switch types used in DNS analyzer to be more consistent
2025-09-11 10:57:29 -07:00
Tim Wojtulewicz
f056df1301 Clean up initialization of DNS_Interpreter 2025-09-11 10:56:57 -07:00
Tim Wojtulewicz
501160c976 Switch types used in DNS analyzer to be more consistent 2025-09-11 10:56:57 -07:00
Tim Wojtulewicz
c6cf1ee3ae Merge remote-tracking branch 'origin/topic/awelzel/btest-suspend-processing-websocket'
* origin/topic/awelzel/btest-suspend-processing-websocket:
  btest/core/suspend_processing: Add WebSocket example
2025-09-08 11:19:45 -07:00
Arne Welzel
9e7537044f btest/core/suspend_processing: Add WebSocket example
Add a test/example forwarding all new_connection() events produced during
`zeek -r wikipedia.trace` as my_new_connection() to a WebSocket client.

This is mostly to demonstrate and verify usage of suspend_processing(),
websocket_client_added(), resume_processing(), Pcap::file_done(),
websocket_client_lost() and terminate() together.
2025-09-08 11:11:13 -07:00
Tim Wojtulewicz
dd881d9cde Merge remote-tracking branch 'origin/topic/etyp/bump-spicy-coverity'
* origin/topic/etyp/bump-spicy-coverity:
  Bump Spicy for Coverity fixes
2025-09-08 11:02:47 -07:00
Tim Wojtulewicz
76492302ad Merge remote-tracking branch 'origin/topic/timw/port-doctest-version-include-change-from-upstream'
* origin/topic/timw/port-doctest-version-include-change-from-upstream:
  Update src/3rdparty submodule for doctest v2.4.12 and include fix
2025-09-08 11:02:16 -07:00
Tim Wojtulewicz
168ff0b8a2 Update src/3rdparty submodule for doctest v2.4.12 and include fix 2025-09-08 10:52:06 -07:00
Evan Typanski
16a43f04bd Bump Spicy for Coverity fixes 2025-09-08 11:35:58 -04:00
Tim Wojtulewicz
37836d1bb4 Merge remote-tracking branch 'origin/topic/timw/ci-centos-stream-10'
* origin/topic/timw/ci-centos-stream-10:
  CI: Fix warning about ENV usage in CI dockerfiles
  CI: Add centos stream 10 build
2025-09-06 04:26:51 +00:00
Tim Wojtulewicz
7305a79440 CI: Fix warning about ENV usage in CI dockerfiles
This also bumps the dates on the DOCKERFILE_VERSION values
2025-09-06 04:26:03 +00:00
Tim Wojtulewicz
9bee00de9c CI: Add centos stream 10 build 2025-09-06 04:26:03 +00:00
Christian Kreibich
a58323c367 Merge branch 'topic/christian/fix-cluster-testing-get-instances-c2a'
* topic/christian/fix-cluster-testing-get-instances-c2a:
  Bump zeek-client to pull in more resilient controller I/O
2025-09-05 19:52:57 -07:00
Christian Kreibich
49ef0abd3b Bump zeek-client to pull in more resilient controller I/O 2025-09-05 16:26:57 -07:00
Tim Wojtulewicz
b7790641ba Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump auxil/spicy to latest development snapshot
2025-09-05 12:56:33 -07:00
Benjamin Bannier
8fd8309b28 Bump auxil/spicy to latest development snapshot 2025-09-05 17:48:42 +02:00
Tim Wojtulewicz
35ad76c96b Merge remote-tracking branch 'origin/topic/timw/testing-upstream-libkqueue'
* origin/topic/timw/testing-upstream-libkqueue:
  libkqueue: Switch to using HEAD from upstream master
2025-09-04 16:22:04 -07:00
Tim Wojtulewicz
d1f34ae546 libkqueue: Switch to using HEAD from upstream master
The upstream recently merge Christian's fixes for the fd_map allocations
so that patch doesn't need to be in our fork anymore. I also tested removing
the patch about timers from our fork, and it seems to only matter for Linux
kernels earlier than 5.3. All of our supported platforms are newer than
that.
2025-09-04 16:20:18 -07:00
Tim Wojtulewicz
0dadf2af04 Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump auxil/spicy to latest development snapshot
2025-09-04 09:04:39 -07:00
Benjamin Bannier
a48b4caabc Bump auxil/spicy to latest development snapshot 2025-09-04 17:01:46 +02:00
zeek-bot
dc7b331450 Update doc submodule [nomail] [skip ci] 2025-09-04 00:28:10 +00:00
Tim Wojtulewicz
4d338ccd7d Fix clang-tidy warning from recent SVCB merge 2025-09-03 16:50:07 -07:00
Tim Wojtulewicz
cff4edd732 NEWS: Add note about DNS SVCB changes 2025-09-03 15:38:47 -07:00
Tim Wojtulewicz
7142b9efde Merge remote-tracking branch 'klemensya/svcparams'
* klemensya/svcparams:
  Parse SVCB/HTTPS SvcParams list
2025-09-03 15:36:03 -07:00
Tim Wojtulewicz
26ea7cc655 Clang-tidy fixes for recent IDPtr changes 2025-09-03 15:34:29 -07:00
Tim Wojtulewicz
e3b22cd21f Merge remote-tracking branch 'origin/topic/vern/emphasize-IDPtrs'
* origin/topic/vern/emphasize-IDPtrs:
  fixup! fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects
  fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects
  fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects
  fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects
  annotate a number of BTests as unsuited for -O gen-C++ testing due to multiple Zeek runs
  BTest baseline updates for -O gen-C++ - all minor tweaks
  BTest updates for script optimization tracking of BiFs
  regression test for former ASAN issue with script optimization of lambdas
  shift much of the internal use of ID* identifier pointers over to IDPtr objects
  maintenance update for script optimization's knowledge of BiFs
  logger fix for interoperability with -O gen-C++ code
2025-09-03 15:33:43 -07:00
Evan Typanski
42f7a2d88c Merge remote-tracking branch 'origin/topic/vern/field-assign-parsing'
* origin/topic/vern/field-assign-parsing:
  tightened up parsing of $field=X record constructor expressions
2025-09-03 16:21:24 -04:00
Vern Paxson
3ff3eee398 fixup! fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects 2025-09-03 12:42:58 -07:00
Vern Paxson
a6f9d69c91 fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects 2025-09-03 11:20:29 -07:00
Vern Paxson
7397dc6568 fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects 2025-09-03 11:19:38 -07:00
Vern Paxson
34831aa7d3 fixup! shift much of the internal use of ID* identifier pointers over to IDPtr objects 2025-09-03 11:19:38 -07:00
Vern Paxson
b6b8484819 annotate a number of BTests as unsuited for -O gen-C++ testing due to multiple Zeek runs 2025-09-03 11:19:38 -07:00
Vern Paxson
77bb32ff78 BTest baseline updates for -O gen-C++ - all minor tweaks 2025-09-03 11:19:38 -07:00
Vern Paxson
1b4bc72802 BTest updates for script optimization tracking of BiFs 2025-09-03 11:19:38 -07:00
Vern Paxson
e9971e31d5 regression test for former ASAN issue with script optimization of lambdas 2025-09-03 11:19:38 -07:00
Vern Paxson
693aa244f9 shift much of the internal use of ID* identifier pointers over to IDPtr objects 2025-09-03 11:19:31 -07:00
Vern Paxson
1c7c1b62f6 maintenance update for script optimization's knowledge of BiFs 2025-09-03 11:14:22 -07:00
Vern Paxson
fb344a20ea logger fix for interoperability with -O gen-C++ code 2025-09-03 11:14:22 -07:00
Benjamin Bannier
07dd2a1c6f Merge branch 'topic/bbannier/test-bittorrent-unnessary-sigs' 2025-09-03 14:51:16 +02:00
Klemens Nanni
397f7e5c0e Parse SVCB/HTTPS SvcParams list
Add full support for RFC 9460's SvcParams list.

Amend the existing `dns_svcb_rr` record by a vector of new
`dns_svcb_param` records containing aptly typed SvcParamKey and
SvcParamValue pairs.  Example output:

```
@load base/protocols/dns
event dns_HTTPS( c: connection , msg: dns_msg , ans: dns_answer , https: dns_svcb_rr ) {
	for (_, param in https$svc_params)
		print to_json(param);  # filter uninitialised values
}
```

```
$ dig https cloudflare-ech.com +short | tr [:space:] \\n
1
.
alpn="h3,h2"
ipv4hint=104.18.10.118,104.18.11.118
ech=AEX+DQBBHgAgACBGL2e9TiFwjK/w1Zg9AmRm7mgXHz3PjffP0mTFNMxmDQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA=
ipv6hint=2606:4700::6812:a76,2606:4700::6812:b76
```

```
{"key":1,"alpn":["h3","h2"]}
{"key":4,"hint":["104.18.10.118","104.18.11.118"]}
{"key":5,"ech":"AEX+DQBBHgAgACBGL2e9TiFwjK/w1Zg9AmRm7mgXHz3PjffP0mTFNMxmDQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA="}
{"key":6,"hint":["2606:4700::6812:a76","2606:4700::6812:b76"]}
```

Values with malformed data or belonging to invalid/reserved keys
are passed raw bytes in network order for script-level inspection.

Follow up to "Initial Support to DNS SVCB/HTTPS RR"
https://github.com/zeek/zeek/pull/1808
2025-09-03 09:53:55 +03:00
Tim Wojtulewicz
5d93254400 Merge remote-tracking branch 'origin/topic/timw/remove-unneeded-binpac-includes'
* origin/topic/timw/remove-unneeded-binpac-includes:
  Remove some unnecessary #includes from binpac source files
2025-09-02 16:00:27 -07:00
Tim Wojtulewicz
adb28453a7 Remove some unnecessary #includes from binpac source files 2025-09-02 11:52:52 -07:00
Tim Wojtulewicz
deeca84332 Merge remote-tracking branch 'origin/topic/timw/readability-container-contains'
* origin/topic/timw/readability-container-contains:
  Fix a few more random clang-tidy findings
  Use std::numbers::pi instead of hard-coded value
  Use std::scoped_lock instead of std::lock_guard
  Use .contains() instead of .find() or .count()
2025-09-02 11:49:29 -07:00
Tim Wojtulewicz
3c7885abdf Fix a few more random clang-tidy findings 2025-09-02 16:51:34 +00:00
Tim Wojtulewicz
aa3940f16d Use std::numbers::pi instead of hard-coded value 2025-09-02 16:51:23 +00:00
Tim Wojtulewicz
66aefc6a54 Use std::scoped_lock instead of std::lock_guard 2025-09-02 16:42:52 +00:00
Tim Wojtulewicz
b592b6c998 Use .contains() instead of .find() or .count() 2025-09-02 16:42:52 +00:00
Benjamin Bannier
4c9cbeb43f Remove unnecessary peer signature from test scripts.base.protocols.bittorrent.tracker 2025-09-02 10:53:38 +02:00
Vern Paxson
36862a18d6 tightened up parsing of $field=X record constructor expressions 2025-08-31 15:14:26 -07:00
zeek-bot
d63e3f9706 Update doc submodule [nomail] [skip ci] 2025-08-31 00:17:01 +00:00
Christian Kreibich
f38ac30418 Merge branch 'topic/christian/management-framework-tls'
* topic/christian/management-framework-tls:
  Bump zeek-testing-cluster to pull in WebSocket TLS updates
  Bump zeek-client to pull in TLS config updates
  Management framework: add TLS options for controller's websocket server
2025-08-29 21:53:37 -07:00
Christian Kreibich
236d3a1ced Bump zeek-testing-cluster to pull in WebSocket TLS updates 2025-08-29 17:20:15 -07:00
Christian Kreibich
779f7064ad Bump zeek-client to pull in TLS config updates 2025-08-29 17:20:10 -07:00
Tim Wojtulewicz
d20550f553 Merge remote-tracking branch 'origin/topic/timw/switch-spicy-zeek-builds-to-ubuntu-24'
* origin/topic/timw/switch-spicy-zeek-builds-to-ubuntu-24:
  Move benchmarking to Ubnutu 24 task, add to normal PR builds
  Reorder ubuntu builds so 22.04 comes last
  Rename Ubuntu-based tasks to have the full version name
  Switch Zeek Spicy builds to Ubuntu 24
2025-08-29 15:08:38 -07:00
Arne Welzel
b014e8e56e Management framework: add TLS options for controller's websocket server 2025-08-29 12:44:07 -07:00
Tim Wojtulewicz
b156bcf6dd Move benchmarking to Ubnutu 24 task, add to normal PR builds
We already have a "regular Linux" build for PRs, but I'm adding this one
in so that we have benchmark coverage on PRs as well.
2025-08-29 10:39:49 -07:00
Tim Wojtulewicz
ea076dc14a Reorder ubuntu builds so 22.04 comes last 2025-08-28 15:37:16 -07:00
Tim Wojtulewicz
6e2ca35fb0 Rename Ubuntu-based tasks to have the full version name 2025-08-28 15:37:16 -07:00
Tim Wojtulewicz
692c6a2f10 Switch Zeek Spicy builds to Ubuntu 24 2025-08-28 15:37:16 -07:00
Tim Wojtulewicz
273abf3d08 Merge remote-tracking branch 'origin/topic/timw/tools-clang-tidy'
* origin/topic/timw/tools-clang-tidy:
  gen-zam: Move source files up a directory
  bifcl: Fix clang-tidy warnings
  bifcl: Run clang-format on c++ code embedded in builtin-func.{l,y}
  binpac: Fix a large number of clang-tidy warnings
  binpac: Replace delete_list macro uses
  binpac: Run clang-format on c++ code embedded in pac_parse.{ll,yy}
2025-08-28 15:20:32 -07:00
Tim Wojtulewicz
2acfa27c2a Merge remote-tracking branch 'origin/topic/timw/link-prometheus-via-broker-instead-of-directly'
* origin/topic/timw/link-prometheus-via-broker-instead-of-directly:
  Link Prometheus symbols via Broker instead of directly
2025-08-28 13:06:44 -07:00
Tim Wojtulewicz
cf8f3547f4 Link Prometheus symbols via Broker instead of directly 2025-08-28 13:05:40 -07:00
Tim Wojtulewicz
7499234d42 gen-zam: Move source files up a directory 2025-08-28 12:14:09 -07:00
Tim Wojtulewicz
d3ac12da68 bifcl: Fix clang-tidy warnings 2025-08-28 12:14:09 -07:00
Tim Wojtulewicz
22d82edc74 bifcl: Run clang-format on c++ code embedded in builtin-func.{l,y} 2025-08-28 12:14:09 -07:00
Tim Wojtulewicz
31b65f70da binpac: Fix a large number of clang-tidy warnings 2025-08-28 12:14:09 -07:00
Tim Wojtulewicz
4dc546f8c8 binpac: Replace delete_list macro uses 2025-08-28 12:14:09 -07:00
Tim Wojtulewicz
64b3265eb8 binpac: Run clang-format on c++ code embedded in pac_parse.{ll,yy} 2025-08-28 12:14:09 -07:00
zeek-bot
ea0ffd3ec1 Update doc submodule [nomail] [skip ci] 2025-08-28 00:16:01 +00:00
Arne Welzel
4f84192c3a Merge remote-tracking branch 'origin/topic/timw/ci-restore-ubuntu22-build'
* origin/topic/timw/ci-restore-ubuntu22-build:
  CI: Restore build steps for ubuntu22 task
2025-08-27 09:28:13 +02:00
Arne Welzel
702518e288 Merge remote-tracking branch 'origin/topic/timw/ruff-check-pre-commit-alias'
* origin/topic/timw/ruff-check-pre-commit-alias:
  Fix ruff check legacy alias for pre-commit
2025-08-27 09:27:41 +02:00
Tim Wojtulewicz
bb1001fb01 CI: Restore build steps for ubuntu22 task
This got accidentally deleted during the reorganization of the CI tasks
2025-08-26 17:30:36 -07:00
Tim Wojtulewicz
cfa73bd512 Merge remote-tracking branch 'origin/topic/timw/reduce-ci-load'
* origin/topic/timw/reduce-ci-load:
  CI: Rework layout of when each task runs
2025-08-26 14:40:05 -07:00
Tim Wojtulewicz
a0bdab5cf6 CI: Rework layout of when each task runs 2025-08-26 12:53:16 -07:00
Tim Wojtulewicz
39cd0332cd Fix ruff check legacy alias for pre-commit 2025-08-26 12:47:03 -07:00
Tim Wojtulewicz
d7db612b0f Merge remote-tracking branch 'origin/topic/bbannier/issue-3266'
* origin/topic/bbannier/issue-3266:
  Fix installation of symlink with `DESTDIR`
2025-08-26 08:59:34 -07:00
Tim Wojtulewicz
9e9c193f2a Update zeekctl submodule for docs fixes [nomail] [skip ci] 2025-08-26 08:59:11 -07:00
Tim Wojtulewicz
84c3619ef6 Merge remote-tracking branch 'origin/topic/awelzel/zeekctl-88-add-metrics-addr-and-document'
* origin/topic/awelzel/zeekctl-88-add-metrics-addr-and-document:
  Bump zeekctl
2025-08-25 12:29:44 -07:00
Arne Welzel
33f5825d38 Bump zeekctl 2025-08-25 15:14:27 +02:00
Arne Welzel
3e89e6b328 Merge remote-tracking branch 'origin/topic/awelzel/cluster-event-metadata-fixes-for-8.0'
* origin/topic/awelzel/cluster-event-metadata-fixes-for-8.0:
  cluster/Backend: Fallback to current network time when current event has not timestamp
  cluster/serializer/broker: Do not send empty metadata vectors around
2025-08-22 10:13:30 +02:00
Christian Kreibich
2929f1eb17 Merge branch 'topic/christian/news-typos'
* topic/christian/news-typos:
  Minor fixes to a few NEWS entries.
2025-08-21 17:10:17 -07:00
Christian Kreibich
ade7b0a9a2 Minor fixes to a few NEWS entries. 2025-08-21 15:16:41 -07:00
Arne Welzel
ce7ba36b3c Merge remote-tracking branch 'origin/topic/awelzel/bye-twitter'
* origin/topic/awelzel/bye-twitter:
  README.md: Add Mastodon and Bluesky links
  README: Drop "Follow us on Twitter"
2025-08-21 17:06:29 +02:00
Arne Welzel
ab960026d8 README.md: Add Mastodon and Bluesky links 2025-08-21 16:58:27 +02:00
Arne Welzel
836f4f4310 README: Drop "Follow us on Twitter" 2025-08-21 16:44:15 +02:00
Benjamin Bannier
15604811cb Fix installation of symlink with DESTDIR
We install test data which we also make available under an alternative
path for backwards compatibility. The installation of this symlink did
not take `DESTDIR` installs like used by Zeek's packaging into account
which caused installations from packages to behave different from
installs from source.

This patch fixes the symlink to respect a possible `DESTDIR`.

Closes #3266.
2025-08-21 10:56:28 +02:00
zeek-bot
3947b402a0 Update doc submodule [nomail] [skip ci] 2025-08-21 00:26:50 +00:00
Arne Welzel
9a7678f15a cluster/Backend: Fallback to current network time when current event has not timestamp
When a WebSocket client sends an event to Zeek without explicit network
timestamp metadata, Zeek would use -1.0 as a timestamp for any events
published while handling this event. Instead, it seems far more sensible
to use the current network time in that scenario.
2025-08-20 19:56:50 +02:00
Arne Welzel
01fe022e07 cluster/serializer/broker: Do not send empty metadata vectors around
Event when there's no metadata attached to an event, we'd still use the
constructor passing an empty metadata vector, resulting in an on-the-wire
representation with an empty trailing vector.

Particularly visible when just snooping events via websocat. There also
seems to be some bug with the timestamp -1 handling.
2025-08-20 19:55:38 +02:00
Tim Wojtulewicz
c9c5959d49 Merge remote-tracking branch 'origin/topic/timw/move-submodules-to-main-repo-take-2'
* origin/topic/timw/move-submodules-to-main-repo-take-2: (343 commits)
  Add NEWS entries for submodule moves
  Remove configure --with-gen-zam argument and the CMake summaries
  af_packet: Remove submodule, adapt CMake/code for Zeek build
  af_packet: pre-commit fixes
  af_packet: Fix initialization
  af_packet: Ensure all of the member fields get initialized
  af_packet: Require CMake 3.15 to match Zeek's requirement
  af_packet: Note that Zeek ships with a built-in version.
  af_packet: Use cstdint instead of stdint.h
  af_packet: Use override for overriding parent methods
  af_packet: Use 'pragma once' instead of include guards
  af_packet: AF_Packet: Fix wrong vlan when PCP or DEI bits are set in tp_vlan_tci
  af_packet: AF_Packet: Check interface for upness
  af_packet: AF_Packet: Use negative socket_fd for error indication
  af_packet: AF_Packet: Remove usages of inline
  af_packet: Add guarded zeek/zeek-version.h include.
  af_packet: RX_Ring: Add include for string
  af_packet: Increase version number.
  af_packet: Add info if TP_STATUS_CSUM_VALID is not defined.
  af_packet: Define TP_STATUS_CSUM_VALID when not defined
  ...
2025-08-20 08:53:55 -07:00
Tim Wojtulewicz
469bd8d562 Add NEWS entries for submodule moves 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
95ea468db1 Remove configure --with-gen-zam argument and the CMake summaries 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
6002f63a37 af_packet: Remove submodule, adapt CMake/code for Zeek build 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
62e27ee6f7 af_packet: pre-commit fixes 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
709f876947 af_packet: Fix initialization 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
f92bffcfd9 af_packet: Ensure all of the member fields get initialized 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
1f7c2f42bc af_packet: Require CMake 3.15 to match Zeek's requirement 2025-08-20 08:52:26 -07:00
Jan Grashoefer
a4cd5dd452 af_packet: Note that Zeek ships with a built-in version.
Closes #64.
2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
c55fad5094 af_packet: Use cstdint instead of stdint.h 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
ba15e3e3b2 af_packet: Use override for overriding parent methods 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
69cae88bb0 af_packet: Use 'pragma once' instead of include guards 2025-08-20 08:52:26 -07:00
Arne Welzel
aefa52821c af_packet: AF_Packet: Fix wrong vlan when PCP or DEI bits are set in tp_vlan_tci
A user reported vlan ids > 4095 being logged by Zeek [1]. For populating
packet->vlan, mask away Priority Code Point (PCP) and Drop Eligible
Indicator (DEI) bits from the tp_vlan_tci field, else we're not setting
the correct value on the packet.

Fixes #60

[1] https://community.zeek.org/t/zeek-reporting-vlan-ids-above-4095-bug-found/7000
2025-08-20 08:52:26 -07:00
Arne Welzel
c3a13304cb af_packet: AF_Packet: Check interface for upness
When using af_packet with an interface that was not up, the following
non-informative error was reported:

    $ /opt/zeek-5.2/bin/zeek -i af_packet::replay
    fatal error: problem with interface af_packet::replay (Invalid argument)

With this change, the error now includes information about the
interface being down:

    $ ZEEK_PLUGIN_PATH=$(pwd)/build zeek -Ci af_packet::replay
    fatal error: problem with interface af_packet::replay (interface is down)

Fixes #51
2025-08-20 08:52:26 -07:00
Arne Welzel
df4beb6054 af_packet: AF_Packet: Use negative socket_fd for error indication
Technically, socket() can return 0, so shouldn't use it as an
indication of a non existent / closed socket.

I'm not 100% sure about the Close() contract here: If something
goes haywire with a packet source Zeek calls FatalError without
calling Close() nor properly destructing the PktSrc. Oh yikes.
2025-08-20 08:52:26 -07:00
Arne Welzel
17d60e4ab9 af_packet: AF_Packet: Remove usages of inline
...not sure why they are marked inline.
2025-08-20 08:52:26 -07:00
Arne Welzel
d9d7b76c5d af_packet: Add guarded zeek/zeek-version.h include.
With zeek/zeek#2802, zeek-config.h will not provide ZEEK_VERSION_NUMBER
when a plugin is compiled as a builtin/static plugin into Zeek. This is
done to avoid tree-wide ccache busting when just the version changes.
2025-08-20 08:52:26 -07:00
Arne Welzel
67d3b0697f af_packet: RX_Ring: Add include for string
When compiling with clang and libc++ like done when using Google's
hongfuzz in the oss-fuzz setup, the following errors are produced:

    Step #3 - "compile-honggfuzz-address-x86_64": /src/zeek/auxil/zeek-af_packet-plugin/src/RX_Ring.cc:19:9: error: no matching conversion for functional-style cast from 'const char[15]' to 'RX_RingException'
    Step #3 - "compile-honggfuzz-address-x86_64":                 throw RX_RingException("invalid socket");
    Step #3 - "compile-honggfuzz-address-x86_64":                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Step #3 - "compile-honggfuzz-address-x86_64": /src/zeek/auxil/zeek-af_packet-plugin/src/RX_Ring.h:14:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const char[15]' to 'const RX_RingException' for 1st argument
    Step #3 - "compile-honggfuzz-address-x86_64": class RX_RingException : public std::runtime_error {
    Step #3 - "compile-honggfuzz-address-x86_64":       ^
    Step #3 - "compile-honggfuzz-address-x86_64": /src/zeek/auxil/zeek-af_packet-plugin/src/RX_Ring.h:14:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const char[15]' to 'RX_RingException' for 1st argument
    Step #3 - "compile-honggfuzz-address-x86_64": /src/zeek/auxil/zeek-af_packet-plugin/src/RX_Ring.h:16:2: note: candidate constructor not viable: no known conversion from 'const char[15]' to 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char>>') for 1st argument
    Step #3 - "compile-honggfuzz-address-x86_64":         RX_RingException(const std::string& what_arg) : std::runtime_error(what_arg) {}
    Step #3 - "compile-honggfuzz-address-x86_64":

The problem can be reproduced outside of hongfuzz by compiling this
plugin with with clang/libc++:

    export CXX=clang++-14
    export CXXFLAGS=-stdlib=libc++
    ./configure
    make

Include <string> in RX_Ring.h to ensure the required const char * to
std::string conversion are available to any users of RX_RingException.
2025-08-20 08:52:26 -07:00
Jan Grashoefer
165d60236c af_packet: Increase version number. 2025-08-20 08:52:26 -07:00
Jan Grashoefer
61a3538106 af_packet: Add info if TP_STATUS_CSUM_VALID is not defined. 2025-08-20 08:52:26 -07:00
Arne Welzel
e0d7dba113 af_packet: Define TP_STATUS_CSUM_VALID when not defined
On some older Linux distributions (CentOS 7), the if_packet.h header does
not yet include TP_STATUS_CSUM_VALID (introduced in March 2015). Simply
define it if it's not there.
2025-08-20 08:52:26 -07:00
Jan Grashoefer
7d0841ae31 af_packet: Improve the README. 2025-08-20 08:52:26 -07:00
Arne Welzel
90d61cae72 af_packet: Make block_size and block_timeout configurable
This lowers the default timeout from 100msec to 10msec and increases the default
block_size from 16KB to 32KB. Both are aligned with what Suricata uses as defaults.

The block_size is likely too conservative for high-performance, tuning
guides recommend starting with 1MB block size.

Fixes #37.
2025-08-20 08:52:26 -07:00
Jan Grashoefer
8d2979e935 af_packet: Cleanup checksum offloading support. 2025-08-20 08:52:26 -07:00
Tim Wojtulewicz
cd297e13dd af_packet: Support checksum offloading (requires Zeek 5.1). 2025-08-20 08:52:26 -07:00
Arne Welzel
ffbb2823da af_packet: Remove compile_options() again
This seems to trickle through to base Zeek code when done like that.

https://cirrus-ci.com/task/4788073346105344?logs=build#L2298
2025-08-20 08:52:26 -07:00
Arne Welzel
6ad8e3ed24 af_packet: Add -Wunused and -Werror
This would've found the enable_defrag issue and also points out another
unused variable.
2025-08-20 08:52:26 -07:00
Arne Welzel
41331e5605 af_packet: Fix enable_defrag
Seems enable_defrag was never actually passed down to the relevant functions.
Remove the default parameters to ensure we properly pass it down.
2025-08-20 08:52:26 -07:00
Arne Welzel
62b28177ee af_packet: Remove linux/version.h include
Not sure why this is needed. On my system it defines LINUX_VERSION_CODE
and KERNEL_VERSION and neither is used within the plugin.
2025-08-20 08:52:26 -07:00
Arne Welzel
1dc6718621 af_packet: Remove FindKernelHeaders, not needed
There's been some wondering why kernel headers are required to compile
this plugin as it's not providing a kernel module or otherwise provides
functionality related to kernel APIs. AF_PACKET sockets are provided
through user-space APIs.

There may have been historical reasons, but let's move forward and
remove the dependency.

Fixes #29 #24
2025-08-20 08:52:26 -07:00
Jan Grashoefer
46f364c3dd af_packet: Increase version number. 2025-08-20 08:52:26 -07:00
Jan Grashoefer
630d1edff9 af_packet: Make link type configurable. 2025-08-20 08:52:26 -07:00
Jan Grashoefer
7be67782c2 af_packet: Increase version number. 2025-08-20 08:52:25 -07:00
Michael Dopheide
e2f40fc5b1 af_packet: Create README file which zeek's ConfigurePackaging.cmake requires 2025-08-20 08:52:25 -07:00
Jan Grashoefer
716916a97d af_packet: Increase version number. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
448e69471c af_packet: Convert README formatting to Markdown. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
1fe008945e af_packet: Hacked VLAN support. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
b38894a329 af_packet: Increase version number. 2025-08-20 08:52:25 -07:00
Christian Kreibich
96384be689 af_packet: Avoid Zeek script double-loading problems
The plugin mechanism automatically picks up the scripts folder for
plugin-related Zeek scripts. When a package's zkg.meta also declares the scripts
folder the location for package-level scripts, the scripts get installed
redundantly in two places. Zeek cannot recognize them as duplicates, triggering
various errors relating to double-defined symbols.

This moves the package-level scripts to a subdirectory with a placeholder. The
placeholder avoids the zkg install-time warning, whose original fix in e3aea1
introduced this problem.
2025-08-20 08:52:25 -07:00
Jan Grashoefer
74f9d11776 af_packet: Fix Zeek version dependency. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
e945e2c8bb af_packet: Increase version number. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
45b3dbf267 af_packet: Slightly reorder README. 2025-08-20 08:52:25 -07:00
Johanna Amann
e4aa85d2a6 af_packet: Add FANOUT_CBPF and FANOUT_EBPF 2025-08-20 08:52:25 -07:00
Michael Dopheide
79842b25c1 af_packet: Namespace changes adding zeek:: as well as zeek/ prefix for include files. 2025-08-20 08:52:25 -07:00
Vlad Grigorescu
e3c5865684 af_packet: GetFanoutMode: Fix case statement (missing breaks).
Without this, you can't actually set the fanout mode to anything but HASH.
2025-08-20 08:52:25 -07:00
Jan Grashoefer
62356c38dd af_packet: Fixed test baseline to include defrag option. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
130f7f7272 af_packet: Increase version number. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
4deb8f6402 af_packet: Add support for defragmentation of IP packets. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
57dd239917 af_packet: Increase version number. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
8aa35fed6f af_packet: Add upgrade note to README. 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
8d0bc4a804 af_packet: Add some missing includes due to changes in Zeek 3.1 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
a7195a7a75 af_packet: File naming and build system changes to support deprecation changes in Zeek 3.0 2025-08-20 08:52:25 -07:00
Jan Grashoefer
1f1627ad73 af_packet: Increased version number. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
5e3ae6227b af_packet: Updated README. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
eb3dc4b563 af_packet: Include info files for distribution. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
9cc01769b4 af_packet: Minor improvements to fix compiler warnings. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
b6e52b262c af_packet: Increased version number. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
4eaa201821 af_packet: Updated README regarding --with-latest-kernel. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
3adaef434b af_packet: Added buffer_size option to broctl plugin.
The buffer size can now be set in node.cfg using the
af_packet_buffer_size key.
2025-08-20 08:52:25 -07:00
Jan Grashoefer
a89379c353 af_packet: Added bro-pkg instructions to the README. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
1a107bd838 af_packet: Increased version number. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
1dfb115e35 af_packet: Fixed broctl example. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
478265b4f2 af_packet: Fixed compatibility for kernel versions < 3.14. 2025-08-20 08:52:25 -07:00
Jan Grashoefer
742b0820bc af_packet: Imported version 1.1 of the plugin. 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
32522307d9 gen-zam: Fix clang-tidy and pre-commit warnings 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
a2f4f2adc3 gen-zam: Remove submodule, adapt CMake configuration for Zeek build 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
526238299d gen-zam: Fix a pile of Coverity findings 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
3845fced55 gen-zam: Require C++20 for builds 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
f6f84184ed gen-zam: Add clang-format pre-commit hook 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
d5cc0d5135 gen-zam: Add cmake-format pre-commit hook 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
027c075fb0 gen-zam: Use const references instead of copying type values 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
97492b4d70 gen-zam: Reserve space for args vector before pushing back items 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
75bba1a8f5 gen-zam: Fix clang-tidy bugprone-macro-parentheses/cppcoreguidelines-macro-usage warnings in headers 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
0acd4bf04e gen-zam: Fix clang-tidy bugprone-branch-clone warnings in headers 2025-08-20 08:52:25 -07:00
Vern Paxson
53591cf205 gen-zam: generate descriptions of macros, akin to those already generated for operations 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
12bb2a04eb gen-zam: Require CMake 3.15, in line with other Zeek projects 2025-08-20 08:52:25 -07:00
Vern Paxson
a20e268f13 gen-zam: more robust dispatch that allows for eval/eval-mixed overlap 2025-08-20 08:52:25 -07:00
Vern Paxson
736eb99054 gen-zam: extensive changes corresponding to those described in GH-3872 2025-08-20 08:52:25 -07:00
Vern Paxson
4ae4548ceb gen-zam: gen-zam extended to read from multiple files on the command-line 2025-08-20 08:52:25 -07:00
Vern Paxson
aee70af743 gen-zam: fix for generating relational operations with first operand being a constant 2025-08-20 08:52:25 -07:00
Vern Paxson
f9385ef88d gen-zam: hooks for supporting ZAM profiling 2025-08-20 08:52:25 -07:00
Vern Paxson
4e07a9681d gen-zam: fixes for generating ZAM operations relating to indirect calls 2025-08-20 08:52:25 -07:00
Vern Paxson
6f8c54d69a gen-zam: support for ZAM instructions using IntrusivePtr for call expression ASTs 2025-08-20 08:52:25 -07:00
Vern Paxson
6f648e36d1 gen-zam: fix to make generated function calls compatible with "when" lambdas 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
b04c03ee89 gen-zam: Fix some warnings from newer compilers about unqualified std::move calls 2025-08-20 08:52:25 -07:00
Vern Paxson
1e73b02977 gen-zam: better error reporting when ZAM code does a function call 2025-08-20 08:52:25 -07:00
Tomer Lev
3b3f6bbe4d gen-zam: Fix a bug caused by different behaviour of std::regex_replace under MSVC.
Under MSVC regex objects are multiline by default and there is no apparant way of changing this behaviour. Under clang/gcc regex is singleline unless std::regeX_constants::multiline is specificied.
This behaviour is assumed in Gen-ZAM.cc when auto-generating header files.

Example: https://godbolt.org/z/aP59x3EhT
2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
6ad6fd165b gen-zam: clang-tidy: Avoid copying string objects if possible 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
27d674edc0 gen-zam: clang-tidy: Avoid bugprone narrowing conversions 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
bacd56258c gen-zam: Fix a couple of coverity issues
1491335: AUTO_CAUSES_COPY due to a for loop using auto& instead of const auto&
1491338: AUTO_CAUSES_COPY due to a for loop using auto& instead of const auto&
2025-08-20 08:52:25 -07:00
Vern Paxson
789b06b1ea gen-zam: fix memory management for vector-of-strings operations 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
f330505e83 gen-zam: Deprecate bro_int_t and bro_uint_t 2025-08-20 08:52:25 -07:00
Johanna Amann
902577b7ce gen-zam: Fix compile error on GCC-12/Ubuntu 22.04 2025-08-20 08:52:25 -07:00
Christian Kreibich
4a7cf8c26e gen-zam: Remove unnecessary include from CMakeLists.txt 2025-08-20 08:52:25 -07:00
Christian Kreibich
b51430c04e gen-zam: Trivial source tweaks to make it build 2025-08-20 08:52:25 -07:00
Christian Kreibich
5ea34f20b8 gen-zam: Establish the usual environment for cmake-driven builds 2025-08-20 08:52:25 -07:00
Christian Kreibich
c1f240295f gen-zam: Move Gen-ZAM sources to src subdirectory 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
c618bb7a56 bifcl: Remove submodule, adapt CMake configuration for Zeek build 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
f6d9696bf1 bifcl: Require C++20 for builds 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
d8d8772342 bifcl: Add NOLINT for clang-tidy performance-enum-size to generated headers 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
c63a220579 bifcl: Add missing include of cinttypes 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
867d91b535 bifcl: Some other minor cleanup 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
23a5e46b8e bifcl: Minor cleanup of include files 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
7026938082 bifcl: Pass boolean false to BuiltinFunc constructor instead of zero
This fixes a modernize-use-bool-literals clang-tidy warning in the
generated code.
2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
c30aa7a903 bifcl: Don't do 'using namespace std' in headers, plus a little cleanup 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
75a8814cee bifcl: Switch more namespacing in generated code to nested style 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
234726dac7 bifcl: Reformat CMakeLists via pre-commit 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
2f97833acd bifcl: Switch namespacing in generated code to C++-17-style nested namespaces 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
d2edc334ad bifcl: Add #pragma once to generated headers 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
dac04be859 bifcl: Make BIFs just return ValPtr directly instead of BifReturnVal 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
f2cd4ae3e6 bifcl: Reformat Bifcl in Spicy style 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
8e5b722145 bifcl: Remove usage of FindRequiredPackage 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
af0c68c183 bifcl: Add /J flag on Windows to force unsigned char 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
3004675015 bifcl: Force -std=c++17 mode for cmake targets, remove use of RequireCXX17.cmake 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
af2a1b67bc bifcl: Require CMake 3.15.0 to build, similar to the recent changes to zeek and broker 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
7275016bcb bifcl: Remove vendored CMake files from repo 2025-08-20 08:52:25 -07:00
Arne Welzel
e7cce57f2b bifcl: Render runtime type checks for var_args bifs
Currently, Zeek disables any static type checking for var_arg bifs.
However, the generated preamble for var_args bifs assume that
typed positional arguments are correctly typed and blindly calls
the type converters on them. This easily triggers abort()s at runtime
currently when a script mistakenly uses the wrong types for var_arg
bifs. For example, calling publish_rr() with a port instead of a string
causes a hard-abort with Zeek 5.0.8.

    $ zeek -e 'Cluster::publish_rr(Cluster::Pool(), 80/tcp)'
    fatal error in <no location>: Val::CONVERTER (port/string) (80/tcp)
    Aborted (core dumped)

Extend bifcl so that for var_arg functions and the types that bifcl understands,
we render a runtime type check and explicit early return to avoid the abort().
For any/other types, the implementer of the bif continuous to be responsible
for type checking.

This isn't solving the var_args situation generally, but avoids some
ad-hoc fixes trickling in current bif implementations.

Some references:

https://github.com/zeek/zeek/issues/1523
https://github.com/zeek/zeek/issues/2425
https://github.com/zeek/zeek/issues/2935
https://github.com/zeek/zeek/pull/2950
2025-08-20 08:52:25 -07:00
Arne Welzel
efb32d31fc bifcl: builtin-func.l: Allow more than just one additional component
I'm not sure why this was restricted to only two components,
the following appears functional in Zeek scripts.

    module A::B::C;

    export {
      type MyRecord: record {
        a: string;
      };
    }

Closes #25.
2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
8e295df115 bifcl: Other minor cleanups 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
8662b29ac6 bifcl: Use bools for boolean comparisons 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
224a42e1f0 bifcl: Use nullptrs for pointer initializations 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
4ed4f3e1b8 bifcl: Include stdint.h early to prevent redefinition of int type macros 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
0c4676e835 bifcl: Remove argument from BIFCL_LSAN_DISABLE macro to fix warning on Windows 2025-08-20 08:52:25 -07:00
Tomer Lev
4352f0c0bb bifcl: Only adding subdir if running standalone 2025-08-20 08:52:25 -07:00
Tomer Lev
c6042154b9 bifcl: Adding support for libunistd. Also adding pragma guard for the right arch 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
3a18b2144c bifcl: Add clang-format and run it on everything 2025-08-20 08:52:25 -07:00
Elad Solomon
552be424c4 bifcl: Adapted bifcl to compile with MSVC for Windows environment. 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
f69f9e06e1 bifcl: Use full path to filename in #line directives in generated code
This fixes the DWARF information gets output by the compiler, and allows debuggers
to use the full path name to display contextual information when a session stops
inside of BIF code.
2025-08-20 08:52:25 -07:00
Benjamin Bannier
09d3268740 bifcl: Keep zeekygen comments close to their definitions
The Yacc grammar treats comments like other whitespace and when seeing
the first definition in a file would previously emit all whitespace
before emitting the `export` section containing the definition. This
lead to the first definition being separated from their zeekygen
documention (separated by `export {`).

With this patch we start the export section before emitting whitespace.
While this might now pull more "whitespace" into the exported part, it
avoids breaking the association between zeekygen comments and
definitions.

Closes #15.
2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
e080c5c6b2 bifcl: Remove remaining uses of Bro naming 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
669875a9b7 bifcl: Deprecate bro_int_t and bro_uint_t 2025-08-20 08:52:25 -07:00
Vern Paxson
2f3f7e9ce2 bifcl: trimmed & regularized some minor variable naming 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
02fe78a03f bifcl: Allow analyzer to be passed as nullptr for enqueue methods
This allows the methods to be used in contexts where the analyzer ID
is not available or when the ID doesn't matter, such as in packet
analyzers.
2025-08-20 08:52:25 -07:00
Seth Hall
d0ed713108 bifcl: Updates for building Zeek as a subproject 2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
ea625959c1 bifcl: Rename Session::ConnVal() to Session::GetVal() 2025-08-20 08:52:25 -07:00
Jon Siwek
ae56d45a1f bifcl: Prevent use of LeakSanitizer on FreeBSD 2025-08-20 08:52:25 -07:00
Jon Siwek
34c4f678cf bifcl: Add missing zeek/ to generated header includes
Related to https://github.com/zeek/zeek/pull/1377
2025-08-20 08:52:25 -07:00
Tim Wojtulewicz
279d5f3fad bifcl: Remove v4.1 deprecation warnings 2025-08-20 08:52:25 -07:00
Vern Paxson
72fa791294 bifcl: support for new FileVal class 2025-08-20 08:52:24 -07:00
Jon Siwek
23a4b7e7c1 bifcl: Update minimum required CMake to 3.5 2025-08-20 08:52:24 -07:00
Jon Siwek
fbc98f4dd5 bifcl: Postpone initialization of constants for subdir BIFs 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
406f68f7fa bifcl: Rename bro-bif.h to zeek-bif.h 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
56d9813042 bifcl: Move __RegisterBif from zeek::detail::plugin to zeek::plugin::detail 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
74d21a40e4 bifcl: SOURCE_LOCAL is part of the zeek::util::detail namespace now 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
c5189596da bifcl: Move Connection to zeek namespace 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
5c94ea02c5 bifcl: Move BifReturnVal to zeek::detail namespace 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
cffecc5033 bifcl: Move event code to zeek namespace, rename mgr to event_mgr 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
2090786ac5 bifcl: Move BroFile to zeek namespace, rename to File 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
caf565c539 bifcl: Move base analyzer classes to zeek namespace 2025-08-20 08:52:24 -07:00
Jon Siwek
fe0b3dd13f bifcl: Ensure strncpy null-termination 2025-08-20 08:52:24 -07:00
Jon Siwek
a5a7f08c37 bifcl: Fix stringop-truncation compiler warning 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
b203311bad bifcl: Add zeek:: namespace to val_mgr usage 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
6204542b5a bifcl: Review cleanup 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
ff7b41ff12 bifcl: Move BuiltinFunc to zeek namespace 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
13dac12521 bifcl: Move Frame to the zeek::detail namespace 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
0597535149 bifcl: Move all Val classes to the zeek namespaces 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
79bbe9a7bf bifcl: Move IntrusivePtr to the zeek namespace 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
73fb715657 bifcl: Update namespace for *Type classes 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
6813ddaaa9 bifcl: Update namespace for plugin::Plugin and plugin::BifItem classes 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
9f317f02a4 bifcl: Update namespace for __RegisterBif function 2025-08-20 08:52:24 -07:00
Jon Siwek
011f66cb2d bifcl: Use new TimeVal/DoubleVal subclass ctors 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
4686ba3824 bifcl: Include Func.h in files during build 2025-08-20 08:52:24 -07:00
Jon Siwek
99fa631ddd bifcl: Change constructor for BroFile args 2025-08-20 08:52:24 -07:00
Jon Siwek
23b4af393f bifcl: Switch zeek:🆔:lookup to zeek:🆔:find 2025-08-20 08:52:24 -07:00
Jon Siwek
2ef1aacd36 bifcl: Use zeek::BifEvent:: for enqueue_ functions instead of BifEvent::
The old BifEvent::generate_ functions were already deprecated
2025-08-20 08:52:24 -07:00
Jon Siwek
4c2fb01981 bifcl: Deprecate BifFunc:: declarations, replace with zeek::BifFunc::
Also changes name of function slightly, example: bro_fmt -> fmt_bif.
2025-08-20 08:52:24 -07:00
Jon Siwek
d72884064a bifcl: Deprecate names in BifConst, replace with zeek::BifConst
Some Val* types are also replaced with IntrusivePtr
2025-08-20 08:52:24 -07:00
Jon Siwek
620680d878 bifcl: Deprecate all BroType* in BifType:: namespace
Replaced with equivalently named IntrusivePtr in zeek::BifType::
2025-08-20 08:52:24 -07:00
Jon Siwek
36dec9dbb5 bifcl: Change internal_handler() usage 2025-08-20 08:52:24 -07:00
Jon Siwek
59e86c6ea0 bifcl: Renaming/scoping of lookup functions 2025-08-20 08:52:24 -07:00
Jon Siwek
53d6f6665e bifcl: Replace deprecated use of internal_const_val() 2025-08-20 08:52:24 -07:00
Jon Siwek
719b8082ca bifcl: Update deprecated use of internal_type() 2025-08-20 08:52:24 -07:00
Jon Siwek
b29ecfd822 bifcl: Deprecate BifEvent::generate_*, add BifEvent::enqueue_* 2025-08-20 08:52:24 -07:00
Jon Siwek
0f5c621bd7 bifcl: Update deprecated Connection::BuildConnVal usage 2025-08-20 08:52:24 -07:00
Jon Siwek
7958f7854c bifcl: Return nullptr instead of 0 in BIF error conditions 2025-08-20 08:52:24 -07:00
Jon Siwek
c2841cb1b2 bifcl: Update deprecated ValManager::Get usages 2025-08-20 08:52:24 -07:00
Jon Siwek
9a3ac5de98 bifcl: Change BIFs to return a wrapper object
That allows implicit conversion from either Val* or IntrusivePtr<T>
2025-08-20 08:52:24 -07:00
Jon Siwek
df5249e7dd bifcl: Remove use of Variable-Length-Arrays
Related to https://github.com/zeek/zeek/issues/895
2025-08-20 08:52:24 -07:00
Jon Siwek
e5c62c01a4 bifcl: Support multiple/alternate event prototype definitions 2025-08-20 08:52:24 -07:00
Jon Siwek
b6b094b43a bifcl: Don't pass a TimerMgr to EventMgr::Enqueue() 2025-08-20 08:52:24 -07:00
Jon Siwek
de453419d7 bifcl: Use EventMgr::Enqueue() instead of QueueEventFast() 2025-08-20 08:52:24 -07:00
Jon Siwek
163a86fc4e bifcl: Move BIF function arguments from val_list to vector of IntrusivePtr 2025-08-20 08:52:24 -07:00
Jon Siwek
7009f1dda6 bifcl: Fix header include guards 2025-08-20 08:52:24 -07:00
Jon Siwek
c60bd14d56 bifcl: Disable LeakSanitizer
Related to https://github.com/zeek/zeek/issues/699
2025-08-20 08:52:24 -07:00
Jon Siwek
81b23aff92 bifcl: Move CMake project() after cmake_minimum_required() 2025-08-20 08:52:24 -07:00
Jon Siwek
a86b98bb9e bifcl: Move headers into include/ subdir
This avoids potential problems with libc++ 8+ on case-insensitive file
systems due to inclusion of a new header called <version> which will end
up conflicting with the VERSION file if the search path includes the
project root.
2025-08-20 08:52:24 -07:00
Daniel Thayer
3ce42f2f35 bifcl: Rename Bro to Zeek 2025-08-20 08:52:24 -07:00
Jon Siwek
3b8932ff01 bifcl: Update codegen to use faster val_list and event queue API 2025-08-20 08:52:24 -07:00
Daniel Thayer
a95808bc6b bifcl: Change file extension of auto-generated script files
Changed ".bro" file extension to ".zeek".
2025-08-20 08:52:24 -07:00
Robin Sommer
c3f6c8a4a0 bifcl: Fix compiler warning. 2025-08-20 08:52:24 -07:00
Jon Siwek
3a4f38a04b bifcl: Port bifcl code from Bro 2025-08-20 08:52:24 -07:00
Jon Siwek
73e8f2c79d bifcl: First commit 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
137e8bddc9 Run pre-commit on merged binpac code 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
8a7c6df278 Fix clang-tidy findings in the binpac lib code 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
6bddc06f8d Add copyright headers to all of the binpac source files 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
0377486637 binpac: Remove submodule, adapt CMake configuration for Zeek build 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
79733d9390 binpac: Restore README file without version number 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
a25b5b65ff binpac: Fix coverity unchecked return warning 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
d13cdd6427 binpac: Use std::move for a string value 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
710e2eaced binpac: Make sure pac_expr fields are initialized 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
b9b4fcb78b binpac: Require C++20 for builds 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
bb382fc0c0 binpac: Fix clang-tidy readability-isolate-declaration finding in generated code 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
ef962376bc binpac: Add 'override' to virtual methods in generated code 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
28cc9ca3ec binpac: Add NOLINT for clang-tidy performance-enum-size to generated headers 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
09936133a6 binpac: Reorder the fields in pac_type.h for better packing 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
45d07641e4 binpac: Make 'nullptr' a keyword, allow values to be set to it and compared against it
This helps fix 'modernize-use-nullptr' findings in generated code.
2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
3cf68302a2 binpac: Make 'bool' a discrete type and handle it differently when generating code
This fixes clang-tidy modernize-use-bool-literals findings in the generated code
2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
54a0e01805 binpac: Wrap generated switch statements in NOLINTs for bugprone-branch-clone
Binpac generates a lot of switch statements with repeated blocks in
them (typically empty blocks). Running clang-tidy on the generated code
with bugprone-branch-clone generates a lot of warnings. Instead of
doing a ton of analysis in binpac to avoid generating the duplicates,
just mark any switch generated with an annotation to avoid reporting
them.
2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
670c4dcbcf binpac: Add missing .cmake-format.json, reformat with pre-commit 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
dacfe747b9 binpac: Format output closer to what clang-format would output 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
964817f9bf binpac: Add cmake-format and typos pre-commit configs 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
3297de477b binpac: Reformat C++ code in Spicy style 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
716bf016a1 binpac: Remove usage of FindRequiredPackage 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
a4bc3fdf32 binpac: Add /J flag on Windows to force unsigned char 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
874de5d25b binpac: Force -std=c++17 mode for cmake targets, remove use of RequireCXX17.cmake 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
b7cc5afa78 binpac: Require CMake 3.15.0 to build, similar to the recent changes to zeek and broker 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
d39df6b243 binpac: Remove vendored CMake files from repo 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
4d0a29a725 binpac: Don't output comment for &let/&withinput if no such fields exist 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
ba7a7c2201 binpac: Include stdint.h early to prevent redefinition of int type macros 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
e05a0b8748 binpac: Remove argument from BINPAC_LSAN_DISABLE macro to fix warning on Windows 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
5264b957f1 binpac: Generate range-based for loops for array cleanup 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
65da8cf5de binpac: Avoid initializing array length variables twice in generated code 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
299f39e8e2 binpac: Mark overridden methods with 'override' 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
45ef19049c binpac: Add final keyword to class definitions 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
613ffef4a2 binpac: Use nullptr in generated code 2025-08-20 08:52:24 -07:00
Tim Wojtulewicz
9f3750d0cc binpac: Apply clang-tidy's modernize-use-nullptr check 2025-08-20 08:52:24 -07:00
Vern Paxson
49a96f5216 binpac: address linter warnings about use of sprintf() 2025-08-20 08:52:23 -07:00
Tomer Lev
d5f2c9c3a8 binpac: Only adding subdir if running standalone 2025-08-20 08:52:23 -07:00
Tomer Lev
9a4e01e634 binpac: Additional Windows fixes. Fixed wrong MSVC macro definition and std::filesystem invocation. Linking to libunistd library 2025-08-20 08:52:23 -07:00
Arne Welzel
60265b8ce7 binpac: pac_scan: Exit with failure for include errors
Elsewhere (zeek/zeek#2482), it was observed that when binpac encounters
include failures, it still exits with 0 indicating success. Subsequent
compilation of the produced .h and .cc files likely fails.

Exit with 1 on include errors to make pin pointing issues easier by
having make/ninja stop earlier.
2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
d21f99ef2b binpac: Wrap native dirname() call in ifdef, call std::filesystem on Windows 2025-08-20 08:52:23 -07:00
Elad Solomon
faa1b7abbf binpac: Adapted binpac to compile with MSVC for Windows environment. 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
dd3737b5c8 binpac: Apply bits of nadi-bittorrent patch that aren't applied 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
090325df40 binpac: Add pre-commit hooks and run clang-format on everything 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
090ac0a6e0 binpac: Remove already-applied binpac-* patches 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
6034744a0c binpac: Rename files in patches to match current directory structure 2025-08-20 08:52:23 -07:00
Seth Hall
c010152340 binpac: CMAKE_CFG_INTDIR is no longer necessary.
CMake documentation says that CMAKE_CFG_INTDIR is no longer necessary to
find the right binary for the configuration and is in fact deprecated in
recent versions of CMake.
2025-08-20 08:52:23 -07:00
Seth Hall
024b4ff8f3 binpac: Updates for building Zeek as a submodule 2025-08-20 08:52:23 -07:00
Jon Siwek
508e78ebe9 binpac: Prevent use of LeakSanitizer on FreeBSD 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
f365c253a7 binpac: Fix LGTM findings 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
5d75f8ed6c binpac: Remove usage of ZEEK_FORWARD_DECLARE_NAMESPACED macro 2025-08-20 08:52:23 -07:00
Jon Siwek
b1101e6e16 binpac: Fix #include of RE.h to use zeek/RE.h 2025-08-20 08:52:23 -07:00
Jon Siwek
c5fe0eaa17 binpac: GH-14: Use larger temporary storage for evaluating case-expressions
For example:

    inum: uint32 = case (ed & 0x0f) of {
        0x00    -> n_8;  # n_8 is a uint8
        0x01    -> n_16; # n_16 is a uint16
        0x02    -> n_32; # n_32 is a uint32
        default -> 0;
    };

Previously, the temporary storage used for evaluating the
case-expression was based on whatever type the first case yields, which
is a uint8 in the above example.  That behavior can lead to a narrowing
conversion whenever the 0x01 or 0x02 cases occur.

The new behavior is to base the temporary storage's type on the largest
numeric type that the case-expression can yield, which is uint32 in the
above example.
2025-08-20 08:52:23 -07:00
Jon Siwek
11b6feb18b binpac: Update minimum required CMake to 3.5 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
f1d7d0c80d binpac: Move RE_Matcher to zeek namespace 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
cd7a2e9783 binpac: Squash two rules into one with a wildcard 2025-08-20 08:52:23 -07:00
Tim Wojtulewicz
a7f14ed423 binpac: Allow namespaced names as typenames for function return values 2025-08-20 08:52:23 -07:00
Jon Siwek
9de6212dda binpac: Remove use of Variable-Length-Arrays
Related to https://github.com/zeek/zeek/issues/895
2025-08-20 08:52:23 -07:00
Jon Siwek
db7c3d7c5c binpac: Fix incorrect boundary checks in flowbuffer frame length parsing
Incremental flowbuffer parsing sought to first parse the "minimum header
length" required to get the full frame length, possibly from a record
field, but generating the logic to parse that field could greedily
bundle in additional boundary-checks for all subsequent fields of
known-size.

E.g. for flowunit parsing of this:

    type HDR = record {
        version:    uint8;
        reserved:   uint8;
        len:        uint16;
    } &byteorder=bigendian;

    type FOO_PDU(is_orig: bool) = record {
        hdr:        HDR;
        plen:       uint8;
        ptype:      uint8;
        something:  bytestring &restofdata;
    } &byteorder=bigendian, &length=hdr.len;

The flowbuffer was correctly seeking to buffer 4 bytes and parse the
"hdr.len" field, but the generated parsing logic for "hdr.len" included
a boundary check all the way up to include "plen" and "ptype".

This causes out-of-bounds exceptions to be thrown for inputs that should
actually be possible to incrementally parse via flowbuffer.
2025-08-20 08:52:23 -07:00
Jon Siwek
3aad9c74c3 binpac: Disable LeakSanitizer
https://github.com/zeek/zeek/issues/699
2025-08-20 08:52:23 -07:00
Jon Siwek
b2ef28c2e7 binpac: Fix Zeek build for multi-config CMake generators (e.g. Xcode) 2025-08-20 08:52:23 -07:00
Jon Siwek
3cba237e84 binpac: Fix shared library versioning to agree with OpenBSD expectations
OpenBSD shared library names are like "libfoo.so.major.minor" and
binpac was previously letting the post-release number into the name
like "libbinpac.so.0.54-7", which isn't compatible with that scheme.

Related to https://github.com/zeek/zeek/issues/649
2025-08-20 08:52:23 -07:00
Jon Siwek
8b4b74e54a binpac: Move CMake project() after cmake_minimum_required() 2025-08-20 08:52:23 -07:00
Jon Siwek
ef933c9e76 binpac: Fix signed integer overflow in array bounds checks
Array lengths use signed integer storage, so multiplication of that
by the element size for purpose of bounds checking against available
data may produce a signed integer overlow, which is undefined behavior.
2025-08-20 08:52:23 -07:00
Jon Siwek
7632c69566 binpac: Fix a printf format specifier 2025-08-20 08:52:23 -07:00
Daniel Thayer
219dbd0fa3 binpac: More Bro to Zeek renaming 2025-08-20 08:52:23 -07:00
Daniel Thayer
078722fc8d binpac: Rename Bro to Zeek 2025-08-20 08:52:23 -07:00
Jon Siwek
533d823514 binpac: Fix C++11 compatibility issue for older compilers 2025-08-20 08:52:23 -07:00
Jon Siwek
21cf20fc6f binpac: Improve storage type used for case-type index
The type used to store the index for a case-type now tracks the
type of the index expression rather than always using an "int".

The case fields also now have some checking done at code-gen-time to
ensure the constants used for cases does not exceed the numeric limit
of the type used in the case's index expression.  Then, assuming, it
looks safe, the C++ case labels are generated with casts to the type
of the Binpac case's index expression to ensure compilers accept it
(since all Binpac numbers use "int" for storage/printing internally).
2025-08-20 08:52:23 -07:00
Jon Siwek
b4b229acf7 binpac: Add FlowBuffer policy mechanisms
This allows for tunability of the following behaviors:

* Minimum flowbuffer capacity to use when parsing a new unit

* Threshold at which flowbuffer capacity is contracted back to the
  minimum after parsing a complete unit and before parsing the next

* Maximum flowbuffer capacity to allow when parsing a given unit

Failed flowbuffer allocations due to reaching maximum capacity or any
other reason now throw ExceptionFlowBufferAlloc.
2025-08-20 08:52:23 -07:00
Jon Siwek
7e6e24a4d8 binpac: Build binpac shared lib instead of static by default
Related to https://github.com/zeek/zeek/issues/307
2025-08-20 08:52:23 -07:00
Jon Siwek
7bb1a148af binpac: Bump minimum CMake version to 2.8.12 2025-08-20 08:52:23 -07:00
Derek Ditch
2da5fecc16 binpac: Set installdirs using GNUInstallDirs module in CMake 2025-08-20 08:52:23 -07:00
Jon Siwek
1d750aa164 binpac: Replace u_char usages with unsigned char
Improve Alpine (musl) support by not relying on the (technically)
non-standard u_char typedef.
2025-08-20 08:52:23 -07:00
Jon Siwek
46e2490cb0 binpac: Fix array bounds checking
For arrays that are fields within a record, the bounds check was based
on a pointer to the start of the record rather than the start of the
array field.
2025-08-20 08:52:23 -07:00
Jon Siwek
de87adf398 binpac: Update BinPAC_EXE CMake variable to be a full path 2025-08-20 08:52:23 -07:00
Jon Siwek
721ea63a33 binpac: Install headers to alternate path as part of Bro sub-project 2025-08-20 08:52:23 -07:00
Jon Siwek
eea32ada6d binpac: Remove "installation skip" code paths 2025-08-20 08:52:23 -07:00
Jon Siwek
9bb3a94595 binpac: Don't install binpac.h.in 2025-08-20 08:52:23 -07:00
Robin Sommer
c149922d64 binpac: Fix compiler warning. 2025-08-20 08:52:23 -07:00
Jon Siwek
465fd6bd56 binpac: BIT-1829: throw exceptions for negative array length expressions 2025-08-20 08:52:23 -07:00
Jon Siwek
455e2fbac5 binpac: BIT-1829: throw exceptions for excessive array sizes
For arrays with unknown element size, it used to cap the array length to
be the maximum it could be for the given input buffer, assuming 1-byte
elements.  An exception is instead now raised for cases where the
maximum array size (number of elements) exceeds what's possibly in the
buffer.  Using an exception versus capping the length may help prevent
protocol analyzers from unintentionally accessing array indices that
were not actually parsed even if the evauluated-length-expression for
that given array implies it may have been.
2025-08-20 08:52:23 -07:00
Jon Siwek
5a688c2730 binpac: Migrate fmt() usage to strfmt()
The former is easy to misuse by accidentally storing the contents of
the temporary string return value and accessing it later.  There's also
potential pitfalls in changing it to return a pointer into a static
buffer, so instead start using strfmt() uniformly across the codebase
and change some methods to use strings instead of char*.
2025-08-20 08:52:23 -07:00
Jon Siwek
0a05aa92fc binpac: Improve parsing of known-length, static-size arrays
In this case, the bounds checking for individual elements can be
optimized out of the parsing-loop in favor of a single, array-wide
bounds check beforehand.
2025-08-20 08:52:23 -07:00
Jon Siwek
d6fc439c21 binpac: GH-4: fix premature loop termination when parsing known-length arrays
For arrays with a length expression (e.g. uint16[size] instead of
uint16[]), the parsing loop would consider reaching the end of the
data buffer as a successful loop termination condition even if it's
not yet parsed the required number of elements.

Now, for such arrays, the loop will only terminate based on the loop
counter (derived from the length expression) or else it will throw an
OOB exception when trying to parse an element and finding not enough
data in the buffer.

Credit to Tomas Bortoli for reporting the problem and proposing
patches.
2025-08-20 08:52:23 -07:00
Jon Siwek
9c61eefe0d binpac: BIT-1829: fix &length suppressing boundary checks for array elements
It should only suppress the parsing-loop boundary check in the case
where array elaments are a single byte in length and thus covered by
the boundary check (generated as a result of &length) that is placed
before the parsing-loop.
2025-08-20 08:52:23 -07:00
Jon Siwek
39547dccec binpac: BIT-1914: emit deprecation warning for &check usages 2025-08-20 08:52:23 -07:00
Jon Siwek
8a1c8db02e binpac: BIT-1914: move &check implementation to new &enforce attribute
&check returns to being a no-op to avoid unintentionally
breaking existing code.
2025-08-20 08:52:23 -07:00
Jon Siwek
0ecf7755ea binpac: BIT-1914: Implement &check
Patch submitted by Antoine
2025-08-20 08:52:23 -07:00
Jon Siwek
0b84838465 binpac: Fix an uninitialized member warning 2025-08-20 08:52:23 -07:00
giralt
5cfbefca7c binpac: Extends BinPAC to support arbitrary line breakers via &linebreaker attribute
This feature is needed to run the FIX ASCII analyzer: https://github.com/reservoirlabs/fix-ascii
2025-08-20 08:52:23 -07:00
Johanna Amann
827d1ff11e binpac: Fix integer overflow in binpac generated code.
The issue is that t_begin_of_data + %s can sometimes overflow.

Bug reported and patch proposed by
Philippe Antoine <p.antoine@catenacyber.fr> from Catena cyber.
2025-08-20 08:52:23 -07:00
Johanna Amann
e4c168836e binpac: Allow more than one &require attribute on a field.
Patch by François Pennaneach <francois.pennaneach@free.fr>.

BIT-1753 #close
2025-08-20 08:52:23 -07:00
Bryon Gloden, CISSP®
ffe92f487f binpac: Update pac_parse.yy
(error) Memory leak: msgbug

Found by https://github.com/bryongloden/cppcheck
2025-08-20 08:52:23 -07:00
Bartolo Otrit
f1239143cb binpac: Bug fix of pac_swap function with int32 type of argument.
How to reproduce:

>>>code
int32 n = 0xF71B0000;
int32 n1 = pac_swap(n);
code<<<

n1 becomes 0xFFFFFFF7 instead of 0x00001BF7

Reason: Undefined behaviour after bit shift operation because of
negative value of the argument. See C++ standard (2011) 5.8.2 (Shift
operators).
2025-08-20 08:52:23 -07:00
Robin Sommer
d73e3485c1 binpac: Fixing Coverity warning. 2025-08-20 08:52:23 -07:00
Vlad Grigorescu
dc49b0343f binpac: Add a comment in the generated C++ code for fall through in switch
A common BinPAC construct for parsing records is a switch statement,
with no breaks between the cases, as control is expected to fall
through.

Coverity raises an error about this; this commit should fix that.
2025-08-20 08:52:23 -07:00
Seth Hall
a9d294528d binpac: Fixed compiler complaining about recursive function. 2025-08-20 08:52:23 -07:00
Robin Sommer
e3e4453dac binpac: Adding missing include. 2025-08-20 08:52:23 -07:00
Jon Siwek
ae20042943 binpac: BIT-1343: fix %include to work with relative paths 2025-08-20 08:52:23 -07:00
Jon Siwek
ded5abb01e binpac: BIT-1361: Improve boundary checks of records that use &length
Specifying &length on a record no longer skips generating boundary
checks for individual fields.  E.g. a record field that specifies a
&length that extends beyond the &length of the record containing it
should throw binpac::ExceptionOutOfBound, the usual way of handling
out-of-bounds conditions.
2025-08-20 08:52:23 -07:00
Jon Siwek
8648820497 binpac: Fix potential out-of-bounds memory reads in generated code.
Field lengths derived from other data in the input could potentially
lead to reading from outside the bounds of the input buffer.

Reported by John Villamil and Chris Rohlf - Yahoo Paranoids
2025-08-20 08:52:23 -07:00
Jon Siwek
db1c70b32e binpac: Separate declaration of binpac::init from definition.
When friend'ing a global function via qualified-id, Clang complains if
it's not been previously declared.
2025-08-20 08:52:23 -07:00
Robin Sommer
434f147932 binpac: Adding a new binpac::init() function that must be called by the host
before anything else.

Internally, this function compiles all regular expressions, avoiding
to that inside the regexp constructore. The code is a bit hackish due
to the way the regexp code depends on the Bro header.
2025-08-20 08:52:23 -07:00
Jon Siwek
498a5314ed binpac: Request format macros from inttypes.h explicitly.
This helps ensure the availability of PRI* macros from .pac files,
which cannot create this definition themselves since the inclusion
of binpac.h is hardcoded to be placed very early in the generated
code and already includes inttypes.h itself.
2025-08-20 08:52:23 -07:00
Jon Siwek
a5fb8e3787 binpac: Fix uninitialized (or unused) fields. 2025-08-20 08:52:23 -07:00
Jon Siwek
81bf65e148 binpac: Generate initialization code for external types.
Numeric/pointer types can be initialized to 0.
2025-08-20 08:52:23 -07:00
Jon Siwek
201b43f3be binpac: Optimize negative string length check.
Strings with a constant &length expression can be checked for negative
length values while generating the parser instead of in the parser
itself (which likely just ends up being dead code).
2025-08-20 08:52:23 -07:00
Jon Siwek
13e14768da binpac: Add virtual dtor to RefCount base class.
The code generated for types w/ &refcount will subclass RefCount and
Unref definitely deletes via a pointer to that base class so it needs a
virtual dtor.
2025-08-20 08:52:23 -07:00
Jon Siwek
4d7de63ef0 binpac: Add missing break to switch statement case. 2025-08-20 08:52:23 -07:00
Jon Siwek
8136abafef binpac: Remove unreachable code. 2025-08-20 08:52:23 -07:00
Jon Siwek
5e0f604418 binpac: Add missing va_end()'s to match va_start()'s.
Probably not an issue on most implementations, but undefined behavior
is scary and it's easy to fix.
2025-08-20 08:52:23 -07:00
Jon Siwek
cb524c2fde binpac: Fix two use-after-free bugs. 2025-08-20 08:52:23 -07:00
Jon Siwek
871541e636 binpac: Fix double-free.
The field is deleted by a base class dtor.
2025-08-20 08:52:23 -07:00
Robin Sommer
61cc83affa binpac: Adding an interface to manually control the buffering for generated
parsers.

This consists of two parts:

    1. The generated Flow classes expose their flow buffers via a new
       method flow_buffer().

    2. Flow buffers get two new methods:

        // Interface for delayed parsing. Sometimes BinPAC doesn't get the
        // buffering right and then one can use these to feed parts
        // individually and assemble them internally. After calling
        // FinishBuffer(), one can send the uppper-layer flow an FlowEOF()
        // to trigger parsing.
        void BufferData(const_byteptr data, const_byteptr end);
        void FinishBuffer();
2025-08-20 08:52:23 -07:00
Jon Siwek
ce2b56751b binpac: Fix an exception slicing issue in binpac generated cleanup code.
Switch to using a no-argument throw to preserve the dynamic type of
the binpac exception.  Otherwise, the exception is "sliced" and can only
be subsequently handled as binpac::Exception and not a derived type.
2025-08-20 08:52:23 -07:00
Jon Siwek
14e3d5a1a3 binpac: Add scoping to usages of binpac::Exception classes in generated code.
This allows analyzers to define their own types of the same name
without mistakingly overshadowing the usages of binpac::Exception
and its derived types in the generated parser code.
2025-08-20 08:52:23 -07:00
Robin Sommer
6c70f7851b binpac: Silence warning for generated code when compiling with clang. 2025-08-20 08:52:23 -07:00
Jon Siwek
8cf0be6d0f binpac: Change binpac.h integral typedefs and reimplement 64-bit pac_swap().
Integer types now use <inttypes.h>, and the 64-bit byte-swapping
function uses a union approach instead of masking/bit-shifting.

Addresses #761.
2025-08-20 08:52:23 -07:00
Jon Siwek
bf2184bb0f binpac: Raise minimum required CMake version to 2.6.3 2025-08-20 08:52:23 -07:00
Robin Sommer
fccf3a7340 binpac: Distribution cleanup. 2025-08-20 08:52:23 -07:00
Robin Sommer
092d049f8e binpac: Arrays now suport the &transient attribute.
If set, parsed elements won't actually be added to the array, and read
access to the array aren't permitted. This is helpful to save memory
in the case of large arrays for which elements don't need (or can't)
be buffered.
2025-08-20 08:52:23 -07:00
Jon Siwek
5db7ba4050 binpac: Update to use cmake submodule 2025-08-20 08:52:23 -07:00
Jon Siwek
969998d148 binpac: Remove $Id$ tags 2025-08-20 08:52:23 -07:00
Jon Siwek
3841c68d87 binpac: Install binaries with an RPATH 2025-08-20 08:52:23 -07:00
Jon Siwek
a4f05185d6 binpac: Workaround for FreeBSD CMake port missing debug flags 2025-08-20 08:52:23 -07:00
Robin Sommer
77e4315a57 binpac: Fixing compiler warning 2025-08-20 08:52:23 -07:00
Seth Hall
1d6cea8c52 binpac: Adding int64 and uint64 types to binpac. 2025-08-20 08:52:23 -07:00
Jon Siwek
50f5a913c3 binpac: Adding files to CMake build targets so they show up in generated IDE projects.
This addresses #413.
2025-08-20 08:52:23 -07:00
Robin Sommer
d41a2def5a binpac: Fixing crash with undefined case expressions.
Found by Emmanuele Zambon.
2025-08-20 08:52:23 -07:00
Jon Siwek
e7e2ee38e7 binpac: Add explicit CMake check for compiler 2025-08-20 08:52:23 -07:00
Seth Hall
1a15b968e6 binpac: Added an option to quiet the status output from binpac.
This adds the -q command line flag to quiet the output.
It also fixes a small compiler warning.
2025-08-20 08:52:23 -07:00
Jon Siwek
c2dbefab17 binpac: MacPorts & Fink paths now prepended to default search prefixes 2025-08-20 08:52:23 -07:00
Jon Siwek
2260d6c60e binpac: Add warning when building and installing are done by different users 2025-08-20 08:52:22 -07:00
Jon Siwek
4dd640d0f7 binpac: CMake 2.6 compatibility changes 2025-08-20 08:52:22 -07:00
Robin Sommer
71cc7e9d5b binpac: Cleaning up. 2025-08-20 08:52:22 -07:00
Jon Siwek
67e5bc7198 binpac: Made uninstall target cooperate with other projects 2025-08-20 08:52:22 -07:00
Jon Siwek
aacc6ee043 binpac: Added uninstall target 2025-08-20 08:52:22 -07:00
Jon Siwek
ed7e697d35 binpac: Changed default CMAKE_BUILD_TYPE to RelWithDebInfo
The --enable-debug option of the configure wrapper changes it to Debug.
Removed --enable-release option of the configure wrapper.
2025-08-20 08:52:22 -07:00
Jon Siwek
32423cf27b binpac: Customizable error messages for missing prereqs.
Adds the FindRequiredPackage() macro that wraps the functionality
of the standard find_package() macro.
2025-08-20 08:52:22 -07:00
Jon Siwek
173c3784ab binpac: Prepend build dir to search path.
This avoids inclusion of conflicting superproject config.h.
2025-08-20 08:52:22 -07:00
Jon Siwek
6b1b6b178a binpac: configure now writes directly to CMakeCache.txt
The intermediate BuildOptions.cmake file is no longer needed.
2025-08-20 08:52:22 -07:00
Jon Siwek
8366dd6bcb binpac: Minor style changes. 2025-08-20 08:52:22 -07:00
Jon Siwek
32db4e4447 binpac: CMake module path adjustment.
To allow inclusion from a superproject.
2025-08-20 08:52:22 -07:00
Jon Siwek
a05eb8b150 binpac: Added configure script to wrap cmake functionality 2025-08-20 08:52:22 -07:00
Jon Siwek
92f936fdb8 binpac: Added headers to install target.
Also set some convenience variables that mimic what a FindBinPAC
module would set.  These could be used by a superproject that
wants to decide whether to use an existing BinPAC installation
or (re)build from source.
2025-08-20 08:52:22 -07:00
Jon Siwek
47c64d7fed binpac: Changes to add an install target. 2025-08-20 08:52:22 -07:00
Jon Siwek
4644605860 binpac: Added debug/release mode compiler flags and build summary output. 2025-08-20 08:52:22 -07:00
Jon Siwek
0944e3619c binpac: Added bison flag for verbose output. 2025-08-20 08:52:22 -07:00
Jon Siwek
9d7d6f8868 binpac: Two small changes:
- Moved find_package() calls up to top directory so failure can occur
  right away if any dependencies are missing
- Got rid of a bunch of header checks and preprocessor definitions that
  aren't ever used; not sure why I had them there in the first place
2025-08-20 08:52:22 -07:00
Jon Siwek
677ae82203 binpac: Changes to the config.h generation.
- Renamed VERSION preprocessor definition to not conflict with Bro's.
- Removed check for HAVE_CONFIG_H; config.h will always be generated in the
  binpac build directory, but if a parent directory has generated a config.h
  and added that to compiler include search paths via include_directories(),
  then that one should be used -- include_directories() appends paths by
  default and the parent CMakeLists.txt will have called it first.
2025-08-20 08:52:22 -07:00
Jon Siwek
73a67f0ae3 binpac: Removed unnecessary subdir for custom CMake modules. 2025-08-20 08:52:22 -07:00
Jon Siwek
65668d3ea6 binpac: Initial, working CMake build added. 2025-08-20 08:52:22 -07:00
Jon Siwek
c8665318e6 binpac: Initial import of Bro's binpac subdirectory from SVN r7088. 2025-08-20 08:52:22 -07:00
Evan Typanski
5a1c4fd5fe Merge remote-tracking branch 'origin/topic/etyp/coverity-attr'
* origin/topic/etyp/coverity-attr:
  Fix Coverity issue with new `Attributes` ctor
2025-08-20 11:38:43 -04:00
Evan Typanski
111583602e Fix Coverity issue with new Attributes ctor 2025-08-20 08:28:18 -04:00
Tim Wojtulewicz
8632d79775 Merge remote-tracking branch 'origin/topic/timw/ci-centos9-newer-python'
* origin/topic/timw/ci-centos9-newer-python:
  CI: Update CentOS 9 to Python 3.13
2025-08-19 15:08:45 -07:00
Arne Welzel
cf8a54b3df Merge remote-tracking branch 'origin/topic/awelzel/no-null-strings-in-threading-vals'
* origin/topic/awelzel/no-null-strings-in-threading-vals:
  logging/Manager: Also pass non-null vector and set
  logging/Manager: Non-null strings for empty strings
2025-08-19 20:27:46 +02:00
Arne Welzel
c44ce78591 logging/Manager: Also pass non-null vector and set
Primarily to align with strings and also to keep the plugin
API the same.
2025-08-19 20:04:08 +02:00
Arne Welzel
247931f2df logging/Manager: Non-null strings for empty strings
After #4724, empty strings would result in nullptrs being stored in the
threading::Value's string_val.data field instead of a valid pointer to
an empty strings. This upsets UBSAN's  nonnull check for memcpy()

    [01:29:45.807]   ../../src/SerializationFormat.cc:80:33: runtime error: null pointer passed as argument 2, which is declared to never be null
    [01:29:45.807]   /usr/include/string.h:44:28: note: nonnull attribute specified here
    [01:29:45.807]       #0 0x5b2e9c933a3f in zeek::detail::SerializationFormat::WriteData(void const*, unsigned long) /zeek/build/src/../../src/SerializationFormat.cc:80:5
    [01:29:45.807]       #1 0x5b2e9c935184 in zeek::detail::BinarySerializationFormat::Write(char const*, int, char const*) /zeek/build/src/../../src/SerializationFormat.cc:371:40

Continue to allocate the empty string for now as a fix.
2025-08-19 20:03:23 +02:00
Tim Wojtulewicz
963ee89528 CI: Update CentOS 9 to Python 3.13 2025-08-19 10:43:40 -07:00
Johanna Amann
8d89e035fd Merge remote-tracking branch 'origin/topic/johanna/ci_for_ubuntu_25_04_instead_of_ubuntu_24_10_because_that_one_is_at_eol'
* origin/topic/johanna/ci_for_ubuntu_25_04_instead_of_ubuntu_24_10_because_that_one_is_at_eol:
  CI: Ubuntu 24.10 is eol, add Ubuntu 25.04
2025-08-19 15:23:20 +01:00
Johanna Amann
721ff91ac0 CI: Ubuntu 24.10 is eol, add Ubuntu 25.04 2025-08-19 09:12:51 +01:00
zeek-bot
f6a369ec2b Update doc submodule [nomail] [skip ci] 2025-08-19 00:37:30 +00:00
Tim Wojtulewicz
7514f7c038 Merge remote-tracking branch 'origin/topic/timw/add-missing-cluster-serializer-header'
* origin/topic/timw/add-missing-cluster-serializer-header:
  Add a missing header for the broker cluster serializer
2025-08-18 14:59:50 -07:00
Tim Wojtulewicz
177a45f71c Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump auxil/spicy to latest development snapshot
2025-08-18 14:47:14 -07:00
Tim Wojtulewicz
18b3303b54 Add a missing header for the broker cluster serializer 2025-08-18 14:00:24 -07:00
Evan Typanski
59e84e06f6 Merge remote-tracking branch 'origin/topic/etyp/fix-optional-attr-errors'
* origin/topic/etyp/fix-optional-attr-errors:
  Fix parameter attributes pretending to be records
  Only allow `&optional` in records
2025-08-18 14:49:56 -04:00
Tim Wojtulewicz
644d480afd Update docs submodule [nomail] [skip ci] 2025-08-18 10:03:50 -07:00
Tim Wojtulewicz
a4da8d3f7b Merge remote-tracking branch 'origin/topic/etyp/update-news-record-vec-deprecation'
* origin/topic/etyp/update-news-record-vec-deprecation:
  Add `record_type_to_vector` deprecation to NEWS
2025-08-18 09:40:50 -07:00
Evan Typanski
acd885b9f3 Add record_type_to_vector deprecation to NEWS 2025-08-18 11:58:51 -04:00
Arne Welzel
9b94e25e67 Merge remote-tracking branch 'origin/topic/awelzel/4754-follow-up'
* origin/topic/awelzel/4754-follow-up:
  cluster/serializer/broker: Drop unused include
  cluster/serializer/broker: fixup inconsistent param comment
2025-08-18 16:44:43 +02:00
Arne Welzel
8d0a942101 cluster/serializer/broker: Drop unused include 2025-08-18 14:52:21 +02:00
Arne Welzel
f4e7c4afe8 cluster/serializer/broker: fixup inconsistent param comment
Thanks clang-tidy.

References #4754 #4756
2025-08-18 14:51:40 +02:00
Arne Welzel
2c9015d247 Merge branch 'master' of https://github.com/blightzero/zeek
* 'master' of https://github.com/blightzero/zeek:
  Changed behavior of var-extraction-uri.zeek from policy/protocol/http to extract only the URI parameter names. Do not include the path in the first parameter name. Only extract uri vars if parameters actually exist.
2025-08-18 13:14:34 +02:00
Benjamin Bannier
e9203de4d8 Bump auxil/spicy to latest development snapshot 2025-08-18 12:59:25 +02:00
Arne Welzel
e04f725523 Merge remote-tracking branch 'amazing-pp/t/psql-login-no-role'
* amazing-pp/t/psql-login-no-role:
  Report PostgreSQL login success only after ReadyForQuery
2025-08-18 09:40:22 +02:00
Fupeng Zhao
e4e56789db
Report PostgreSQL login success only after ReadyForQuery
Previously, Zeek treated the receipt of `AuthenticationOk` as a
successful login. However, according to the PostgreSQL
Frontend/Backend Protocol, the startup phase is not complete until
the server sends `ReadyForQuery`. It is still possible for the server
to emit an `ErrorResponse` (e.g. ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION)
after `AuthenticationOk` but before `ReadyForQuery`.

This change updates the PostgreSQL analyzer to defer reporting login
success until `ReadyForQuery` is observed. This prevents false
positives in cases where authentication succeeds but session startup
fails.
2025-08-18 10:59:44 +08:00
Arne Welzel
c0a863cba0 Merge remote-tracking branch 'origin/topic/vern/stmt-line-numbers'
* origin/topic/vern/stmt-line-numbers:
  maintenance updates for ZAM BiF-tracking
  fix line numbers associated with "if" and initialization statements
2025-08-17 17:29:09 +02:00
Arne Welzel
3d6a064ecc Merge remote-tracking branch 'origin/topic/awelzel/4754-double-wrapped-broker-data-records'
* origin/topic/awelzel/4754-double-wrapped-broker-data-records:
  cluster/serializer/broker: Do not special case Broker::Data anymore
  broker/Data: Support unwrapping Broker::Data records
2025-08-17 16:57:28 +02:00
Arne Welzel
f57a1263d4 cluster/serializer/broker: Do not special case Broker::Data anymore
The previous approach ignored the fact that nested / inner values might
also be Broker::Data values. I'm not super sure about the validity of
the test, because it's essentially demonstrating any-nesting, but
it's not leading to extra Broker::Data encoding.
2025-08-17 16:56:20 +02:00
Arne Welzel
9e70d8b8ad broker/Data: Support unwrapping Broker::Data records
Calling val_to_data() on a Broker::Data ends up wrapping the
Broker::Data record instead of using the contained broker::value
directly.

Seems this should be the default behavior and wonder if the flag
even makes sense, but for a 8.0 backport that seems more reasonable.
2025-08-17 16:56:20 +02:00
Vern Paxson
5b74b3d0ac maintenance updates for ZAM BiF-tracking 2025-08-16 14:10:17 -07:00
Vern Paxson
46d0b55417 fix line numbers associated with "if" and initialization statements 2025-08-16 14:09:32 -07:00
Tim Wojtulewicz
a3983cc939 Merge remote-tracking branch 'origin/revert-4746-topic/timw/move-submodules-to-main-repo'
* origin/revert-4746-topic/timw/move-submodules-to-main-repo:
  Revert "Move BinPAC, bifcl, af_packet, and gen_zam submodules into main zeek repo"
2025-08-15 15:21:12 -07:00
Tim Wojtulewicz
e64ec54172
Revert "Move BinPAC, bifcl, af_packet, and gen_zam submodules into main zeek repo" 2025-08-15 15:11:22 -07:00
Tim Wojtulewicz
a10a70994e Merge remote-tracking branch 'origin/topic/timw/move-submodules-to-main-repo'
* origin/topic/timw/move-submodules-to-main-repo:
  Fix some clang-tidy findings in generated BIF code
  Fix clang-tidy and pre-commit warnings for gen-zam code files
  Move gen-zam code into the main Zeek repository
  Move zeek-af_packet-plugin code into the main Zeek repository
  Move the bifcl code into the main Zeek repository
  Fix clang-tidy findings in the binpac lib code
  Add copyright headers to all of the binpac source files
  Move binpac code into the main Zeek repository
2025-08-15 14:02:23 -07:00
Tim Wojtulewicz
a1f5f0a40e Fix some clang-tidy findings in generated BIF code 2025-08-15 13:57:27 -07:00
Tim Wojtulewicz
f194b14727 Fix clang-tidy and pre-commit warnings for gen-zam code files 2025-08-15 13:57:27 -07:00
Tim Wojtulewicz
8f918dab47 Move gen-zam code into the main Zeek repository
This is based on commit 56a6db00b887c79d26f303676677cb490d1c296d from
the gen-zam repository.
2025-08-15 13:57:27 -07:00
Tim Wojtulewicz
5ccf64102b Move zeek-af_packet-plugin code into the main Zeek repository
This is based on commit b89a6f64123f778090d1dd6ec48e6b8e8906ea11 from
the zeek-af_packet-plugin repository.
2025-08-15 13:57:27 -07:00
Tim Wojtulewicz
68926faf47 Move the bifcl code into the main Zeek repository
This is based on commit 5947749f7850b075f11d6a2aaefe7dad4f63cb62f from
the bifcl repository.
2025-08-15 13:57:27 -07:00
Tim Wojtulewicz
cd1414ab69 Fix clang-tidy findings in the binpac lib code 2025-08-15 13:57:27 -07:00
Tim Wojtulewicz
4ae8bb856d Add copyright headers to all of the binpac source files 2025-08-15 13:57:27 -07:00
Tim Wojtulewicz
ff26835976 Move binpac code into the main Zeek repository
This is based on commit 48f75b5f6415fe9d597e3e991cec635b1bc400dc from
the binpac repository.
2025-08-15 13:57:27 -07:00
Evan Typanski
4445bc1daf Fix parameter attributes pretending to be records
Parameters relied on is_record for a couple of validations, but they are
not records and should not be treated as such. This way we can validate
&optional better.
2025-08-14 12:00:15 -04:00
Evan Typanski
4e5a56c5e0 Only allow &optional in records
There was some confusing behavior with &optional and locals, so this
should get rid of that by making it an error. However, there is a case
where function parameters are still allowed to have &optional - this is
because there are checks for &default in parameters as well.
2025-08-14 11:38:19 -04:00
zeek-bot
a2680d5eca Update doc submodule [nomail] [skip ci] 2025-08-14 00:25:34 +00:00
Benjamin Grap
fafc0212a5 Changed behavior of var-extraction-uri.zeek from policy/protocol/http to extract only the URI parameter names. Do not include the path in the first parameter name. Only extract uri vars if parameters actually exist. 2025-08-13 22:45:20 +02:00
Arne Welzel
63574b9fd4 Merge remote-tracking branch 'origin/topic/awelzel/docker-trixie'
* origin/topic/awelzel/docker-trixie:
  ci: Run zeekctl and builtin tasks with Debian 13, too
  ci: Prepend timestamps to output
  ci: Enable Spicy for arm_debian13
  ci: Add Debian 13.0 (trixie)
  docker: Bump to debian:trixie-slim
2025-08-13 21:21:16 +02:00
Arne Welzel
b346418856 ci: Run zeekctl and builtin tasks with Debian 13, too 2025-08-13 20:42:20 +02:00
Arne Welzel
80ecaf491c ci: Prepend timestamps to output 2025-08-13 20:37:19 +02:00
Arne Welzel
3e4c2c0288 ci: Enable Spicy for arm_debian13 2025-08-13 20:37:19 +02:00
Arne Welzel
ccd4a2935c ci: Add Debian 13.0 (trixie) 2025-08-13 20:37:16 +02:00
Arne Welzel
91afdd03b8 docker: Bump to debian:trixie-slim 2025-08-13 20:37:14 +02:00
Tim Wojtulewicz
75ba63eb3f Merge remote-tracking branch 'origin/topic/timw/limit-string-and-container-lengths-in-logs'
* origin/topic/timw/limit-string-and-container-lengths-in-logs:
  Add NEWS entry for field length limiting
  Tag truncated values with a flag, plus pack threading::Value better
  Remove length limiting on string fields for HTTP
  Make total_size counter a member in logging::Manager
  Remove using numeric_limits and just check for zero instead
  Expand the size of the log-size filters for x509
  Add options to filter at the stream level as well as globally
  Add a weird that gets emitted when strings/containers are over the limits
  Add metrics to track string and container fields limited by length
  Replace unused stream argument from RecordToLogRecord with WriterInfo
  Implement string- and container-length filtering at the log record level
2025-08-12 17:43:02 -07:00
Tim Wojtulewicz
a1c201fb8f Add NEWS entry for field length limiting 2025-08-12 17:31:29 -07:00
Tim Wojtulewicz
39814816af Tag truncated values with a flag, plus pack threading::Value better 2025-08-12 17:31:29 -07:00
Tim Wojtulewicz
c8818d76bd Remove length limiting on string fields for HTTP 2025-08-12 17:31:29 -07:00
Tim Wojtulewicz
29425688da Make total_size counter a member in logging::Manager 2025-08-12 17:31:29 -07:00
Tim Wojtulewicz
98a77b5f25 Remove using numeric_limits and just check for zero instead 2025-08-12 17:31:29 -07:00
Tim Wojtulewicz
8a4bc084f9 Expand the size of the log-size filters for x509 2025-08-12 17:31:28 -07:00
Tim Wojtulewicz
0ec2161b04 Add options to filter at the stream level as well as globally 2025-08-12 17:31:28 -07:00
Tim Wojtulewicz
339d46ae26 Add a weird that gets emitted when strings/containers are over the limits 2025-08-12 17:31:28 -07:00
Tim Wojtulewicz
837fde1a08 Add metrics to track string and container fields limited by length 2025-08-12 17:31:28 -07:00
Tim Wojtulewicz
cd74a4e138 Replace unused stream argument from RecordToLogRecord with WriterInfo
This also adds a WriterInfo argument to ValToLogVal and passes the one from
RecordToLogRecord into it.
2025-08-12 17:31:28 -07:00
Tim Wojtulewicz
e2e7ab28da Implement string- and container-length filtering at the log record level 2025-08-12 17:31:28 -07:00
Tim Wojtulewicz
cc59bfa5d8 Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump pre-commit hooks
  Bump auxil/spicy to latest development snapshot
2025-08-12 12:38:51 -07:00
Tim Wojtulewicz
d9357b4204 Merge remote-tracking branch 'origin/topic/timw/remove-8.1-deprecations'
* origin/topic/timw/remove-8.1-deprecations:
  Pass DNS complete_flag along as a uint8_t instead of a String
  Update docs submodule with 8.1 deprecation removals
  Update zeekjs submodule with 8.1 deprecation fixes
  Remove deprecations tagged for v8.1
2025-08-12 11:01:29 -07:00
Tim Wojtulewicz
f1d69df165 Pass DNS complete_flag along as a uint8_t instead of a String 2025-08-12 11:00:40 -07:00
Tim Wojtulewicz
73c9a1f3d9 Update docs submodule with 8.1 deprecation removals 2025-08-12 11:00:40 -07:00
Tim Wojtulewicz
cdba3c601f Update zeekjs submodule with 8.1 deprecation fixes 2025-08-12 10:19:03 -07:00
Tim Wojtulewicz
d95affde4d Remove deprecations tagged for v8.1 2025-08-12 10:19:03 -07:00
Benjamin Bannier
62e742aa3b Bump pre-commit hooks 2025-08-12 17:49:42 +02:00
Benjamin Bannier
5465a1c312 Bump auxil/spicy to latest development snapshot 2025-08-12 17:47:40 +02:00
zeek-bot
e4dab3dded Update doc submodule [nomail] [skip ci] 2025-08-12 00:44:57 +00:00
Tim Wojtulewicz
76289a8022 Merge remote-tracking branch 'origin/topic/awelzel/4730-smb-read-response-data-offset'
* origin/topic/awelzel/4730-smb-read-response-data-offset:
  smb2/read: Parse only 1 byte for data_offset, ignore reserved1
2025-08-11 11:37:38 -07:00
Tim Wojtulewicz
dff534962e Merge remote-tracking branch 'origin/topic/timw/docs-generation-virtualenv'
* origin/topic/timw/docs-generation-virtualenv:
  Update docs submodule with new python packages
  Use virtualenv in docs generation/builds
2025-08-10 21:28:48 -07:00
Tim Wojtulewicz
302f6f2787 Update docs submodule with new python packages 2025-08-10 21:21:41 -07:00
Tim Wojtulewicz
ef055ddb7c Use virtualenv in docs generation/builds 2025-08-08 20:38:31 -07:00
Arne Welzel
b2a2ad7e10 smb2/read: Parse only 1 byte for data_offset, ignore reserved1
A user provided a SMB2 pcap with the reserved1 field of a ReadResponse
set to 1 instead of 0. This confused the padding computation due to
including this byte into the offset. Properly split data_offset and
reserved1 into individual byte fields.

Closes #4730
2025-08-08 16:12:20 +02:00
Arne Welzel
13f613eb1d Merge remote-tracking branch 'origin/topic/awelzel/4176-cluster-on-sub-unsub-hooks'
* origin/topic/awelzel/4176-cluster-on-sub-unsub-hooks:
  cluster: Add on_subscribe() and on_unsubscribe() hooks
2025-08-08 14:24:18 +02:00
Tim Wojtulewicz
54d67c3322 Merge remote-tracking branch 'origin/topic/timw/cleanup-warnings-from-plugin-btest-builds'
* origin/topic/timw/cleanup-warnings-from-plugin-btest-builds:
  Update zeek-aux to remove BRO_DIST from plugin skeleton
  cmake_minimum_required() should come before project()
2025-08-07 08:39:40 -07:00
Tim Wojtulewicz
162ecc022e Update zeek-aux to remove BRO_DIST from plugin skeleton 2025-08-07 08:39:08 -07:00
Arne Welzel
bd9130a69a Merge remote-tracking branch 'origin/topic/awelzel/tap-analyzer-take-four-thanks-clang-tidy'
* origin/topic/awelzel/tap-analyzer-take-four-thanks-clang-tidy:
  btest/tap-analyzer: Update existing test and add new one for UpdateConnVal()
  SessionAdapter: Keep tap_analyzers until destruction
  tcp,udp,icmp adapters: Move TapPacket() to earlier
  tcp,udp,icmp adapters: Fix UpdateConnVal() superclass call
2025-08-07 10:49:12 +02:00
Tim Wojtulewicz
3c535ec215 cmake_minimum_required() should come before project() 2025-08-06 12:10:41 -07:00
Arne Welzel
f98508bbb0 btest/tap-analyzer: Update existing test and add new one for UpdateConnVal()
This also changes the output of connection UIDs from the tap analyzer to be
prefixed with C for easier correlation with other logs.

Relates to #4337 #4725 #4734 #4737
2025-08-06 17:22:59 +02:00
Arne Welzel
bdff2935a4 SessionAdapter: Keep tap_analyzers until destruction
connection_state_remove() is invoked after Done(), so it's not a good
idea to remove the tap analyzers before in case they have up-to-date
information for the connection val.

Relates to #4337 #4725 #4734 #4737
2025-08-06 17:22:55 +02:00
Arne Welzel
ee93213d39 tcp,udp,icmp adapters: Move TapPacket() to earlier
Writing a test, the packet was tapped after protocol analysis at least
for TCP. Ensure tapping happens before. The adapter->Process() moving
after pkt->session made me a bit wondering if things are underspecified
here, but seems reasonable to set the session on pkt before adapter->Process().

Relates to #4337 #4725 #4734 #4737
2025-08-06 17:22:51 +02:00
Arne Welzel
9d7cfcbce3 tcp,udp,icmp adapters: Fix UpdateConnVal() superclass call
Now that SessionAdapter implements UpdateConnVal(), the individual
adapters need to call that instead of Analyzer::UpdateConnVal()

Thanks clang-tidy.

Relates to #4337 #4725 #4734 #4737
2025-08-06 17:22:44 +02:00
Johanna Amann
2f2f328a72 Merge remote-tracking branch 'origin/topic/johanna/analyzer-log-proto'
* origin/topic/johanna/analyzer-log-proto:
  Add proto to analyzer.log
2025-08-06 14:38:47 +01:00
Evan Typanski
22f77248f5 Merge remote-tracking branch 'origin/topic/etyp/fix-record-vec-type-conflict'
* origin/topic/etyp/fix-record-vec-type-conflict:
  Fix record coercion with compatible types
2025-08-06 09:10:19 -04:00
Arne Welzel
33b6869425 Merge remote-tracking branch 'origin/topic/awelzel/tap-analyzer-take-three'
* origin/topic/awelzel/tap-analyzer-take-three:
  TapAnalyzer: Fix docstring
  btest/plugins/tap-analyzer: Update baseline
2025-08-06 14:27:56 +02:00
Arne Welzel
ce7c394af1 TapAnalyzer: Fix docstring
Relates to #4337 #4725 #4734
2025-08-06 14:19:40 +02:00
Arne Welzel
ac776b0aad btest/plugins/tap-analyzer: Update baseline
Relates to #4337 #4725 #4734
2025-08-06 14:17:42 +02:00
Johanna Amann
82266b1e78 Add proto to analyzer.log
The analyzer.log file was missing the protocol field to distinguish
tcp/udp connections.
2025-08-06 11:34:57 +01:00
Arne Welzel
7dea987432 Merge remote-tracking branch 'origin/topic/awelzel/4337-tap-analyzer-follow-up'
* origin/topic/awelzel/4337-tap-analyzer-follow-up:
  TapAnalyzer: More verdict to action rename
2025-08-05 20:00:44 +02:00
Arne Welzel
b4925fbd16 TapAnalyzer: More verdict to action rename
Relates to #4725 #4337
2025-08-05 19:59:06 +02:00
Arne Welzel
1e05588e8e Merge remote-tracking branch 'origin/topic/awelzel/4337-tap-analyzer-sketch'
* origin/topic/awelzel/4337-tap-analyzer-sketch:
  IPBasedAnalyzer: Call TapPacket() when skipping
  SessionAdapter: Introduce TapAnalyzer for session adapter
2025-08-05 19:49:01 +02:00
Arne Welzel
4bc7f9532c IPBasedAnalyzer: Call TapPacket() when skipping
When skip_further_processing() is called, a TapAnalyzer should still see
the packets as skipped with SkipReason "skipping".
2025-08-05 19:47:04 +02:00
Arne Welzel
dc904b2216 SessionAdapter: Introduce TapAnalyzer for session adapter
This commit introduces a mechanism to attach light weight analyzers to
the root analyzer of sessions in order to tap into the packets delivered
to child analyzer.
2025-08-05 19:47:02 +02:00
Evan Typanski
006bef71b5 Fix record coercion with compatible types
Fixes #4722
2025-08-04 17:09:26 -04:00
Christian Kreibich
56325d1412 Merge branch 'topic/christian/zeek-8.0-news'
* topic/christian/zeek-8.0-news:
  Compile contributors for Zeek 8.0 in the NEWS file
2025-08-04 09:35:53 -07:00
Christian Kreibich
4fdd83f3f5 Compile contributors for Zeek 8.0 in the NEWS file 2025-08-04 09:32:58 -07:00
Tim Wojtulewicz
6afeeca090 Start of 8.1.0 development 2025-08-04 08:26:29 -07:00
Arne Welzel
4ecc62322e Merge remote-tracking branch 'origin/topic/awelzel/depend-on-libzmq'
* origin/topic/awelzel/depend-on-libzmq:
  ci/windows: No ZeroMQ cluster backend
  cluster/zeromq: Bail on missing ZeroMQ by default
2025-08-01 17:10:32 +02:00
Arne Welzel
3c2d01e19e Merge remote-tracking branch 'origin/topic/neverlord/std-span'
* origin/topic/neverlord/std-span:
  Remove zeek::Span and use std::span instead
2025-08-01 14:50:02 +02:00
Arne Welzel
1a87ebab72 cluster: Add on_subscribe() and on_unsubscribe() hooks
Closes #4176
2025-08-01 14:06:19 +02:00
Arne Welzel
7a68208ecf ci/windows: No ZeroMQ cluster backend
Doesn't seems there's libzmq available, so just skip building.
2025-08-01 10:17:13 +02:00
Arne Welzel
993502e0b6 cluster/zeromq: Bail on missing ZeroMQ by default 2025-08-01 09:46:06 +02:00
zeek-bot
aabb36abf7 Update doc submodule [nomail] [skip ci] 2025-08-01 00:28:48 +00:00
Tim Wojtulewicz
f2e155d7fa Merge remote-tracking branch 'origin/topic/timw/update-ct-ca-lists'
* origin/topic/timw/update-ct-ca-lists:
  Update CT/CA lists to versions from NSS 3.114
2025-07-31 14:32:21 -07:00
Tim Wojtulewicz
528f0d9766 Merge remote-tracking branch 'origin/topic/timw/update-submodules-ahead-of-8.0'
* origin/topic/timw/update-submodules-ahead-of-8.0:
  Updating submodule(s) [nomail]
2025-07-31 14:29:48 -07:00
Tim Wojtulewicz
1daead9edd Update CT/CA lists to versions from NSS 3.114 2025-07-31 11:34:23 -07:00
Tim Wojtulewicz
74a3fe5856 Updating submodule(s) [nomail] 2025-07-31 10:37:45 -07:00
Tim Wojtulewicz
b9a5a635bd Merge remote-tracking branch 'origin/topic/timw/clang-tidy-fix'
* origin/topic/timw/clang-tidy-fix:
  Fix use-after-move reported by clang-tidy
2025-07-31 10:34:58 -07:00
Tim Wojtulewicz
647da4f970 Fix use-after-move reported by clang-tidy
This was introduced by 9eb94ee151.
2025-07-31 09:55:43 -07:00
Johanna Amann
136bdb43fd Merge remote-tracking branch 'origin/topic/johanna/gh-4694'
* origin/topic/johanna/gh-4694:
  Add tests for the deprecated-dpd-log.zeek policy script
  Move c$service_violation to deprecated-dpd-log.zeek
2025-07-31 16:11:00 +01:00
Tim Wojtulewicz
3e0012ea30 Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump `auxil/spicy` to latest development snapshot
2025-07-31 07:58:05 -07:00
Benjamin Bannier
c0ce3f19fb Bump auxil/spicy to latest development snapshot 2025-07-31 13:47:32 +02:00
zeek-bot
defc0c96d8 Update doc submodule [nomail] [skip ci] 2025-07-31 00:18:15 +00:00
Arne Welzel
10e7f14f78 Merge remote-tracking branch 'origin/topic/awelzel/defer-more-stuff'
* origin/topic/awelzel/defer-more-stuff:
  RecordType: Ensure &default fields are always re-initialized
  Attr: Deprecate using &default and &optional together on record fields
  RecordType: Allow deferring &default=vector(), set(), table() fields
2025-07-30 10:35:56 +02:00
Arne Welzel
9eb94ee151 RecordType: Ensure &default fields are always re-initialized
This started working partly after the deferral logic introduced with
Zeek 6.0 so this finishes it :-)
2025-07-30 10:26:06 +02:00
Arne Welzel
473723cc47 Attr: Deprecate using &default and &optional together on record fields
If &default implies re-initialization of the field, using them together
doesn't make much sense.
2025-07-30 10:26:06 +02:00
Arne Welzel
23181e4811 RecordType: Allow deferring &default=vector(), set(), table() fields 2025-07-30 10:26:06 +02:00
Arne Welzel
d7fbd49d9e Merge remote-tracking branch 'origin/topic/vern/zam-record-fields-fixes'
* origin/topic/vern/zam-record-fields-fixes:
  fixes for specialized ZAM operations needing to check whether record fields exist
2025-07-30 10:08:21 +02:00
Johanna Amann
a90969800c Add tests for the deprecated-dpd-log.zeek policy script
This re-adds baselines for the old dpd.log to check functionality until
its removal in 8.1
2025-07-30 07:58:36 +01:00
Johanna Amann
8de178d923 Move c$service_violation to deprecated-dpd-log.zeek
This moves c$service_violation to the deprecated-dpd-log policy script.

This is the only script in the distribution that uses the field, and it
is unlikely to be used externally. It is also responsible for a
significant amount of memory use by itself.

This also restores the field being populated, which was broken in
GH-4362
2025-07-30 07:58:36 +01:00
Vern Paxson
47bf6af6a5 fixes for specialized ZAM operations needing to check whether record fields exist 2025-07-30 08:36:04 +02:00
zeek-bot
86ab82c0df Update doc submodule [nomail] [skip ci] 2025-07-30 00:25:27 +00:00
Johanna Amann
a22b45c69e Merge remote-tracking branch 'origin/topic/johanna/gh-4202'
* origin/topic/johanna/gh-4202:
  Update NEWS for Conn::set_conn changes
  DNS-fuzzer: raise new_connection event
  Optimize Conn::set_conn to minimize operations
  Move Conn::set_conn() from connection_state_remove to new_connection
2025-07-29 21:01:51 +01:00
Johanna Amann
8de1357e52 Update NEWS for Conn::set_conn changes 2025-07-29 18:41:59 +01:00
Johanna Amann
5e74eefd88 DNS-fuzzer: raise new_connection event
The conn protocol scripts now assume that new_connection is run before
connection_state_remove. Update the DNS analyzer to raise the
new_connection event.
2025-07-29 18:41:59 +01:00
Arne Welzel
ab282e3637 Merge remote-tracking branch 'origin/topic/awelzel/cluster-event-out-of-detail'
* origin/topic/awelzel/cluster-event-out-of-detail:
  cluster::Event: Move implementation into cluster/Event.{h,cc}
  cluster: Move cluster::detail::Event to cluster::Event
2025-07-29 18:24:20 +02:00
Arne Welzel
40389603c2 cluster::Event: Move implementation into cluster/Event.{h,cc} 2025-07-29 18:13:59 +02:00
Arne Welzel
bda70067ec cluster: Move cluster::detail::Event to cluster::Event
This class is a parameter of virtual methods of the Backend API for users
to implement and also a parameter to the HookPublishEvent() API. Seems it
shouldn't be in detail and instead we should own it.

Alternatively, could mark the cluster APIs as not-stable-yet, but I
think we can move forward and make it non-detail for 8.0.
2025-07-29 18:13:59 +02:00
Tim Wojtulewicz
9f3a1a135f Merge remote-tracking branch 'origin/topic/timw/fix-fuzzer-conn-key-deprecation'
* origin/topic/timw/fix-fuzzer-conn-key-deprecation:
  Fix ConnKey deprecation warnings from generic fuzzer
2025-07-29 07:41:23 -07:00
Tim Wojtulewicz
743b9e27cc Merge remote-tracking branch 'origin/topic/timw/fix-irc-analyzer-event-types'
* origin/topic/timw/fix-irc-analyzer-event-types:
  Fix types passed to some of the IRC analyzer events
2025-07-29 07:19:36 -07:00
Tim Wojtulewicz
06ec03046d Merge remote-tracking branch 'origin/topic/timw/fix-ranges-debian-11-build-failure'
* origin/topic/timw/fix-ranges-debian-11-build-failure:
  Fix build failure with std::ranges on Debian 11
2025-07-29 07:19:11 -07:00
Arne Welzel
cd7836dda2 Merge remote-tracking branch 'origin/topic/awelzel/4431-zeromq-drop-policy-v2'
* origin/topic/awelzel/4431-zeromq-drop-policy-v2:
  cluster.bif: Improve Cluster::publish() docstring
  btest/cluster/zeromq: Add tests for overload behavior
  cluster/zeromq: Metric for msg errors
  cluster/zeromq: Drop events when overloaded
  cluster/zeromq: Comments and move lookups to InitPostScript()
  cluster/zeromq: Rework lambdas to member functions
  cluster/zeromq: Support local XPUB/XSUB hwm and buf configurability
  cluster/OnLoop: Support DontBlock and Force flags for queueing
  cluster/ThreadedBackend: Injectable OnLoopProcess instance
2025-07-29 11:38:49 +02:00
Arne Welzel
55ecd90928 cluster.bif: Improve Cluster::publish() docstring 2025-07-29 11:23:53 +02:00
Arne Welzel
c8307487d1 btest/cluster/zeromq: Add tests for overload behavior
The overload-drop.zeek and overload-no-drop.zeek tests have proxy,
worker-1 and worker-2 publish to the manager topic. For the drop
case, we verify that both, the senders, but also the manager drops
events. For the no-drop test, the HWMs are set such that all events
are buffered.

The overload-worker-proxy-topic*.zeek tests are similar, but instead
of publishing to the manager topic, proxy, worker-1 and worker-2 publish
to the proxy and worker topics to overload each other. This had
previously resulted in lockups and these tests verify that this doesn't
happen anymore.
2025-07-29 11:23:53 +02:00
Arne Welzel
d2bb86f8b4 cluster/zeromq: Metric for msg errors 2025-07-29 11:23:53 +02:00
Arne Welzel
073de9f5fd cluster/zeromq: Drop events when overloaded
When either the XPUB socket's hwm is reached, or the onloop queue is
full, drop the events. Users can set ths xpub_sndhwm and
onloop_queue_hwm to 0 to avoid these drops at the risk of unbounded
memory growth.
2025-07-29 11:23:53 +02:00
Arne Welzel
5de9296c77 cluster/zeromq: Comments and move lookups to InitPostScript() 2025-07-29 11:23:53 +02:00
Arne Welzel
85d5dda028 cluster/zeromq: Rework lambdas to member functions 2025-07-29 11:23:53 +02:00
Arne Welzel
5dc4586b70 cluster/zeromq: Support local XPUB/XSUB hwm and buf configurability 2025-07-29 11:23:53 +02:00
Arne Welzel
d79d4b1b2a cluster/OnLoop: Support DontBlock and Force flags for queueing
Also allow max_queue_size to be 0 for unlimited queueing.
2025-07-29 11:23:53 +02:00
Arne Welzel
12518e8256 Merge remote-tracking branch 'origin/topic/awelzel/expose-num-packets-unprocessed'
* origin/topic/awelzel/expose-num-packets-unprocessed:
  ConnStats: Expose num_packets_unprocessed
  packet_analysis/Manager: Rename GetUnprocessedCount() to PacketsUnprocessed()
2025-07-29 10:12:46 +02:00
Johanna Amann
83d5243cf6 Optimize Conn::set_conn to minimize operations
Now that Conn::set_conn is guaranteed to be called at the beginning and
at the end of the connection, we can skip re-setting the elements that
we know will not have changed. This prevents repeated lookups, e.g. to
check that addresses are in the local networks.

During `connection_state_remove`, only the duration, number of
packets, service, and history fields are updated.

local_orig and local_resp are updated when the connection is flipped. A
test was added for that purpose. It uses the already existing
http.zeek-image-post-1080-8000-x.pcap, which was slightly rewritten for
this, so that one side of the connection has IP addresses different from
127.0.0.1.

The existing history-flip test also was updated to have one side being
in a local-net, to check that the flipping of local_orig and local_resp
works correctly at the beginning of a connection.
2025-07-29 09:11:57 +01:00
Johanna Amann
3e4f67e67c Move Conn::set_conn() from connection_state_remove to new_connection
c$conn is often needed for connection events, but it being established
in connection_state_removed can be a problem because event handlers have
to remember to call Con::set_conn().

This commit moves to call Conn::set_conn() in new_connection.

Addresses GH-4202

update logs
2025-07-29 09:11:57 +01:00
Arne Welzel
96f9cc73c3 Merge remote-tracking branch 'origin/topic/awelzel/spicy-format-for-8.0'
* origin/topic/awelzel/spicy-format-for-8.0:
  Update .git-blame-ignore-revs
  analyzer/protocol: Reformat with spicy-format
  pre-commit-config: Bump spicy-format to 0.26.0
2025-07-29 10:05:33 +02:00
Arne Welzel
e535f4bab1 Update .git-blame-ignore-revs 2025-07-29 10:04:14 +02:00
Arne Welzel
d70bcd07b9 analyzer/protocol: Reformat with spicy-format 2025-07-29 10:01:32 +02:00
Arne Welzel
aa2afa3e9b pre-commit-config: Bump spicy-format to 0.26.0 2025-07-29 09:59:50 +02:00
Dominik Charousset
690a2a1122 Remove zeek::Span and use std::span instead 2025-07-29 07:51:29 +02:00
Tim Wojtulewicz
d8e93f1b2d Fix types passed to some of the IRC analyzer events 2025-07-28 17:43:08 -07:00
Tim Wojtulewicz
fe689ecf60 Fix ConnKey deprecation warnings from generic fuzzer 2025-07-28 17:29:16 -07:00
zeek-bot
941ea4282b Update doc submodule [nomail] [skip ci] 2025-07-29 00:28:44 +00:00
Tim Wojtulewicz
6b4b3b41cd Fix build failure with std::ranges on Debian 11 2025-07-28 15:58:46 -07:00
Tim Wojtulewicz
73d56407b1 Merge remote-tracking branch 'origin/topic/awelzel/3935-dce-rpc-named-pipe-docs'
* origin/topic/awelzel/3935-dce-rpc-named-pipe-docs:
  dce-rpc: Make named_pipe filed docs extensive
2025-07-28 14:18:23 -07:00
Tim Wojtulewicz
22fc57a90a Merge remote-tracking branch 'origin/topic/johanna/gh-4656'
* origin/topic/johanna/gh-4656:
  Fix parsing of EDNS rcode
2025-07-28 14:16:24 -07:00
Tim Wojtulewicz
8063be111a Merge remote-tracking branch 'origin/topic/timw/more-irc-coverage'
* origin/topic/timw/more-irc-coverage:
  Expand coverage of IRC analyzer with more commands
  Add support for ircv3 tags
2025-07-28 14:15:47 -07:00
Tim Wojtulewicz
e2a702f1ab Expand coverage of IRC analyzer with more commands 2025-07-28 14:13:55 -07:00
Tim Wojtulewicz
a33f100880 Add support for ircv3 tags
This also replaces the irc-dcc-send.trace file in our pcap library with
a cleaner one that includes ircv3 tags.
2025-07-28 14:06:33 -07:00
Tim Wojtulewicz
8aeaed69c5 Merge remote-tracking branch 'origin/topic/timw/lazy-allocate-id-option-handlers'
* origin/topic/timw/lazy-allocate-id-option-handlers:
  Move ID::type in structure to fill memory padding
  Use sorted forward_list instead of multimap for ID option change handlers
2025-07-28 13:57:26 -07:00
Tim Wojtulewicz
47553c79ec Move ID::type in structure to fill memory padding 2025-07-28 13:41:51 -07:00
Tim Wojtulewicz
035b4a4a8e Use sorted forward_list instead of multimap for ID option change handlers 2025-07-28 13:41:51 -07:00
Tim Wojtulewicz
020dd1a848 Merge remote-tracking branch 'origin/topic/timw/cpp20-modernization'
* origin/topic/timw/cpp20-modernization:
  Remove intermediate cipher vectors in ssl-analyzer.pac
  Reduce the size of Func::Body quite a bit with some extra packing
  Switch to using std::ranges algorithms
  Enable modernize-std-numbers clang-tidy checker, fix findings
  Switch to using c++20 constraints instead of std::enable_if
2025-07-28 13:13:02 -07:00
Tim Wojtulewicz
d021845079 Remove intermediate cipher vectors in ssl-analyzer.pac 2025-07-28 13:03:25 -07:00
Tim Wojtulewicz
2cfa5e79fa Reduce the size of Func::Body quite a bit with some extra packing 2025-07-28 13:03:25 -07:00
Tim Wojtulewicz
72c79006ac Switch to using std::ranges algorithms 2025-07-28 13:03:25 -07:00
Tim Wojtulewicz
b4cbda4e02 Enable modernize-std-numbers clang-tidy checker, fix findings 2025-07-28 13:03:25 -07:00
Tim Wojtulewicz
414728cc71 Switch to using c++20 constraints instead of std::enable_if 2025-07-28 13:03:25 -07:00
Evan Typanski
c00314746a Merge branch 'topic/etyp/deprecate-record-ty-to-vec'
* topic/etyp/deprecate-record-ty-to-vec:
  Deprecate `record_type_to_vector`
2025-07-28 12:25:44 -04:00
Evan Typanski
7f93ff5ecd Deprecate record_type_to_vector
After #4682, record_fields is ordered so this is redundant. Furthermore,
it is incorrectly documented, as it says nested records are flattened.
2025-07-28 11:11:33 -04:00
Arne Welzel
120f061bcd ConnStats: Expose num_packets_unprocessed
Not sure it's the best place to put, but we don't have packet analysis stats
bif and also num_packets is already there, so seems reasonable to put the
num_packets_unprocessed into
2025-07-28 14:10:53 +02:00
Arne Welzel
fa476746bf packet_analysis/Manager: Rename GetUnprocessedCount() to PacketsUnprocessed()
Mostly to align with PacketsProcessed()
2025-07-28 13:41:32 +02:00
zeek-bot
7894d88461 Update doc submodule [nomail] [skip ci] 2025-07-26 00:28:44 +00:00
Tim Wojtulewicz
a09b4108c8 Merge remote-tracking branch 'origin/topic/timw/odesc-size-t'
* origin/topic/timw/odesc-size-t:
  Use size_t for byte sizes in SerializationFormat
  Add ODesc::Size() that returns size_t, deprecate ODesc::Len()
2025-07-25 09:14:01 -07:00
Tim Wojtulewicz
e1342ff72d Use size_t for byte sizes in SerializationFormat 2025-07-25 09:13:10 -07:00
Tim Wojtulewicz
7a5209855f Add ODesc::Size() that returns size_t, deprecate ODesc::Len() 2025-07-25 09:13:10 -07:00
Arne Welzel
3f810e038b dce-rpc: Make named_pipe filed docs extensive
Closes #3935
2025-07-25 11:12:38 +02:00
Arne Welzel
6e2a18ce4f Merge remote-tracking branch 'origin/topic/awelzel/conn-id-ctx-singleton'
* origin/topic/awelzel/conn-id-ctx-singleton:
  RecordType: Allow field init deferral of deferrable record constructors
  Conn: Use conn_id_ctx singleton
  Conn: Add InitPostScript() and conn_id_ctx singleton
  ID: Add conn_id_ctx
2025-07-25 10:59:07 +02:00
Arne Welzel
2cb26eda51 RecordType: Allow field init deferral of deferrable record constructors
The ctx: conn_id_ctx &default=conn_id_ctx() field was not optimized
as deferrable even though by default its an empty record and so deferring
initialization seems safe. Open-code the special record constructor
expression case in ExprFieldInit so that the ctx field is not default
initialized at record construction anymore. I am wondering a bit if the
same applies to &default=set() and &default=table().
2025-07-25 10:55:51 +02:00
zeek-bot
8a6aca6175 Update doc submodule [nomail] [skip ci] 2025-07-25 00:19:51 +00:00
Tim Wojtulewicz
90da71ef16 Merge remote-tracking branch 'origin/topic/timw/update-broker'
* origin/topic/timw/update-broker:
  Update broker submodule to pull in clang 20 fix [nomail]
2025-07-24 12:46:27 -07:00
Tim Wojtulewicz
73f2cadd88 Update broker submodule to pull in clang 20 fix [nomail] 2025-07-24 10:43:57 -07:00
Tim Wojtulewicz
9c845d9979 Merge remote-tracking branch 'origin/topic/timw/pid-start-time-metric'
* origin/topic/timw/pid-start-time-metric:
  Add process_start_time_seconds and process_pid metrics
2025-07-24 10:39:52 -07:00
Tim Wojtulewicz
d5db359772 Add process_start_time_seconds and process_pid metrics 2025-07-24 10:39:14 -07:00
Arne Welzel
906cec9adb Conn: Use conn_id_ctx singleton 2025-07-24 17:35:07 +02:00
Arne Welzel
eba6355b84 Conn: Add InitPostScript() and conn_id_ctx singleton 2025-07-24 17:28:31 +02:00
Arne Welzel
a2922cdde9 ID: Add conn_id_ctx
Seemed a bit unfortunate to use id::connection and id::conn_id, but
then do something different for conn_id_ctx.
2025-07-24 17:27:51 +02:00
Tim Wojtulewicz
d12b381e3e Merge remote-tracking branch 'origin/topic/timw/no-weekly-tasks-on-master-pushes'
* origin/topic/timw/no-weekly-tasks-on-master-pushes:
  CI: Only run weekly tasks as part of cron
2025-07-24 08:01:07 -07:00
Johanna Amann
383dce9343 Fix parsing of EDNS rcode
The EDNS rcode was incorrectly calculated. The extended rcode is formed
by taking the upper 8 bits of the extended rcode field, plus the lower 4
bits of the existing rcode.

This also adds a new trace with an extended rcode, and a testcase
parsing it.

Reported by dwhitemv25.

Fixes GH-4656
2025-07-24 14:57:00 +01:00
Arne Welzel
e231efac0b Merge remote-tracking branch 'origin/topic/awelzel/4645-icmp-conns-inconsistent'
* origin/topic/awelzel/4645-icmp-conns-inconsistent:
  conn_key/fivetuple: Handle one-way ICMP conns in DoConnKeyFromVal()
2025-07-24 09:49:07 +02:00
Arne Welzel
785bb2ee13 conn_key/fivetuple: Handle one-way ICMP conns in DoConnKeyFromVal()
When a conn_id represents a ICMP "connection", we need to determine the
is_one_way flag for InitTuple() in order to skip any flipping of address
and ports for one-way ICMP connections.

Fixes #4645
2025-07-24 09:48:33 +02:00
Johanna Amann
4399f171ae Merge remote-tracking branch 'origin/topic/johanna/pppoe-session-id-logging'
* origin/topic/johanna/pppoe-session-id-logging:
  Update external tests for pppoe-session-id conn.log changes
  PPPoE: add session id logging
2025-07-24 07:57:18 +01:00
zeek-bot
106831bc62 Update doc submodule [nomail] [skip ci] 2025-07-24 00:29:42 +00:00
Tim Wojtulewicz
acdf8f4d4d Merge remote-tracking branch 'origin/topic/timw/coverity-fixes'
* origin/topic/timw/coverity-fixes:
  Fix a few other minor issues reported by Coverity
  Add a few extra null checks, plus a missing initialization that led to a bad null check
  Fix some integer overflow issues reported by Coverity
  Ignore a couple of known-unused results reported by Coverity
  Fix some bit-shifting overflow/UB issues reported by Coverity
  Reset the value of a status variable in SQLite backend before using it in a loop
  Fix a potential memory leak reported by Coverity
  Avoid some string copies in IRC analyzer
  Add some additional std::moves reported by Coverity
  Fix an unsigned integer comparison reported by Coverity
  Fix uninitialized class member Coverity findings
  Handle uncaught exception during setup
  Update gen-zam submodule for Coverity findings
2025-07-23 15:26:29 -07:00
Tim Wojtulewicz
64bca5ce4c Fix a few other minor issues reported by Coverity 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
d22810e476 Add a few extra null checks, plus a missing initialization that led to a bad null check 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
2e5db823ef Fix some integer overflow issues reported by Coverity 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
2da3b3a2a6 Ignore a couple of known-unused results reported by Coverity 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
d4cb3c8225 Fix some bit-shifting overflow/UB issues reported by Coverity 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
22e78c3c24 Reset the value of a status variable in SQLite backend before using it in a loop 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
0b3b5e2ef2 Fix a potential memory leak reported by Coverity 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
dea44003a1 Avoid some string copies in IRC analyzer 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
205c72d26f Add some additional std::moves reported by Coverity 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
2ce26f1be0 Fix an unsigned integer comparison reported by Coverity 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
4c58fb26c4 Fix uninitialized class member Coverity findings 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
923ffbf25a Handle uncaught exception during setup 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
382dfca7a8 Update gen-zam submodule for Coverity findings 2025-07-23 15:17:53 -07:00
Tim Wojtulewicz
ca3b670d0f Merge remote-tracking branch 'origin/topic/timw/storage-forced-sync'
* origin/topic/timw/storage-forced-sync:
  Fix swapped storage metrics names
  Add flag to force synchronous mode when calling storage script-land functions
2025-07-23 14:03:56 -07:00
Tim Wojtulewicz
146837fe73 Fix swapped storage metrics names 2025-07-23 13:14:46 -07:00
Tim Wojtulewicz
7e3ed2010d Add flag to force synchronous mode when calling storage script-land functions 2025-07-23 13:14:34 -07:00
Tim Wojtulewicz
7b858cf270 CI: Only run weekly tasks as part of cron 2025-07-23 12:15:10 -07:00
Arne Welzel
ee5ffdf42c Merge remote-tracking branch 'origin/topic/awelzel/control-switch-to-cluster'
* origin/topic/awelzel/control-switch-to-cluster:
  NEWS: ZeekControl, ZeroMQ and WebSocket
  Update zeekctl module for ClusterBackend and UseWebSocket
  control: Use Cluster::publish() for replying
2025-07-23 19:31:45 +02:00
Tim Wojtulewicz
f5500a718f Merge remote-tracking branch 'origin/topic/timw/clang-tidy-bif-code'
* origin/topic/timw/clang-tidy-bif-code:
  Fix clang-tidy findings in embedded C++ from bif files
2025-07-23 10:20:26 -07:00
Tim Wojtulewicz
3b6a27d0a3 Fix clang-tidy findings in embedded C++ from bif files 2025-07-23 10:19:32 -07:00
Tim Wojtulewicz
83c914ce2d Merge remote-tracking branch 'origin/topic/timw/ci-weekly-compiler-task'
* origin/topic/timw/ci-weekly-compiler-task:
  CI: Add weekly task for running builds with newest compilers
2025-07-23 08:21:31 -07:00
Tim Wojtulewicz
2e612fc493 Merge remote-tracking branch 'origin/topic/timw/commit-info-for-plugin-ci-build'
* origin/topic/timw/commit-info-for-plugin-ci-build:
  Output more information when cloning repos for include_plugins CI task
2025-07-23 08:20:43 -07:00
Johanna Amann
9ab7b768c6 Update external tests for pppoe-session-id conn.log changes 2025-07-23 14:09:17 +01:00
Johanna Amann
e5a434c392 PPPoE: add session id logging
This adds a new PacketAnalyzer::PPPoE::session_id bif, which extracts
the PPPoE session ID from the current packet.

Furthermore, a new policy script is added which adds the pppoe session
id to the connection log.

Related to GH-4602
2025-07-23 13:43:45 +01:00
Arne Welzel
84cbd3784f Merge remote-tracking branch 'origin/topic/awelzel/make-record-fields-ordered'
* origin/topic/awelzel/make-record-fields-ordered:
  Type/RecordType: Make table returned by GetRecordFieldsVal() ordered
2025-07-23 13:38:05 +02:00
Arne Welzel
24faa5722f NEWS: ZeekControl, ZeroMQ and WebSocket 2025-07-23 13:31:11 +02:00
Arne Welzel
7131be9fa5 Update zeekctl module for ClusterBackend and UseWebSocket 2025-07-23 13:31:08 +02:00
Arne Welzel
3f2fe6fc3d control: Use Cluster::publish() for replying
Switching to ZeroMQ as cluster backend and dabbling with zeekctl
and WebSocket, replies didn't arrive due to the usage of
Broker::publish() rather than Cluster::publish(). Additionally,
add the node name to the topic on which we reply so that the
receiver can figure out which node sent the reply. It could've
been a separate event parameter, but the topic appears just fine.
2025-07-23 11:59:32 +02:00
zeek-bot
55cdb707e9 Update doc submodule [nomail] [skip ci] 2025-07-23 00:29:23 +00:00
Tim Wojtulewicz
48610bef41 CI: Add weekly task for running builds with newest compilers 2025-07-22 14:27:22 -07:00
Tim Wojtulewicz
07a1c6b699 Merge remote-tracking branch 'origin/topic/timw/update-af-packet'
* origin/topic/timw/update-af-packet:
  Update zeek-af_packet-plugin submodule to fix initialization [nomail]
2025-07-22 11:40:27 -07:00
Tim Wojtulewicz
b0d1688fe1 Update zeek-af_packet-plugin submodule to fix initialization [nomail] 2025-07-22 10:24:29 -07:00
Tim Wojtulewicz
ed81e251dc Merge remote-tracking branch 'origin/topic/timw/update-broker'
* origin/topic/timw/update-broker:
  Update broker submodule [nomail]
2025-07-22 08:05:22 -07:00
Tim Wojtulewicz
94b026ee47 Update zeek-af_packet-plugin submodule [nomail] 2025-07-22 08:04:33 -07:00
Arne Welzel
9f3a3b423f Type/RecordType: Make table returned by GetRecordFieldsVal() ordered
Seems only reasonable to provide that guarantee as pointed out in #4674.
2025-07-22 16:58:40 +02:00
Tim Wojtulewicz
f9dbd55599 Update broker submodule [nomail] 2025-07-21 15:50:51 -07:00
Arne Welzel
b4d2af23dd cluster/ThreadedBackend: Injectable OnLoopProcess instance
This allows injecting a custom onloop process to configure the
max_queue_size at instantiation time. Also allow access to the
instance directly and deprecate the QueueForProcessing() helper
2025-07-21 21:36:33 +02:00
Tim Wojtulewicz
e458da944f Return weird if a log line is over a configurable size limit 2025-07-21 09:14:52 -07:00
zeek-bot
db018253fe Update doc submodule [nomail] [skip ci] 2025-07-19 00:21:36 +00:00
Tim Wojtulewicz
cb2e193452 Merge remote-tracking branch 'origin/topic/timw/storage-metrics'
* origin/topic/timw/storage-metrics:
  Add SQLite page_count and file_size metrics
  Add btests to cover storage metrics
  Add storage metrics for operations, expirations, data transferred
  Fix ordering of telemtry metrics when running under test
  Make RunPragma take an optional value parser to return data
  Make SQLite::Step take a callback function for parsing result data
2025-07-18 14:28:46 -07:00
Tim Wojtulewicz
d0a6d84237 Add SQLite page_count and file_size metrics 2025-07-18 14:28:04 -07:00
Tim Wojtulewicz
f73ac7089f Add btests to cover storage metrics 2025-07-18 14:28:04 -07:00
Tim Wojtulewicz
a0ffe7f748 Add storage metrics for operations, expirations, data transferred 2025-07-18 14:28:04 -07:00
Tim Wojtulewicz
cab0883254 Fix ordering of telemtry metrics when running under test 2025-07-18 14:28:04 -07:00
Tim Wojtulewicz
365e6cbc9e Make RunPragma take an optional value parser to return data 2025-07-18 14:28:04 -07:00
Tim Wojtulewicz
b44f7ca9ad Make SQLite::Step take a callback function for parsing result data 2025-07-18 14:28:04 -07:00
Benjamin Bannier
784c4537e6 Merge branch 'topic/bbannier/bump-spicy' 2025-07-18 13:32:45 +02:00
Benjamin Bannier
e470c3241d Bump auxil/spicy to latest development snapshot 2025-07-18 11:07:37 +02:00
Tim Wojtulewicz
1dc7d88efd Merge remote-tracking branch 'origin/topic/timw/update-libkqueue'
* origin/topic/timw/update-libkqueue:
  Update libkqueue submodule [nomail]
2025-07-17 12:59:10 -07:00
Tim Wojtulewicz
5773283e10 Update libkqueue submodule [nomail] 2025-07-17 10:38:05 -07:00
Tim Wojtulewicz
beb70e27b5 Merge remote-tracking branch 'origin/topic/timw/cpp20-starts-and-ends-with'
* origin/topic/timw/cpp20-starts-and-ends-with:
  Use std::string/string_view versions of starts_with/ends_with where appropriate
2025-07-17 09:09:40 -07:00
Tim Wojtulewicz
a1d121e5aa Use std::string/string_view versions of starts_with/ends_with where appropriate
The util:: versions of these methods remain as a thin wrapper around them so
they can be used with const char* arguments. Otherwise callers have to manually
make string_view objects from the input.
s Please enter the commit message for your changes. Lines starting
2025-07-17 09:08:54 -07:00
Tim Wojtulewicz
6218643347 Merge remote-tracking branch 'origin/topic/timw/hilti-nolint-enum'
* origin/topic/timw/hilti-nolint-enum:
  Add nolint for enum size for HILTI_RT_ENUM use
2025-07-17 08:40:58 -07:00
zeek-bot
79639499fb Update doc submodule [nomail] [skip ci] 2025-07-17 00:27:51 +00:00
Tim Wojtulewicz
49a7f64460 Add nolint for enum size for HILTI_RT_ENUM use 2025-07-16 09:49:57 -07:00
Robin Sommer
c94ce6b946
Merge remote-tracking branch 'origin/topic/robin/gh-4481-test-analyzer'
* origin/topic/robin/gh-4481-test-analyzer:
  Spicy: Fix missing include.
  Bump Spicy.
  Spicy: Add functions to check if Zeek provides an analyzer of a given name.
2025-07-16 17:47:08 +02:00
Arne Welzel
8f4470926f Merge remote-tracking branch 'origin/topic/awelzel/eml-extraction-v3'
* origin/topic/awelzel/eml-extraction-v3:
  NEWS: Add entry about SMTP::enable_rfc822_msg_file_analysis
  btest: Add tests for full email extraction
  SMTP: Adapt scripts for enable_rfc822_msg_file_analysis
  SMTP: Add missing Undelivered() call
  SMTP: Add enable_rfc822_msg_file_analysis
2025-07-16 12:38:29 +02:00
Arne Welzel
c69ed1adf7 NEWS: Add entry about SMTP::enable_rfc822_msg_file_analysis 2025-07-16 12:37:33 +02:00
cccs-jsjm
1b3b3892b5 btest: Add tests for full email extraction 2025-07-16 12:37:33 +02:00
Arne Welzel
4c60dfd6c5 SMTP: Adapt scripts for enable_rfc822_msg_file_analysis
Specifically, set a MIME part's parent_id to the rfc822_msg_fuid if it
is set and take into account the current rfc822_msg_fuid for describe_file()
to avoid fuid collisions of the top-level RFC822 message and the first
MIME part.
2025-07-16 12:37:33 +02:00
Arne Welzel
a42875d033 SMTP: Add missing Undelivered() call
Not that it's implement, but for consistency.
2025-07-16 11:27:00 +02:00
Arne Welzel
6f05fbf2ce SMTP: Add enable_rfc822_msg_file_analysis
Enabling this option will instantiate a new fa_file instance for every
top-level RFC 822 message in an SMTP transaction.
2025-07-16 11:26:49 +02:00
Robin Sommer
a840613441
Spicy: Fix missing include. 2025-07-16 09:34:22 +02:00
Robin Sommer
7575c35c68
Bump Spicy. 2025-07-16 09:34:22 +02:00
Christian Kreibich
fba319857b Merge branch 'topic/bbannier/named-ctr'
* topic/bbannier/named-ctr:
  Prefer explicit construction to coercion in record initialization
2025-07-15 17:38:04 -07:00
Christian Kreibich
907ddce581 Merge branch 'topic/christian/fix-debuglogger-stdsort'
* topic/christian/fix-debuglogger-stdsort:
  Add missing header to allow std::sort() on GCC 15.1
2025-07-15 17:37:02 -07:00
Christian Kreibich
1dc7d1f124 Add missing header to allow std::sort() on GCC 15.1 2025-07-15 16:38:52 -07:00
Tim Wojtulewicz
42a2a19f28 Merge remote-tracking branch 'origin/topic/bbannier/sqlite-no-stale-entries'
* origin/topic/bbannier/sqlite-no-stale-entries:
  Make PUT on SQLite backend implicitly overwrite expired entries
  Prevent SQLite storage backend from serving expired entries
2025-07-15 15:51:54 -07:00
Benjamin Bannier
16c40f4f3a Make PUT on SQLite backend implicitly overwrite expired entries
The backend does not serve expired but still present entries so to a
user they do not exist. When they put new data over such an entry their
expecation is that the value is overwritten, even if not explicitly
requested.
2025-07-15 15:50:43 -07:00
Benjamin Bannier
2f67539c0f Prevent SQLite storage backend from serving expired entries
The SQLite storage backend implements expiration by hand and garbage
collection is done in `DoExpire`. This previously relied exclusively on
gets not running within `Storage::expire_interval` of the put, otherwise
we would potentially serve expired entries.

With this patch we explictly check that entries are not expired before
serving them so that the SQLite backend should never serve expired
entries.
2025-07-15 15:47:31 -07:00
Tim Wojtulewicz
abac0b577c Merge remote-tracking branch 'origin/topic/timw/update-submodules'
* origin/topic/timw/update-submodules:
  Update package-manager submodule [nomail]
  Update binpac submodule [nomail]
2025-07-15 08:58:11 -07:00
Robin Sommer
7dc5a70dc8
Spicy: Add functions to check if Zeek provides an analyzer of a given name.
```
## Checks if there is a Zeek analyzer of a given name.
##
## analyzer: the Zeek-side name of the analyzer to check for
## if_enabled: if true, only checks for analyzers that are enabled
##
## Returns the type of the analyzer if it exists, or ``Undef`` if it does not.
public function has_analyzer(analyzer: string, if_enabled: bool = True): bool &cxxname="zeek::spicy::rt::has_analyzer";

## Differentiates between the types of analyzers Zeek provides.
public type AnalyzerType = enum { Protocol, File, Packet, };

## Returns the type of a Zeek analyzer of a given name.
##
## analyzer: the Zeek-side name of the analyzer to check
## if_enabled: if true, only checks for analyzers that are enabled
##
## Returns the type of the analyzer if it exists, or ``Undef`` if it does not.
public function analyzer_type(analyzer: string, if_enabled: bool = True): AnalyzerType &cxxname="zeek::spicy::rt::analyzer_type";

```

Closes #4481.
2025-07-15 14:22:27 +02:00
Tim Wojtulewicz
e55c37ae8b Update package-manager submodule [nomail] 2025-07-14 21:40:21 -07:00
Tim Wojtulewicz
4a7c681b99 Update binpac submodule [nomail] 2025-07-14 21:40:21 -07:00
zeek-bot
e0e62e28f6 Update doc submodule [nomail] [skip ci] 2025-07-15 00:30:17 +00:00
Tim Wojtulewicz
dc5d7c3fc9 Merge remote-tracking branch 'origin/topic/timw/std-filesystem'
* origin/topic/timw/std-filesystem:
  Fix some missing #includes resulting from removal of ghc::filesystem
  Remove ghc::filesystem submodule, switch to std::filesystem
2025-07-14 13:09:24 -07:00
Tim Wojtulewicz
55b427142d Merge remote-tracking branch 'origin/topic/johanna/connection-syn-packet-doc'
* origin/topic/johanna/connection-syn-packet-doc:
  Documentation: connection_SYN_packet
2025-07-14 11:26:13 -07:00
Johanna Amann
2fc75009f4 Documentation: connection_SYN_packet
Slightly clarify documentation related to the connection_SYN_packet
event.
2025-07-14 11:25:49 -07:00
Tim Wojtulewicz
1f87382302 Fix some missing #includes resulting from removal of ghc::filesystem 2025-07-14 11:23:54 -07:00
Tim Wojtulewicz
770bc0491e Remove ghc::filesystem submodule, switch to std::filesystem 2025-07-14 11:23:54 -07:00
Tim Wojtulewicz
2414e54195 Output more information when cloning repos for include_plugins CI task 2025-07-14 11:19:19 -07:00
Tim Wojtulewicz
a843521e78 Merge remote-tracking branch 'origin/topic/timw/cpp20-clang-tidy-updates'
* origin/topic/timw/cpp20-clang-tidy-updates:
  Use ranges::reverse_view to fix a few reverse ranged-for loops
  Disable a few new modernize clang-tidy checkers, enabled by C++20
2025-07-14 09:31:31 -07:00
Tim Wojtulewicz
8640f92b1f Use ranges::reverse_view to fix a few reverse ranged-for loops 2025-07-14 09:30:54 -07:00
Tim Wojtulewicz
832f67e91c Disable a few new modernize clang-tidy checkers, enabled by C++20 2025-07-14 09:30:54 -07:00
Arne Welzel
a014f48e0f Merge remote-tracking branch 'origin/topic/awelzel/4655-putty-org-to-chiark'
* origin/topic/awelzel/4655-putty-org-to-chiark:
  btest: Switch putty.org usage in tests to official URL
2025-07-14 09:31:20 +02:00
Arne Welzel
13f32a6b37 btest: Switch putty.org usage in tests to official URL
Closes #4655
2025-07-14 09:07:58 +02:00
Tim Wojtulewicz
448590270b Merge remote-tracking branch 'origin/topic/timw/move-util-deferred'
* origin/topic/timw/move-util-deferred:
  Move util::Deferred into util-types.h
2025-07-13 19:23:08 -07:00
Tim Wojtulewicz
6e96cb59ec Move util::Deferred into util-types.h 2025-07-13 19:22:02 -07:00
zeek-bot
e91e9c4523 Update doc submodule [nomail] [skip ci] 2025-07-12 00:17:54 +00:00
Benjamin Bannier
d5fd29edcd Prefer explicit construction to coercion in record initialization
While we support initializing records via coercion from an expression
list, e.g.,

    local x: X = [$x1=1, $x2=2];

this can sometimes obscure the code to readers, e.g., when assigning to
value declared and typed elsewhere. The language runtime has a similar
overhead since instead of just constructing a known type it needs to
check at runtime that the coercion from the expression list is valid;
this can be slower than just writing the readible code in the first
place, see #4559.

With this patch we use explicit construction, e.g.,

    local x = X($x1=1, $x2=2);
2025-07-11 16:28:37 -07:00
Evan Typanski
54f9e45597 Merge remote-tracking branch 'origin/topic/etyp/baseline-cleanup'
* origin/topic/etyp/baseline-cleanup:
  Cleanup unused baselines
2025-07-11 15:35:59 -04:00
Tim Wojtulewicz
0e869a5941 Merge remote-tracking branch 'origin/topic/timw/cpp20-NEWS'
* origin/topic/timw/cpp20-NEWS:
  Add NEWS entry about C++ 20 [nomail] [skip ci]
2025-07-11 12:13:54 -07:00
Tim Wojtulewicz
a4acae2dfe Add NEWS entry about C++ 20 [nomail] [skip ci] 2025-07-11 11:57:24 -07:00
Evan Typanski
a739d47835 Merge remote-tracking branch 'origin/topic/vern/add-del-void-exprs'
* origin/topic/vern/add-del-void-exprs:
  crash fixes for constructs that expect add/delete expressions to return values
2025-07-11 12:58:56 -04:00
Vern Paxson
fe5c953d31 crash fixes for constructs that expect add/delete expressions to return values 2025-07-11 12:56:08 -04:00
zeek-bot
a6776a9f25 Update doc submodule [nomail] [skip ci] 2025-07-11 00:49:08 +00:00
Tim Wojtulewicz
1e55543e86 Merge branch 'topic/timw/c++20'
* topic/timw/c++20:
  Reduce some false-positive warnings from GCC to warnings with -Werror
  Add zeek-namespaced alias for jthread
  Include RequireCXXStd.cmake from main CMakeLists.txt
  Update submodules to C++20-enabled versions
2025-07-10 15:43:09 -07:00
Tim Wojtulewicz
57a3c733d1 Reduce some false-positive warnings from GCC to warnings with -Werror
This also works around some of the same warnings. These are known bugs
in GCC 11+ and GCC 13.x.
2025-07-10 14:07:08 -07:00
Tim Wojtulewicz
cd356ce45d Add zeek-namespaced alias for jthread
Apple Clang (as of version 17.0.0) does not support jthread unless
you enable experimental libcpp features by defining
_LIBCPP_ENABLE_EXPERIMENTAL or passing -fexperimental_library to
the compiler. Even if you don't do those, our 3rdparty jthread
library fails to build because of a bunch of namespace/naming
collisions. I moved our 3rdparty one to the `nonstd` namespace, and
am using an alias under __APPLE__ to avoid the collisions.
2025-07-10 14:07:07 -07:00
Tim Wojtulewicz
350d0859aa Include RequireCXXStd.cmake from main CMakeLists.txt 2025-07-10 14:07:07 -07:00
Tim Wojtulewicz
0de1d8a345 Update submodules to C++20-enabled versions 2025-07-10 14:07:07 -07:00
Evan Typanski
066bbab07b Cleanup unused baselines 2025-07-10 16:46:09 -04:00
Tim Wojtulewicz
c6011e2160 Merge remote-tracking branch 'origin/topic/timw/known-services-with-storage-framework'
* origin/topic/timw/known-services-with-storage-framework:
  Modify known-services policy script to add storage framework support
2025-07-10 08:55:49 -07:00
Tim Wojtulewicz
1f64bb2870 Modify known-services policy script to add storage framework support
This adds a flag to enable using the storage framework instead of Broker stores,
plus a btest for both broker and the the storage framework.
2025-07-10 08:55:01 -07:00
Robin Sommer
6446bdf0dc
Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  [Spicy] Add linker scope to debugging output.
  [Spicy] Remove declarations for unimplemented functions.
  [Spicy] Bump `auxil/spicy/` to latest development snapshot.
2025-07-10 09:41:07 +02:00
Robin Sommer
ce6c7a6cd1
Merge remote-tracking branch 'origin/topic/bbannier/protocol-handle-close-finish'
* origin/topic/bbannier/protocol-handle-close-finish:
  [Spicy] Let `zeek::protocol_handle_close()` send a TCP EOF.
2025-07-10 09:38:11 +02:00
zeek-bot
d06468fd34 Update doc submodule [nomail] [skip ci] 2025-07-10 00:18:59 +00:00
Tim Wojtulewicz
0848ddfb9f Merge remote-tracking branch 'origin/topic/vern/ZAM-incr-op-opt-fix'
* origin/topic/vern/ZAM-incr-op-opt-fix:
  ZAM optimizer fix for += / -= set operations
2025-07-09 15:10:17 -07:00
Vern Paxson
1d43760862 ZAM optimizer fix for += / -= set operations 2025-07-09 13:40:33 -07:00
Robin Sommer
da59c12a9a
[Spicy] Add linker scope to debugging output. 2025-07-09 17:36:05 +02:00
Benjamin Bannier
96b8cd8ee4
[Spicy] Remove declarations for unimplemented functions. 2025-07-09 17:36:05 +02:00
Benjamin Bannier
2307c62a61
[Spicy] Bump auxil/spicy/ to latest development snapshot. 2025-07-09 17:36:05 +02:00
Benjamin Bannier
d6c22295bd
[Spicy] Let zeek::protocol_handle_close() send a TCP EOF.
Zeek's analyzer API makes it hard to determine during analyzer
shutdown whether a regular end-of-data has been reached, or if we're
aborting in the middle of a session (e.g., because Zeek missed the
remaining packets): the corresponding analyzer method, `EndOfData()`
gets called in both cases.

In an earlier change, we had stopped signaling Spicy analyzers a
regular finish when that `EndOfData()` method executes, because doing
so could trigger a parse error if it wasn't a regular shutdown—-which
isn't desired, a user request was to just silently stop processing in
this case.

However, that behavior now seems unfortunate in the case that one
deliberately calls `zeek::protocol_handle_close()` to terminate an
analyzer: this feels like a regular shutdown that should just
immediately happen. We achieve this now in this function by
additionally signaling the shutdown at the TCP layer as an "end of
file", which, for Spicy analyzers, happens to run the final, orderly
tear-down.

Not exactly great, but ti seems to thread the needle to achieve the
desired semantics in both cases.
2025-07-09 17:28:19 +02:00
Benjamin Bannier
92868804b1 Merge branch 'topic/bbannier/bump-pre-commit-hook-spicy-format' 2025-07-09 11:56:03 +02:00
Benjamin Bannier
b959ba3395 Bump spicy-format pre-commit hook
pre-commit ignores Cargo.lock files for Rust projects, so any movement
in a Rust project's dependencies can break a hook, even if no code in
the hook changed. I have tried to work with upstream on a fix, but they
basically told me they weren't interested and to get lost.

This bumps the `spicy-format` pre-commit hook to a new version which
explicitly deals with bumps of its dependencies. Having to do this
semi-regularly is not fun, and ideally somebody interested in using this
hook would help set up infrastructure in the hook so it just pulls
pre-built binaries. This is not directly supported by pre-commit, but
many projects work around this by declaring a Python module which then
pulls pre-build binaries which already exist for spicy-format.
2025-07-09 11:40:25 +02:00
Christian Kreibich
9322687823 Merge branch 'topic/christian/rdp-cookie-clarification'
* topic/christian/rdp-cookie-clarification:
  Clarify the cookie field's origin in the RDP log.
2025-07-08 17:45:27 -07:00
zeek-bot
8be80f8c18 Update doc submodule [nomail] [skip ci] 2025-07-09 00:27:47 +00:00
Christian Kreibich
2ca0fb6539 Clarify the cookie field's origin in the RDP log. 2025-07-08 16:31:57 -07:00
Arne Welzel
0c60f2a70a Merge branch 'topic/jgras/connection-packet-threshold' of https://github.com/J-Gras/zeek
* 'topic/jgras/connection-packet-threshold' of https://github.com/J-Gras/zeek:
  Add NEWS entry for generic packet thresholds
  Allow for multiple generic packet thresholds
  Add btest for conn_generic_packet_threshold_crossed event
  Update dump-events btest baseline
  Add conn_generic_packet_threshold_crossed event
2025-07-08 17:54:27 +02:00
Johanna Amann
8ba77da152 Merge remote-tracking branch 'origin/topic/johanna/gh-4602'
* origin/topic/johanna/gh-4602:
  PPPoE: don't forward more bytes than header indicates
2025-07-08 11:44:53 +01:00
Johanna Amann
4c46c02aec Merge remote-tracking branch 'origin/topic/johanna/random-indentation'
* origin/topic/johanna/random-indentation:
  Fix indentation of scripts / tests
2025-07-08 11:41:37 +01:00
Jan Grashoefer
50ab72efc2 Add NEWS entry for generic packet thresholds 2025-07-08 11:30:38 +02:00
Jan Grashoefer
e6d8c3b072 Allow for multiple generic packet thresholds
Co-authored-by: Arne Welzel <arne.welzel@corelight.com>
2025-07-08 11:29:06 +02:00
Johanna Amann
1fed0ed58d PPPoE: don't forward more bytes than header indicates
This changes the PPPoE parser so that it doesn't forward extra bytes
that might be appended after the payload. Instead, it raises a weird if
the payload size doesn't match the size indicated by the header.

This is in line with what other protocol parsers (like UDP) are doing.

Two tests needed to be updated - with this change, the traffic in
pppoe-over-qinq.pcap is now valid TLS. A new trace was introduced for
the confirmation-violation-info test.

Addresses GH-4602
2025-07-08 10:20:59 +01:00
Johanna Amann
359c7707e0 Fix indentation of scripts / tests
No functional changes
2025-07-08 10:13:48 +01:00
Arne Welzel
d42d467965 Merge remote-tracking branch 'origin/topic/vern/line-number-ordering'
* origin/topic/vern/line-number-ordering:
  Bump ZeekJS to work with new Location constructor
  remove non-functional column information from Location objects
  isolate Location specifics to private class variables to enforce correct line number ordering
2025-07-08 10:40:58 +02:00
Arne Welzel
781097ef72 Bump ZeekJS to work with new Location constructor 2025-07-08 10:39:53 +02:00
Vern Paxson
a9b37467a4 remove non-functional column information from Location objects 2025-07-08 10:39:53 +02:00
Vern Paxson
5c63133226 isolate Location specifics to private class variables to enforce correct line number ordering 2025-07-08 10:39:28 +02:00
Arne Welzel
3c941a6d3e Merge remote-tracking branch 'origin/topic/awelzel/id-opt-info-branch-clone-no-lint'
* origin/topic/awelzel/id-opt-info-branch-clone-no-lint:
  script_opt/IDOptInfo: Add NOLINT(bugprone-branch-clone)
2025-07-07 20:07:35 +02:00
Arne Welzel
0cc30faa55 script_opt/IDOptInfo: Add NOLINT(bugprone-branch-clone) 2025-07-07 18:52:11 +02:00
Arne Welzel
b034fd3f55 Merge remote-tracking branch 'origin/topic/awelzel/bump-zeekjs-0-18-0'
* origin/topic/awelzel/bump-zeekjs-0-18-0:
  Bump zeekjs to v0.18.0
2025-07-07 18:17:25 +02:00
Arne Welzel
869bd181b2 Merge remote-tracking branch 'origin/topic/vern/ZAM-const-prop-fix'
* origin/topic/vern/ZAM-const-prop-fix:
  fix for error in ZAM's constant propagation logic
2025-07-07 18:15:57 +02:00
Vern Paxson
0c1e248572 fix for error in ZAM's constant propagation logic 2025-07-04 16:05:46 -07:00
Arne Welzel
e3cb063032 Bump zeekjs to v0.18.0
1b7071e version: 0.18.0
    07c801e tests: Bump version requirement for new-event and log-events
    b7b69eb Add support for node v24
2025-07-04 17:10:49 +02:00
zeek-bot
319af542d9 Update doc submodule [nomail] [skip ci] 2025-07-04 00:25:19 +00:00
Arne Welzel
eb6b4a0c46 Merge remote-tracking branch 'origin/topic/awelzel/revert-to-tpe'
* origin/topic/awelzel/revert-to-tpe:
  scripts: Use tpe instead of type_, again
2025-07-03 20:44:04 +02:00
Arne Welzel
df581c59b4 scripts: Use tpe instead of type_, again
The .rst generation doesn't escape the trailing `_` and the docs build
gets upset due to using `type` as a reference target then.

For the better or worse, revert to using tpe. Though I acknowledge this
means we need to be careful with trailing underscores because our docs
build is so fragile.

Partly reverts b9eabbabba.
2025-07-03 20:25:34 +02:00
Arne Welzel
388cbcee48 Merge remote-tracking branch 'origin/topic/awelzel/4605-conn-id-context'
* origin/topic/awelzel/4605-conn-id-context:
  NEWS: Adapt for conn_id$ctx introduction
  conn_key/fivetuple: Drop support for non conn_id records
  Conn: Move conn_id init and flip to IPBasedConnKey
  IPBasedConnKey: Add GetTransportProto() helper
  input/Manager: Ignore empty record types
  external: Bump commit hashes for external suites
  ip/vlan_fivetuple: Populate nested conn_id_context, not conn_id
  ConnKey: Extend DoPopulateConnIdVal() with ctx
  btest: Update tests and baselines after adding ctx to conn_id
  init-bare: Add conn_id_ctx to conn_id
2025-07-03 18:42:48 +02:00
Arne Welzel
a7bc144465 NEWS: Adapt for conn_id$ctx introduction 2025-07-03 18:21:36 +02:00
Arne Welzel
6eb0d4df32 conn_key/fivetuple: Drop support for non conn_id records
Previously, we supported any records that happened to have orig_h,
resp_h, etc. fields, but it's not exactly clear why we ever did. Users
that relied on this can instantiate an explicit conn_id instance, too.
2025-07-03 18:21:36 +02:00
Arne Welzel
f8eab9e9cf Conn: Move conn_id init and flip to IPBasedConnKey
This loosens the coupling of the script-layer conn_id record and
the code in Conn a bit, moving more into the IPBasedConnKey class.

I'm not quite sure whether moving the flipping logic is worth it,
but assuming Conn could become non-IP in the future, it might.
2025-07-03 18:21:36 +02:00
Arne Welzel
661fa91231 IPBasedConnKey: Add GetTransportProto() helper 2025-07-03 18:21:36 +02:00
Arne Welzel
a975d65d01 input/Manager: Ignore empty record types
Somewhere record types with zero fields get the optional attribute
apparently. The input/sqlite/basic test failed due to complaining
that ctx is optional. It isn't optional and when it has zero fields
we can just ignore it, too.

Also adds a input framework test with an explicit empty record type
2025-07-03 18:21:15 +02:00
Arne Welzel
8c7d732d4c external: Bump commit hashes for external suites
get_file_handle() may include c$id and perturbs their values when adding new
fields. I think that's reasonable, as files transferred in one VLAN should
be treated separate from files transferred in a different VLAN.
2025-07-03 18:19:47 +02:00
Arne Welzel
e221042f14 ip/vlan_fivetuple: Populate nested conn_id_context, not conn_id
This also enforces conn_id and conn_id_ctx types instead of being
able to handle any conn_id-like record.
2025-07-03 18:19:46 +02:00
Arne Welzel
b7a22a87c6 ConnKey: Extend DoPopulateConnIdVal() with ctx
This prepares the move where ConnKey implementations should fill out
ctx rather than filling conn_id directly. The API continues to receive
both, conn_id and ctx, as adding fields to `conn_id` is reasonable
use-case even if it's just for logging purposes.
2025-07-03 18:19:46 +02:00
Arne Welzel
112e3c1c03 btest: Update tests and baselines after adding ctx to conn_id 2025-07-03 18:19:46 +02:00
Arne Welzel
25fc4d5d98 init-bare: Add conn_id_ctx to conn_id
This nested record can be used to discriminate orig_h or resp_h being
observed in different "contexts". A context can be based on VLAN tags,
but any custom ConnKey implementation should populate the ctx field,
allowing to write context-aware Zeek scripts without needing to know
what the context really is.
2025-07-03 18:19:46 +02:00
Jan Grashoefer
d8ee27bdcc Add btest for conn_generic_packet_threshold_crossed event 2025-07-03 12:47:29 +02:00
Jan Grashoefer
b0d2713547 Update dump-events btest baseline
Changes in endpoint stats are a side-effect caused by the ConnSize
analyzer updating the conn record triggering the threshold event. The
phenomenon is described in https://github.com/zeek/zeek/issues/4214.
2025-07-03 12:32:31 +02:00
Jan Grashoefer
4831bf80d1 Add conn_generic_packet_threshold_crossed event 2025-07-03 12:09:47 +02:00
Johanna Amann
2a34cf3f46 Merge remote-tracking branch 'origin/topic/johanna/ssl-small-tweaks'
* origin/topic/johanna/ssl-small-tweaks:
  Spicy SSL analyzer: move unknown version out of possible range
  Spicy SSL analyzer: move exceptions to &requires & throw
2025-07-02 07:50:33 +01:00
zeek-bot
d519d052bc Update doc submodule [nomail] [skip ci] 2025-07-02 00:28:17 +00:00
Evan Typanski
310a82e7fd Merge remote-tracking branch 'origin/topic/etyp/redis-resp3'
* origin/topic/etyp/redis-resp3:
  Touchup TODOs in the Redis analyzer
  Handle more Redis RESP3 protocol pieces
  Stringify all Redis-RESP serialized data
  Handle Redis protocol `message` separately
  Add Redis analyzer array stringification
2025-07-01 14:20:19 -04:00
Evan Typanski
e7c798e526 Touchup TODOs in the Redis analyzer
Also renames `KnownCommand` to `RedisCommand` to avoid conflicts.
2025-07-01 14:14:15 -04:00
Evan Typanski
64443e5e5a Handle more Redis RESP3 protocol pieces
This passes the "minimum protocol version" along in the reply and adds
support for attributes, which were added relatively recently.
2025-07-01 14:14:15 -04:00
Evan Typanski
b34d3ff2f0 Stringify all Redis-RESP serialized data 2025-07-01 14:14:15 -04:00
Evan Typanski
a4ce682bc9 Handle Redis protocol message separately
Closes #4504

Messages are not typical responses, so they need special handling. This
is different between RESP2 and 3, so this is the first instance where
the script layer needs to tell the difference.
2025-07-01 14:14:15 -04:00
Evan Typanski
8b914f4714 Add Redis analyzer array stringification
This was going to be how "message" server data was handled, but that
ended up being bad. Regardless, this is probably nice to have.
2025-07-01 10:23:57 -04:00
Benjamin Bannier
e3b0d1d2be Merge branch 'topic/bbannier/bump-pre-commit-hooks' 2025-07-01 11:09:23 +02:00
Benjamin Bannier
b9eabbabba Bump pre-commit hooks 2025-07-01 10:39:47 +02:00
Arne Welzel
6d272038fe Merge remote-tracking branch 'origin/topic/timw/4617-reset-expire-time-on-overwrite'
* origin/topic/timw/4617-reset-expire-time-on-overwrite:
  SQLite: Reset expiration time on overwrite
2025-07-01 09:20:58 +02:00
zeek-bot
7a19e4e7d3 Update doc submodule [nomail] [skip ci] 2025-07-01 00:28:16 +00:00
Tim Wojtulewicz
fd7259f436 SQLite: Reset expiration time on overwrite 2025-06-30 14:41:10 -07:00
Tim Wojtulewicz
5daa83bfa4 Merge remote-tracking branch 'origin/topic/bbannier/readability-isolate-declaration'
* origin/topic/bbannier/readability-isolate-declaration:
  Make clang-tidy warnings report as errors to cause CI build to fail
  Fix a clang-tidy finding in cluster telemetry code
  Fix clang-tidy readability-isolate-declaration warnings
2025-06-30 14:19:37 -07:00
Tim Wojtulewicz
79959310a6 Make clang-tidy warnings report as errors to cause CI build to fail 2025-06-30 14:19:06 -07:00
Tim Wojtulewicz
1bc39cb541 Fix a clang-tidy finding in cluster telemetry code 2025-06-30 14:19:06 -07:00
Benjamin Bannier
627c3ad726 Fix clang-tidy readability-isolate-declaration warnings
I missed one of these in review so a machine is probably better at
catching them.

I fixed the existing instances which where largely in code which look
dated. Where possible I slightly reorganized the code so we do not have
to leave values uninitialized, but did not touch up anything else.
2025-06-30 14:19:06 -07:00
Arne Welzel
c725311d07 Merge remote-tracking branch 'origin/topic/awelzel/cluster-log-websocket-application-name'
* origin/topic/awelzel/cluster-log-websocket-application-name:
  cluster/WebSocket: Include X-Application-Name in cluster.log
2025-06-30 17:56:19 +02:00
Arne Welzel
1d931b5a2f cluster/WebSocket: Include X-Application-Name in cluster.log
A bit ad-hoc formatting for the log, but that's mostly because cluster.log
only has message field and I don't think having a dedicated application_name
column is worth it. That could also be added by custom scripts if it's really
wanted for a given deployment.
2025-06-30 17:55:24 +02:00
Arne Welzel
5847a2d32e Merge remote-tracking branch 'origin/topic/awelzel/cluster-telemetry-follow-up'
* origin/topic/awelzel/cluster-telemetry-follow-up:
  Bump cluster test suite
  cluster/Telemetry: Cache CallExpr locations
  cluster/Telemetry: Avoid unneeded StringVal() construction
  Val: Switch TablePatternMatcher to std::string_view
  RE: Add MatchAll() and MatchSet() for std::string_view
  cluster/websocket: Fix and test for invalid X-Application-Name
  cluster/telemetry: Move topic_normalization redef to zeromq
2025-06-30 13:30:04 +02:00
Arne Welzel
42ed82824e Bump cluster test suite
Since zeek/zeek#4552, metrics are labeled with node, not endpoint,
adapt the tests for that.
2025-06-30 13:22:31 +02:00
Arne Welzel
73e55fa909 cluster/Telemetry: Cache CallExpr locations 2025-06-30 13:22:31 +02:00
Arne Welzel
be8b4747c4 cluster/Telemetry: Avoid unneeded StringVal() construction 2025-06-30 13:22:31 +02:00
Arne Welzel
dad5ccd622 Val: Switch TablePatternMatcher to std::string_view
...and add TableVal::LookupPattern(std::string_view sv).
2025-06-30 13:22:31 +02:00
Arne Welzel
dce51b99e5 RE: Add MatchAll() and MatchSet() for std::string_view 2025-06-30 13:22:31 +02:00
Arne Welzel
5c6a6d9427 cluster/websocket: Fix and test for invalid X-Application-Name 2025-06-30 13:22:31 +02:00
zeek-bot
e79ae5a1d9 Update doc submodule [nomail] [skip ci] 2025-06-27 00:19:29 +00:00
Johanna Amann
2bb47d8d9a Spicy SSL analyzer: move unknown version out of possible range
This moves the negotiated version outside of the possible range of
protocol values. I don't think it was possible to cause a problem with
this in the past - but this approach seems safer.
2025-06-26 20:26:02 +01:00
Johanna Amann
2ce0d4f73b Spicy SSL analyzer: move exceptions to &requires & throw
This commit changes exception handling in a couple of places, to prefer
the use of &requires and throw.
2025-06-26 20:26:02 +01:00
Johanna Amann
dbeadc65ba Merge remote-tracking branch 'origin/topic/johanna/gh-4547'
* origin/topic/johanna/gh-4547:
  Spicy SSL analyzer: make record layer version parsing more strict
2025-06-26 20:21:54 +01:00
Arne Welzel
222f34b4ac Bump cluster testuite for endpoint to node renaming 2025-06-26 19:22:09 +02:00
Arne Welzel
3cd6e1ca06 Merge remote-tracking branch 'origin/topic/vern/if-coverage'
* origin/topic/vern/if-coverage:
  extend script coverage profiling to track whether conditionals evaluate to true/false
2025-06-26 18:49:42 +02:00
Johanna Amann
74b847a122 Spicy SSL analyzer: make record layer version parsing more strict
The Spicy based SSL analyzer was, so far, more permissive with the
record layer versions that it would accept.

This change brings the parsing of record layer versions in line with the
binpac based analyzer. This behavioral difference was discovered due to
a test that changed with the recent dpd log changes.
2025-06-26 16:57:51 +01:00
Vern Paxson
0255b5d120 extend script coverage profiling to track whether conditionals evaluate to true/false 2025-06-26 16:10:50 +02:00
Arne Welzel
26f5166d7a cluster/telemetry: Move topic_normalization redef to zeromq 2025-06-26 15:22:11 +02:00
Arne Welzel
22958f7cdf Merge remote-tracking branch 'origin/topic/awelzel/1474-cluster-telemetry'
* origin/topic/awelzel/1474-cluster-telemetry:
  btest/cluster/telemetry: Add smoke testing for telemetry
  cluster/WebSocket: Fetch X-Application-Name header as app label
  cluster/WebSocket: Pass X-Application-Name to dispatcher
  broker/WebSocketShim: Add calls to Telemetry hooks
  cluster/WebSocket: Configure telemetry for WebSocket backends
  broker: Hook up generic cluster telemetry
  cluster: Introduce telemetry component

One bug fix removing static from a variable that shouldn't be static.
2025-06-26 14:54:01 +02:00
Johanna Amann
14e801a709 Merge remote-tracking branch 'origin/topic/johanna/gh-4598'
* origin/topic/johanna/gh-4598:
  Only pass session ticket data in ssl_session_ticket_handshake event
2025-06-26 09:59:16 +01:00
zeek-bot
9f16050d0a Update doc submodule [nomail] [skip ci] 2025-06-26 00:26:06 +00:00
Arne Welzel
771c37b6b2 Merge branch 'rename' of https://github.com/bhaskarbhar/zeek
* 'rename' of https://github.com/bhaskarbhar/zeek:
  Update zeek.bif
  Update init-bare.zeek
  Added Baseline
  Renamed
2025-06-25 19:27:13 +02:00
bhaskarbhar
f9c34f29c7
Update zeek.bif 2025-06-25 22:53:29 +05:30
bhaskarbhar
722381366b
Update init-bare.zeek 2025-06-25 22:51:43 +05:30
root
1fba346f5d Added Baseline 2025-06-25 21:22:21 +05:30
root
da89e7ee6e Renamed 2025-06-25 21:10:08 +05:30
Arne Welzel
0e1431eef4 btest/cluster/telemetry: Add smoke testing for telemetry 2025-06-25 17:13:01 +02:00
Arne Welzel
b28e5f261e cluster/WebSocket: Fetch X-Application-Name header as app label 2025-06-25 17:12:59 +02:00
Arne Welzel
2f7d5eaf2a cluster/WebSocket: Pass X-Application-Name to dispatcher
This is going to be used to add labels to telemetry if the
X-Application-Name header is set.
2025-06-25 17:07:29 +02:00
Arne Welzel
6a84237a95 broker/WebSocketShim: Add calls to Telemetry hooks
WebSocket clients with Broker do not use the normal Broker backend, so
we need to add the telemetry invocations explicitly.
2025-06-25 16:59:49 +02:00
Arne Welzel
376e6dba97 cluster/WebSocket: Configure telemetry for WebSocket backends 2025-06-25 16:59:49 +02:00
Arne Welzel
f011e7e667 broker: Hook up generic cluster telemetry 2025-06-25 16:59:49 +02:00
Arne Welzel
4c34274a6c cluster: Introduce telemetry component 2025-06-25 16:59:49 +02:00
Evan Typanski
d3593e0489 Merge remote-tracking branch 'origin/topic/etyp/remove-list'
* origin/topic/etyp/remove-list:
  Remove `list` from Zeek grammar
2025-06-25 10:36:08 -04:00
Arne Welzel
cd934c460b Merge remote-tracking branch 'origin/topic/christian/extensible-conntuples'
* origin/topic/christian/extensible-conntuples:
  btest/plugins: Add test for custom ConnKey factory
  NEWS updates for pluggable connection tuples.
  Add a VLAN-aware flow tuple implementation.
  Deprecate ConnTuple and related APIs.
  Deprecate the old Connection constructor and detail::ConnKey class.
  Switch to virtualized use of new zeek::ConnKey class tree
  Provide a connkey factory for Zeek's default five-tuples.
  Add IP-specific ConnKey implementation.
  Establish plugin infrastructure for ConnKey factories.
  Add new ConnKey abstraction.
2025-06-25 14:17:49 +02:00
Arne Welzel
e7b1b174f0 btest/plugins: Add test for custom ConnKey factory
This just counts DoInits() and adds that information to the conn_id
record, but without including it into the hash. Mostly for smoke
testing.
2025-06-25 13:19:26 +02:00
Christian Kreibich
a040f550f4 NEWS updates for pluggable connection tuples. 2025-06-25 13:19:26 +02:00
Christian Kreibich
29b0f844c0 Add a VLAN-aware flow tuple implementation.
This is a first "real" implementation of a custom tuple, adding additional
fields over the standard five-tuple.

Includes test cases.
2025-06-25 13:19:26 +02:00
Christian Kreibich
a5122b5032 Deprecate ConnTuple and related APIs.
Given IP-aware ConnKeys, ConnTuples aren't really required any more. ConnTuple
had two benefits:

- It preserved the original src/dst orientation from the packet headers it was
based on, which IPBasedConnKey now tracks and provides accessor methods for.

- In IPBasedAnalyzer::AnalyzePacket() its instance survived past the std:move()
of the key into NewConn(), which we sidestep by keeping the original src address
and port around until we need after the connection is obtained.
2025-06-25 13:19:26 +02:00
Christian Kreibich
7548dc9e96 Deprecate the old Connection constructor and detail::ConnKey class.
The new key-based Connection constructor replaces the former, and the new
ConnKey class tree replaces the latter.
2025-06-25 13:19:26 +02:00
Christian Kreibich
52d6228b06 Switch to virtualized use of new zeek::ConnKey class tree
This touches quite a few places, but each just swaps out existing
APIs and/or zeek::detail::ConnKey instances.
2025-06-25 13:19:26 +02:00
Christian Kreibich
b8f82ff659 Provide a connkey factory for Zeek's default five-tuples.
Since the base factory is pure virtual this is now the first full
implementation, but still a bit of a special case because it implements Zeek's
default behavior and doesn't add "custom" content to the tuple.
2025-06-25 13:18:08 +02:00
Christian Kreibich
5af8fc242a Add IP-specific ConnKey implementation.
The InitTuple() implementation here is a placeholder for a fuller one following
later, when we do away with the need for ConnTuple.
2025-06-25 13:18:08 +02:00
Christian Kreibich
0c64f6a7b9 Establish plugin infrastructure for ConnKey factories.
ConnKey factories are intermediaries that encapsulate the details of how to
instantiate ConnKeys, which codify the hash input for connection lookups.
2025-06-25 13:18:07 +02:00
Christian Kreibich
d19fdfd17c Add new ConnKey abstraction. 2025-06-25 13:18:07 +02:00
Arne Welzel
4b472f2771 Merge remote-tracking branch 'origin/topic/awelzel/telemetry-endpoint-to-node-rename'
* origin/topic/awelzel/telemetry-endpoint-to-node-rename:
  telemetry: Rename endpoint label to node label
2025-06-25 09:33:55 +02:00
Arne Welzel
eea194ddd8 telemetry: Rename endpoint label to node label
Using a label named "endpoint" is not intuitive and requires explaining to
users that it's really just the Cluster::node value. Change the label to
"node", so that we don't need to do the explaining.

This probably breaks some existing users of the Prometheus metrics, but after
looking more at metrics recently, "endpoint" really is a thorn in my eye.
2025-06-25 09:33:01 +02:00
zeek-bot
261582bcd5 Update doc submodule [nomail] [skip ci] 2025-06-25 00:17:53 +00:00
Tim Wojtulewicz
4c2990f6ad Merge remote-tracking branch 'origin/topic/timw/available_tags'
* origin/topic/timw/available_tags:
  Add get_tags_by_category BIF method
2025-06-24 15:38:32 -07:00
bhaskarbhar
04d6fa3cb7 Add get_tags_by_category BIF method 2025-06-24 13:47:49 -07:00
Tim Wojtulewicz
4db7d40894 Add NEWS entry about deprecation of --with-binpac and --with-bifcl 2025-06-24 12:56:03 -07:00
Tim Wojtulewicz
e5afa4160c Merge remote-tracking branch 'origin/topic/timw/remove-with-binpac-bifcl'
* origin/topic/timw/remove-with-binpac-bifcl:
  Deprecate --with-binpac/--with-bifcl configure options
  Remove deprecated --disable-archiver configure argument
2025-06-24 12:51:15 -07:00
Tim Wojtulewicz
60953e14e7 Deprecate --with-binpac/--with-bifcl configure options 2025-06-24 12:50:35 -07:00
Tim Wojtulewicz
60a4aef941 Remove deprecated --disable-archiver configure argument 2025-06-24 12:50:35 -07:00
Arne Welzel
5e5d943273 Merge remote-tracking branch 'origin/topic/awelzel/publish-error-test-avoid-tsan-report'
* origin/topic/awelzel/publish-error-test-avoid-tsan-report:
  btest/broker/publish-errors: Avoid exit(0)
2025-06-24 19:07:23 +02:00
Arne Welzel
2e30f87e33 btest/broker/publish-errors: Avoid exit(0)
Calling exit() doesn't properly shutdown the manager instances and TSAN reports a
leaked thread. Just avoid this for now by using terminate() instead.
2025-06-24 19:06:52 +02:00
Arne Welzel
fbeb3adfe6 Merge remote-tracking branch 'origin/topic/awelzel/dns-naming-authority-pointer'
* origin/topic/awelzel/dns-naming-authority-pointer:
  DNS: Implement NAPTR RR support
  DNS: Move extract_char_string() helper around
2025-06-24 17:44:17 +02:00
Arne Welzel
4f1fc296b6 DNS: Implement NAPTR RR support
My phone is sending NAPTR queries and we reported an unknown RR type 35
in weird.log for the response, so figured I'd just add it.
2025-06-24 17:43:27 +02:00
Johanna Amann
9d06a13828 Only pass session ticket data in ssl_session_ticket_handshake event
This commit fixes the parsing of the data field in the SSL analyzer. So
far, this field contained two extra bytes at the beginning, which
contain the length of the following data.

Now, the data passed to the event only contains the actual value of the
session ticket.

The Spicy analyzer already contains the correct handling of this field,
and does not need to be updated. A test that uses the event and
exhibited the bug was added.
2025-06-24 16:33:14 +01:00
Arne Welzel
cab4ebf513 Merge remote-tracking branch 'origin/topic/awelzel/4586-zeromq-ipv6'
* origin/topic/awelzel/4586-zeromq-ipv6:
  cluster/zeromq: Short-circuit DoPublishLogWrite() when not initialized
  cluster/zeromq: Hook up and enable IPV6 by default
  cluster/zeromq/connect: Make failures fatal
  cluster/zeromq: Move log_push creation to DoInit()
2025-06-24 17:16:58 +02:00
Arne Welzel
1afd497c0c cluster/zeromq: Short-circuit DoPublishLogWrite() when not initialized
After moving the log_push initialization from the constructor to the
DoInit() method, it's now possible that DoPublishLogWrites() is invoked
even if DoInit() was never called. Handle this by short-circuiting. This
is sort of an error, but can happen during tests if scripts are loaded
somewhat arbitrarily.
2025-06-24 17:12:45 +02:00
Arne Welzel
89c0b0faf3 cluster/zeromq: Hook up and enable IPV6 by default
ZeroMQ's IPv6 support isn't enabled by default, resulting in
"No such device" errors when attempting to listen on an IPv6
address. This change adds a ipv6 option to the ZeroMQ module
and enables it by default. Further, adds a test configuring
everything to listen on IPv6 ::1 as well, and one test to provoke
the original error. This also regularizes some error messages.

The addr_to_uri() calls weren't actually needed, but they apparently do
not hurt and the result is easier on the eyes, so use them :-)
2025-06-24 17:12:45 +02:00
Benjamin Bannier
767ddfd8a1 Merge branch 'topic/bbannier/issue-4587' 2025-06-24 16:31:01 +02:00
Benjamin Bannier
c15d04282d Build builtin Spicy analyzers in debug mode if debug mode is enabled
Closes #4587.
2025-06-24 16:30:41 +02:00
Johanna Amann
72bd683c23 Merge remote-tracking branch 'origin/topic/johanna/default-canonifier-only-first-timestamp'
* origin/topic/johanna/default-canonifier-only-first-timestamp:
  Default canonifier change to only remove first timestamp in line
  Align SMB timestamp calculation between operating systems
2025-06-24 14:02:04 +01:00
Tim Wojtulewicz
e39a1d7271 Merge remote-tracking branch 'origin/topic/timw/ipv6-chain-vector'
* origin/topic/timw/ipv6-chain-vector:
  Switch IPv6_Hdr_Chain to a vector of objects instead of pointers
2025-06-23 10:52:33 -07:00
Tim Wojtulewicz
d6e25a2e22 Switch IPv6_Hdr_Chain to a vector of objects instead of pointers 2025-06-23 10:41:23 -07:00
Tim Wojtulewicz
33b23ef4b1 Merge remote-tracking branch 'origin/topic/timw/zeromq-include-paths'
* origin/topic/timw/zeromq-include-paths:
  Remove unneeded include dirs in zeromq CMakeLists.txt
2025-06-23 10:40:10 -07:00
Tim Wojtulewicz
7e6d3a6b39 Remove unneeded include dirs in zeromq CMakeLists.txt 2025-06-23 10:39:13 -07:00
Tim Wojtulewicz
8d92ad472c Merge branch 'topic/timw/clang-tidy-fixes'
* topic/timw/clang-tidy-fixes: (41 commits)
  Deprecate BRO_PLUGIN_INSTALL_PATH constant
  Make constants in IP::ParseResult uppercase, deprecate the old ones
  Fix comparison against CapLen results in IPTunnel
  Fix clang-tidy cppcoreguidelines-virtual-class-destructor warnings in headers
  Fix clang-tidy cppcoreguidelines-macro-usage warnings in headers
  Fix clang-tidy modernize-use-using warnings in headers
  Fix clang-tidy modernize-use-transparent-functors warnings in headers
  Fix clang-tidy modernize-use-override warnings in headers
  Fix clang-tidy modernize-use-nullptr warnings in headers
  Fix clang-tidy modernize-use-equals-delete warnings in headers
  Fix clang-tidy modernize-use-emplace warnings in headers
  Fix clang-tidy modernize-use-default-member-init warnings in headers
  Fix clang-tidy modernize-use-bool-literals warnings in headers
  Fix clang-tidy modernize-return-braced-init-list warnings in headers
  Fix clang-tidy modernize-type-traits warnings in headers
  Fix clang-tidy modernize-redundnat-void-arg warnings in headers
  Fix clang-tidy modernize-pass-by-value warnings in headers
  Fix clang-tidy modernize-loop-convert warnings in headers
  Fix clang-tidy modernize-macro-to-enum warnings in headers
  Fix clang-tidy performance-unnecessary-copy-initialization warnings in headers
  ...
2025-06-23 10:37:29 -07:00
Tim Wojtulewicz
6aa5145782 Deprecate BRO_PLUGIN_INSTALL_PATH constant 2025-06-23 08:35:25 -07:00
Tim Wojtulewicz
37be47328e Make constants in IP::ParseResult uppercase, deprecate the old ones 2025-06-23 08:35:25 -07:00
Tim Wojtulewicz
a27dee6370 Fix comparison against CapLen results in IPTunnel 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
311a744a20 Fix clang-tidy cppcoreguidelines-virtual-class-destructor warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
e84c99fb14 Fix clang-tidy cppcoreguidelines-macro-usage warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
74bf987b82 Fix clang-tidy modernize-use-using warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
6f79a6381f Fix clang-tidy modernize-use-transparent-functors warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
e613e7c304 Fix clang-tidy modernize-use-override warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
edf3ceb52c Fix clang-tidy modernize-use-nullptr warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
f15cab4a2b Fix clang-tidy modernize-use-equals-delete warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
cb78d2202f Fix clang-tidy modernize-use-emplace warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
fb55c8856e Fix clang-tidy modernize-use-default-member-init warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
a05b4abdf7 Fix clang-tidy modernize-use-bool-literals warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
ed202b36b2 Fix clang-tidy modernize-return-braced-init-list warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
157c488b9d Fix clang-tidy modernize-type-traits warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
23184af21c Fix clang-tidy modernize-redundnat-void-arg warnings in headers 2025-06-23 08:35:24 -07:00
Tim Wojtulewicz
d19486d039 Fix clang-tidy modernize-pass-by-value warnings in headers 2025-06-23 08:35:24 -07:00
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
zeek-bot
2242423aa3 Update doc submodule [nomail] [skip ci] 2025-06-12 00:26:21 +00:00
Tim Wojtulewicz
2b8cb515b9 Merge remote-tracking branch 'origin/topic/timw/fix-master'
* origin/topic/timw/fix-master:
  Add missing #include to packet_analysis/Component.h
2025-06-11 13:18:43 -07:00
Tim Wojtulewicz
f712c77682 Add missing #include to packet_analysis/Component.h 2025-06-11 12:10:14 -07:00
Tim Wojtulewicz
0a8149c185 Merge remote-tracking branch 'origin/topic/timw/util-types'
* origin/topic/timw/util-types:
  Remove some unused #includes from spicy code
  Remove using util.h in various headers in favor of util-types.h
  Move type definitions/aliases from util.h to a separate file
2025-06-11 11:12:27 -07:00
Tim Wojtulewicz
dc42f0fd5f Remove some unused #includes from spicy code 2025-06-11 11:11:54 -07:00
Tim Wojtulewicz
f8c04998af Remove using util.h in various headers in favor of util-types.h 2025-06-11 11:11:54 -07:00
Tim Wojtulewicz
9928403b0b Move type definitions/aliases from util.h to a separate file 2025-06-11 11:11:54 -07:00
Christian Kreibich
62442058e7 Merge branch 'topic/christian/enumval-string-fix'
* topic/christian/enumval-string-fix:
  Bugfix: AsString() on an EnumVal will segfault
2025-06-11 09:01:03 -07:00
Arne Welzel
f5063bfcd4 Merge remote-tracking branch 'origin/topic/awelzel/4522-bdat-last-reply-fix'
* origin/topic/awelzel/4522-bdat-last-reply-fix:
  smtp: Fix last_reply column in smtp.log for BDAT LAST
2025-06-11 17:25:21 +02:00
zeek-bot
53c56491ee Update doc submodule [nomail] [skip ci] 2025-06-11 00:30:17 +00:00
Christian Kreibich
dcf6e7432d Bugfix: AsString() on an EnumVal will segfault
This likely simply hasn't come up in practice, but we now go the intended route
of producing the textual enum value from the type.
2025-06-10 15:16:11 -07:00
Tim Wojtulewicz
14ca808bcf Merge remote-tracking branch 'origin/topic/timw/netbios-ssn-session-timeout-constant'
* origin/topic/timw/netbios-ssn-session-timeout-constant:
  Move netbios_ssn_session_timeout to a script-level constant
2025-06-10 12:08:46 -07:00
Tim Wojtulewicz
ed51738668 Move netbios_ssn_session_timeout to a script-level constant 2025-06-10 11:58:20 -07:00
Arne Welzel
61f93f9eb6 Merge remote-tracking branch 'origin/topic/awelzel/disable-zam-bif-tracking'
* origin/topic/awelzel/disable-zam-bif-tracking:
  btest/opt/ZAM-bif-tracking: Disable by default
2025-06-10 18:50:54 +02:00
Arne Welzel
dc26558894 btest/opt/ZAM-bif-tracking: Disable by default
After a public discussion and also chatting with Vern directly, disable the
ZAM bif tracking test to avoid an update every time new functions are
added. Usually these aren't performance critical and the defaults
characterization is fine. If they are performance critical, then Vern
is currently best positioned to properly integrate an optimized version.
2025-06-10 15:53:18 +02:00
Christian Kreibich
2f8bbeab1f Merge branch 'topic/christian/btest-trace-cleanup'
* topic/christian/btest-trace-cleanup:
  Btests: don't use -C in Zeek invocations that don't actually need it
  Remove executable file permission bits from a bunch of our pcaps
2025-06-09 18:00:44 -07:00
zeek-bot
9e2accf016 Update doc submodule [nomail] [skip ci] 2025-06-07 00:24:09 +00:00
Christian Kreibich
8b39e59572 Btests: don't use -C in Zeek invocations that don't actually need it 2025-06-06 13:46:45 -07:00
Christian Kreibich
e3cecdf04d Remove executable file permission bits from a bunch of our pcaps 2025-06-06 12:35:14 -07:00
Tim Wojtulewicz
e6d0f8a64d Mark ZeekString vector helper methods deprecated 2025-06-06 12:26:43 -07:00
Tim Wojtulewicz
ac9ee9f219 Merge remote-tracking branch 'origin/topic/timw/clang-tidy-modernize-fixes'
* origin/topic/timw/clang-tidy-modernize-fixes:
  Move initialization of RandTest members to header
  Update .clang-tidy to have modernize-* enabled with some exclusions
  Fix clang-tidy modernize-use-transparent-functors findings
  Fix clang-tidy modernize-use-override findings
  Fix clang-tidy modernize-use-nullptr findings
  Fix clang-tidy modernize-use-emplace findings
  Fix clang-tidy modernize-use-default-member-init findings
  Fix clang-tidy modernize-use-bool-literals findings
  Fix clang-tidy modernize-return-braced-init-list findings
  Fix clang-tidy modernize-redundant-void-arg findings
  Fix clang-tidy modernize-pass-by-value findings
  Fix clang-tidy modernize-min-max-use-initializer-list findings
  Fix clang-tidy modernize-make-unique findings
  Fix clang-tidy modernize-loop-convert findings (LOOP_OVER_ macros)
  Fix clang-tidy modernize-loop-convert findings
  Update bifcl submodule with clang-tidy fixes [nomail]
2025-06-06 11:45:59 -07:00
Tim Wojtulewicz
b22caa812d Move initialization of RandTest members to header 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
359ab18bf7 Update .clang-tidy to have modernize-* enabled with some exclusions 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
0681ab9071 Fix clang-tidy modernize-use-transparent-functors findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
2f0e3a5e23 Fix clang-tidy modernize-use-override findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
ee319fc1c5 Fix clang-tidy modernize-use-nullptr findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
a3078f3132 Fix clang-tidy modernize-use-emplace findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
3943e64372 Fix clang-tidy modernize-use-default-member-init findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
0227e3a545 Fix clang-tidy modernize-use-bool-literals findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
17c14a3ce1 Fix clang-tidy modernize-return-braced-init-list findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
8c3eee7a87 Fix clang-tidy modernize-redundant-void-arg findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
5930d2f944 Fix clang-tidy modernize-pass-by-value findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
46e67a749a Fix clang-tidy modernize-min-max-use-initializer-list findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
2aa2e2c071 Fix clang-tidy modernize-make-unique findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
5d3222cbfe Fix clang-tidy modernize-loop-convert findings (LOOP_OVER_ macros) 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
f3588657bf Fix clang-tidy modernize-loop-convert findings 2025-06-06 11:43:06 -07:00
Tim Wojtulewicz
49b803c0a8 Update bifcl submodule with clang-tidy fixes [nomail] 2025-06-06 11:43:06 -07:00
Christian Kreibich
b95f1b0925 Merge branch 'topic/christian/zeekygen-parse-only'
* topic/christian/zeekygen-parse-only:
  Fix a typo.
  Update NEWS for Zeekygen parse-only change.
  Remove adjustments and custom terminate() for Zeekygen invocation.
  Suppress warnings on deprecated DPD scripts during Zeekygen
  Stop suppressing stdout during Zeekygen docs generation
  Make Zeekygen docs generation (-X) imply parse-only (-a)
2025-06-06 10:43:32 -07:00
Arne Welzel
2468fe2355 Merge branch 't/gh-4448' of https://github.com/AmazingPP/zeek
* 't/gh-4448' of https://github.com/AmazingPP/zeek:
  Fix `&ordered` attribute not preserved in table initializer assignments
2025-06-06 17:35:54 +02:00
Arne Welzel
d650589ad4 smtp: Fix last_reply column in smtp.log for BDAT LAST
The response to BDAT LAST was never recognized, resulting in the
BDAT LAST commands not being logged in a timely fashion and receiving
the wrong status.

This likely doesn't handle complex pipeline scenarios, but it fixes
the wrong behavior for smtp_reply() not handling simple BDAT commands
responses.

Thanks @cccs-jsjm for the report!

Closes #4522
2025-06-06 10:40:49 +02:00
Arne Welzel
8189716adc Merge branch 'topic/ado/final-docker' of https://github.com/edoardomich/zeek
* 'topic/ado/final-docker' of https://github.com/edoardomich/zeek:
  docker: Add `net-tools` and `procps` dependencies
2025-06-06 10:26:45 +02:00
Edoardo Mich
3eec9daae6 docker: Add net-tools and procps dependencies
Add `net-tools` and `procps` to the final.Dockerfile, to avoid warning in
zeekctl commands like: "failed to find local IP addresses [...]" and the
error in `zeekctl top` command caused respectively by missing `ifconfig`
and `top` commands.
2025-06-06 09:17:01 +02:00
Tim Wojtulewicz
1ba2f62b4e Merge remote-tracking branch 'origin/topic/timw/configure-output-follow-up'
* origin/topic/timw/configure-output-follow-up:
  Follow-ups to configure output reformatting
2025-06-05 20:31:11 -07:00
Tim Wojtulewicz
66ba1baddf Follow-ups to configure output reformatting 2025-06-05 20:30:50 -07:00
Christian Kreibich
1dcd13a019 Fix a typo. 2025-06-05 17:51:54 -07:00
Christian Kreibich
aa4c176835 Update NEWS for Zeekygen parse-only change. 2025-06-05 17:51:49 -07:00
Christian Kreibich
fc29aae183 Remove adjustments and custom terminate() for Zeekygen invocation. 2025-06-05 17:44:15 -07:00
Christian Kreibich
c1cec7aec7 Suppress warnings on deprecated DPD scripts during Zeekygen
Also fix corresponding baseline.
2025-06-05 17:44:10 -07:00
zeek-bot
cd71dfed14 Update doc submodule [nomail] [skip ci] 2025-06-06 00:29:39 +00:00
Christian Kreibich
678a22461c Stop suppressing stdout during Zeekygen docs generation
It's no longer needed to suppress noise, and any output is now actually of
interest.
2025-06-05 17:12:16 -07:00
Christian Kreibich
ec89d6ffff Make Zeekygen docs generation (-X) imply parse-only (-a)
Nobody generates docs at startup while then moving on to regular Zeek operation,
and the generated runtime output when loading scripts/zeekygen is both noisy and
confusing.
2025-06-05 17:11:10 -07:00
Tim Wojtulewicz
e6492f7c7b Merge remote-tracking branch 'origin/topic/timw/storage-expire-contention'
* origin/topic/timw/storage-expire-contention:
  Add busy_timeout script-level option, override any busy_timeout pragma
  Handle potential contention when running sqlite expiration
  Add expiration to sqlite-cluster.btest
  Use unique_ptr to avoid needing to call sqlite3_reset manually
  Move Deferred class from ZeroMQ to util
2025-06-05 12:43:50 -07:00
Tim Wojtulewicz
be71196fa7 Add busy_timeout script-level option, override any busy_timeout pragma 2025-06-05 10:21:50 -07:00
Tim Wojtulewicz
0e5b3def84 Handle potential contention when running sqlite expiration 2025-06-05 10:21:50 -07:00
Tim Wojtulewicz
fb165c5ef1 Add expiration to sqlite-cluster.btest 2025-06-05 10:21:50 -07:00
Tim Wojtulewicz
97a2ec379e Use unique_ptr to avoid needing to call sqlite3_reset manually 2025-06-05 10:21:50 -07:00
Tim Wojtulewicz
850b20e12b Move Deferred class from ZeroMQ to util 2025-06-05 10:21:50 -07:00
Johanna Amann
c68dfdca2f Merge remote-tracking branch 'origin/topic/johanna/gh-4547'
* origin/topic/johanna/gh-4547:
  Temporarily disable pppoe-over-qinq-test for spicy-ssl
2025-06-05 18:16:45 +01:00
Johanna Amann
f8e5b90f9a Temporarily disable pppoe-over-qinq-test for spicy-ssl
The analyzer.log changes exposed a new bug in the Spicy SSL
implemenataion.

Relates to GH-4547
2025-06-05 17:28:47 +01:00
Tim Wojtulewicz
a289307e50 Merge remote-tracking branch 'origin/topic/timw/clang-20-build-warnings'
* origin/topic/timw/clang-20-build-warnings:
  Silence -Wnontrivial-memcall warning in ConnKey methods
2025-06-05 08:22:40 -07:00
Tim Wojtulewicz
badca1e604 Merge remote-tracking branch 'origin/topic/timw/update-broker'
* origin/topic/timw/update-broker:
  Update broker submodule [nomail]
2025-06-05 08:21:42 -07:00
Johanna Amann
e6755325e1 Merge remote-tracking branch 'origin/topic/johanna/new-style-analyzer-log'
* origin/topic/johanna/new-style-analyzer-log:
  NEWS entries for analyzer log changes
  Move detect-protocol from frameworks/dpd to frameworks/analyzer
  Introduce new c$failed_analyzers field
  Settle on analyzer.log for the dpd.log replacement
  dpd->analyzer.log change - rename files
  Analyzer failure logging: tweaks and test fixes
  Introduce analyzer-failed.log, as a replacement for dpd.log
  Rename analyzer.log to analyzer.debug log; move to policy
  Move dpd.log to policy script
2025-06-05 07:22:35 +01:00
Tim Wojtulewicz
62dc6ce7bc Merge remote-tracking branch 'origin/topic/timw/clang-tidy-cppcoreguidelines-fixes'
* origin/topic/timw/clang-tidy-cppcoreguidelines-fixes:
  Add some notes about missing/disabled cppcoreguildlines clang-tidy checkers
  Fix clang-tidy cppcoreguidelines-macro-usage findings (macro functions)
  Fix clang-tidy cppcoreguidelines-macro-usage findings (macros as constants)
  script_opt: Add missing virtual destructor (cppcoreguidelines-virtual-class-destructor)
2025-06-04 09:38:38 -07:00
Tim Wojtulewicz
05aa4690ad Add some notes about missing/disabled cppcoreguildlines clang-tidy checkers 2025-06-04 09:24:05 -07:00
Tim Wojtulewicz
460fe24a9a Fix clang-tidy cppcoreguidelines-macro-usage findings (macro functions) 2025-06-04 09:24:05 -07:00
Tim Wojtulewicz
ad99a6821e Fix clang-tidy cppcoreguidelines-macro-usage findings (macros as constants) 2025-06-04 09:24:05 -07:00
Tim Wojtulewicz
d6d56d330b script_opt: Add missing virtual destructor (cppcoreguidelines-virtual-class-destructor) 2025-06-04 09:24:05 -07:00
Johanna Amann
c392cda11c Merge remote-tracking branch 'origin/topic/johanna/parallelize-coverage-bare-mode-errors'
* origin/topic/johanna/parallelize-coverage-bare-mode-errors:
  Parallelize coverage/bare-mode-errors
2025-06-04 15:56:37 +01:00
Evan Typanski
14fa756d31 Merge remote-tracking branch 'origin/topic/etyp/fix-reenable-analyzer-log'
* origin/topic/etyp/fix-reenable-analyzer-log:
  Fix Spicy re-enable builtin analyzer debug message
2025-06-04 08:40:27 -04:00
Johanna Amann
c51998361c Parallelize coverage/bare-mode-errors
Currently, coverage/bare-mode-errors is one of the slowest tests in the
entire test suite. This is caused by the fact that it has to repeatedly
launch Zeek for every script that we ship. This is done sequentially.

This commit changes this test to use xargs to spawn 20 parallell
processes.
2025-06-04 13:18:05 +01:00
Johanna Amann
9466b10387 NEWS entries for analyzer log changes 2025-06-04 12:16:09 +01:00
Johanna Amann
f02e817aea Move detect-protocol from frameworks/dpd to frameworks/analyzer
detect-protocol.zeek was the last non-deprecated script left in
policy/frameworks/dpd. It was moved to policy/frameworks/analyzer. A
script that loads the script from the new location with a deprecation
warning was added.
2025-06-04 12:16:09 +01:00
Johanna Amann
58613f0313 Introduce new c$failed_analyzers field
This field is used internally to trace which analyzers already had a
violation. This is mostly used to prevent duplicate logging.

In the past, c$service_violation was used for a similar purpose -
however it has slightly different semantics. Where c$failed_analyzers
tracks analyzers that were removed due to a violation,
c$service_violation tracks violations - and doesn't care if an analyzer
was actually removed due to it.
2025-06-04 12:07:13 +01:00
赵富鹏
074faf202f Fix &ordered attribute not preserved in table initializer assignments 2025-06-04 17:07:34 +08:00
zeek-bot
fd98958b92 Update doc submodule [nomail] [skip ci] 2025-06-04 00:23:30 +00:00
Tim Wojtulewicz
0ef2710ca1 Add a missing #include needed by ZeekString on Windows 2025-06-03 15:19:22 -07:00
Tim Wojtulewicz
38ec080196 Update redis btest baselines 2025-06-03 13:37:03 -07:00
Tim Wojtulewicz
3ae9d8ba90 Merge remote-tracking branch 'origin/topic/timw/4350-redis-passwords'
* origin/topic/timw/4350-redis-passwords:
  Redis: Add support for sending AUTH commands during connection
  Redis: disconnect cleanly if INFO request fails
  Fix segfault if storage sync open_backend returns bad code
  Add ToStdString and ToStdStringView to ZeekString
2025-06-03 11:54:23 -07:00
Tim Wojtulewicz
f2aca331ec Redis: Add support for sending AUTH commands during connection 2025-06-03 11:38:38 -07:00
Tim Wojtulewicz
9f12208f57 Redis: disconnect cleanly if INFO request fails 2025-06-03 11:38:38 -07:00
Tim Wojtulewicz
0d18ce4e13 Fix segfault if storage sync open_backend returns bad code 2025-06-03 11:38:38 -07:00
Tim Wojtulewicz
d570486f36 Add ToStdString and ToStdStringView to ZeekString 2025-06-03 11:38:38 -07:00
Johanna Amann
42ba2fcca0 Settle on analyzer.log for the dpd.log replacement
This commit renames analyzer-failed.log to analyzer.log, and updates the
respective news entry.
2025-06-03 17:33:36 +01:00
Johanna Amann
130c89a0a7 dpd->analyzer.log change - rename files
To address review feedback in GH-4362: rename analyzer-failed-log.zeek
to loggig.zeek, analyzer-debug-log.zeek to debug-logging.zeek and
dpd-log.zeek to deprecated-dpd-log.zeek.

Includes respective test, NEWS, etc updates.
2025-06-03 16:32:52 +01:00
Evan Typanski
23b244367b Fix Spicy re-enable builtin analyzer debug message 2025-06-03 11:02:30 -04:00
Johanna Amann
af77a7a83b Analyzer failure logging: tweaks and test fixes
The main part of this commit are changes in tests. A lot of the tests
that previously relied on analyzer.log or dpd.log now use the new
analyzer-failed.log.

I verified all the changes and, as far as I can tell, everything
behaves as it should. This includes the external test baselines.

This change also enables logging of file and packet analyzer to
analyzer_failed.log and fixes some small behavior issues.

The analyzer_failed event is no longer raised when the removal of an
analyzer is vetoed.

If an analyzer is no longer active when an analyzer violation is raised,
currently the analyzer_failed event is raised. This can, e.g., happen
when an analyzer error happens at the very end of the connection. This
makes the behavior more similar to what happened in the past, and also
intuitively seems to make sense.

A bug introduced in the failed service logging was fixed.
2025-06-03 15:56:42 +01:00
Johanna Amann
8c814fa88c Introduce analyzer-failed.log, as a replacement for dpd.log
Analyzer-failed.log is, essentially, the replacement for dpd.log. The
name should make more sense, as it does now log analyzer failures. For
protocol analyzers specifically, these are failures that lead to the
analyzer being disabled.
2025-06-03 15:17:26 +01:00
Johanna Amann
c55e21da71 Rename analyzer.log to analyzer.debug log; move to policy
The current analyzer.log is more useful for debugging than for
operational purposes. Hence this is disabled by default, moved to a
policy script, and the log is renamed to analyzer-debug.log.

Furthermore, logging of analyzer confirmations and disabling analyzers
are now enabled by default.
2025-06-03 15:17:26 +01:00
Johanna Amann
6183c5086b Move dpd.log to policy script
This is the first phase of moving from the current dpd log to a more
modern logfile, without some of the weirdnesses that the current dpd log
contains.

Tests will not pass in the current state; this is just splitting out
functionality.
2025-06-03 15:17:26 +01:00
zeek-bot
f96ce6727f Update doc submodule [nomail] [skip ci] 2025-06-03 00:29:11 +00:00
Tim Wojtulewicz
f76a2437cd Merge remote-tracking branch 'origin/topic/timw/update-windows-ci'
* origin/topic/timw/update-windows-ci:
  Update libunistd submodule [nomail]
  Update Windows CI image to Visual Studio 2022
2025-06-02 14:53:01 -07:00
Tim Wojtulewicz
cd2514f9de Update libunistd submodule [nomail] 2025-06-02 14:52:05 -07:00
Tim Wojtulewicz
295efa7e83 Update Windows CI image to Visual Studio 2022 2025-06-02 14:52:05 -07:00
Tim Wojtulewicz
237c7da47a Merge remote-tracking branch 'origin/topic/timw/bump-opensuse-tumbleweed-docker-image'
* origin/topic/timw/bump-opensuse-tumbleweed-docker-image:
  CI: Force rebuild of opensuse tumbleweed docker image
2025-06-02 14:31:39 -07:00
Tim Wojtulewicz
aea614be56 Merge remote-tracking branch 'origin/topic/robin/gh-4501-eod-abort'
* origin/topic/robin/gh-4501-eod-abort:
  Bump Spicy to pull in fix.
2025-06-02 14:30:51 -07:00
Tim Wojtulewicz
d0f82d8e15 Merge remote-tracking branch 'origin/topic/awelzel/bump-zeekjs-0-17-1'
* origin/topic/awelzel/bump-zeekjs-0-17-1:
  Bump zeekjs to v0.17.1
2025-06-02 11:45:15 -07:00
Tim Wojtulewicz
f2b6fbe1a4 Merge remote-tracking branch 'origin/topic/bbannier/comment-fix'
* origin/topic/bbannier/comment-fix:
  Fix incorrectly copied comment [skip CI]
2025-06-02 11:44:05 -07:00
Tim Wojtulewicz
44a95a61b8 CI: Force rebuild of opensuse tumbleweed docker image
Something is off with the libhiredis package that's installed
as part of the current image, and 'zypper patch' is failing to
update it during the prepare step. Force a rebuild so the
updated package is part of the image to start with.
2025-06-02 10:40:39 -07:00
Arne Welzel
4d03f21031 Bump zeekjs to v0.17.1
b340648 version: 0.17.1
    ccd32e1 ci/docker: Use Fedora 42, retire Fedora 40
    6893431 Nodejs: Use argv.data() over &argv[0]
2025-06-02 19:05:18 +02:00
Arne Welzel
0a34b39e7a Merge remote-tracking branch 'origin/topic/awelzel/4177-4178-custom-event-metadata-part-2'
* origin/topic/awelzel/4177-4178-custom-event-metadata-part-2:
  Event: Bail on add_missing_remote_network_timestamp without add_network_timestamp
  btest/plugin: Test custom metadata publish
  NEWS: Add note about generic event metadata
  cluster: Remove deprecated Event constructor
  cluster: Remove some explicit timestamp handling
  broker/Manager: Fetch and forward all metadata from events
  Event/init-bare: Add add_missing_remote_network_timestamp logic
  cluster/Backend/DoProcessEvent: Use generic metadata, not just timestamps
  cluster/Event: Support moving args and metadata from event
  cluster/serializer/broker: Support generic metadata
  cluster/Event: Generic metadata support
  Event: Use -1.0 for undefined/unset timestamps
  cluster: Use shorter obj_desc versions
  Desc: Add obj_desc() / obj_desc_short() overloads for IntrusivePtr
2025-06-02 17:33:22 +02:00
Arne Welzel
8fc86bb4b6 Event: Bail on add_missing_remote_network_timestamp without add_network_timestamp 2025-06-02 17:31:36 +02:00
Arne Welzel
0ab53c75cd btest/plugin: Test custom metadata publish
Usage demo for plugin writers to add custom event metadata and access in
in Zeek scripts.
2025-06-02 17:31:36 +02:00
Arne Welzel
7db03a8c77 NEWS: Add note about generic event metadata 2025-06-02 17:31:36 +02:00
Arne Welzel
8e87dcbdb2 cluster: Remove deprecated Event constructor
It is now unused, ditch it. This wasn't available in an LTS release yet
and anyhow is in the detail namespace.
2025-06-02 17:31:36 +02:00
Arne Welzel
e3a83addce cluster: Remove some explicit timestamp handling
Backend::MakeClusterEvent() for now is the only place to add implicit
network timestamp metadata within the cluster component.
2025-06-02 17:31:36 +02:00
Arne Welzel
e1f70164e0 broker/Manager: Fetch and forward all metadata from events
Also use the generic metadata version for publishing, keep the
ts-based API for now, but only add timestamps when
EventMetadata::add_network_timestamp is T. I'm not sure what the
right way forward here is, maybe deprecating Broker's publish event
variations and funneling through cluster.
2025-06-02 17:31:36 +02:00
Arne Welzel
96f2d5d369 Event/init-bare: Add add_missing_remote_network_timestamp logic
Make defaulting to the local network timestamp for remote events opt-in.
2025-06-02 17:31:36 +02:00
Arne Welzel
b87109fcf1 cluster/Backend/DoProcessEvent: Use generic metadata, not just timestamps 2025-06-02 17:31:36 +02:00
Arne Welzel
4996ba88fb cluster/Event: Support moving args and metadata from event 2025-06-02 17:31:36 +02:00
Arne Welzel
46d4b5825b cluster/serializer/broker: Support generic metadata
Instead of handling just the network timestamp, support extraction of
the whole metadata vector that broker events hold.
2025-06-02 17:31:36 +02:00
Arne Welzel
71412f35b7 cluster/Event: Generic metadata support
Instead of a timestamp attribute, switch to holding a EventMetadataVectorPtr
like zeek::Event instances do. Keep the old constructor until the end of
the patch series.
2025-06-02 17:31:36 +02:00
Arne Welzel
7b4b1779bf Event: Use -1.0 for undefined/unset timestamps
This can happen if either there's no network timestamp associated with
an event, or there's currently no event being dispatched. Using 0.0
isn't great as it's the normal start timestamp before reading a network
packet. Using -1.0 gives the caller a chance to check and realize what's
going on.
2025-06-02 17:31:36 +02:00
Benjamin Bannier
0dae8b8d2d Fix incorrectly copied comment [skip CI] 2025-06-02 13:24:24 +02:00
Arne Welzel
31f51f7a87 Merge remote-tracking branch 'origin/topic/bbannier/coverity-fixes'
* origin/topic/bbannier/coverity-fixes:
  Prefer `std::move` over copy
2025-06-02 10:17:24 +02:00
Arne Welzel
e5bb6317fa Merge remote-tracking branch 'origin/topic/vern/CPP-maint.May25'
* origin/topic/vern/CPP-maint.May25:
  minor BTest maintenance updates for -O gen-C++
  fix for more robustly finding BTests to assess for -O gen-C++
  fix for -O gen-C++ dealing with type constants of unnamed compound types
2025-06-02 10:12:27 +02:00
Arne Welzel
41f04eda72 Merge remote-tracking branch 'origin/topic/awelzel/intel-indicator-hooks'
* origin/topic/awelzel/intel-indicator-hooks:
  intel/seen/manage-event-groups: Policy script for toggling intel event groups
  intel: Add indicator_inserted and indicator_removed hooks
2025-06-02 09:52:07 +02:00
Arne Welzel
0619fe2f4f intel/seen/manage-event-groups: Policy script for toggling intel event groups
Co-authored-by: Mohan Dhawan <mohan@corelight.com>
2025-06-02 09:51:14 +02:00
Arne Welzel
7eb849ddf4 intel: Add indicator_inserted and indicator_removed hooks
This change adds two new hooks to the Intel framework that can be used
to intercept added and removed indicators and their type.

These hooks are fairly low-level. One immediate use-case is to count the
number of indicators loaded per Intel::Type and enable and disable the
corresponding event groups of the intel/seen scripts.

I attempted to gauge the overhead and while it's definitely there, loading
a file with ~500k DOMAIN entries takes somewhere around ~0.5 seconds hooks
when populated via the min_data_store store mechanism. While that
doesn't sound great, it actually takes the manager on my system 2.5
seconds to serialize and Cluster::publish() the min_data_store alone
and its doing that serially for every active worker. Mostly to say that
the bigger overhead in that area on the manager doing redundant work
per worker.

Co-authored-by: Mohan Dhawan <mohan@corelight.com>
2025-06-02 09:50:48 +02:00
Benjamin Bannier
1760d99c49 Prefer std::move over copy 2025-06-02 08:45:32 +02:00
Vern Paxson
614eb8d343 minor BTest maintenance updates for -O gen-C++ 2025-05-31 12:52:44 -07:00
Vern Paxson
9117ccab12 fix for more robustly finding BTests to assess for -O gen-C++ 2025-05-31 12:50:14 -07:00
Vern Paxson
e165e64fa5 fix for -O gen-C++ dealing with type constants of unnamed compound types 2025-05-31 12:49:37 -07:00
zeek-bot
224519c11a Update doc submodule [nomail] [skip ci] 2025-05-31 00:26:58 +00:00
Tim Wojtulewicz
3282bbc429 Merge remote-tracking branch 'origin/topic/vern/ZAM-maint.May25'
* origin/topic/vern/ZAM-maint.May25:
  fix for crash when interpreting transformed ASTs that include multi-field record assignments/additions
  Remove unused ZAM compiler method
2025-05-30 13:07:01 -07:00
Tim Wojtulewicz
70bc0d9deb Merge remote-tracking branch 'origin/topic/timw/cleanup-cmake-summary-output'
* origin/topic/timw/cleanup-cmake-summary-output:
  Add utility methods to make CMake summary output nicer
2025-05-30 12:16:35 -07:00
Tim Wojtulewicz
e93242726b Add utility methods to make CMake summary output nicer 2025-05-30 11:57:43 -07:00
Tim Wojtulewicz
dc5dd8be45 Merge remote-tracking branch 'origin/topic/timw/new-ci-pr-labels'
* origin/topic/timw/new-ci-pr-labels:
  CI: Add PR label for skipping all CI jobs
  CI: Add PR label for running cluster tests
2025-05-30 10:29:37 -07:00
Tim Wojtulewicz
bc4cf14237 CI: Add PR label for skipping all CI jobs 2025-05-30 10:29:02 -07:00
Tim Wojtulewicz
e9544386fe CI: Add PR label for running cluster tests 2025-05-30 10:27:52 -07:00
Vern Paxson
dc68a62a1e fix for crash when interpreting transformed ASTs that include multi-field record assignments/additions 2025-05-30 09:44:26 -07:00
Vern Paxson
ba0b7492a7 Remove unused ZAM compiler method 2025-05-30 09:38:42 -07:00
Tim Wojtulewicz
9c290df47f Merge remote-tracking branch 'origin/topic/timw/ci-clang-tidy'
* origin/topic/timw/ci-clang-tidy:
  CI: Add new task to run clang-tidy as part of nightly builds
  CI: Update to clang 19 on ubuntu 24.04, add clang-tidy package
2025-05-30 08:39:36 -07:00
Tim Wojtulewicz
bf9813a7c6 CI: Add new task to run clang-tidy as part of nightly builds 2025-05-30 08:39:14 -07:00
Tim Wojtulewicz
dbd787a81f CI: Update to clang 19 on ubuntu 24.04, add clang-tidy package 2025-05-30 08:39:14 -07:00
Arne Welzel
f4cd92e24a Merge remote-tracking branch 'origin/topic/awelzel/4494-ts-millis-signed'
* origin/topic/awelzel/4494-ts-millis-signed:
  logging/ascii/json: Make TS_MILLIS signed, add TS_MILLIS_UNSIGNED
2025-05-30 17:24:17 +02:00
Arne Welzel
93813a5079 logging/ascii/json: Make TS_MILLIS signed, add TS_MILLIS_UNSIGNED
It seems TS_MILLIS is specifically for Elasticsearch and starting with
Elasticsearch 8.2 epoch_millis does (again?) support negative epoch_millis,
so make Zeek produce that by default.

If this breaks a given deployment, they can switch Zeek back to TS_MILLIS_UNSIGNED.

https://discuss.elastic.co/t/migration-from-es-6-8-to-7-17-issues-with-negative-date-epoch-timestamp/335259
https://github.com/elastic/elasticsearch/pull/80208

Thanks for @timo-mue for reporting!

Closes #4494
2025-05-30 17:23:29 +02:00
Tim Wojtulewicz
c387ec87be Merge remote-tracking branch 'origin/topic/timw/clang-tidy-performance-fixes'
* origin/topic/timw/clang-tidy-performance-fixes:
  Add move operations for LogWriteHeader
  Add missing setting of type in session::Key move operations
  Update .clang-tidy to have performance-* enabled with some exclusions
  Fix clang-tidy performance-inefficient-string-concatenation warnings
  Fix clang-tidy performance-unnecessary-copy-initialization warnings
  Fix clang-tidy performance-move-const-argument warnings (not move assignable/copyable)
  Fix clang-tidy performance-move-const-argument warnings (passing move to const argument)
  Fix clang-tidy performance-move-const-argument warnings (moving trivially copyable)
  Fix clang-tidy performance-move-const-argument warnings (moving const variables)
  Fix clang-tidy performance-inefficient-vector-operation warnings
  Fix clang-tidy performance-for-range-copy warnings
  Fix clang-tidy performance-faster-string-find warnings
  Fix clang-tidy performance-enum-size warnings
  Fix clang-tidy performance-avoid-endl warnings
2025-05-30 08:13:19 -07:00
Tim Wojtulewicz
6eb49a10cc Add move operations for LogWriteHeader 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
df852255c6 Add missing setting of type in session::Key move operations 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
db69773d23 Update .clang-tidy to have performance-* enabled with some exclusions 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
c609d5c90a Fix clang-tidy performance-inefficient-string-concatenation warnings 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
cb8c35748a Fix clang-tidy performance-unnecessary-copy-initialization warnings 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
909413838c Fix clang-tidy performance-move-const-argument warnings (not move assignable/copyable) 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
57c10a6ace Fix clang-tidy performance-move-const-argument warnings (passing move to const argument) 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
ad4694f529 Fix clang-tidy performance-move-const-argument warnings (moving trivially copyable) 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
144a3dee3a Fix clang-tidy performance-move-const-argument warnings (moving const variables) 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
6196950567 Fix clang-tidy performance-inefficient-vector-operation warnings 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
b8e28abb97 Fix clang-tidy performance-for-range-copy warnings 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
178d7f4cd0 Fix clang-tidy performance-faster-string-find warnings 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
f4c47d0357 Fix clang-tidy performance-enum-size warnings 2025-05-30 08:12:29 -07:00
Tim Wojtulewicz
11a1d8d506 Fix clang-tidy performance-avoid-endl warnings 2025-05-30 08:02:55 -07:00
Arne Welzel
10bfb34a8a Update doc submodule [nomail] [skip ci]
Fix botched last-minute cleanup.
2025-05-30 16:49:10 +02:00
Arne Welzel
1d241fabf4 Merge remote-tracking branch 'origin/topic/awelzel/zeekygen-field-directive'
* origin/topic/awelzel/zeekygen-field-directive:
  Bump doc submodule for ext/zeek.py modifications
  RecordType:DescribeReST: Render RecordType using zeek:field directive
2025-05-30 16:44:42 +02:00
Tim Wojtulewicz
08f335b5f6 Update broker submodule [nomail] 2025-05-30 07:30:41 -07:00
Arne Welzel
f16ebd34b3 Merge remote-tracking branch 'origin/topic/awelzel/4474-cluster-websocket-ipv6'
* origin/topic/awelzel/4474-cluster-websocket-ipv6:
  IXWebsocket: Bump to version with memset() sock addr fix
  cluster/websocket: Deprecate $listen_host, introduce $listen_addr
  cluster/websocket-ixwebsocket: Determine proper address_family
2025-05-30 11:47:55 +02:00
Arne Welzel
66fef5a9bd IXWebsocket: Bump to version with memset() sock addr fix 2025-05-30 11:02:41 +02:00
Arne Welzel
544d571089 cluster/websocket: Deprecate $listen_host, introduce $listen_addr
This only changes the script-layer API, but keeps the std::string host
in the C++ layer's ServerOptions. Mostly because the ixwebsocket library
takes host as std::string. Also, maybe at  some point we'd want to
support something scheme-based like unix:///var/run/zeek.sock and placing
that in a string could not be totally wrong.

Add tests for IPV6, too.
2025-05-30 11:02:41 +02:00
Arne Welzel
8b029d0050 cluster/websocket-ixwebsocket: Determine proper address_family
Closes #4474
2025-05-30 11:01:31 +02:00
Tim Wojtulewicz
372986f052 Update docs submodue [nomail] [skip ci] 2025-05-28 11:44:09 -07:00
Tim Wojtulewicz
2d7aad2c81 Merge remote-tracking branch 'origin/topic/timw/remove-with-bind'
* origin/topic/timw/remove-with-bind:
  Remove obsolete --with-bind configure flag
2025-05-28 08:29:50 -07:00
Arne Welzel
871e81dd6a Bump doc submodule for ext/zeek.py modifications 2025-05-28 16:18:44 +02:00
Arne Welzel
71fb301e3d RecordType:DescribeReST: Render RecordType using zeek:field directive
This is for zeek/zeek-docs#324.
2025-05-28 15:59:50 +02:00
Robin Sommer
e494fb5d19
Bump Spicy to pull in fix.
Includes a new regression test.

Closes #4501.
2025-05-28 15:50:47 +02:00
Tim Wojtulewicz
9db9861f75 Remove obsolete --with-bind configure flag 2025-05-27 17:55:49 -07:00
zeek-bot
9ffc87a90e Update doc submodule [nomail] [skip ci] 2025-05-28 00:38:27 +00:00
Tim Wojtulewicz
bca6bc70b2 Silence -Wnontrivial-memcall warning in ConnKey methods 2025-05-27 13:48:37 -07:00
Tim Wojtulewicz
88ae3ba412 Merge remote-tracking branch 'origin/topic/timw/coverity'
* origin/topic/timw/coverity:
  Add a few std::moves to fix Coverity warnings
  Fix possible memory leak in broker::Manager
  fixup! Use SCN* constants when reading into sized integer types
  from_json: Statically lookup err index in result type
  Use SCN* constants when reading into sized integer types
  Remove setting unused variable value in FTP::parse_eftp
2025-05-27 12:49:13 -07:00
Tim Wojtulewicz
e4ab1a3b1d Add a few std::moves to fix Coverity warnings 2025-05-27 12:03:45 -07:00
Tim Wojtulewicz
ff7c908460 Fix possible memory leak in broker::Manager 2025-05-27 12:03:45 -07:00
Tim Wojtulewicz
54c5a470bd fixup! Use SCN* constants when reading into sized integer types 2025-05-27 12:03:45 -07:00
Tim Wojtulewicz
a6437142ce from_json: Statically lookup err index in result type 2025-05-27 12:03:45 -07:00
Tim Wojtulewicz
1992a55798 Use SCN* constants when reading into sized integer types 2025-05-27 12:03:45 -07:00
Tim Wojtulewicz
ff4d1a4121 Remove setting unused variable value in FTP::parse_eftp 2025-05-27 12:03:45 -07:00
Tim Wojtulewicz
aaca36dc22 Merge remote-tracking branch 'origin/topic/timw/clang-tidy-bugprone-fixes'
* origin/topic/timw/clang-tidy-bugprone-fixes: (22 commits)
  Update .clang-tidy to have bugprone-* enabled with some exclusions
  Fix clang-tidy bugprone-unused-return-value warnings
  Fix clang-tidy bugprone-unsafe-functions warnings
  Fix clang-tidy bugprone-unused-local-non-trivial-variable warnings
  Fix clang-tidy bugprone-throw-keyword-missing warnings
  Fix clang-tidy bugprone-switch-missing-default-case warnings
  Fix clang-tidy bugprone-suspicious-realloc-usage warnings
  Fix clang-tidy bugprone-suspicious-include warnings
  Fix clang-tidy bugprone-suspicious-string-compare warnings
  Fix clang-tidy bugprone-suspicious-stringview-data-usage warnings
  Fix clang-tidy bugprone-string-literal-with-embedded-nul warnings
  Fix clang-tidy bugprone-parent-virtual-call warnings
  Fix clang-tidy bugprone-misplaced-widening-cast warnings
  Fix clang-tidy bugprone-inc-dec-in-conditions warnings
  Fix clang-tidy bugprone-multi-level-implicit-pointer-conversion warnings
  Fix clang-tidy bugprone-macro-parentheses warnings
  Fix clang-tidy bugprone-incorrect-roundings warnings
  Fix clang-tidy bugprone-incorrect-division warnings
  Fix clang-tidy bugprone-implicit-widening-of-multiplication-result warnings
  Remove noexcept from util::tokenize_string
  ...
2025-05-27 11:59:46 -07:00
Tim Wojtulewicz
998479258a Update .clang-tidy to have bugprone-* enabled with some exclusions 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
637a7732c0 Fix clang-tidy bugprone-unused-return-value warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
ae2ff9901b Fix clang-tidy bugprone-unsafe-functions warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
d2045d1834 Fix clang-tidy bugprone-unused-local-non-trivial-variable warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
8bb015754a Fix clang-tidy bugprone-throw-keyword-missing warnings
This one renames the Modbus Exception binpac type to ExcResponse. clang-tidy
insisted that anything named started with Exception was actually an exception
and needed to be thrown.
2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
2c2a595af5 Fix clang-tidy bugprone-switch-missing-default-case warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
b20419efaf Fix clang-tidy bugprone-suspicious-realloc-usage warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
f643d02bf8 Fix clang-tidy bugprone-suspicious-include warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
4d60d4833e Fix clang-tidy bugprone-suspicious-string-compare warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
975f24bde6 Fix clang-tidy bugprone-suspicious-stringview-data-usage warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
02589c349a Fix clang-tidy bugprone-string-literal-with-embedded-nul warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
74acc30258 Fix clang-tidy bugprone-parent-virtual-call warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
b3de432ef2 Fix clang-tidy bugprone-misplaced-widening-cast warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
184757b3db Fix clang-tidy bugprone-inc-dec-in-conditions warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
d0bbc61bd4 Fix clang-tidy bugprone-multi-level-implicit-pointer-conversion warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
9e83759e83 Fix clang-tidy bugprone-macro-parentheses warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
1d315a3847 Fix clang-tidy bugprone-incorrect-roundings warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
87f1b1a7b3 Fix clang-tidy bugprone-incorrect-division warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
18983aed02 Fix clang-tidy bugprone-implicit-widening-of-multiplication-result warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
bdb0fad6d5 Remove noexcept from util::tokenize_string
One instance of this method is noexcept and one isn't. The version
that is noexcept uses std::vector::emplace_back, which may throw
exceptions. Instead of adding a try/catch block, opt for just making
the two functions able to throw exceptions.

This fixes a clang-tidy bugprone-exception-escape warning.
2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
dbecfb5a2a Fix clang-tidy bugprone-branch-clone warnings 2025-05-27 11:58:27 -07:00
Tim Wojtulewicz
92854e95d3 Fix clang-tidy bugprone-assignment-in-if-condition warnings 2025-05-27 11:58:27 -07:00
Johanna Amann
8ce741a7a8 Merge remote-tracking branch 'origin/topic/johanna/gh-4463'
* origin/topic/johanna/gh-4463:
  Add explicit TLS support for FTP
2025-05-27 17:47:52 +01:00
Johanna Amann
718307214e Add explicit TLS support for FTP
This is defined in RFC 4217; TLS initialized by the client sending an
`AUTH TLS` command.

Fixes GH-4463
2025-05-27 16:57:51 +01:00
Evan Typanski
9f2fb47f48 Merge remote-tracking branch 'origin/topic/etyp/redis-analyzer'
* origin/topic/etyp/redis-analyzer:
  spicy-redis: Add NEWS entry
  spicy-redis: Separate error replies from success
  spicy-redis: Cleanup scripts and tests
  spciy-redis: Bring Redis analyzer into Zeek proper
  spicy-redis: Abort parsing if server data comes first
  spicy-redis: Add recursion depth to server data
  spicy-redis: Make client data only accept bulk strings
  spicy-redis: Add dpd signature and clean pcaps
  spicy-redis: Add some commands and touch up parsing
  spicy-redis: Add some script logic for logging
  spicy-redis: Separate client/server
  spicy-redis: Touchup logging and Spicy issues
  spicy-redis: Add synchronization and pipeline support
  spicy-redis: Begin Spicy Redis analyzer
2025-05-27 10:20:00 -04:00
Evan Typanski
1b962b0fa7 spicy-redis: Add NEWS entry 2025-05-27 10:12:52 -04:00
Evan Typanski
b4429a995a spicy-redis: Separate error replies from success 2025-05-27 09:31:25 -04:00
Evan Typanski
d5b121db14 spicy-redis: Cleanup scripts and tests
- Recomputes checksums for pcaps to keep clean
- Removes some tests that had big pcaps or weren't necessary
- Cleans up scripting names and minor points
- Comments out Spicy code that causes a build failure now with a TODO to
  uncomment it
2025-05-27 09:29:13 -04:00
Evan Typanski
11777bd6d5 spciy-redis: Bring Redis analyzer into Zeek proper 2025-05-27 09:28:12 -04:00
Evan Typanski
aef9fe11dc spicy-redis: Abort parsing if server data comes first
Redis seems to only want client data first to request server data. The
DPD signature seems to pick up on some cases where server data comes
first, but is otherwise "valid" RESP. See if this helps lower FP rates.
2025-05-27 09:28:12 -04:00
Evan Typanski
90d56ce630 spicy-redis: Add recursion depth to server data 2025-05-27 09:28:12 -04:00
Evan Typanski
292241f420 spicy-redis: Make client data only accept bulk strings 2025-05-27 09:28:12 -04:00
Evan Typanski
7f28ec8bc5 spicy-redis: Add dpd signature and clean pcaps 2025-05-27 09:28:12 -04:00
Evan Typanski
f0e9f46c7c spicy-redis: Add some commands and touch up parsing 2025-05-27 09:28:12 -04:00
Evan Typanski
22bda56af3 spicy-redis: Add some script logic for logging
Also "rebrands" from RESP to Redis.
2025-05-27 09:28:12 -04:00
Evan Typanski
757cbbf902 spicy-redis: Separate client/server
This makes the parser more official and splits the client/server out
from each other. Apparently they're different enough to be separate.
2025-05-27 09:28:12 -04:00
Evan Typanski
f0f2969a66 spicy-redis: Touchup logging and Spicy issues 2025-05-27 09:28:12 -04:00
Evan Typanski
97d26a689d spicy-redis: Add synchronization and pipeline support
Also adds some command support
2025-05-27 09:28:12 -04:00
Evan Typanski
4210e62e57 spicy-redis: Begin Spicy Redis analyzer 2025-05-27 09:28:12 -04:00
Benjamin Bannier
897b1546a2 Merge branch 'topic/bbannier/bump-spicy' 2025-05-27 15:13:59 +02:00
Benjamin Bannier
2104a84e0b Do not build tests for auxil/spicy 2025-05-27 15:12:09 +02:00
Benjamin Bannier
99243b5fbe Bump auxil/spicy to latest development snapshot 2025-05-27 09:17:57 +02:00
Arne Welzel
e2e13902f3 cluster: Use shorter obj_desc versions 2025-05-26 17:53:23 +02:00
Arne Welzel
0c18ec5e5d Desc: Add obj_desc() / obj_desc_short() overloads for IntrusivePtr
When using these helpers in code, one barely has raw pointers and the
repeated `.get()` call cumbersome and noisy.
2025-05-26 16:10:48 +02:00
Arne Welzel
cef63e871e Merge remote-tracking branch 'origin/topic/awelzel/fix-no-zero-timestamp-metadata'
* origin/topic/awelzel/fix-no-zero-timestamp-metadata:
  btest: Add test for Cluster::hello zero-timestamp
  EventMgr/Enqueue: Add automatic timestamp metadata to local events, only
  cluster and broker: Propagate zero-timestamp as metadata, too.
2025-05-26 16:08:58 +02:00
Arne Welzel
277c3f5245 btest: Add test for Cluster::hello zero-timestamp 2025-05-26 16:08:27 +02:00
Arne Welzel
a9d22611d0 EventMgr/Enqueue: Add automatic timestamp metadata to local events, only
It seems less surprising if only local events receive automatic network
timestamp metadata. For remote events the automatic value will most
likely be misleading.
2025-05-26 16:08:27 +02:00
Arne Welzel
d828e08a9e cluster and broker: Propagate zero-timestamp as metadata, too.
This will be cleaned up later to just pass all contained metadata from
a cluster event to the queued event, but for now do this here, otherwise
we break some internal tests.
2025-05-26 13:37:42 +02:00
zeek-bot
ffb07ce2bd Update doc submodule [nomail] [skip ci] 2025-05-24 00:24:08 +00:00
Tim Wojtulewicz
f996f661b6 Merge remote-tracking branch 'origin/topic/timw/redis-connection-failure'
* origin/topic/timw/redis-connection-failure:
  Redis: bump version of hiredis required
  Redis: return proper error if connection fails
2025-05-23 12:13:51 -07:00
Tim Wojtulewicz
85e27afaa8 Redis: bump version of hiredis required 2025-05-23 12:13:13 -07:00
Tim Wojtulewicz
0fb4548ff0 Redis: return proper error if connection fails 2025-05-23 12:13:13 -07:00
Arne Welzel
d929392a76 Merge remote-tracking branch 'origin/topic/awelzel/4177-4178-custom-event-metadata-part-1'
* origin/topic/awelzel/4177-4178-custom-event-metadata-part-1:
  Event: Move meta after args
  Event: Use IntrusivePtr to manage obj refcount
  btest/zam: Update for new EventMetadata bifs
  broker and cluster: Switch to new Enqueue() API
  Event/zeek.bif: Add EventMetadata current() and current_values() accessors
  Event: Deprecate default network timestamp metadata
  Event: Store timestamp in metadata vector
  EventRegistry/zeek.bif/init-bare: Add event metadata infrastructure
  EventMgr: Add CurrentEvent() accessor
2025-05-23 21:02:28 +02:00
Arne Welzel
bfcb68f8e7 Event: Move meta after args 2025-05-23 19:32:50 +02:00
Arne Welzel
89402fcc1b Event: Use IntrusivePtr to manage obj refcount
Fly-by cleanup.
2025-05-23 19:32:50 +02:00
Arne Welzel
e4e9ec3e80 btest/zam: Update for new EventMetadata bifs 2025-05-23 19:32:50 +02:00
Arne Welzel
506fea3335 broker and cluster: Switch to new Enqueue() API
This is a bit intermediary. In part 2 this will deal with any metadata,
not just timestamps.
2025-05-23 19:32:50 +02:00
Arne Welzel
75aa6588fe Event/zeek.bif: Add EventMetadata current() and current_values() accessors
...and basic smoke testing.
2025-05-23 19:32:50 +02:00
Arne Welzel
53b0f0ad64 Event: Deprecate default network timestamp metadata
This deprecates the Event constructor and the ``ts`` parameter of Enqueue()
Instead, versions are introduced that take a detail::MetadataVectorPtr which
can hold the network timestamp metadata and is meant to be allocated by the
caller instead of automatically during Enqueue() or within the Event
constructor.

This also introduces a BifConst ``EventMetadata::add_network_timestamp`` to
opt-in adding network timestamps to events globally. It's disabled by
default as there are not a lot of known use cases that need this.
2025-05-23 19:32:23 +02:00
Arne Welzel
12c523f3f7 Event: Store timestamp in metadata vector
This removes the ts attribute from Event and instead allocates a vector for
storing metadata. By default, adds the network time as a TimeVal. Later
patches will make the allocation of the vector optional by introducing a
different constructor so that users that are not interested in network
timestamp metadata do not take the allocation hit.

Moving the explicit ``ts`` out of the event is done in order to treat it
just as generic metadata, too. However, the Time() accessor is adapted to
lookup the value from the metadata vector instead.
2025-05-23 19:32:23 +02:00
Arne Welzel
cc7dc60c1e EventRegistry/zeek.bif/init-bare: Add event metadata infrastructure
Introduce a new EventMetadata module and members on EventMgr to register
event metadata types.
2025-05-23 19:31:58 +02:00
Arne Welzel
fc96c81c70 EventMgr: Add CurrentEvent() accessor
Avoid proliferation of accessors on EventMgr.
2025-05-23 19:31:06 +02:00
Tim Wojtulewicz
57b618ee4a Merge remote-tracking branch 'origin/topic/timw/remove-findclangtidy'
* origin/topic/timw/remove-findclangtidy:
  Remove FindClangTidy.cmake, update cmake submodule
2025-05-23 08:32:13 -07:00
Tim Wojtulewicz
b091f5b5c3 Remove FindClangTidy.cmake, update cmake submodule 2025-05-23 08:30:48 -07:00
zeek-bot
7110a8b838 Update doc submodule [nomail] [skip ci] 2025-05-23 00:16:11 +00:00
Tim Wojtulewicz
bb17d9e4d6 Merge remote-tracking branch 'origin/topic/timw/sqlite-cluster-test-followup'
* origin/topic/timw/sqlite-cluster-test-followup:
  SQLite: Add TODO note about possibly using sqlite3_busy_timeout
  SQLite: Fix typo in variable name causing pragmas not to retry on busy
  SQLite: Use tableval iteration instead of ToMap for pragmas
  SQLite: Fix logging/error messages around executing pragmas
2025-05-22 16:55:20 -07:00
Tim Wojtulewicz
8a27b894b6 SQLite: Add TODO note about possibly using sqlite3_busy_timeout 2025-05-22 10:23:17 -07:00
Tim Wojtulewicz
25f144381c SQLite: Fix typo in variable name causing pragmas not to retry on busy 2025-05-22 10:23:17 -07:00
Tim Wojtulewicz
57d797e087 SQLite: Use tableval iteration instead of ToMap for pragmas 2025-05-22 10:22:40 -07:00
Tim Wojtulewicz
384ea046b3 SQLite: Fix logging/error messages around executing pragmas 2025-05-22 10:22:40 -07:00
zeek-bot
0864048c3f Update doc submodule [nomail] [skip ci] 2025-05-22 00:15:56 +00:00
Tim Wojtulewicz
25dd1a2702 Disable sqlite-cluster btest
This test is being flaky on some platforms and still having problems
with executing pragmas at startup. Disable it for now until it can be
fixed.
2025-05-21 15:42:29 -07:00
Tim Wojtulewicz
6b104f3e22 Merge remote-tracking branch 'origin/topic/timw/fix-sqlite-btest-output'
* origin/topic/timw/fix-sqlite-btest-output:
  Update baseline of sqlite-basic btest after recent changes
2025-05-21 12:47:16 -07:00
Tim Wojtulewicz
0c7ad126d6 Update baseline of sqlite-basic btest after recent changes 2025-05-21 11:01:54 -07:00
Tim Wojtulewicz
1862e66097 Merge remote-tracking branch 'origin/topic/timw/sqlite-cluster-test'
* origin/topic/timw/sqlite-cluster-test:
  SQLite: Move integrity_check to pragma table
  SQLite: Add backend option for pragma timeout
  SQLite: Rename tuning_params to pragma_commands, move running pragmas to utility method
  SQLite: Retry pragma statements at startup to avoid contention
  SQLite: Check for locked database as well as busy databases
  SQLite: Fix some string-sizing issues
  SQLite: Run pragmas on connection before creating table
  SQLite: Add busy_timeout pragma to default options
  Prefix sqlite-based btests with sqlite- to match redis tests
  Add sqlite cluster storage btest
2025-05-21 09:41:15 -07:00
Tim Wojtulewicz
a58128a45c SQLite: Move integrity_check to pragma table 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
78dffb1d6f SQLite: Add backend option for pragma timeout 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
f0e7b78554 SQLite: Rename tuning_params to pragma_commands, move running pragmas to utility method 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
53cb3c3681 SQLite: Retry pragma statements at startup to avoid contention 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
227d24b64d SQLite: Check for locked database as well as busy databases 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
1bff4c9537 SQLite: Fix some string-sizing issues 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
ac064bd6af SQLite: Run pragmas on connection before creating table 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
26cc6d4e7b SQLite: Add busy_timeout pragma to default options 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
e91421a8de Prefix sqlite-based btests with sqlite- to match redis tests 2025-05-21 09:38:27 -07:00
Tim Wojtulewicz
41bddae59f Add sqlite cluster storage btest 2025-05-21 09:38:27 -07:00
Arne Welzel
891338194f Merge remote-tracking branch 'origin/topic/awelzel/fixup-detect-sql-injection-zeekygen-comment'
* origin/topic/awelzel/fixup-detect-sql-injection-zeekygen-comment:
  http/detect-sql-injection: Fix zeekygen comment
  btest/coverage/test-all-policy-zeekygen: Load test-all-policy with zeekygen enabled
2025-05-21 13:39:07 +02:00
Arne Welzel
8d588a10a9 http/detect-sql-injection: Fix zeekygen comment
Discarded extraneous Zeekygen comment: $src field; and always provides a victim IP address in the $dst field.
2025-05-21 11:49:48 +02:00
Arne Welzel
aabd1e3825 btest/coverage/test-all-policy-zeekygen: Load test-all-policy with zeekygen enabled
There should not be warnings produced. The default ZEEK_DISABLE_ZEEKYGEN=1
setting in the btest configuration hid some issues previously.
2025-05-21 11:49:12 +02:00
zeek-bot
7d54a58a76 Update doc submodule [nomail] [skip ci] 2025-05-21 00:15:25 +00:00
Tim Wojtulewicz
c596556036 Merge remote-tracking branch 'origin/topic/timw/3913-parse-port-invalid-read'
* origin/topic/timw/3913-parse-port-invalid-read:
  Add extra input files to ftp fuzzer corpus
  Use bool instead of int flag in FTP analyzer's parse_eftp method
  Fix undefined behavior in FTP analyzer's parse_port method
  Fix invalid-read in FTP analyzer's parse_port method
2025-05-20 12:02:18 -07:00
Arne Welzel
ec744024d3 Merge remote-tracking branch 'origin/topic/awelzel/btest-cluster-layout-replacement'
* origin/topic/awelzel/btest-cluster-layout-replacement:
  btest remaining: Use generic cluster-layout.zeek
  btest/frameworks/logging: Use generic cluster-layout.zeek
  btest/files/x509: Use generic cluster-layout.zeek
  btest/frameworks/notice: Use generic cluster-layout.zeek
  btest/policy: Use generic cluster-layout.zeek
  btest/frameworks/intel: Use generic cluster-layout.zeek
  btest/frameworks/sumstats: Use generic cluster-layout.zeek
  btest/frameworks/cluster: Use generic cluster-layout.zeek
  btest/frameworks/config: Use generic cluster-layout.zeek
  btest/broker: Use generic cluster-layout.zeek
  btest/cluster: Use generic cluster-layout.zeek
  testing/btest/Files: Add generic broker/cluster-layout.zeek
2025-05-20 20:30:47 +02:00
Arne Welzel
00eabb6cbb btest remaining: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
9365f71965 btest/frameworks/logging: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
6c00c05249 btest/files/x509: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
d7b5955e5e btest/frameworks/notice: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
2a3f2d0004 btest/policy: Use generic cluster-layout.zeek
Catch-all for cluster scripts in policy directory.
2025-05-20 20:30:01 +02:00
Arne Welzel
00a12a4cc5 btest/frameworks/intel: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
4dec63936e btest/frameworks/sumstats: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
0a06a77c69 btest/frameworks/cluster: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
e114b0e371 btest/frameworks/config: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
f9ff396acf btest/broker: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
a15df5fc11 btest/cluster: Use generic cluster-layout.zeek 2025-05-20 20:30:01 +02:00
Arne Welzel
b3f53dc455 testing/btest/Files: Add generic broker/cluster-layout.zeek
This is a cluster-layout.zeek template that can be copied into a testing
directory if needed. The idea is that a developer sets environment
variables within their btest and the Cluster::nodes variable is
implicitly extended by appropriate nodes.

For example, using @TEST-PORT BROKER_LOGGER1_PORT will add an appropriate
logger-1 node to Cluster::nodes, based on the existence of the
BROKER_LOGGER1_PORT environment variable.
2025-05-20 20:30:01 +02:00
Tim Wojtulewicz
9ae16a3db3 Add extra input files to ftp fuzzer corpus 2025-05-20 10:58:32 -07:00
Tim Wojtulewicz
517dfff529 Use bool instead of int flag in FTP analyzer's parse_eftp method 2025-05-20 10:58:32 -07:00
Tim Wojtulewicz
c0b09665b9 Fix undefined behavior in FTP analyzer's parse_port method 2025-05-20 10:58:32 -07:00
Tim Wojtulewicz
8596671dd5 Fix invalid-read in FTP analyzer's parse_port method 2025-05-20 10:58:32 -07:00
Arne Welzel
906b91dca8 Merge remote-tracking branch 'origin/topic/vern/http-sqli-replacement'
* origin/topic/vern/http-sqli-replacement:
  site/local: Switch to detect-sql-injection
  Add a revised script for detecting HTTP SQL injection, deprecate original
2025-05-20 16:26:13 +02:00
Arne Welzel
c687a24503 site/local: Switch to detect-sql-injection 2025-05-20 16:24:28 +02:00
Vern Paxson
dcd14f7a16 Add a revised script for detecting HTTP SQL injection, deprecate original 2025-05-20 16:24:20 +02:00
zeek-bot
a694781bad Update doc submodule [nomail] [skip ci] 2025-05-20 00:25:51 +00:00
Tim Wojtulewicz
ddeecabc1e Merge remote-tracking branch 'origin/topic/awelzel/event-trace-fix-operator-equals'
* origin/topic/awelzel/event-trace-fix-operator-equals:
  EventTrace: Fix operator==() UBSAN downcast error
2025-05-19 12:33:08 -07:00
Arne Welzel
1ed38e7342 EventTrace: Fix operator==() UBSAN downcast error
New test triggered the following error:

    runtime error: downcast of address 0x57021a323ea0 which does not point to an object of type 'const FileVal' 0x57021a323ea0: note: object is of type 'zeek::FuncVal'
2025-05-19 20:48:18 +02:00
Christian Kreibich
fdecfba6b4 Merge branch 'smoot-improve-from_json' of github.com:/stevesmoot/zeek
* 'smoot-improve-from_json' of github.com:/stevesmoot/zeek:
  update baseline for zam
  Update src/zeek.bif
  Change from_json to return an error rather than print it.
2025-05-19 11:06:29 -07:00
Arne Welzel
eb15997cc3 Merge remote-tracking branch 'origin/topic/awelzel/event-trace-mgr-destructor-fclose'
* origin/topic/awelzel/event-trace-mgr-destructor-fclose:
  btest/core: Add event-trace test
  zeek-setup: Free event_trace_mgr after generating trace
  EventTraceMgr: Rename etm to event_trace_mgr
  EventTraceMgr: Move fclose() to destructor
2025-05-19 20:02:12 +02:00
Tim Wojtulewicz
e21fb9c9c7 Update cmake submodule 2025-05-19 10:54:10 -07:00
Tim Wojtulewicz
cc79afd24f Merge remote-tracking branch 'origin/topic/timw/include-cleanup-part-2'
* origin/topic/timw/include-cleanup-part-2:
  Remove unnecessary #includes in script_opt
  Remove unnecessary #includes in telemetry and supervisor
  Remove unnecessary #includes in cluster/broker/iosource/probabilistic/session
  Remove unnecessary #includes in zeekygen and base plugin files
  Remove unnecessary #includes in input/logging/threading
  Remove unnecessary #includes in analyzer/packet analyzer/file analyzer source files
  Remove unnecessary #includes in analyzer/packet analyzer/file analyzer headers
  Remove unnecessary #includes in base files in repo
2025-05-19 10:26:05 -07:00
Tim Wojtulewicz
12356a6393 Remove unnecessary #includes in script_opt 2025-05-19 10:25:05 -07:00
Tim Wojtulewicz
0e47fa10c6 Remove unnecessary #includes in telemetry and supervisor 2025-05-19 10:25:05 -07:00
Tim Wojtulewicz
8b992320cb Remove unnecessary #includes in cluster/broker/iosource/probabilistic/session 2025-05-19 10:25:05 -07:00
Tim Wojtulewicz
17101da6b3 Remove unnecessary #includes in zeekygen and base plugin files 2025-05-19 10:25:05 -07:00
Tim Wojtulewicz
e3c4b1fd58 Remove unnecessary #includes in input/logging/threading 2025-05-19 10:25:05 -07:00
Tim Wojtulewicz
79301c4691 Remove unnecessary #includes in analyzer/packet analyzer/file analyzer source files 2025-05-19 10:25:05 -07:00
Tim Wojtulewicz
456c1fa42c Remove unnecessary #includes in analyzer/packet analyzer/file analyzer headers 2025-05-19 10:25:05 -07:00
Tim Wojtulewicz
896e41c794 Remove unnecessary #includes in base files in repo 2025-05-19 09:50:23 -07:00
Tim Wojtulewicz
224be5a951 Merge remote-tracking branch 'origin/topic/timw/rename-ci-github-labels'
* origin/topic/timw/rename-ci-github-labels:
  Rename CI-related github labels for PRs
2025-05-19 09:44:10 -07:00
Tim Wojtulewicz
e72572bf32 Rename CI-related github labels for PRs 2025-05-19 09:41:27 -07:00
Arne Welzel
000cc50813 btest/core: Add event-trace test 2025-05-19 18:23:08 +02:00
Arne Welzel
eeb08f6ba8 zeek-setup: Free event_trace_mgr after generating trace
While it'd be destructed due to being a global unique_ptr, force
it to happen right after generating the trace.
2025-05-19 18:10:36 +02:00
Arne Welzel
5bcf6bec52 EventTraceMgr: Rename etm to event_trace_mgr
Mostly to avoid having new maintainers/developers knowing about yet
another abbreviation.
2025-05-19 18:10:36 +02:00
Arne Welzel
1465e390a2 EventTraceMgr: Move fclose() to destructor
Coverity complains about a missing fclose() in a non-existing
destructor. Also sprinkle in a strerror() call for fopen() to
provide a bit of a hint what might have gone wrong.
2025-05-19 18:10:32 +02:00
zeek-bot
bf30cf7997 Update doc submodule [nomail] [skip ci] 2025-05-17 00:27:23 +00:00
Tim Wojtulewicz
9683e88795 Merge remote-tracking branch 'origin/topic/timw/include-cleanup-part-1'
* origin/topic/timw/include-cleanup-part-1:
  Remove including <cinttypes> from util.h
  Remove telemetry #includes from OpaqueVal.h
  Reduce includes in plugin/Component.h
  Remove zeek/Stats.h include from NetVar.h
  Include StmtBase/StmtEnums in Func.h instead of Stmt.h
  Use modern names for standard headers
  Remove fix for CentOS 7 from TCP_Flags.h
  Fix usage of std::string in http analyzer
  Reorder top section of net_util.h to batch includes together
  Use quotes instead of <> for zeek includes
  Fix Obj.h include in IntrusivePtr.h to have full path
2025-05-16 10:27:46 -07:00
Tim Wojtulewicz
e618d00326 Remove including <cinttypes> from util.h 2025-05-16 10:14:37 -07:00
Tim Wojtulewicz
174bf09d77 Remove telemetry #includes from OpaqueVal.h 2025-05-16 10:14:37 -07:00
Tim Wojtulewicz
c659592773 Reduce includes in plugin/Component.h 2025-05-16 10:14:37 -07:00
Tim Wojtulewicz
ff9f0f7a5c Remove zeek/Stats.h include from NetVar.h 2025-05-16 10:14:37 -07:00
Tim Wojtulewicz
ca3002d745 Include StmtBase/StmtEnums in Func.h instead of Stmt.h
This requires changes in lots of other files that were depending on Func.h
to provide that include for them.
2025-05-16 10:14:36 -07:00
Tim Wojtulewicz
ad50443590 Use modern names for standard headers 2025-05-16 10:14:36 -07:00
Tim Wojtulewicz
4b2ed67eaf Remove fix for CentOS 7 from TCP_Flags.h 2025-05-16 10:14:36 -07:00
Tim Wojtulewicz
3197bb7f59 Fix usage of std::string in http analyzer 2025-05-16 10:14:36 -07:00
Tim Wojtulewicz
661b230f23 Reorder top section of net_util.h to batch includes together 2025-05-16 10:14:36 -07:00
Tim Wojtulewicz
648f0f0623 Use quotes instead of <> for zeek includes 2025-05-16 10:14:36 -07:00
Tim Wojtulewicz
499db5dd70 Fix Obj.h include in IntrusivePtr.h to have full path 2025-05-16 10:14:36 -07:00
Arne Welzel
4691e2c51b Merge remote-tracking branch 'origin/topic/vern/event-trace-on-exit'
* origin/topic/vern/event-trace-on-exit:
  Generate --event-trace output explicitly rather than in EventTraceMgr destructor
2025-05-16 13:40:04 +02:00
Vern Paxson
f5c1a32d8d Generate --event-trace output explicitly rather than in EventTraceMgr destructor 2025-05-15 13:00:17 -07:00
Tim Wojtulewicz
6833088cde Merge remote-tracking branch 'origin/topic/timw/disallow-blind-searching-for-krb5-on-macos'
* origin/topic/timw/disallow-blind-searching-for-krb5-on-macos:
  Require non-system version of libkrb5 on macOS
2025-05-15 12:15:57 -07:00
Tim Wojtulewicz
663281e05f Require non-system version of libkrb5 on macOS 2025-05-15 11:24:51 -07:00
Arne Welzel
e40aac30f4 Merge remote-tracking branch 'origin/topic/awelzel/bump-ixwebsocket-11.4.6'
* origin/topic/awelzel/bump-ixwebsocket-11.4.6:
  IXWebSocket: Point at upstream, bump to v11.4.6
2025-05-15 16:44:30 +02:00
Arne Welzel
4911d34a1d IXWebSocket: Point at upstream, bump to v11.4.6 2025-05-15 16:37:09 +02:00
Johanna Amann
9d3e39581e Merge branch 'topic/jgras/pop3-stls-dpd' of https://github.com/J-Gras/zeek
* 'topic/jgras/pop3-stls-dpd' of https://github.com/J-Gras/zeek:
  Add STLS command to POP3 DPD signature
2025-05-15 10:23:43 +01:00
zeek-bot
adc0937bf5 Update doc submodule [nomail] [skip ci] 2025-05-15 00:14:11 +00:00
Jan Grashoefer
84cc4b890d Add STLS command to POP3 DPD signature 2025-05-14 16:37:25 +02:00
zeek-bot
734fd62325 Update doc submodule [nomail] [skip ci] 2025-05-14 00:15:11 +00:00
Arne Welzel
2255fa23b8 Merge remote-tracking branch 'origin/topic/vern/zam-aggr-change-in-loop'
* origin/topic/vern/zam-aggr-change-in-loop:
  fix for ZAM optimization when an aggregate is modified inside of a loop
2025-05-13 19:50:56 +02:00
Tim Wojtulewicz
5aa6734042 Merge remote-tracking branch 'origin/topic/timw/allow-macos-libkrb5'
* origin/topic/timw/allow-macos-libkrb5:
  Allow macOS to search for libkrb5, but disallow system version of library
2025-05-13 10:03:55 -07:00
Tim Wojtulewicz
051c191f63 Allow macOS to search for libkrb5, but disallow system version of library 2025-05-13 10:03:26 -07:00
Arne Welzel
8f60d37ad0 Merge remote-tracking branch 'origin/topic/awelzel/4440-websocket-pong-timeout'
* origin/topic/awelzel/4440-websocket-pong-timeout:
  btest/cluster/websocket: Update tests for new event signature
  cluster/websocket: Propagate code and reason to websocket_client_lost()
  cluster/websocket: Support configurable ping interval
  IXWebSocket: Bump to improve O^2 rxbuf erase()
2025-05-13 18:58:54 +02:00
Arne Welzel
6d2bd93f1f btest/cluster/websocket: Update tests for new event signature 2025-05-13 18:26:03 +02:00
Arne Welzel
a61aff010f cluster/websocket: Propagate code and reason to websocket_client_lost()
This allows to get visibility into the reason why ixwebsocket or the
client decided to disconnect.

Closed #4440
2025-05-13 18:26:03 +02:00
Arne Welzel
aaddeb19ad cluster/websocket: Support configurable ping interval
Primarily for testing purposes and maybe the hard-coded 5 seconds is too
aggressive for some deployments, so makes sense for it to be
configurable.
2025-05-13 18:26:03 +02:00
Tim Wojtulewicz
912356deac Merge remote-tracking branch 'origin/topic/bbannier/fix-spicy-main'
* origin/topic/bbannier/fix-spicy-main:
  Fix clang-tidy `bugprone-inc-dec-in-conditions` report in Spicy plugins glue compiler
  Fix clang-tidy `performance-enum-size` reports in Spicy plugin's glue compiler
  Remove unneeded copies in Spicy plugin glue compiler
  Adjust for renamed function flavor in Spicy development version
2025-05-12 11:33:54 -07:00
Vern Paxson
da689f1835 fix for ZAM optimization when an aggregate is modified inside of a loop 2025-05-09 15:01:55 -07:00
Arne Welzel
6b6c3dbbb7 Merge remote-tracking branch 'origin/topic/justin/file_analysis_speedup'
* origin/topic/justin/file_analysis_speedup:
  speed up file analysis, remove IncrementByteCount
2025-05-09 17:25:55 +02:00
Benjamin Bannier
24071118eb Fix clang-tidy bugprone-inc-dec-in-conditions report in Spicy plugins glue compiler 2025-05-09 16:58:22 +02:00
Justin Azoff
7f350587b0 speed up file analysis, remove IncrementByteCount
Avoid creating and recreating count objects for each chunk of file
analyzed.  This replaces counts inside of records with c++ uint64_ts.

On a pcap containing a 100GB file download this gives a 9% speedup

    Benchmark 1 (3 runs): zeek-master/bin/zeek -Cr http_100g_zeroes.pcap tuning/json-logs frameworks/files/hash-all-files
      measurement          mean ± σ            min … max           outliers         delta
      wall_time           102s  ± 1.23s      101s  …  103s           0 ( 0%)        0%
      peak_rss            108MB ±  632KB     107MB …  109MB          0 ( 0%)        0%
      cpu_cycles          381G  ±  862M      380G  …  382G           0 ( 0%)        0%
      instructions        663G  ± 5.16M      663G  …  663G           0 ( 0%)        0%
      cache_references   1.03G  ±  109M      927M  … 1.15G           0 ( 0%)        0%
      cache_misses       12.3M  ±  587K     11.7M  … 12.9M           0 ( 0%)        0%
      branch_misses      1.23G  ± 2.10M     1.22G  … 1.23G           0 ( 0%)        0%
    Benchmark 2 (3 runs): zeek-file_analysis_speedup/bin/zeek -Cr http_100g_zeroes.pcap tuning/json-logs frameworks/files/hash-all-files
      measurement          mean ± σ            min … max           outliers         delta
      wall_time          92.9s  ± 1.85s     91.8s  … 95.1s           0 ( 0%)        -  9.0% ±  3.5%
      peak_rss            108MB ±  393KB     108MB …  109MB          0 ( 0%)          +  0.1% ±  1.1%
      cpu_cycles          341G  ±  695M      341G  …  342G           0 ( 0%)        - 10.4% ±  0.5%
      instructions        605G  ±  626M      605G  …  606G           0 ( 0%)        -  8.7% ±  0.2%
      cache_references    831M  ± 16.9M      813M  …  846M           0 ( 0%)        - 19.6% ± 17.2%
      cache_misses       12.4M  ± 1.48M     11.4M  … 14.1M           0 ( 0%)          +  0.3% ± 20.8%
      branch_misses      1.02G  ± 3.45M     1.02G  … 1.02G           0 ( 0%)        - 16.8% ±  0.5%
2025-05-09 10:50:04 -04:00
Arne Welzel
2041306772 IXWebSocket: Bump to improve O^2 rxbuf erase()
Part of #4440
2025-05-09 16:38:36 +02:00
Benjamin Bannier
37b095f39b Fix clang-tidy performance-enum-size reports in Spicy plugin's glue compiler 2025-05-09 16:08:14 +02:00
Benjamin Bannier
9355512adc Remove unneeded copies in Spicy plugin glue compiler 2025-05-09 16:08:14 +02:00
Benjamin Bannier
fbe8dbce5e Adjust for renamed function flavor in Spicy development version
With zeek/spicy#2048 the flavor for functions was renamed from
`Standard` to `Function`. This patch adapts the code for that while
still allowing using earlier Spicy versions.
2025-05-09 16:08:14 +02:00
Arne Welzel
20ada619c5 Updating submodules binpac, broker and zeek-aux [nomail] 2025-05-09 09:52:20 +02:00
zeek-bot
b629b6bfe6 Update doc submodule [nomail] [skip ci] 2025-05-09 00:23:30 +00:00
Tim Wojtulewicz
957098af1c Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump auxil/spicy to latest development snapshot
2025-05-08 15:14:37 -07:00
Christian Kreibich
8d79429555 Merge branch 'topic/christian/fix-broker-peering-overflows-metric'
* topic/christian/fix-broker-peering-overflows-metric:
  Bugfix: accurately track Broker buffer overflows w/ multiple peerings
2025-05-08 15:07:39 -07:00
Tim Wojtulewicz
2c17c85f55 Merge branch 'topic/timw/switch-broker-error-to-error'
* topic/timw/switch-broker-error-to-error:
  Downgrade broker clone FatalError to an Error
2025-05-08 13:47:06 -07:00
Tim Wojtulewicz
e00942c021 Downgrade broker clone FatalError to an Error 2025-05-08 13:46:21 -07:00
Benjamin Bannier
abbc4f23b8 Bump auxil/spicy to latest development snapshot 2025-05-08 21:54:15 +02:00
Arne Welzel
7583651bec Merge remote-tracking branch 'origin/topic/awelzel/ci-fedora-42'
* origin/topic/awelzel/ci-fedora-42:
  probabilistic/BitVector: Add include <cstdint>
  Bump spicy to fix build with GCC 15.1
  CI: Drop fedora-40
  CI: Add fedora-42
2025-05-08 13:19:30 +02:00
Arne Welzel
f80abe9d45 probabilistic/BitVector: Add include <cstdint> 2025-05-08 10:37:32 +02:00
Arne Welzel
43c20f41da Bump spicy to fix build with GCC 15.1 2025-05-08 10:37:32 +02:00
Arne Welzel
368a38a050 CI: Drop fedora-40
Still 3 weeks to go, but not quite seeing why we should support 3
different Fedora releases with Zeek 7.2.
2025-05-08 10:37:32 +02:00
Arne Welzel
aacc484543 CI: Add fedora-42
This ships with gcc 15.1.1 and Python 3.13.3
2025-05-08 10:37:29 +02:00
Arne Welzel
60efc7741d Merge branch 'gcc15' of https://github.com/i2z1/zeek
* 'gcc15' of https://github.com/i2z1/zeek:
  Include cstdint header to support uint8_t/uint64_t in GCC 15+
2025-05-08 09:25:28 +02:00
Christian Kreibich
738ce1c235 Bugfix: accurately track Broker buffer overflows w/ multiple peerings
When a node restarts or a peering between two nodes starts over for other
reasons, the internal tracking in the Broker manager resets its state (since
it's per-peering), and thus the message overflow counter. The script layer was
unaware of this, and threw errors when trying to reset the corresponding counter
metric down to zero at sync time.

We now track past buffer overflows via a separate epoch table, using Broker peer
ID comparisons to identify new peerings, and set the counter to the sum of past
and current overflows.

I considered just making this a gauge, but it seems more helpful to be able to
look at a counter to see whether any messages have ever been dropped over the
lifetime of the node process.

As an aside, this now also avoids repeatedly creating the labels vector,
re-using the same one for each metric.

Thanks to @pbcullen for identifying this one!
2025-05-07 17:27:38 -07:00
zeek-bot
42365b85f0 Update doc submodule [nomail] [skip ci] 2025-05-08 00:14:52 +00:00
Tim Wojtulewicz
1dfbd33929 Merge remote-tracking branch 'origin/topic/timw/storage-timeout-option'
* origin/topic/timw/storage-timeout-option:
  Move options to redis backend options instead of module-level options
  Add operation_timeout and command_timeout storage backend options
2025-05-07 15:39:35 -07:00
Tim Wojtulewicz
fd10dd015f Move options to redis backend options instead of module-level options 2025-05-07 15:38:58 -07:00
Tim Wojtulewicz
824b91216f Add operation_timeout and command_timeout storage backend options 2025-05-07 15:38:58 -07:00
Tim Wojtulewicz
507974a1d8 Merge remote-tracking branch 'origin/topic/christian/news-fix'
* origin/topic/christian/news-fix:
  Fix Broker metrics naming bugs that snuck in w/ last-minute renaming [skip ci]
2025-05-07 14:09:52 -07:00
i2z1
c0da0642b1
Include cstdint header to support uint8_t/uint64_t in GCC 15+ 2025-05-07 22:42:01 +03:00
Christian Kreibich
6657e4efbd Fix Broker metrics naming bugs that snuck in w/ last-minute renaming [skip ci] 2025-05-07 12:32:43 -07:00
Tim Wojtulewicz
6f8924596f Merge remote-tracking branch 'origin/topic/johanna/fix-failed-service-logging'
* origin/topic/johanna/fix-failed-service-logging:
  Fix policy/protocols/conn/failed-service-logging.zeek
2025-05-07 10:29:54 -07:00
Tim Wojtulewicz
8096388904 Update opt.ZAM-bif-tracking baseline 2025-05-07 09:12:56 -07:00
Arne Welzel
8089f5bed4 Merge remote-tracking branch 'origin/topic/awelzel/more-terminate-while-queueing-hardening'
* origin/topic/awelzel/more-terminate-while-queueing-hardening:
  btest/cluster/generic/publish-any: Apply Christian's fix from broker/publish-any
  wstest/terminate-while-queueing: Patch close_socket()
2025-05-07 17:24:04 +02:00
Arne Welzel
3ec3205074 btest/cluster/generic/publish-any: Apply Christian's fix from broker/publish-any 2025-05-07 17:18:01 +02:00
Tim Wojtulewicz
d7b31f5b44 Merge remote-tracking branch 'origin/topic/timw/storage-is-connected-bif'
* origin/topic/timw/storage-is-connected-bif:
  Add Storage::is_connected BIF
  Move cast_handle from storage-async.bif to BackendHandleVal static method
2025-05-07 08:16:59 -07:00
Tim Wojtulewicz
58ee8d3c5c Add Storage::is_connected BIF 2025-05-07 08:13:16 -07:00
Tim Wojtulewicz
cbc41e298d Move cast_handle from storage-async.bif to BackendHandleVal static method 2025-05-07 08:13:16 -07:00
Arne Welzel
82731992d9 wstest/terminate-while-queueing: Patch close_socket()
I believe there's a bug/usage issue in the websockets library
where during send(), EOF is detected and stored, but the receiving
thread is then discarding the last received frame. Avoid the bug
by replacing the close_socket() implementation of the websockets
library just for that test and leave detecting the EOF condition
to the receiving thread.
2025-05-07 16:33:54 +02:00
Arne Welzel
135acc7c6d Merge remote-tracking branch 'origin/topic/awelzel/fix-flaky-terminate-while-queueing'
* origin/topic/awelzel/fix-flaky-terminate-while-queueing:
  cluster/websocket: Stop and wait for reply thread during Terminate()
2025-05-07 13:22:13 +02:00
Arne Welzel
ca02316671 cluster/websocket: Stop and wait for reply thread during Terminate()
The terminate-while-queueing test added for #4428 failed spuriously
indicating that sometimes WebSocket clients receive code 1000 instead of 1001.
This happens if the ixwebsocket server is shutdown before the reply thread had a
chance to process queued close messages.

Fix by signaling and waiting for the dispatcher's reply thread to terminate
before returning from Terminate().
2025-05-07 12:45:01 +02:00
zeek-bot
ac1230fcbe Update doc submodule [nomail] [skip ci] 2025-05-07 00:15:52 +00:00
Steve Smoot
53f2f6ec57 update baseline for zam 2025-05-06 15:11:12 -07:00
Tim Wojtulewicz
1da414ec3d Update paraglob submodule [nomail] 2025-05-06 13:19:49 -07:00
Johanna Amann
f293d5a852 Fix policy/protocols/conn/failed-service-logging.zeek
In GH-4422 it was pointed out that the protocols/conn/failed-service-logging.zeek
policy script only works when
`DPD::track_removed_services_in_connection=T` is set.

This was caused by a logic error in the script. This commit fixes this
logic error and introduces an additional test that checks that
failed-service-logging works even when the option is not set to true.
2025-05-06 13:37:12 +01:00
Arne Welzel
3be7a9ce91 Merge remote-tracking branch 'origin/topic/awelzel/double-commented-btest-lines'
* origin/topic/awelzel/double-commented-btest-lines:
  testing/btest: Fix double commented @TEST- lines
2025-05-06 14:21:03 +02:00
Arne Welzel
4afb0ffeeb Merge remote-tracking branch 'origin/topic/awelzel/4420-simeon-breaking-websockets'
* origin/topic/awelzel/4420-simeon-breaking-websockets:
  Websocket: Close onloop during Terminate()
  OnLoop: notify_all() instead of notify_one()
2025-05-06 14:20:38 +02:00
Arne Welzel
bb06af601f Websocket: Close onloop during Terminate()
Terminate() is called when Zeek shuts down. If WebSocket client threads
were blocked in QueueForProcessing() due to reaching queue limits, these
previously would not exit QueueForProcessing() and instead block
indefinitely, resulting in the ixwebsocket library blocking and its
garbage collection thread running at 100%. Not great.

Closing the onloop instance will unblock the WebSocket client threads
for a timely shutdown.

Closes #4420
2025-05-06 14:19:08 +02:00
Arne Welzel
0e327a0c12 testing/btest: Fix double commented @TEST- lines
sed -i 's/^# # @/# @/g'
2025-05-06 14:06:29 +02:00
Arne Welzel
6ebec6dde7 OnLoop: notify_all() instead of notify_one()
There might be more than one thread blocked waiting for room in the
queue, ensure they all wake up when shutting down.
2025-05-06 12:23:08 +02:00
zeek-bot
e986caddf0 Update doc submodule [nomail] [skip ci] 2025-05-06 00:16:07 +00:00
Smoot
daaec62b4a
Update src/zeek.bif
Co-authored-by: Tim Wojtulewicz <timwoj@gmail.com>
2025-05-05 14:57:09 -07:00
Tim Wojtulewicz
0393e4b84a Merge remote-tracking branch 'XueSongTap/master'
* XueSongTap/master:
  Add baseline for find_first test, update comments, and reorder function imports
  Add find_first string function
2025-05-05 13:40:40 -07:00
Tim Wojtulewicz
f9aa9a430d Merge remote-tracking branch 'origin/topic/timw/storage-check-redis-server-version'
* origin/topic/timw/storage-check-redis-server-version:
  Add commands to the static methods for the Redis implementation
  Redis: Check server version when connecting
2025-05-05 11:12:09 -07:00
Tim Wojtulewicz
dda319fd53 Add commands to the static methods for the Redis implementation 2025-05-05 11:10:06 -07:00
Tim Wojtulewicz
ecd603516f Redis: Check server version when connecting 2025-05-05 10:49:37 -07:00
Tim Wojtulewicz
58d71d2fa3 Merge remote-tracking branch 'origin/topic/timw/storage-redis-expire-string-view'
* origin/topic/timw/storage-redis-expire-string-view:
  Use std::string_view in Redis::DoExpire to avoid copies
2025-05-05 10:44:51 -07:00
Tim Wojtulewicz
df9b396ee6 Use std::string_view in Redis::DoExpire to avoid copies 2025-05-05 10:44:06 -07:00
Arne Welzel
50ac8d1468 Merge remote-tracking branch 'origin/topic/awelzel/4405-quic-fragmented-crypto'
* origin/topic/awelzel/4405-quic-fragmented-crypto:
  Bump external/zeek-testing
  QUIC: Extract reset_crypto() function
  QUIC: Rename ConnectionIDInfo to Context
  QUIC: Switch initial_destination_conn_id to optional
  QUIC: Use initial destination conn_id for decryption
  QUIC: Handle CRYPTO frames across multiple INITIAL packets
  QUIC: Do not consume EncryptedLongPacketPayload
  QUIC: Fix ACK frame parsing
2025-05-05 14:40:59 +02:00
Arne Welzel
8fd3cbf7cc Bump external/zeek-testing 2025-05-05 14:34:38 +02:00
Arne Welzel
39d0610ce1 QUIC: Extract reset_crypto() function 2025-05-05 14:34:38 +02:00
Arne Welzel
c19e79246f QUIC: Rename ConnectionIDInfo to Context
Lets just call it what it is given that it contains more than just
connection IDs.
2025-05-05 14:34:38 +02:00
Arne Welzel
fd29b48803 QUIC: Switch initial_destination_conn_id to optional 2025-05-05 14:34:38 +02:00
Arne Welzel
fe89a521d1 QUIC: Use initial destination conn_id for decryption
Ensure the client side also uses the initial destination connection ID
for decryption purposes instead of the one from the current long header
packet. PCAP from local WiFi hotspot.
2025-05-05 14:34:11 +02:00
Arne Welzel
ae90524027 QUIC: Handle CRYPTO frames across multiple INITIAL packets
Instead of sending the accumulated CRYPTO frames after processing an
INITIAL packet, add logic to determine the total length of the TLS
Client or Server Hello (by peeking into the first 4 byte). Once all
CRYPTO frames have arrived, flush the reassembled data to the TLS
analyzer at once.
2025-05-05 14:34:11 +02:00
Arne Welzel
e459d96fb6 QUIC: Do not consume EncryptedLongPacketPayload
The payload is already consumed within the InitialPacket unit. Consuming
it again resulted in UDP datagrams with multiple packets to ignore
the remaining packets in the same UDP datagram. The baseline changes
showing I being followed by a new H indicates that the INITIAL packet
was followed by a HANDSHAKE packet, but previously Zeek discarded
these.
2025-05-05 14:34:11 +02:00
zeek-bot
823abe2d90 Update doc submodule [nomail] [skip ci] 2025-05-03 00:12:50 +00:00
yexiaochuan
fd7045e274 Add baseline for find_first test, update comments, and reorder function imports 2025-05-02 11:51:45 +08:00
Arne Welzel
d655c64e0b Merge remote-tracking branch 'origin/topic/awelzel/event-publish-hook'
* origin/topic/awelzel/event-publish-hook:
  NEWS: Add HookPublishEvent() note
  btest/plugin: Test for PublishEventHook()
  broker and cluster: Wire up HookPublishEvent
  plugin: Add HookPublishEvent hook
2025-04-30 17:57:46 +02:00
Arne Welzel
48d965f85c NEWS: Add HookPublishEvent() note 2025-04-30 17:26:33 +02:00
Arne Welzel
0bf3417d4c btest/plugin: Test for PublishEventHook() 2025-04-30 17:26:33 +02:00
Arne Welzel
53236a184a broker and cluster: Wire up HookPublishEvent 2025-04-30 17:26:33 +02:00
Arne Welzel
621fd2ab39 plugin: Add HookPublishEvent hook 2025-04-30 17:26:33 +02:00
Arne Welzel
f8b75426ee Merge remote-tracking branch 'origin/topic/awelzel/bif-tracking-no-zeromq'
* origin/topic/awelzel/bif-tracking-no-zeromq:
  ZAM-bif-tracking: Remove ZeroMQ dependency
2025-04-30 17:23:22 +02:00
Arne Welzel
90eb22ce73 ZAM-bif-tracking: Remove ZeroMQ dependency
Vern didn't have ZeroMQ installed and the test was skipped for him.
Generally would recommend anyone working on core Zeek to install
libzmq-dev or the equivalent for their environment, but until it is a
real required dependency, loosen the requirements on the test.
2025-04-30 17:08:21 +02:00
Arne Welzel
f63677fcd5 QUIC: Fix ACK frame parsing
Later tests will exercise this.
2025-04-30 15:54:42 +02:00
Tim Wojtulewicz
e56de061f9 Merge remote-tracking branch 'origin/topic/vern/zam-inlining-temps'
* origin/topic/vern/zam-inlining-temps:
  fixed incorrect ZAM optimization of expressions seen in single-statement inlined functions
2025-04-29 17:50:39 -07:00
Vern Paxson
d2762fb247 fixed incorrect ZAM optimization of expressions seen in single-statement inlined functions 2025-04-29 14:29:07 -07:00
yexiaochuan
6c240dc0bb Add find_first string function 2025-04-30 00:15:34 +08:00
Tim Wojtulewicz
2cf8497bf7 Merge remote-tracking branch 'origin/topic/timw/update-ct-ca-lists'
* origin/topic/timw/update-ct-ca-lists:
  External tests: add removed logs to CT list to prevent baseline changes
  Update Mozilla CA list and CT list to NSS 3.110
2025-04-29 08:53:04 -07:00
Arne Welzel
d5e1dc27c6 Merge branch 'topic/mohan/intel-event-groups' of https://github.com/Mohan-Dhawan/zeek
* 'topic/mohan/intel-event-groups' of https://github.com/Mohan-Dhawan/zeek:
  coalesce smtp handlers for ADDR
  Add fine-grained groups for Intel events
2025-04-29 15:00:58 +02:00
Mohan Dhawan
36c4d112c8
coalesce smtp handlers for ADDR 2025-04-29 16:30:31 +05:30
Arne Welzel
5bf660a9ce Merge remote-tracking branch 'origin/topic/awelzel/cluster-coverity-fixes'
* origin/topic/awelzel/cluster-coverity-fixes:
  broker/WebSocketShim: Check RegisterFd() return
  cluster/OnLoop: Fix coverity report about proc accessed without lock
2025-04-28 19:41:10 +02:00
Arne Welzel
540baa89af Merge remote-tracking branch 'origin/topic/awelzel/3045-no-holes-in-vectors'
* origin/topic/awelzel/3045-no-holes-in-vectors:
  broker/Data/data_to_val: Fail on vectors/lists with holes
2025-04-28 18:24:25 +02:00
Arne Welzel
7092db6318 broker/Data/data_to_val: Fail on vectors/lists with holes
Instead of simply removing holes from vectors or lists when converting
from Val to Broker format, error out as the receiver has no chance to
reconstruct where the hole might have been.

We could encode holes with broker::none, but this will put unnecessary
burden on language bindings and users due to the potential optionality.
Think a std::vector<uint64_t> that technically needs to be a
std::vector<std::optional<uint64_t>> to represent optional elements
properly.

Closes #3045
2025-04-28 18:23:37 +02:00
Johanna Amann
28ec4e2f2a External tests: add removed logs to CT list to prevent baseline changes 2025-04-28 16:42:52 +01:00
Arne Welzel
d02588d25c broker/WebSocketShim: Check RegisterFd() return 2025-04-28 16:24:25 +02:00
Arne Welzel
4101efed4f cluster/OnLoop: Fix coverity report about proc accessed without lock
Coverity complains proc is set under a lock, but accessed in Process()
without a lock. Fix this by setting it in Close() also without locking.
The proc member should only ever be accessed my the main thread.
2025-04-28 16:23:08 +02:00
Tim Wojtulewicz
b9b268bd86 Merge remote-tracking branch 'origin/topic/timw/use-after-move'
* origin/topic/timw/use-after-move:
  Fix use-after-move in recent broker changes
2025-04-25 16:11:56 -07:00
Tim Wojtulewicz
f8d2f30cec Fix use-after-move in recent broker changes 2025-04-25 13:48:14 -07:00
Tim Wojtulewicz
223c5ab955 Start of 8.0.0 development 2025-04-25 11:59:08 -07:00
Mohan Dhawan
8314b18092
Add fine-grained groups for Intel events 2025-04-24 23:24:40 +05:30
Steve Smoot
9ef579b09e Change from_json to return an error rather than print it. 2025-04-23 15:56:12 -07:00
Tim Wojtulewicz
cb35da08bc Update Mozilla CA list and CT list to NSS 3.110 2025-04-23 10:41:19 -07:00
2407 changed files with 434408 additions and 110940 deletions

View file

@ -18,6 +18,8 @@ spicy_ssl_config: &SPICY_SSL_CONFIG --build-type=release --disable-broker-tests
asan_sanitizer_config: &ASAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=address --enable-fuzzers --enable-coverage --ccache --enable-werror
ubsan_sanitizer_config: &UBSAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=undefined --enable-fuzzers --ccache --enable-werror
tsan_sanitizer_config: &TSAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=thread --enable-fuzzers --ccache --enable-werror
macos_config: &MACOS_CONFIG --build-type=release --disable-broker-tests --prefix=$CIRRUS_WORKING_DIR/install --ccache --enable-werror --with-krb5=/opt/homebrew/opt/krb5
clang_tidy_config: &CLANG_TIDY_CONFIG --build-type=debug --disable-broker-tests --prefix=$CIRRUS_WORKING_DIR/install --ccache --enable-werror --enable-clang-tidy
resources_template: &RESOURCES_TEMPLATE
cpu: *CPUS
@ -33,6 +35,7 @@ macos_environment: &MACOS_ENVIRONMENT
ZEEK_CI_BTEST_JOBS: 12
# No permission to write to default location of /zeek
CIRRUS_WORKING_DIR: /tmp/zeek
ZEEK_CI_CONFIGURE_FLAGS: *MACOS_CONFIG
freebsd_resources_template: &FREEBSD_RESOURCES_TEMPLATE
cpu: 8
@ -45,48 +48,108 @@ freebsd_environment: &FREEBSD_ENVIRONMENT
ZEEK_CI_CPUS: 8
ZEEK_CI_BTEST_JOBS: 8
builds_only_if_template: &BUILDS_ONLY_IF_TEMPLATE
# Rules for skipping builds:
# - Do not run builds for anything that's cron triggered
# - Don't do darwin builds on zeek-security repo because they use up a ton of compute credits.
# - Always build PRs, but not if they come from dependabot
# - Always build master and release/* builds from the main repo
only_if_pr_master_release: &ONLY_IF_PR_MASTER_RELEASE
only_if: >
( $CIRRUS_CRON == '' ) &&
( ( $CIRRUS_PR != '' && $CIRRUS_BRANCH !=~ 'dependabot/.*' ) ||
( ( $CIRRUS_REPO_NAME == 'zeek' || $CIRRUS_REPO_NAME == 'zeek-security' ) &&
(
$CIRRUS_BRANCH == 'master' ||
$CIRRUS_BRANCH =~ 'release/.*'
( $CIRRUS_CRON != 'weekly' ) &&
( $CIRRUS_PR != '' ||
$CIRRUS_BRANCH == 'master' ||
$CIRRUS_BRANCH =~ 'release/.*'
)
) )
)
skip_task_on_pr: &SKIP_TASK_ON_PR
# Skip this task on PRs if it does not have the fullci label,
# it continues to run for direct pushes to master/release.
skip: >
! ( $CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*fullci.*' )
zam_skip_task_on_pr: &ZAM_SKIP_TASK_ON_PR
# Skip this task on PRs unless it has the `fullci` or `zamci` label
# or files in src/script_opt/** were modified.
# It continues to run for direct pushes to master/release, as
# CIRRUS_PR will be empty.
skip: >
! ( $CIRRUS_PR == '' || $CIRRUS_PR_LABELS =~ '.*fullci.*' || $CIRRUS_PR_LABELS =~ '.*zamci.*' || changesInclude('src/script_opt/**') )
benchmark_only_if_template: &BENCHMARK_ONLY_IF_TEMPLATE
# only_if condition for cron-triggered benchmarking tests.
# These currently do not run for release/.*
only_if_pr_master_release_nightly: &ONLY_IF_PR_MASTER_RELEASE_NIGHTLY
only_if: >
( $CIRRUS_REPO_NAME == 'zeek' || $CIRRUS_REPO_NAME == 'zeek-security' ) &&
( $CIRRUS_CRON == 'benchmark-nightly' ||
$CIRRUS_PR_LABELS =~ '.*fullci.*' ||
$CIRRUS_PR_LABELS =~ '.*benchmark.*' )
( ( $CIRRUS_REPO_NAME == 'zeek' || $CIRRUS_REPO_NAME == 'zeek-security' ) &&
( $CIRRUS_CRON != 'weekly' ) &&
( $CIRRUS_PR != '' ||
$CIRRUS_BRANCH == 'master' ||
$CIRRUS_BRANCH =~ 'release/.*' ||
( $CIRRUS_CRON == 'nightly' && $CIRRUS_BRANCH == 'master' )
)
)
only_if_pr_release_and_nightly: &ONLY_IF_PR_RELEASE_AND_NIGHTLY
only_if: >
( ( $CIRRUS_REPO_NAME == 'zeek' || $CIRRUS_REPO_NAME == 'zeek-security' ) &&
( $CIRRUS_CRON != 'weekly' ) &&
( $CIRRUS_PR != '' ||
$CIRRUS_BRANCH =~ 'release/.*' ||
( $CIRRUS_CRON == 'nightly' && $CIRRUS_BRANCH == 'master' )
)
)
only_if_pr_nightly: &ONLY_IF_PR_NIGHTLY
only_if: >
( ( $CIRRUS_REPO_NAME == 'zeek' || $CIRRUS_REPO_NAME == 'zeek-security' ) &&
( $CIRRUS_CRON != 'weekly' ) &&
( $CIRRUS_PR != '' ||
( $CIRRUS_CRON == 'nightly' && $CIRRUS_BRANCH == 'master' )
)
)
only_if_release_tag_nightly: &ONLY_IF_RELEASE_TAG_NIGHTLY
only_if: >
( ( $CIRRUS_REPO_NAME == 'zeek' ) &&
( $CIRRUS_CRON != 'weekly' ) &&
( ( $CIRRUS_BRANCH =~ 'release/.*' && $CIRRUS_TAG =~ 'v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$' ) ||
( $CIRRUS_CRON == 'nightly' && $CIRRUS_BRANCH == 'master' )
)
)
only_if_nightly: &ONLY_IF_NIGHTLY
only_if: >
( ( $CIRRUS_REPO_NAME == 'zeek' ) &&
( $CIRRUS_CRON == 'nightly' && $CIRRUS_BRANCH == 'master' )
)
only_if_weekly: &ONLY_IF_WEEKLY
only_if: >
( ( $CIRRUS_REPO_NAME == 'zeek' || $CIRRUS_REPO_NAME == 'zeek-security' ) &&
( $CIRRUS_CRON == 'weekly' && $CIRRUS_BRANCH == 'master' )
)
skip_if_pr_skip_all: &SKIP_IF_PR_SKIP_ALL
skip: >
( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
skip_if_pr_not_full_ci: &SKIP_IF_PR_NOT_FULL_CI
skip: >
( ( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS !=~ ".*CI: Full.*") ||
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
)
skip_if_pr_not_full_or_benchmark: &SKIP_IF_PR_NOT_FULL_OR_BENCHMARK
skip: >
( ( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS !=~ ".*CI: (Full|Benchmark).*" ) ||
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
)
skip_if_pr_not_full_or_cluster_test: &SKIP_IF_PR_NOT_FULL_OR_CLUSTER_TEST
skip: >
( ( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS !=~ ".*CI: (Full|Cluster Test).*" ) ||
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
)
skip_if_pr_not_full_or_zam: &SKIP_IF_PR_NOT_FULL_OR_ZAM
skip: >
( ( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS !=~ ".*CI: (Full|ZAM).*" ) ||
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
)
skip_if_pr_not_full_or_zeekctl: &SKIP_IF_PR_NOT_FULL_OR_ZEEKCTL
skip: >
( ( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS !=~ ".*CI: (Full|Zeekctl).*" ) ||
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
)
skip_if_pr_not_full_or_windows: &SKIP_IF_PR_NOT_FULL_OR_WINDOWS
skip: >
( ( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS !=~ ".*CI: (Full|Windows).*" ) ||
( $CIRRUS_PR_LABELS =~ ".*CI: Skip All.*" )
)
ci_template: &CI_TEMPLATE
<< : *BUILDS_ONLY_IF_TEMPLATE
# Default timeout is 60 minutes, Cirrus hard limit is 120 minutes for free
# tasks, so may as well ask for full time.
timeout_in: 120m
@ -130,6 +193,7 @@ ci_template: &CI_TEMPLATE
env:
CIRRUS_WORKING_DIR: /zeek
CIRRUS_LOG_TIMESTAMP: true
ZEEK_CI_CPUS: *CPUS
ZEEK_CI_BTEST_JOBS: *BTEST_JOBS
ZEEK_CI_BTEST_RETRIES: *BTEST_RETRIES
@ -180,6 +244,10 @@ fedora42_task:
dockerfile: ci/fedora-42/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_SKIP_ALL
env:
ZEEK_CI_CONFIGURE_FLAGS: *BINARY_CONFIG
fedora41_task:
container:
@ -187,14 +255,71 @@ fedora41_task:
dockerfile: ci/fedora-41/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
centosstream9_task:
container:
# Stream 9 EOL: Around Dec 2027
# Stream 9 EOL: 31 May 2027
dockerfile: ci/centos-stream-9/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
centosstream10_task:
container:
# Stream 10 EOL: 01 January 2030
dockerfile: ci/centos-stream-10/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
debian13_task:
container:
# Debian 13 (trixie) EOL: TBD
dockerfile: ci/debian-13/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
arm_debian13_task:
arm_container:
# Debian 13 (trixie) EOL: TBD
dockerfile: ci/debian-13/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_SKIP_ALL
debian13_static_task:
container:
# Just use a recent/common distro to run a static compile test.
# Debian 13 (trixie) EOL: TBD
dockerfile: ci/debian-13/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
env:
ZEEK_CI_CONFIGURE_FLAGS: *STATIC_CONFIG
debian13_binary_task:
container:
# Just use a recent/common distro to run binary mode compile test.
# As of 2024-03, the used configure flags are equivalent to the flags
# that we use to create binary packages.
# Just use a recent/common distro to run a static compile test.
# Debian 13 (trixie) EOL: TBD
dockerfile: ci/debian-13/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
env:
ZEEK_CI_CONFIGURE_FLAGS: *BINARY_CONFIG
debian12_task:
container:
@ -202,48 +327,8 @@ debian12_task:
dockerfile: ci/debian-12/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
arm_debian12_task:
arm_container:
# Debian 12 (bookworm) EOL: TBD
dockerfile: ci/debian-12/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
env:
ZEEK_CI_CONFIGURE_FLAGS: *NO_SPICY_CONFIG
debian12_static_task:
container:
# Just use a recent/common distro to run a static compile test.
# Debian 12 (bookworm) EOL: TBD
dockerfile: ci/debian-12/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
env:
ZEEK_CI_CONFIGURE_FLAGS: *STATIC_CONFIG
debian12_binary_task:
container:
# Just use a recent/common distro to run binary mode compile test.
# As of 2024-03, the used configure flags are equivalent to the flags
# that we use to create binary packages.
# Just use a recent/common distro to run a static compile test.
# Debian 12 (bookworm) EOL: TBD
dockerfile: ci/debian-12/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
env:
ZEEK_CI_CONFIGURE_FLAGS: *BINARY_CONFIG
debian11_task:
container:
# Debian 11 EOL: June 2026
dockerfile: ci/debian-11/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
opensuse_leap_15_6_task:
container:
@ -251,6 +336,8 @@ opensuse_leap_15_6_task:
dockerfile: ci/opensuse-leap-15.6/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
opensuse_tumbleweed_task:
container:
@ -259,30 +346,63 @@ opensuse_tumbleweed_task:
<< : *RESOURCES_TEMPLATE
prepare_script: ./ci/opensuse-tumbleweed/prepare.sh
<< : *CI_TEMPLATE
# << : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
ubuntu24_10_task:
weekly_current_gcc_task:
container:
# Ubuntu 24.10 EOL: 2025-07-30
dockerfile: ci/ubuntu-24.10/Dockerfile
# Opensuse Tumbleweed has no EOL
dockerfile: ci/opensuse-tumbleweed/Dockerfile
<< : *RESOURCES_TEMPLATE
prepare_script: ./ci/opensuse-tumbleweed/prepare-weekly.sh
<< : *CI_TEMPLATE
<< : *ONLY_IF_WEEKLY
env:
ZEEK_CI_COMPILER: gcc
weekly_current_clang_task:
container:
# Opensuse Tumbleweed has no EOL
dockerfile: ci/opensuse-tumbleweed/Dockerfile
<< : *RESOURCES_TEMPLATE
prepare_script: ./ci/opensuse-tumbleweed/prepare-weekly.sh
<< : *CI_TEMPLATE
<< : *ONLY_IF_WEEKLY
env:
ZEEK_CI_COMPILER: clang
ubuntu25_04_task:
container:
# Ubuntu 25.04 EOL: 2026-01-31
dockerfile: ci/ubuntu-25.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
ubuntu24_task:
ubuntu24_04_task:
container:
# Ubuntu 24.04 EOL: Jun 2029
dockerfile: ci/ubuntu-24.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_SKIP_ALL
env:
ZEEK_CI_CREATE_ARTIFACT: 1
upload_binary_artifacts:
path: build.tgz
benchmark_script: ./ci/benchmark.sh
# Same as above, but running the ZAM tests instead of the regular tests.
ubuntu24_zam_task:
ubuntu24_04_zam_task:
container:
# Ubuntu 24.04 EOL: Jun 2029
dockerfile: ci/ubuntu-24.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_OR_ZAM
env:
ZEEK_CI_SKIP_UNIT_TESTS: 1
ZEEK_CI_SKIP_EXTERNAL_BTESTS: 1
@ -291,44 +411,41 @@ ubuntu24_zam_task:
ZEEK_CI_BTEST_JOBS: 3
# Same as above, but using Clang and libc++
ubuntu24_clang_libcpp_task:
ubuntu24_04_clang_libcpp_task:
container:
# Ubuntu 24.04 EOL: Jun 2029
dockerfile: ci/ubuntu-24.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
env:
CC: clang-18
CXX: clang++-18
CC: clang-19
CXX: clang++-19
CXXFLAGS: -stdlib=libc++
ubuntu22_task:
ubuntu24_04_clang_tidy_task:
container:
# Ubuntu 22.04 EOL: June 2027
dockerfile: ci/ubuntu-22.04/Dockerfile
# Ubuntu 24.04 EOL: Jun 2029
dockerfile: ci/ubuntu-24.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
env:
ZEEK_CI_CREATE_ARTIFACT: 1
upload_binary_artifacts:
path: build.tgz
benchmark_script: ./ci/benchmark.sh
# Run on PRs, merges to master and release/.* and benchmark-nightly cron.
only_if: >
( $CIRRUS_PR != '' && $CIRRUS_BRANCH !=~ 'dependabot/.*' ) ||
( ( $CIRRUS_REPO_NAME == 'zeek' || $CIRRUS_REPO_NAME == 'zeek-security' ) &&
$CIRRUS_BRANCH == 'master' ||
$CIRRUS_BRANCH =~ 'release/.*' ||
$CIRRUS_CRON == 'benchmark-nightly' )
CC: clang-19
CXX: clang++-19
ZEEK_CI_CONFIGURE_FLAGS: *CLANG_TIDY_CONFIG
# Also enable Spicy SSL for this
ubuntu22_spicy_task:
ubuntu24_04_spicy_task:
container:
# Ubuntu 22.04 EOL: April 2027
dockerfile: ci/ubuntu-22.04/Dockerfile
# Ubuntu 24.04 EOL: Jun 2029
dockerfile: ci/ubuntu-24.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_OR_BENCHMARK
env:
ZEEK_CI_CREATE_ARTIFACT: 1
ZEEK_CI_CONFIGURE_FLAGS: *SPICY_SSL_CONFIG
@ -336,7 +453,33 @@ ubuntu22_spicy_task:
upload_binary_artifacts:
path: build.tgz
benchmark_script: ./ci/benchmark.sh
<< : *BENCHMARK_ONLY_IF_TEMPLATE
ubuntu24_04_spicy_head_task:
container:
# Ubuntu 24.04 EOL: Jun 2029
dockerfile: ci/ubuntu-24.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE_NIGHTLY
<< : *SKIP_IF_PR_NOT_FULL_OR_BENCHMARK
env:
ZEEK_CI_CREATE_ARTIFACT: 1
ZEEK_CI_CONFIGURE_FLAGS: *SPICY_SSL_CONFIG
# Pull auxil/spicy to the latest head version. May or may not build.
ZEEK_CI_PREBUILD_COMMAND: 'cd auxil/spicy && git fetch && git reset --hard origin/main && git submodule update --init --recursive'
spicy_install_analyzers_script: ./ci/spicy-install-analyzers.sh
upload_binary_artifacts:
path: build.tgz
benchmark_script: ./ci/benchmark.sh
ubuntu22_04_task:
container:
# Ubuntu 22.04 EOL: June 2027
dockerfile: ci/ubuntu-22.04/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
alpine_task:
container:
@ -346,6 +489,8 @@ alpine_task:
dockerfile: ci/alpine/Dockerfile
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
# Cirrus only supports the following macos runner currently, selecting
# anything else automatically upgrades to this one.
@ -358,6 +503,8 @@ macos_sequoia_task:
image: ghcr.io/cirruslabs/macos-runner:sequoia
prepare_script: ./ci/macos/prepare.sh
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_SKIP_ALL
<< : *MACOS_ENVIRONMENT
# FreeBSD EOL timelines: https://www.freebsd.org/security/#sup
@ -369,6 +516,8 @@ freebsd14_task:
prepare_script: ./ci/freebsd/prepare.sh
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_SKIP_ALL
<< : *FREEBSD_ENVIRONMENT
freebsd13_task:
@ -379,7 +528,8 @@ freebsd13_task:
prepare_script: ./ci/freebsd/prepare.sh
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI
<< : *FREEBSD_ENVIRONMENT
asan_sanitizer_task:
@ -389,6 +539,8 @@ asan_sanitizer_task:
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_SKIP_ALL
test_fuzzers_script: ./ci/test-fuzzers.sh
coverage_script: ./ci/upload-coverage.sh
env:
@ -405,6 +557,8 @@ asan_sanitizer_zam_task:
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_NIGHTLY
<< : *SKIP_IF_PR_NOT_FULL_OR_ZAM
env:
ZEEK_CI_CONFIGURE_FLAGS: *ASAN_SANITIZER_CONFIG
ASAN_OPTIONS: detect_leaks=1:detect_odr_violation=0
@ -413,7 +567,6 @@ asan_sanitizer_zam_task:
ZEEK_CI_BTEST_EXTRA_ARGS: -a zam
# Use a lower number of jobs due to OOM issues with ZAM tasks
ZEEK_CI_BTEST_JOBS: 3
<< : *ZAM_SKIP_TASK_ON_PR
ubsan_sanitizer_task:
container:
@ -422,11 +575,12 @@ ubsan_sanitizer_task:
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_NIGHTLY
<< : *SKIP_IF_PR_NOT_FULL_CI
test_fuzzers_script: ./ci/test-fuzzers.sh
env:
CC: clang-18
CXX: clang++-18
CC: clang-19
CXX: clang++-19
CXXFLAGS: -DZEEK_DICT_DEBUG
ZEEK_CI_CONFIGURE_FLAGS: *UBSAN_SANITIZER_CONFIG
ZEEK_TAILORED_UB_CHECKS: 1
@ -438,9 +592,11 @@ ubsan_sanitizer_zam_task:
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *ONLY_IF_PR_NIGHTLY
<< : *SKIP_IF_PR_NOT_FULL_OR_ZAM
env:
CC: clang-18
CXX: clang++-18
CC: clang-19
CXX: clang++-19
ZEEK_CI_CONFIGURE_FLAGS: *UBSAN_SANITIZER_CONFIG
ZEEK_TAILORED_UB_CHECKS: 1
UBSAN_OPTIONS: print_stacktrace=1
@ -449,7 +605,6 @@ ubsan_sanitizer_zam_task:
ZEEK_CI_BTEST_EXTRA_ARGS: -a zam
# Use a lower number of jobs due to OOM issues with ZAM tasks
ZEEK_CI_BTEST_JOBS: 3
<< : *ZAM_SKIP_TASK_ON_PR
tsan_sanitizer_task:
container:
@ -458,10 +613,11 @@ tsan_sanitizer_task:
<< : *RESOURCES_TEMPLATE
<< : *CI_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_NIGHTLY
<< : *SKIP_IF_PR_NOT_FULL_CI
env:
CC: clang-18
CXX: clang++-18
CC: clang-19
CXX: clang++-19
ZEEK_CI_CONFIGURE_FLAGS: *TSAN_SANITIZER_CONFIG
ZEEK_CI_DISABLE_SCRIPT_PROFILING: 1
# If this is defined directly in the environment, configure fails to find
@ -482,11 +638,12 @@ windows_task:
prepare_script: ci/windows/prepare.cmd
build_script: ci/windows/build.cmd
test_script: ci/windows/test.cmd
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_OR_WINDOWS
env:
ZEEK_CI_CPUS: 8
# Give verbose error output on a test failure.
CTEST_OUTPUT_ON_FAILURE: 1
<< : *BUILDS_ONLY_IF_TEMPLATE
# Container images
@ -567,22 +724,18 @@ arm64_container_image_docker_builder:
env:
CIRRUS_ARCH: arm64
<< : *DOCKER_BUILD_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_RELEASE_TAG_NIGHTLY
amd64_container_image_docker_builder:
env:
CIRRUS_ARCH: amd64
<< : *DOCKER_BUILD_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE_NIGHTLY
<< : *SKIP_IF_PR_NOT_FULL_OR_CLUSTER_TEST
container_image_manifest_docker_builder:
cpu: 1
# Push master builds to zeek/zeek-dev, or tagged release branches to zeek/zeek
only_if: >
( $CIRRUS_CRON == '' ) &&
( $CIRRUS_REPO_FULL_NAME == 'zeek/zeek' &&
( $CIRRUS_BRANCH == 'master' ||
$CIRRUS_TAG =~ 'v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$' ) )
<< : *ONLY_IF_RELEASE_TAG_NIGHTLY
env:
DOCKER_USERNAME: ENCRYPTED[!505b3dee552a395730a7e79e6aab280ffbe1b84ec62ae7616774dfefe104e34f896d2e20ce3ad701f338987c13c33533!]
DOCKER_PASSWORD: ENCRYPTED[!6c4b2f6f0e5379ef1091719cc5d2d74c90cfd2665ac786942033d6d924597ffb95dbbc1df45a30cc9ddeec76c07ac620!]
@ -661,8 +814,7 @@ container_image_manifest_docker_builder:
# images from the public ECR repository to stay within free-tier bounds.
public_ecr_cleanup_docker_builder:
cpu: 1
only_if: >
$CIRRUS_CRON == '' && $CIRRUS_REPO_FULL_NAME == 'zeek/zeek' && $CIRRUS_BRANCH == 'master'
<< : *ONLY_IF_NIGHTLY
env:
AWS_ACCESS_KEY_ID: ENCRYPTED[!eff52f6442e1bc78bce5b15a23546344df41bf519f6201924cb70c7af12db23f442c0e5f2b3687c2d856ceb11fcb8c49!]
AWS_SECRET_ACCESS_KEY: ENCRYPTED[!748bc302dd196140a5fa8e89c9efd148882dc846d4e723787d2de152eb136fa98e8dea7e6d2d6779d94f72dd3c088228!]
@ -702,27 +854,23 @@ cluster_testing_docker_builder:
path: "testing/external/zeek-testing-cluster/.tmp/**"
depends_on:
- amd64_container_image
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_RELEASE_AND_NIGHTLY
<< : *SKIP_IF_PR_NOT_FULL_OR_CLUSTER_TEST
# Test zeekctl upon master and release pushes and also when
# a PR has a zeekctlci or fullci label.
# a PR has a "CI: Zeekctl" or "CI: Full" label.
#
# Also triggers on CIRRUS_CRON == 'zeekctl-nightly' if that is configured
# through the Cirrus Web UI.
zeekctl_debian12_task:
cpu: *CPUS
memory: *MEMORY
only_if: >
( $CIRRUS_CRON == 'zeekctl-nightly' ) ||
( $CIRRUS_PR != '' && $CIRRUS_PR_LABELS =~ '.*(zeekctlci|fullci).*' ) ||
( $CIRRUS_REPO_NAME == 'zeek' && (
$CIRRUS_BRANCH == 'master' ||
$CIRRUS_BRANCH =~ 'release/.*' )
)
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_OR_ZEEKCTL
container:
# Debian 12 (bookworm) EOL: TBD
dockerfile: ci/debian-12/Dockerfile
# Debian 13 (trixie) EOL: TBD
dockerfile: ci/debian-13/Dockerfile
<< : *RESOURCES_TEMPLATE
sync_submodules_script: git submodule update --recursive --init
always:
@ -745,15 +893,19 @@ include_plugins_debian12_task:
cpu: *CPUS
memory: *MEMORY
container:
# Debian 12 (bookworm) EOL: TBD
dockerfile: ci/debian-12/Dockerfile
# Debian 13 (trixie) EOL: TBD
dockerfile: ci/debian-13/Dockerfile
<< : *RESOURCES_TEMPLATE
sync_submodules_script: git submodule update --recursive --init
fetch_external_plugins_script:
- cd /zeek/testing/builtin-plugins/external && git clone https://github.com/zeek/zeek-perf-support.git
- cd zeek-perf-support && echo "Cloned $(git rev-parse HEAD) for $(basename $(pwd))"
- cd /zeek/testing/builtin-plugins/external && git clone https://github.com/zeek/zeek-more-hashes.git
- cd zeek-more-hashes && echo "Cloned $(git rev-parse HEAD) for $(basename $(pwd))"
- cd /zeek/testing/builtin-plugins/external && git clone https://github.com/zeek/zeek-cluster-backend-nats.git
- cd zeek-cluster-backend-nats && echo "Cloned $(git rev-parse HEAD) for $(basename $(pwd))"
- cd /zeek/testing/builtin-plugins/external && git clone https://github.com/SeisoLLC/zeek-kafka.git
- cd zeek-kafka && echo "Cloned $(git rev-parse HEAD) for $(basename $(pwd))"
always:
ccache_cache:
folder: /tmp/ccache
@ -773,5 +925,5 @@ include_plugins_debian12_task:
on_failure:
upload_include_plugins_testing_artifacts:
path: "testing/builtin-plugins/.tmp/**"
<< : *BUILDS_ONLY_IF_TEMPLATE
<< : *SKIP_TASK_ON_PR
<< : *ONLY_IF_PR_MASTER_RELEASE
<< : *SKIP_IF_PR_NOT_FULL_CI

View file

@ -1,5 +1,76 @@
Checks: '-*,
Checks: [-*,
bugprone-*,
performance-*,
modernize-*,
readability-isolate-declaration,
readability-container-contains,
# Enable a very limited number of the cppcoreguidelines checkers.
# See the notes for some of the rest of them below.
cppcoreguidelines-macro-usage,
cppcoreguidelines-misleading-capture-default-by-value,
cppcoreguidelines-virtual-class-destructor,
# Skipping these temporarily because they are very noisy
-bugprone-forward-declaration-namespace,
-bugprone-narrowing-conversions,
-bugprone-unchecked-optional-access,
-performance-unnecessary-value-param,
-modernize-use-equals-default,
-modernize-use-integer-sign-comparison,
# The following cause either lots of pointless or advisory warnings
-bugprone-easily-swappable-parameters,
clang-analyzer-*,
performance-*'
-bugprone-nondeterministic-pointer-iteration-order,
# bifcl generates a lot of code with double underscores in their name.
# ZAM uses a few identifiers that start with underscores or have
# double-underscores in the name.
-bugprone-reserved-identifier,
# bifcl generates almost every switch statement without a default case
# and so this one generates a lot of warnings.
-bugprone-switch-missing-default-case,
# These report warnings that are rather difficult to fix or are things
# we simply don't want to fix.
-bugprone-undefined-memory-manipulation,
-bugprone-pointer-arithmetic-on-polymorphic-object,
-bugprone-empty-catch,
-bugprone-exception-escape,
-bugprone-suspicious-include,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-raw-string-literal,
-modernize-use-auto,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-modernize-use-designated-initializers,
# This one returns a bunch of findings in DFA and the sqlite library.
# We're unlikely to fix either of them.
-performance-no-int-to-ptr,
# These cppcoreguidelines checkers are things we should investigate
# and possibly fix, but there are so many findings that we're holding
# off doing it for now.
#cppcoreguidelines-init-variables,
#cppcoreguidelines-prefer-member-initializer,
#cppcoreguidelines-pro-type-member-init,
#cppcoreguidelines-pro-type-cstyle-cast,
#cppcoreguidelines-pro-type-static-cast-downcast,
#cppcoreguidelines-special-member-functions,
# These are features in newer version of C++ that we don't have
# access to yet.
-modernize-use-std-format,
-modernize-use-std-print,
]
HeaderFilterRegex: '.h'
ExcludeHeaderFilterRegex: '.*(auxil|3rdparty)/.*'
SystemHeaders: false
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: 'true'
WarningsAsErrors: '*'

View file

@ -33,3 +33,6 @@ f5a76c1aedc7f8886bc6abef0dfaa8065684b1f6
# clang-format: Format JSON with clang-format
e6256446ddef5c5d5240eefff974556f2e12ac46
# analyzer/protocol: Reformat with spicy-format
d70bcd07b9b26036b16092fe950eca40e2f5a032

View file

@ -16,7 +16,7 @@ jobs:
generate:
permissions:
contents: write # for Git to git push
if: github.repository == 'zeek/zeek'
if: "github.repository == 'zeek/zeek' && contains(github.event.pull_request.labels.*.name, 'CI: Skip All') == false"
runs-on: ubuntu-24.04
steps:
@ -66,16 +66,14 @@ jobs:
make \
python3 \
python3-dev \
python3-pip\
python3-pip \
sqlite3 \
swig \
zlib1g-dev
# Many distros adhere to PEP 394's recommendation for `python` =
# `python2` so this is a simple workaround until we drop Python 2
# support and explicitly use `python3` for all invocations.
sudo ln -sf /usr/bin/python3 /usr/local/bin/python
sudo pip3 install --break-system-packages -r doc/requirements.txt
sudo pip3 install --break-system-packages pre-commit
python3 -m venv ci-docs-venv
source ci-docs-venv/bin/activate
pip3 install -r doc/requirements.txt
pip3 install pre-commit
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
@ -112,6 +110,7 @@ jobs:
- name: Generate Docs
run: |
source ci-docs-venv/bin/activate
git config --global user.name zeek-bot
git config --global user.email info@zeek.org

18
.gitmodules vendored
View file

@ -1,9 +1,6 @@
[submodule "auxil/zeek-aux"]
path = auxil/zeek-aux
url = https://github.com/zeek/zeek-aux
[submodule "auxil/binpac"]
path = auxil/binpac
url = https://github.com/zeek/binpac
[submodule "auxil/zeekctl"]
path = auxil/zeekctl
url = https://github.com/zeek/zeekctl
@ -13,18 +10,12 @@
[submodule "cmake"]
path = cmake
url = https://github.com/zeek/cmake
[submodule "src/3rdparty"]
path = src/3rdparty
url = https://github.com/zeek/zeek-3rdparty
[submodule "auxil/broker"]
path = auxil/broker
url = https://github.com/zeek/broker
[submodule "auxil/netcontrol-connectors"]
path = auxil/netcontrol-connectors
url = https://github.com/zeek/zeek-netcontrol
[submodule "auxil/bifcl"]
path = auxil/bifcl
url = https://github.com/zeek/bifcl
[submodule "doc"]
path = doc
url = https://github.com/zeek/zeek-docs
@ -46,9 +37,6 @@
[submodule "auxil/zeek-client"]
path = auxil/zeek-client
url = https://github.com/zeek/zeek-client
[submodule "auxil/gen-zam"]
path = auxil/gen-zam
url = https://github.com/zeek/gen-zam
[submodule "auxil/c-ares"]
path = auxil/c-ares
url = https://github.com/c-ares/c-ares
@ -58,12 +46,6 @@
[submodule "auxil/spicy"]
path = auxil/spicy
url = https://github.com/zeek/spicy
[submodule "auxil/filesystem"]
path = auxil/filesystem
url = https://github.com/gulrak/filesystem.git
[submodule "auxil/zeek-af_packet-plugin"]
path = auxil/zeek-af_packet-plugin
url = https://github.com/zeek/zeek-af_packet-plugin.git
[submodule "auxil/libunistd"]
path = auxil/libunistd
url = https://github.com/zeek/libunistd

View file

@ -10,7 +10,7 @@ repos:
language: python
files: '\.(h|c|cpp|cc|spicy|evt)$'
types: [file]
exclude: '^(testing/btest/(Baseline|plugins|spicy|scripts)/.*|testing/builtin-plugins/.*)$'
exclude: '^(testing/btest/(Baseline|plugins|spicy|scripts)/.*|testing/builtin-plugins/.*|src/3rdparty/.*)$'
- id: btest-command-commented
name: Check that all BTest command lines are commented out
@ -19,25 +19,26 @@ repos:
files: '^testing/btest/.*$'
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.0
rev: v20.1.8
hooks:
- id: clang-format
types_or:
- "c"
- "c++"
- "json"
exclude: '^src/3rdparty/.*'
- repo: https://github.com/maxwinterstein/shfmt-py
rev: v3.11.0.2
rev: v3.12.0.1
hooks:
- id: shfmt
args: ["-w", "-i", "4", "-ci"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.4
rev: v0.12.8
hooks:
- id: ruff
args: [--fix]
- id: ruff-check
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/cheshirekow/cmake-format-precommit
@ -46,14 +47,13 @@ repos:
- id: cmake-format
- repo: https://github.com/crate-ci/typos
rev: v1.30.1
rev: v1.35.3
hooks:
- id: typos
exclude: '^(.typos.toml|src/SmithWaterman.cc|testing/.*|auxil/.*|scripts/base/frameworks/files/magic/.*|CHANGES|scripts/base/protocols/ssl/mozilla-ca-list.zeek)$'
exclude: '^(.typos.toml|src/SmithWaterman.cc|testing/.*|auxil/.*|scripts/base/frameworks/files/magic/.*|CHANGES|scripts/base/protocols/ssl/mozilla-ca-list.zeek|src/3rdparty/.*)$'
- repo: https://github.com/bbannier/spicy-format
rev: v0.25.0
rev: v0.26.0
hooks:
- id: spicy-format
# TODO: Reformat existing large analyzers just before 8.0.
exclude: '(^testing/.*)|(protocol/ldap/.*)|(protocol/quic/.*)|(protocol/websocket/.*)'
exclude: '^testing/.*'

View file

@ -30,12 +30,15 @@ extend-ignore-re = [
"ot->Yield\\(\\)->InternalType\\(\\)",
"switch \\( ot \\)",
"\\(ZAMOpType ot\\)",
"exat", # Redis expire at
"EXAT",
# News stuff
"SupressWeirds.*deprecated",
"\"BaR\"",
"\"xFoObar\"",
"\"FoO\"",
"Smoot",
]
extend-ignore-identifiers-re = [
@ -53,6 +56,7 @@ extend-ignore-identifiers-re = [
"complte_flag", # Existing use in exported record in base.
"VidP(n|N)", # In SMB.
"iin", # In DNP3.
"SCN[dioux]", # sccanf fixed-width identifiers
"(ScValidatePnPService|ScSendPnPMessage)", # In DCE-RPC.
"snet", # Used as shorthand for subnet in base scripts.
"typ",
@ -82,6 +86,7 @@ ot2 = "ot2"
uses_seh = "uses_seh"
ect0 = "ect0"
ect1 = "ect1"
tpe = "tpe"
[default.extend-words]
caf = "caf"

2641
CHANGES

File diff suppressed because it is too large Load diff

View file

@ -68,7 +68,8 @@ option(INSTALL_ZEEKCTL "Install zeekctl." ${ZEEK_INSTALL_TOOLS_DEFAULT})
option(INSTALL_ZEEK_CLIENT "Install the zeek-client." ${ZEEK_INSTALL_TOOLS_DEFAULT})
option(INSTALL_ZKG "Install zkg." ${ZEEK_INSTALL_TOOLS_DEFAULT})
option(PREALLOCATE_PORT_ARRAY "Pre-allocate all ports for zeek::Val." ON)
option(ZEEK_STANDALONE "Build Zeek as stand-alone binary?" ON)
option(ZEEK_STANDALONE "Build Zeek as stand-alone binary." ON)
option(ZEEK_ENABLE_FUZZERS "Build Zeek fuzzing targets." OFF)
# Non-boolean options.
if (NOT WIN32)
@ -89,8 +90,6 @@ set(ZEEK_ETC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc"
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL
"Whether to write a JSON compile commands database")
set(ZEEK_CXX_STD cxx_std_17 CACHE STRING "The C++ standard to use.")
set(ZEEK_SANITIZERS "" CACHE STRING "Sanitizers to use when building.")
set(CPACK_SOURCE_IGNORE_FILES "" CACHE STRING "Files to be ignored by CPack")
@ -193,18 +192,36 @@ if (MSVC)
# TODO: This is disabled for now because there a bunch of known
# compiler warnings on Windows that we don't have good fixes for.
#set(WERROR_FLAG "/WX")
#set(WERROR_FLAG "/WX")
#set(WNOERROR_FLAG "/WX:NO")
endif ()
# Always build binpac in static mode if building on Windows
set(BUILD_STATIC_BINPAC true)
else ()
include(GNUInstallDirs)
if (BUILD_WITH_WERROR)
set(WERROR_FLAG "-Werror")
set(WNOERROR_FLAG "-Wno-error")
# With versions >=13.0 GCC gained `-Warray-bounds` which reports false
# positives, see e.g., https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111273.
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
list(APPEND WERROR_FLAG "-Wno-error=array-bounds")
endif ()
# With versions >=11.0 GCC is returning false positives for -Wrestrict. See
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366. It's more prevalent
# building with -std=c++20.
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
list(APPEND WERROR_FLAG "-Wno-error=restrict")
endif ()
endif ()
endif ()
include(cmake/CommonCMakeConfig.cmake)
include(cmake/FindClangTidy.cmake)
include(cmake/CheckCompilerArch.cmake)
include(cmake/RequireCXXStd.cmake)
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
@ -233,7 +250,7 @@ set(ZEEK_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
# zeek-plugin-create-package.sh. Needed by ZeekPluginConfig.cmake.in.
set(ZEEK_PLUGIN_SCRIPTS_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Our C++17 base target for propagating compiler and linker flags. Note: for
# Our C++ base target for propagating compiler and linker flags. Note: for
# now, we only use it for passing library dependencies around.
add_library(zeek_internal INTERFACE)
add_library(Zeek::Internal ALIAS zeek_internal)
@ -352,7 +369,7 @@ endfunction ()
find_package(Threads REQUIRED)
# Interface library for propagating extra flags and include paths to dynamically
# loaded plugins. Also propagates include paths and C++17 mode on the install
# loaded plugins. Also propagates include paths and c++ standard mode on the install
# interface.
add_library(zeek_dynamic_plugin_base INTERFACE)
target_include_directories(
@ -379,14 +396,14 @@ endfunction ()
add_zeek_dynamic_plugin_build_interface_include_directories(
${PROJECT_SOURCE_DIR}/src/include
${PROJECT_SOURCE_DIR}/auxil/binpac/lib
${PROJECT_SOURCE_DIR}/tools/binpac/lib
${PROJECT_SOURCE_DIR}/auxil/broker/libbroker
${PROJECT_SOURCE_DIR}/auxil/paraglob/include
${PROJECT_SOURCE_DIR}/auxil/prometheus-cpp/core/include
${PROJECT_SOURCE_DIR}/auxil/expected-lite/include
${CMAKE_BINARY_DIR}/src
${CMAKE_BINARY_DIR}/src/include
${CMAKE_BINARY_DIR}/auxil/binpac/lib
${CMAKE_BINARY_DIR}/tools/binpac/lib
${CMAKE_BINARY_DIR}/auxil/broker/libbroker
${CMAKE_BINARY_DIR}/auxil/prometheus-cpp/core/include)
@ -649,6 +666,7 @@ if (ENABLE_DEBUG)
set(VERSION_C_IDENT "${VERSION_C_IDENT}_debug")
target_compile_definitions(zeek_internal INTERFACE DEBUG)
target_compile_definitions(zeek_dynamic_plugin_base INTERFACE DEBUG)
set(SPICYZ_FLAGS "-d" CACHE STRING "Additional flags to pass to spicyz for builtin analyzers")
endif ()
if (NOT BINARY_PACKAGING_MODE)
@ -865,46 +883,35 @@ endif ()
set(PY_MOD_INSTALL_DIR ${py_mod_install_dir} CACHE STRING "Installation path for Python modules"
FORCE)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/auxil/binpac/CMakeLists.txt)
# BinPAC uses the same 'ENABLE_STATIC_ONLY' variable to define whether
# to build statically. Save a local copy so it can be set based on the
# configure flag before we add the subdirectory.
set(ENABLE_STATIC_ONLY_SAVED ${ENABLE_STATIC_ONLY})
set(ENABLE_STATIC_ONLY_SAVED ${ENABLE_STATIC_ONLY})
if (MSVC)
set(BUILD_STATIC_BINPAC true)
endif ()
if (BUILD_STATIC_BINPAC)
set(ENABLE_STATIC_ONLY true)
endif ()
add_subdirectory(auxil/binpac)
set(ENABLE_STATIC_ONLY ${ENABLE_STATIC_ONLY_SAVED})
# FIXME: avoid hard-coding a path for multi-config generator support. See the
# TODO in ZeekPluginConfig.cmake.in.
set(BINPAC_EXE_PATH "${CMAKE_BINARY_DIR}/auxil/binpac/src/binpac${CMAKE_EXECUTABLE_SUFFIX}")
if (BUILD_STATIC_BINPAC)
set(ENABLE_STATIC_ONLY true)
endif ()
find_package(BinPAC REQUIRED)
add_subdirectory(tools/binpac)
set(ENABLE_STATIC_ONLY ${ENABLE_STATIC_ONLY_SAVED})
# Add an alias (used by our plugin setup).
# FIXME: avoid hard-coding a path for multi-config generator support. See the
# TODO in ZeekPluginConfig.cmake.in.
set(BINPAC_EXE_PATH "${CMAKE_BINARY_DIR}/tools/binpac/src/binpac${CMAKE_EXECUTABLE_SUFFIX}")
set(_binpac_exe_path "included")
# Need to call find_package so it sets up the include paths used by plugin builds.
find_package(BinPAC REQUIRED)
add_executable(Zeek::BinPAC ALIAS binpac)
if (NOT BIFCL_EXE_PATH)
add_subdirectory(auxil/bifcl)
add_executable(Zeek::BifCl ALIAS bifcl)
# FIXME: avoid hard-coding a path for multi-config generator support. See the
# TODO in ZeekPluginConfig.cmake.in.
set(BIFCL_EXE_PATH "${CMAKE_BINARY_DIR}/auxil/bifcl/bifcl${CMAKE_EXECUTABLE_SUFFIX}")
set(_bifcl_exe_path "included")
else ()
add_executable(Zeek::BifCl IMPORTED)
set_property(TARGET Zeek::BifCl PROPERTY IMPORTED_LOCATION "${BIFCL_EXE_PATH}")
set(_bifcl_exe_path "BIFCL_EXE_PATH")
endif ()
add_subdirectory(tools/bifcl)
add_executable(Zeek::BifCl ALIAS bifcl)
# FIXME: avoid hard-coding a path for multi-config generator support. See the
# TODO in ZeekPluginConfig.cmake.in.
set(BIFCL_EXE_PATH "${CMAKE_BINARY_DIR}/tools/bifcl/bifcl${CMAKE_EXECUTABLE_SUFFIX}")
set(_bifcl_exe_path "included")
if (NOT GEN_ZAM_EXE_PATH)
add_subdirectory(auxil/gen-zam)
endif ()
add_subdirectory(tools/gen-zam)
if (ENABLE_JEMALLOC)
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
@ -1009,6 +1016,7 @@ if (NOT DISABLE_SPICY)
set(Python3_EXECUTABLE ${Python_EXECUTABLE} CACHE STRING "Python3_EXECUTABLE hint")
endif ()
set(SPICY_ENABLE_TESTS OFF)
add_subdirectory(auxil/spicy)
include(ConfigureSpicyBuild) # set some options different for building Spicy
@ -1047,9 +1055,6 @@ include(BuiltInSpicyAnalyzer)
include_directories(BEFORE ${PCAP_INCLUDE_DIR} ${BIND_INCLUDE_DIR} ${BinPAC_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR} ${JEMALLOC_INCLUDE_DIR})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auxil/filesystem/include/ghc
DESTINATION include/zeek/3rdparty/)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auxil/prometheus-cpp/core/include/prometheus
DESTINATION include/zeek/3rdparty/prometheus-cpp/include)
@ -1059,15 +1064,8 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/auxil/prometheus-cpp/core/include/
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/auxil/expected-lite/include/nonstd
DESTINATION include/zeek/3rdparty/)
# Create 3rdparty/ghc within the build directory so that the include for
# "zeek/3rdparty/ghc/filesystem.hpp" works within the build tree.
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory
"${CMAKE_CURRENT_BINARY_DIR}/3rdparty/")
execute_process(
COMMAND
"${CMAKE_COMMAND}" -E create_symlink
"${CMAKE_CURRENT_SOURCE_DIR}/auxil/filesystem/include/ghc"
"${CMAKE_CURRENT_BINARY_DIR}/3rdparty/ghc")
# Do the same for nonstd.
execute_process(
@ -1082,18 +1080,16 @@ set(USE_GEOIP false)
find_package(LibMMDB)
if (LIBMMDB_FOUND)
set(USE_GEOIP true)
include_directories(BEFORE ${LibMMDB_INCLUDE_DIR})
include_directories(BEFORE SYSTEM ${LibMMDB_INCLUDE_DIR})
list(APPEND OPTLIBS ${LibMMDB_LIBRARY})
endif ()
set(USE_KRB5 false)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package(LibKrb5)
if (LIBKRB5_FOUND)
set(USE_KRB5 true)
include_directories(BEFORE ${LibKrb5_INCLUDE_DIR})
list(APPEND OPTLIBS ${LibKrb5_LIBRARY})
endif ()
find_package(LibKrb5)
if (LIBKRB5_FOUND)
set(USE_KRB5 true)
include_directories(BEFORE SYSTEM ${LibKrb5_INCLUDE_DIR})
list(APPEND OPTLIBS ${LibKrb5_LIBRARY})
endif ()
set(HAVE_PERFTOOLS false)
@ -1125,7 +1121,7 @@ endif ()
# dependencies which tend to be in standard system locations and thus cause the
# system OpenSSL headers to still be picked up even if one specifies
# --with-openssl (which may be common).
include_directories(BEFORE ${OPENSSL_INCLUDE_DIR})
include_directories(BEFORE SYSTEM ${OPENSSL_INCLUDE_DIR})
# Determine if libfts is external to libc, i.e. musl
find_package(FTS)
@ -1191,18 +1187,6 @@ endif ()
# Tell the plugin code that we're building as part of the main tree.
set(ZEEK_PLUGIN_INTERNAL_BUILD true CACHE INTERNAL "" FORCE)
set(ZEEK_HAVE_AF_PACKET no)
if (${CMAKE_SYSTEM_NAME} MATCHES Linux)
if (NOT DISABLE_AF_PACKET)
if (NOT AF_PACKET_PLUGIN_PATH)
set(AF_PACKET_PLUGIN_PATH ${CMAKE_SOURCE_DIR}/auxil/zeek-af_packet-plugin)
endif ()
list(APPEND ZEEK_INCLUDE_PLUGINS ${AF_PACKET_PLUGIN_PATH})
set(ZEEK_HAVE_AF_PACKET yes)
endif ()
endif ()
set(ZEEK_HAVE_JAVASCRIPT no)
if (NOT DISABLE_JAVASCRIPT)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/auxil/zeekjs/cmake)
@ -1222,6 +1206,7 @@ if (NOT DISABLE_JAVASCRIPT)
endif ()
endif ()
set(ZEEK_HAVE_AF_PACKET no CACHE INTERNAL "Zeek has AF_PACKET support")
set(ZEEK_HAVE_JAVASCRIPT ${ZEEK_HAVE_JAVASCRIPT} CACHE INTERNAL "Zeek has JavaScript support")
set(DEFAULT_ZEEKPATH_PATHS
@ -1240,11 +1225,7 @@ endif ()
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "." "${CMAKE_CURRENT_BINARY_DIR}/zeek")
if (BinPAC_ROOT_DIR)
set(ZEEK_CONFIG_BINPAC_ROOT_DIR ${BinPAC_ROOT_DIR})
else ()
set(ZEEK_CONFIG_BINPAC_ROOT_DIR ${ZEEK_ROOT_DIR})
endif ()
set(ZEEK_CONFIG_BINPAC_ROOT_DIR ${BinPAC_ROOT_DIR})
if (BROKER_ROOT_DIR)
set(ZEEK_CONFIG_BROKER_ROOT_DIR ${BROKER_ROOT_DIR})
@ -1462,11 +1443,6 @@ else ()
set(_install_btest_tools_msg "no pcaps")
endif ()
set(_binpac_exe_path "included")
if (BINPAC_EXE_PATH)
set(_binpac_exe_path ${BINPAC_EXE_PATH})
endif ()
set(_gen_zam_exe_path "included")
if (GEN_ZAM_EXE_PATH)
set(_gen_zam_exe_path ${GEN_ZAM_EXE_PATH})
@ -1496,68 +1472,118 @@ if (ZEEK_LEGACY_ANALYZERS OR ZEEK_SKIPPED_ANALYZERS)
)
endif ()
message(
"\n====================| Zeek Build Summary |===================="
"\n"
"\nBuild type: ${CMAKE_BUILD_TYPE}"
"\nBuild dir: ${PROJECT_BINARY_DIR}"
"\n"
"\nInstall prefix: ${CMAKE_INSTALL_PREFIX}"
"\nConfig file dir: ${ZEEK_ETC_INSTALL_DIR}"
"\nLog dir: ${ZEEK_LOG_DIR}"
"\nPlugin dir: ${ZEEK_PLUGIN_DIR}"
"\nPython module dir: ${PY_MOD_INSTALL_DIR}"
"\nScript dir: ${ZEEK_SCRIPT_INSTALL_PATH}"
"\nSpool dir: ${ZEEK_SPOOL_DIR}"
"\nState dir: ${ZEEK_STATE_DIR}"
"\nSpicy modules dir: ${ZEEK_SPICY_MODULE_PATH}"
"\n"
"\nDebug mode: ${ENABLE_DEBUG}"
"\nUnit tests: ${ENABLE_ZEEK_UNIT_TESTS}"
"\nBuiltin Plugins: ${ZEEK_BUILTIN_PLUGINS}"
"\n"
"\nCC: ${CMAKE_C_COMPILER}"
"\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}"
"\nCPP: ${CMAKE_CXX_COMPILER}"
"\n"
"\nAF_PACKET: ${ZEEK_HAVE_AF_PACKET}"
"\nAux. Tools: ${INSTALL_AUX_TOOLS}"
"\nBifCL: ${_bifcl_exe_path}"
"\nBinPAC: ${_binpac_exe_path}"
"\nBTest: ${INSTALL_BTEST}"
"\nBTest tooling: ${_install_btest_tools_msg}"
"\nGen-ZAM: ${_gen_zam_exe_path}"
"\nJavaScript: ${ZEEK_HAVE_JAVASCRIPT}"
"\nSpicy: ${_spicy}"
"\nSpicy analyzers: ${USE_SPICY_ANALYZERS}"
"\nzeek-client: ${INSTALL_ZEEK_CLIENT}"
"\nZeekControl: ${INSTALL_ZEEKCTL}"
"\nzkg: ${INSTALL_ZKG}"
"\n"
"\nlibmaxminddb: ${USE_GEOIP}"
"\nKerberos: ${USE_KRB5}"
"\ngperftools found: ${HAVE_PERFTOOLS}"
"\n - tcmalloc: ${USE_PERFTOOLS_TCMALLOC}"
"\n - debugging: ${USE_PERFTOOLS_DEBUG}"
"\njemalloc: ${ENABLE_JEMALLOC}"
"\n"
"\nCluster backends:"
"\n - Broker: ON"
"\n - ZeroMQ: ${ENABLE_CLUSTER_BACKEND_ZEROMQ}"
"\n"
"\nStorage backends:"
"\n - SQLite: ON"
"\n - Redis: ${ENABLE_STORAGE_BACKEND_REDIS}"
"\n"
"\nFuzz Targets: ${ZEEK_ENABLE_FUZZERS}"
"\nFuzz Engine: ${ZEEK_FUZZING_ENGINE}"
"\n"
"\nInclude What You Use: ${ENABLE_IWYU}"
"\nClang-Tidy: ${ENABLE_CLANG_TIDY}"
"${_analyzer_warning}"
"\n"
"\n================================================================\n")
set(_zeek_builtin_plugins "${ZEEK_BUILTIN_PLUGINS}")
if (NOT ZEEK_BUILTIN_PLUGINS)
set(_zeek_builtin_plugins "none")
endif ()
set(_zeek_fuzzing_engine "${ZEEK_FUZZING_ENGINE}")
if (NOT ZEEK_FUZZING_ENGINE)
if (ZEEK_ENABLE_FUZZERS)
# The default fuzzer used by gcc and clang is libFuzzer. This is if you
# simply pass '-fsanitize=fuzzer' to the compiler.
set(_zeek_fuzzing_engine "libFuzzer")
endif ()
endif ()
## Utility method for outputting status information for features that just have a
## string representation. This can also take an optional second argument that is a
## value string to print.
function (output_summary_line what)
if ("${ARGV1}" MATCHES "^$")
message("${what}:")
return()
endif ()
set(_spaces " ")
string(LENGTH ${what} _what_length)
math(EXPR _num_spaces "25 - ${_what_length}")
string(SUBSTRING ${_spaces} 0 ${_num_spaces} _spacing)
message("${what}:${_spacing}${ARGV1}")
endfunction ()
## Utility method for outputting status information for features that have an ON/OFF
## state.
function (output_summary_bool what state)
if (${state})
output_summary_line("${what}" "ON")
else ()
output_summary_line("${what}" "OFF")
endif ()
endfunction ()
message("\n====================| Zeek Build Summary |====================\n")
output_summary_line("Build type" "${CMAKE_BUILD_TYPE}")
output_summary_line("Build dir" "${PROJECT_BINARY_DIR}")
message("")
output_summary_line("Install prefix" "${CMAKE_INSTALL_PREFIX}")
output_summary_line("Config file dir" "${ZEEK_ETC_INSTALL_DIR}")
output_summary_line("Log dir" "${ZEEK_LOG_DIR}")
output_summary_line("Plugin dir" "${ZEEK_PLUGIN_DIR}")
output_summary_line("Python module dir" "${PY_MOD_INSTALL_DIR}")
output_summary_line("Script dir" "${ZEEK_SCRIPT_INSTALL_PATH}")
output_summary_line("Spool dir" "${ZEEK_SPOOL_DIR}")
output_summary_line("State dir" "${ZEEK_STATE_DIR}")
output_summary_line("Spicy modules dir" "${ZEEK_SPICY_MODULE_PATH}")
message("")
output_summary_bool("Debug mode" ${ENABLE_DEBUG})
output_summary_bool("Unit tests" ${ENABLE_ZEEK_UNIT_TESTS})
message("")
output_summary_line("Builtin Plugins" "${_zeek_builtin_plugins}")
message("")
output_summary_line("CC" "${CMAKE_C_COMPILER}")
output_summary_line("CFLAGS" "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}")
output_summary_line("CXX" "${CMAKE_CXX_COMPILER}")
output_summary_line("CXXFLAGS" "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}")
output_summary_line("CPP" "${CMAKE_CXX_COMPILER}")
message("")
output_summary_bool("AF_PACKET" ${ZEEK_HAVE_AF_PACKET})
output_summary_bool("Aux. Tools" ${INSTALL_AUX_TOOLS})
output_summary_bool("BTest" ${INSTALL_BTEST})
output_summary_line("BTest tooling" ${_install_btest_tools_msg})
output_summary_bool("JavaScript" ${ZEEK_HAVE_JAVASCRIPT})
output_summary_line("Spicy" ${_spicy})
output_summary_bool("Spicy analyzers" ${USE_SPICY_ANALYZERS})
output_summary_bool("zeek-client" ${INSTALL_ZEEK_CLIENT})
output_summary_bool("ZeekControl" ${INSTALL_ZEEKCTL})
output_summary_bool("zkg" ${INSTALL_ZKG})
message("")
output_summary_bool("libmaxminddb" ${USE_GEOIP})
output_summary_bool("Kerberos" ${USE_KRB5})
output_summary_bool("gperftools" ${HAVE_PERFTOOLS})
output_summary_bool(" - tcmalloc" ${USE_PERFTOOLS_TCMALLOC})
output_summary_bool(" - debugging" ${USE_PERFTOOLS_DEBUG})
output_summary_bool("jemalloc" ${ENABLE_JEMALLOC})
message("")
output_summary_line("Cluster backends")
output_summary_bool(" - Broker" ON)
output_summary_bool(" - ZeroMQ" ${ENABLE_CLUSTER_BACKEND_ZEROMQ})
message("")
output_summary_line("Storage backends")
output_summary_bool(" - SQLite" ON)
output_summary_bool(" - Redis" ${ENABLE_STORAGE_BACKEND_REDIS})
message("")
output_summary_bool("Fuzz Targets" ${ZEEK_ENABLE_FUZZERS})
output_summary_line("Fuzz Engine" "${_zeek_fuzzing_engine}")
message("")
output_summary_line("External Tools/Linters")
output_summary_bool(" - Include What You Use" ${ENABLE_IWYU})
output_summary_bool(" - Clang-Tidy" ${ENABLE_CLANG_TIDY})
if (${_analyzer_warning})
message("${_analyzer_warning}\n")
endif ()
message("\n================================================================")
include(UserChangedWarning)

View file

@ -533,32 +533,6 @@ POSSIBILITY OF SUCH DAMAGE.
==============================================================================
%%% auxil/filesystem
==============================================================================
Copyright (c) 2018, Steffen Schümann <s.schuemann@pobox.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================
%%% auxil/highwayhash
==============================================================================

539
NEWS
View file

@ -3,65 +3,507 @@ This document summarizes the most important changes in the current Zeek
release. For an exhaustive list of changes, see the ``CHANGES`` file
(note that submodules, such as Broker, come with their own ``CHANGES``.)
Zeek 7.2.2
Zeek 8.1.0
==========
We would like to thank @cccs-jsjm, @edoardomich, and the Canadian Cyber Defence Collective
for their contributions to this release.
We would like to thank @chrisjlly, Klemens Nanni (@klemensn), and Klemens Nanni
(@klemens-ya) for their contributions to this release.
This release fixes the following security issue:
Breaking Changes
----------------
- Very large log records can cause Zeek to overflow memory and potentially crash. Due to
the possibility of building these log records with packets from remote hosts, this is a
DoS risk. The fix adds additional length checking when serializing log data for writing
to logging streams. This can be controlled via a new ``Log::max_log_record_size``
redefinable constant, and reports a new ``log_record_too_large`` weird if the limitation
is reached for any individual log entry. There is an also a new
``log-writer-discarded-writes`` metric that tracks when this limitation is
reached.
- Python 3.10 is now required for Zeek and all of its associated subprojects.
This release fixes the following bugs:
- The ``&optional`` script attribute will now error when applied to anything that's
not a record field. Previously, this would have surprising behavior.
- The Redis storage backend now requires libhiredis 1.1.0 or later.
- The BinPAC, Bifcl, and Gen-ZAM tools have all moved directly into the Zeek repo, which
should ease maintenance on them a bit. They were moved from the ``auxil`` directory to the
tools directory. Along with this, the ``--gen-zam`` argument for ``configure`` was
removed and the internal version will always be used.
- The websocket support in the Cluster framework gained the ability to listen on IPv6
addresses. This change deprecates the ``WebSocketServerOptions$listen_host`` in favor of
``WebSocketServerOptions$listen_addr``.
- The zeek-af_packet-plugin git submodule was moved directly into the Zeek repo. This used
to live in the ``auxil`` directory, after having moved there from an external plugin.
It is now built as part of main Zeek build whenever building on Linux.
- Likewise, the ZeroMQ cluster backend gained the ability to listen on IPv6 addresses.
New Functionality
-----------------
- The response to BDAT ``LAST`` was never recognized by the SMTP analyzer, resulting in
the BDAT ``LAST`` commands not being logged in a timely fashion and receiving the wrong
status. Zeek now correctly reports these commands.
- A new TapAnalyzer class was added allowing to tap into all packets delivered
to child analyzers attached to session adapters.
- The Docker images for zeek 7.0 releases now include the ``net-tools`` (for ``iproute2``)
package to silience a warning from ``zeekctl``. They also now include the ``procps``
package (for ``top``) to ensure the ``zeekctl`` top command works correctly.
- Two new hooks, ``Cluster::on_subscribe()`` and ``Cluster::on_unsubscribe()`` have
been added to allow observing ``Subscribe()`` and ``Unsubscribe()`` calls on
backends by Zeek scripts.
- The Spicy submodule was updated to v1.13.2. This version fixes an error when extracting
bytes with ``&eod``. This would previously result in a cryptic error message.
- The ability to control the length of strings and containers in log output was added. The
maximum length of individual log fields can be set, as well as the total length of all
string or container fields in a single log record. This feature is controlled via four
new script-level variables:
- The ZeekJS submodule was updated to v0.18.0. This version fixes a compilation error with
debug builds and GCC 15.1, as well as adding future support for Node v24.
Log::default_max_field_string_bytes
Log::default_max_total_string_bytes
Log::default_max_field_container_elements
Log::default_max_total_container_elements
Zeek 7.2.1
When one of the ``field`` limits is reached, the individual field is truncated. When one
of the ``total`` limits is reached, all further strings will returned as empty and all
further container elements will not be output. See the documentation for those variables
for more detail.
The above variables control the truncation globally, but they can also be set for log
streams individually. This is controlled by variables with the same names that can be
set when the log stream is created.
Two new weirds were added to report the truncation: ``log_string_field_truncated`` and
``log_container_field_truncated``. New metrics were added to track how many truncations
have occurred: ``zeek_log_writer_truncated_string_fields_total`` and
``zeek_log_writer_truncated_containers_total``. The metrics are reported for each log
stream.
- The DNS analyzer now returns the set of parameters for SVCB data. It previously handled
SVCB packets, but omitted the parameters while parsing.
Changed Functionality
---------------------
- The var-extraction-uri.zeek policy does not include the path in the ``uri_vars``
field anymore.
- The ``get_current_packet_header()`` now populates the returned record also for
fragmented IP datagrams.
Removed Functionality
---------------------
Deprecated Functionality
------------------------
Zeek 8.0.0
==========
We would like to thank Ivan Navi (@i2z1), Seth Grover (@mmguero), and Simeon Miteff
(@simeonmetiff) for their contributions to this release.
We would like to thank @aidans111, Anthony Verez (@netantho), Baa (@Baa14453),
Bhaskar Bhar (@bhaskarbhar), @dwhitemv25, EdKo (@ephikos), @edoardomich, Fupeng
Zhao (@AmazingPP), hendrik.schwartke@os-s.de (@hendrikschwartke), @i2z1, Jan
Grashöfer (@J-Gras) Jean-Samuel Marier, Justin Azoff (@JustinAzoff), Mario D
(@mari0d), Markus Elfring (@elfring), Peter Cullen (@pbcullen), Sean Donaghy,
Simeon Miteff (@simeonmiteff), Steve Smoot (@stevesmoot), @timo-mue,
@wojciech-graj, and Xiaochuan Ye (@XueSongTap) for their contributions to this
release.
This release fixes the following bugs:
Breaking Changes
----------------
- GCC 15.1 failed to build both Zeek and the integrated Paraglob library.
- Zeek by default now depends on the availability of the ZeroMQ library for building
and running. This is in preparation of switching to the ZeroMQ-based cluster backend
by default in future Zeek versions. On an Ubuntu based system, the required system
packages are ``libzmq5``, ``libzmq3-dev`` and ``cppzmq-dev``. See the Dockerfiles
in the ``ci/`` directory for other supported platforms.
- The requirement for the BIND library to be present for the build was removed. This
library is not needed since we migrated to C-Ares for DNS lookups.
- Zeek and all of its associated submodules now require C++20-capable compilers to
build. This will let us move forward in using more modern C++ features and replace some
workarounds that we have been carrying. Minimum recommended versions of compilers are
GCC 10, Clang 8, and Visual Studio 2022.
- The new cluster-based websocket endpoint gained some performance improvements when
dealing with very high rates of requests.
- The ``zeek::Span`` class has been deprecated and the APIs in the telemetry subsystem
switched to use ``std::span`` instead of ``zeek::Span``. If your plugin instantiates
counter or gauge instances using the telemetry subsystem and you've previously used
``zeek::Span`` explicitly, updates may be needed.
- The Spicy submodule was updated to v1.13.1. This version brings a fix for a compilation
failure when iterating over a byte value.
- The code base underwent a big cleanup of #include usage, across almost all of the
files. We tested builds of all of the existing third-party packages and only noticed one
or two failures, but there is a possibility for breakage related to this cleanup.
- The ``lookup_connection()`` and ``connection_exists()`` builtin functions
now require ``conn_id`` instances as argument, rather than internally supporting
duck type matching ``conn_id``-like records.
- Network timestamps are not added to events by default anymore. Use the following
redef line to enable them:
redef EventMetadata::add_network_timestamp = T;
The background is that event metadata has become more generic and may incur
a small overhead when enabled. There's not enough users of network timestamp
metadata to justify the complexity of treating it separate.
- The ASCII writer's ``JSON::TS_MILLIS`` timestamp format was changed to produce
signed integers. This matters for the representation for timestamps that are
before the UNIX epoch. These are now written as negative values, while previously
the negative value was interpreted as an unsigned integer, resulting in very large
timestamps, potentially causing issues for downstream consumers.
If you prefer to always have unsigned values, it's possible to revert to the previous
behavior by setting:
redef LogAscii::json_timestamps = JSON::TS_MILLIS_UNSIGNED;
- The "endpoint" label of metrics exposed via Prometheus or the ``telemetry.log``
was renamed to "node". This is done for consistency with cluster terminology:
The label values have always been the value of ``Cluster::node`, so it's more intuitive
to call it. The "endpoint" name originated from a time when the telemetry framework
was implemented in Broker.
To revert to the "endpoint" label, you can do the following, but we strongly
suggest to migrate to the new default "node" instead:
redef Telemetry::metrics_endpoint_label = "endpoint";
- The ``current_event_time()`` builtin function as well as ``Event::Time()``
and ``EventMgr::CurrentEventTime()`` now return ``-1.0`` if no timestamp
metadata is available for the current event, or if no event is being
dispatched. Previously this would've been 0.0, or the timestamp of the previously
dispatched event.
- Missing network timestamp metadata on remote events is not set to the local
network time anymore by default. This potentially hid useful debugging information
about another node not sending timestamp metadata. The old behavior can be
re-enabled as follows:
redef EventMetadata::add_missing_remote_network_timestamp = T;
- The ``IsPacketSource()`` method on ``IOSource`` was removed. It was unused
and incorrectly returned ``false`` on all packet sources.
- The ``--with-binpac`` and ``--with-bifcl`` arguments for ``configure`` are now
deprecated. Both arguments have for a long time just used the internal version of the
tooling even if something was passed, so they were mostly useless. This may cause
breakage of cross-compiling, where the ``binpac`` and ``bifcl`` tooling needs to be run
on the host machine. We haven't heard from anyone that this is the case with the
arguments in their currently-broken state.
- The parsing of data for the ``ssl_session_ticket_handshake`` event was fixed.
In the past, the data contained two extra bytes before the session ticket
data. The event now contains only the session ticket data. You might have to
adjust your scripts if you manually worked around this bug in the past.
New Functionality
-----------------
- Zeek now supports pluggable and customizable connection tracking. The default
behavior remains unchanged and uses a connection's five tuple based on the
IP/port pairs and proto field. Zeek 8 ships with one additional implementation,
to factor VLAN tags into the connection tracking. To switch to VLAN-aware
connection tracking:
@load frameworks/conn_key/vlan_fivetuple
By convention, additional fields used by alternative ConnKey implementations are
added into the new ``ctx`` field of ``conn_id``. The type of ``ctx`` is ``conn_id_ctx``.
The ``vlan_fivetuple`` script adds two additional fields to the ``conn_id_ctx``
record type, representing any VLAN tags involved. Accordingly, every log
using ``conn_id`` reflects the change as well as ``ctx`` and the VLAN fields have
the ``&log`` attribute. The columns used for logging will be named ``id.ctx.vlan``
and ``id.ctx.inner_vlan``.
This feature does not automatically provide a notion of endpoint that
corresponds with the effective connection tuple. For example, applications tracking
endpoints by IP address do not somehow become VLAN-aware when enabling
VLAN-aware tracking.
Users may experiment with their own notion of endpoint by combining the ``orig_h``
or ``resp_h`` field of ``conn_id`` with the new ``ctx`` field. For example, tracking
the number of connections from a given host in a VLAN-aware fashion can be done
as follows:
global connection_counts: table[conn_id_ctx, addr] of count &default=0;
event new_connection(c: connection) {
++connection_counts[c$id$ctx, c$id$orig_h];
}
Note that this script snippet isn't VLAN-specific, yet it is VLAN-aware if the
``vlan_fivetuple`` script is loaded. In future Zeek versions, this pattern is
likely to be used to adapt base and policy scripts for more "context awareness".
Users may add their own plugins (for example via a zkg package) to provide
alternative implementations. This involves implementing a factory for
connection "keys" that factor in additional flow information. See the VLAN
implementation in the ``src/packet_analysis/protocol/ip/conn_key/vlan_fivetuple``
directory for an example.
- Added support to ZeekControl for seamlessly switching to ZeroMQ as cluster
backend by adding the following settings to zeekctl.cfg:
ClusterBackend = ZeroMQ
UseWebSocket = 1
With the ZeroMQ cluster backend, Zeekctl requires to use Zeek's WebSocket API
to communicate with individual nodes for the ``print`` and ``netstats`` commands.
Setting the ``UseWebSocket`` option enables a WebSocket server on the manager
node, listening on 127.0.0.1:27759 by default (this is configurable with using
the newly introduced ``WebSocketHost`` and ``WebSocketPort`` options).
The ``UseWebSocket`` option can also be used when ``ClusterBackend`` is set
to ``Broker``, but isn't strictly required.
For ZeroMQ (or other future cluster backends), setting ``UseWebSocket`` is a
requirement as Zeekctl does not speak the native ZeroMQ protocol to communicate
with cluster nodes for executing commands. This functionality requires the
``websockets`` Python package with version 11.0 or higher.
- Cluster telemetry improvements. Zeek now exposes a configurable number of
metrics regarding outgoing and incoming cluster events. By default, the number
of events sent and received by a Zeek cluster node and any attached WebSocket
clients is tracked as four individual counters. It's possible to gather more
detailed information by adding ``Cluster::Telemetry::VERBOSE`` and
``Cluster::Telemetry::DEBUG`` to the variables ``Cluster::core_metrics`` and
``Cluster::webscoket_metrics``:
redef Cluster::core_metrics += { Cluster::Telemetry::VERBOSE };
redef Cluster::websocket_metrics += { Cluster::Telemetry::DEBUG };
Configuring verbose, adds metrics that are labeled with the event handler
and topic name. Configuring debug, uses histogram metrics to additionally track
the distribution of the serialized event size. Additionally, when debug is selected,
outgoing events are labeled with the script location from where they were published.
- Support for the X-Application-Name HTTP header was added to the WebSocket API at
``v1/messages/json``. A WebSocket application connecting to Zeek may set the
X-Application-Name header to a descriptive identifier. The value of this header
will be added to the cluster metrics as ``app`` label. This allows to gather
incoming and outgoing event metrics of a specific WebSocket application, simply
by setting the X-Application-Name header.
- The SMTP analyzer can now optionally forward the top-level RFC 822 message individual
SMTP transactions to the file analysis framework. This can be leveraged to extract
emails in form of ``.eml`` files from SMTP traffic to disk.
To enable this feature, set the ``SMTP::enable_rfc822_msg_file_analysis`` option
and implement an appropriate ``file_new()`` or ``file_over_new_connection()`` handler:
redef SMTP::enable_rfc822_msg_file_analysis = T;
event file_over_new_connection(f: fa_file, c: connection, is_orig: bool) {
if ( f$id == c$smtp$rfc822_msg_fuid )
Files::add_analyzer(f, Files::ANALYZER_EXTRACT, [$extract_filename="email"]);
}
- Generic event metadata support. A new ``EventMetadata`` module was added allowing
to register generic event metadata types and accessing the current event's metadata
using the functions ``current()`` and ``current_all()`` of this module.
- A new plugin hook, ``HookPublishEvent()``, has been added for intercepting
publishing of Zeek events. This hook may be used for monitoring purposes,
modifying or rerouting remote events.
Plugins can implement and enable this hook by calling the following method
within their Configure() implementation.
EnableHook(HOOK_PUBLISH_EVENT)
The signature of ``HookPublishEvent()`` is as follows.
bool HookPublishEvent(zeek::cluster::Backend& backend,
const std::string& topic,
zeek::cluster::detail::Event& event);
- Zeek now includes the Redis protocol analyzer from the evantypanski/spicy-redis
project (https://github.com/evantypanski/spicy-redis). This analyzer is enabled
by default. This analyzer logs Redis commands and their associated replies in
``redis.log``.
To disable the analyzer in case of issues, use the following snippet:
redef Analyzer::disabled_analyzers += {
Analyzer::ANALYZER_REDIS,
};
- The FTP analyzer now supports explicit TLS via AUTH TLS.
- Two new script-level hooks in the Intel framework have been added.
hook indicator_inserted(indicator_value: string, indicator_type: Intel::Type)
hook indicator_removed(indicator_value: string, indicator_type: Intel::Type)
These are reliably invoked on worker and manager nodes the first time an
indicator value is inserted into the store and once it has been completely
removed from the store.
- The ``frameworks/intel/seen`` scripts have been annotated with event groups
and a new ``frameworks/intel/seen/manage-event-groups`` policy script added.
The motivation is to allow Zeek distributors to load the ``intel/seen`` scripts
by default without incurring their event overhead when no Intel indicators are
loaded. Corresponding event handlers are enabled once the first Intel indicator
of a given ``Intel::Type`` is added. Event handlers are disabled when the last
indicator is removed, again.
Note that the ``manage-event-groups`` script interacts with the ``Intel::seen_policy``
hook: If no indicators for a given ``Intel::Type`` are loaded, the ``Intel::seen_policy``
will not be invoked as the event handlers extracting indicators aren't executed.
If you rely on the ``Intel::seen_policy`` hook to be invoked regardless of the
contents of the Intel store, do not load the ``manage-event-groups`` or set:
redef Intel::manage_seen_event_groups = F;
- The DNS analyzer was extended to support NAPTR RRs (RFC 2915, RFC 3403).
A corresponding ``dns_NAPTR_reply`` event was added.
- A new ``get_tags_by_category`` BIF method was added that returns a list of tags for a
specified plugin category. This can be used in lieu of calling ``zeek -NN`` and
parsing the output. For example, this will return the list of all analyzer plugins
currently loaded:
get_tags_by_category("ANALYZER");
- A new ``conn_generic_packet_threshold_crossed`` event was introduced. The event triggers
for any IP-based session that reaches a given threshold. Multiple packet thresholds can
be defined in ``ConnThreshold::generic_packet_thresholds``. The generic thresholds refer
to the total number of packets on a connection without taking direction into account
(i.e. the event also triggers on one-sided connections).
The event is intended as an alternative to the ``new_connection`` event that allows for
ignoring short-lived connections like DNS or scans. For example, it can be used to set
up traditional connection monitoring without introducing overhead for connections that
would never reach a larger threshold anyway.
- Zeek now supports extracting the PPPoE session ID. The ``PacketAnalyzer::PPPoE::session_id``
BiF can be used to get the session ID of the current packet.
The ``conn/pppoe-session-id-logging.zeek`` policy script adds pppoe session IDs to the
connection log.
The ``get_conn_stats()`` function's return value now includes the number of packets
that have not been processed by any analyzer. Using data from ``get_conn_stats()`` and
``get_net_stats()``, it's possible to determine the number of packets that have
been received and accepted by Zeek, but eventually discarded without processing.
Changed Functionality
---------------------
- The `Conn::set_conn` function is now always run in `new_connection`, instead of only
being run in `connection_state_remove`.
- Logging of failed analyzers has been overhauled. `dpd.log` was replaced
by a new `analyzer.log` that presents a more unified and consistent view
of failed analyzers. The previous `analyzer.log` was renamed to `analyzer-debug.log`;
see below for more details.
For protocol analyzers, `analyzer.log` now reports initially confirmed analyzers that
Zeek subsequently removed from the connection due to a protocol violation.
For file and packet analyzers, all errors will be logged to `analyzer.log`.
As part of this work, a new `analyzer_failed` event has been introduced. This event
is raised when an analyzer is removed because of raising a violation.
- `analyzer.log` was renamed to `analyzer_debug.log`, and is no longer created
by default. The log file will be created if the `frameworks/analyzer/debug-logging.zeek`
policy script is loaded.
Note that the namespace for options in the script changed to
`Analyzer::DebugLogging`. Furthermore the default options changed to enable
more detailed output by default.
- Record fields with a ``&default`` attribute are now consistently re-initialized
after deleting such fields. Previously, this would only work for constant
expressions, but has been extended to apply to arbitrary expressions.
- Publishing remote events with vector arguments that contain holes is now
rejected. The receiver side never had a chance to figure out where these
holes would have been. There's a chance this breaks scripts that accidentally
published vectors with holes. A reporter error is produced at runtime when
serialization of vectors with holes is attempted.
- Kerberos support on macOS has been enabled. Due to incompatibilities, the system
provided libkrb5 is ignored, however. Only versions from homebrew are supported and
found/picked-up by default. Use --with-krb5 for pointing at a custom librkb5
installation.
- The ``$listen_host`` configuration for ``Cluster::listen_websocket()``'s
``WebSocketServerOptions`` was deprecated. Use the new ``$listen_addr`` field
instead.
- The `service_violation` field of the connection record was marked as deprecated.
Consider using the new `failed_analyzers` field of the connection record instead.
- `detect-protocol.zeek was the last non-deprecated policy script left in
`frameworks/dpd`. It was moved to `frameworks/analyzer/detect-protocol.zeek`.
- Running Zeek with Zeekygen for documentation extraction (-X|--zeekygen
<cfgfile>) now implies -a, i.e., parse-only mode.
- The `not_valid_before` and `not_valid_after` times of X509 certificates are
now logged as GMT timestamps. Before, they were logged as local times; thus
the output was dependent on the timezone that your system is set to.
Similarly, the related events and the Zeek data structures all interpreted
times in X509 certificates as local times.
- The PPPoE parser now respects the size value given in the PPPoE header. Data
beyond the size given in the header will be truncated.
- Record fields with ``&default`` attributes initializing empty ``vector``, ``table``
or ``set`` instances are now deferred until they are accessed, potentially
improving memory usage when such fields are never accessed.
Removed Functionality
---------------------
- The ``--with-bind`` argument for ``configure`` was removed. We removed the need for the
BIND library from our CMake setup in the v7.2 release, but this non-functional argument
was left behind.
- The ``--disable-archiver`` argument for ``configure`` was removed. This was deprecated
and scheduled to be removed in v7.1, but we apparently missed it during the cleanup for
that release.
Deprecated Functionality
------------------------
- The `dpd.log` is now deprecated and replaced by `analyzer.log` (see above).
`dpd.log` is no longer created by default, but can be loaded using the
`frameworks/analyzer/deprecated-dpd-log.zeek` policy script.
Relatedly, the `service_violation` field of the connection record is
deprecated and will only be present if the
`frameworks/analyzer/deprecated-dpd-log.zeek` policy script is loaded.
- The ``protocols/http/detect-sqli.zeek`` script has been deprecated in favor of a
new ``protocols/http/detect-sql-injection.zeek`` script to switch from the victim
host being placed into the ``src`` field of a notice to instead use ``dst``.
The attacker host is now placed into ``src``. Further, notices hold the first
sampled connection uid.
Note that the ``Notice::Type`` enumeration names remain the same. You can determine
which script was used by the presence of populated ``uid`` and ``dst`` fields in the
``notice.log`` entries.
The replacement script doesn't populate the ``email_body_sections`` anymore either.
- Using ``&default`` and ``&optional`` together on a record field has been deprecated
as it would only result in ``&default`` behavior. This will become an error starting
with Zeek 8.1.
- The ``zeek::Event()`` constructor was deprecated. Use ``event_mgr::Enqueue()``
or ``event_mgr::Dispatch()`` instead.
- Passing ``ts`` as the last argument to ``EventMgr::Enqueue()`` has been deprecated
and will lead to compile time warnings. Use ``EventMgr::Enqueue(detail::MetadataVectorPtr meta, ...)``
for populating ``meta`` accordingly.
- For plugin authors: in the core, the constructor for Connection instances has
been deprecated in favor of a new one to support pluggable connection
tuples. The ConnTuple struct, used by this deprecated Connection constructor,
is now deprecated as well.
- The ``zeek::filesystem`` namespace alias is deprecated in favor of using
``std::filesystem`` directly. Similarly, the ``ghc::filesystem`` submodule stored in
``auxil/filessytem`` has been removed and the files included from it in the Zeek
installation will no longer be installed. Builds won't warn about the deprecation of
``zeek::filesystem`` due to limitations of how we can mark deprecations in C++.
- The ``zeek::util::starts_with`` and ``zeek::util::ends_with`` functions are deprecated.
``std::string`` and ``std::string_view`` added ``begins_with`` and ``ends_with`` methods
in C++ 20, and those should be used instead.
- The ``record_type_to_vector`` BIF is deprecated in favor of using the newly ordered
``record_fields`` BIF.
Zeek 7.2.0
==========
@ -96,8 +538,6 @@ New Functionality
- The bundled version of ZeekJS has been updated to v0.17.0.
- The bundled version of Spicy has been updated to v1.13.0.
- Some DNS events are not raised when ``dns_skip_all_addl`` is set to true. Zeek now
raises a warning when a script declares these events while this option is set to true.
@ -134,9 +574,6 @@ New Functionality
backend for NATS that will be available as an external plugin, but it is not quite
ready yet. Both of the existing backends support usage in a cluster environment.
- The Redis backend requires at least redis-server version 6.2.0 or an equivalent
implementation.
- Improved alternative cluster backend support.
The ZeroMQ cluster backend added in Zeek 7.1 has received various correctness,
@ -211,8 +648,8 @@ New Functionality
scripts. This previously resulted in a fatal error.
- The set of non-routable subnets defined in ``Site::private_address_space`` was expanded
to include ``239.0.0.0/8``, ``224.0.0.0/24``, ``[2002:e000::]/40``, ``[2002:ef00::]/24``,
and ``[fec0::]/10``. These addresses come from RFCs 2365, 3058, 3879, and 5771. This may
to include ``239.0.0.0/8``, ``224.0.0.0/24`, ``[2002:e000::]/40``, ``[2002:ef00::]/24``,
and ``[fec0::]/10`. These addresses come from RFCs 2365, 3058, 3879, and 5771. This may
result in traffic being considered as local traffic that wasn't previously.
- The ``to_count()`` and ``to_int()`` built-in functions now trim trailing spaces passed
@ -321,12 +758,6 @@ Changed Functionality
our switch to use the C-Ares library back in the 5.0 release, but we never removed the
requirement from CMake.
- Publishing remote events with vector arguments that contain holes is now
rejected. The receiver side never had a chance to figure out where these
holes would have been. There's a chance this breaks scripts that accidentally
published vectors with holes. A reporter error is produced at runtime when
serialization of vectors with holes is attempted.
Removed Functionality
---------------------
@ -396,7 +827,7 @@ New Functionality
some updates to Zeek's internal DNS resolver due to changes in the c-ares
API. At least version v1.28.0 is now required to build Zeek.
- Python 3.9 is now required for Zeek and all of it's associated subprojects.
- Python 3.9 is now required for Zeek and all of its associated subprojects.
- IP-based connections that were previously not logged due to using an unknown
IP protocol (e.g. not TCP, UDP, or ICMP) now appear in conn.log. All conn.log
@ -487,7 +918,7 @@ New Functionality
analyzer used for processing the packet when the event is raised. The
``unknown_protocol.log`` file was extended to include this information.
- The MySQL analyzer now generates a ``mysql_user_change()`` event when the user
- The MySQL analyzer now generates a ``mysql_change_user()`` event when the user
changes mid-session via the ``COM_USER_CHANGE`` command.
- The DNS analyzer was extended to support TKEY RRs (RFC 2390). A corresponding

2
README
View file

@ -3,7 +3,7 @@ The Zeek Network Security Monitor
=================================
Zeek is a powerful framework for network traffic analysis and security
monitoring. Follow us on Twitter at @zeekurity.
monitoring.
Key Features
============

View file

@ -15,14 +15,15 @@ traffic analysis and security monitoring.
[_Development_](#development) —
[_License_](#license)
Follow us on Twitter at [@zeekurity](https://twitter.com/zeekurity).
[![Coverage Status](https://coveralls.io/repos/github/zeek/zeek/badge.svg?branch=master)](https://coveralls.io/github/zeek/zeek?branch=master)
[![Build Status](https://img.shields.io/cirrus/github/zeek/zeek)](https://cirrus-ci.com/github/zeek/zeek)
[![Slack](https://img.shields.io/badge/slack-@zeek-brightgreen.svg?logo=slack)](https://zeek.org/slack)
[![Discourse](https://img.shields.io/discourse/status?server=https%3A%2F%2Fcommunity.zeek.org)](https://community.zeek.org)
[![Mastodon](https://img.shields.io/badge/mastodon-@zeek@infosec.exchange-brightgreen.svg?logo=mastodon)](https://infosec.exchange/@zeek)
[![Bluesky](https://img.shields.io/badge/bluesky-@zeek-brightgreen.svg?logo=bluesky)](https://bsky.app/profile/zeek.org)
</h4>

View file

@ -1 +1 @@
7.2.2
8.1.0-dev.626

@ -1 +0,0 @@
Subproject commit 49e956cd278ad0ca72040536ff606f4bb8d4224f

@ -1 +0,0 @@
Subproject commit 894afb64d954f6858ba9101061e56be93b621aca

@ -1 +1 @@
Subproject commit 5b6cbb8c2d9124aa1fb0bea5799433138dc64cf9
Subproject commit 06d491943f4bee6c2d1e17a5c7c31836d725273d

@ -1 +1 @@
Subproject commit 1092e9c03ca62c16fd3d9065117f708630ec2573
Subproject commit 8c0fbfd74325b6c9be022a98bcd414b6f103d09e

@ -1 +0,0 @@
Subproject commit 72a76d774e4c7c605141fd6d11c33cc211209ed9

@ -1 +0,0 @@
Subproject commit f113c5f3220263eca87c3ffaafae43fda3295ae3

@ -1 +1 @@
Subproject commit 10d93cff9fd6c8d8c3e0bae58312aed470843ff8
Subproject commit ea30540c77679ced3ce7886199384e8743628921

@ -1 +1 @@
Subproject commit d2bfec929540c1fec5d1d45f0bcee3cff1eb7fa5
Subproject commit 7e3670aa1f6ab7623a87ff1e770f7f6b5a1c59f1

@ -1 +1 @@
Subproject commit ab6aff89296d11363427beab34f88258c0abd467
Subproject commit ad301651ad0a7426757f8bc94cfc8e8cd98451a8

@ -1 +1 @@
Subproject commit c8a55905e7fbbdaf9c32e4d45d1d41eb667806a8
Subproject commit 7635e113080be6fc20cb308636c8c38565c95c8a

@ -1 +0,0 @@
Subproject commit a3fe59b3f1ded5c3461995134b66c6db182fa56f

@ -1 +1 @@
Subproject commit ee706c54e665dab92a54253f934d2acf1f79137d
Subproject commit 9a51ce1940a808aaad253077905c2b34f15f1e08

@ -1 +1 @@
Subproject commit 4440c7a05ba4be229ac88d70e8f4eef2465afc50
Subproject commit 16849ca3ec2f8637e3f8ef8ee27e2c279724387f

@ -1 +1 @@
Subproject commit a824eedf2fdd28298f09d96ed10c7c74802dc8e4
Subproject commit 485abcad45daeea6d09680e5fc7d29e97d2e3fbe

@ -1 +1 @@
Subproject commit 1b7071e294fde14230c5908a2f0b05228d9d695c
Subproject commit e5985abfffc1ef5ead3a0bab196fa5d86bc5276f

View file

@ -2,7 +2,7 @@ FROM alpine:latest
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20250306
ENV DOCKERFILE_VERSION=20250905
RUN apk add --no-cache \
bash \

View file

@ -0,0 +1,49 @@
FROM quay.io/centos/centos:stream10
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION=20250905
# dnf config-manager isn't available at first, and
# we need it to install the CRB repo below.
RUN dnf -y install 'dnf-command(config-manager)'
# What used to be powertools is now called "CRB".
# We need it for some of the packages installed below.
# https://docs.fedoraproject.org/en-US/epel/
RUN dnf config-manager --set-enabled crb
RUN dnf -y install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
# The --nobest flag is hopefully temporary. Without it we currently hit
# package versioning conflicts around OpenSSL.
RUN dnf -y --nobest install \
bison \
ccache \
cmake \
cppzmq-devel \
diffutils \
flex \
gcc \
gcc-c++ \
git \
jq \
libpcap-devel \
make \
openssl \
openssl-devel \
procps-ng \
python3 \
python3-devel \
python3-pip\
sqlite \
swig \
tar \
which \
zlib-devel \
&& dnf clean all && rm -rf /var/cache/dnf
# Set the crypto policy to allow SHA-1 certificates - which we have in our tests
RUN dnf -y --nobest install crypto-policies-scripts && update-crypto-policies --set LEGACY
RUN pip3 install websockets junit2html

View file

@ -2,7 +2,7 @@ FROM quay.io/centos/centos:stream9
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20241024
ENV DOCKERFILE_VERSION=20250905
# dnf config-manager isn't available at first, and
# we need it to install the CRB repo below.
@ -34,9 +34,9 @@ RUN dnf -y --nobest install \
openssl \
openssl-devel \
procps-ng \
python3 \
python3-devel \
python3-pip\
python3.13 \
python3.13-devel \
python3.13-pip\
sqlite \
swig \
tar \
@ -47,4 +47,8 @@ RUN dnf -y --nobest install \
# Set the crypto policy to allow SHA-1 certificates - which we have in our tests
RUN dnf -y --nobest install crypto-policies-scripts && update-crypto-policies --set LEGACY
# Override the default python3.9 installation paths with 3.13
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 10
RUN alternatives --install /usr/bin/pip3 pip3 /usr/bin/pip3.13 10
RUN pip3 install websockets junit2html

View file

@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20241024
ENV DOCKERFILE_VERSION=20250905
RUN apt-get update && apt-get -y install \
bison \

View file

@ -1,32 +1,36 @@
FROM debian:11
FROM debian:13
ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20241024
ENV DOCKERFILE_VERSION=20250905
RUN apt-get update && apt-get -y install \
bison \
bsdmainutils \
ccache \
cmake \
cppzmq-dev \
curl \
dnsmasq \
flex \
g++ \
gcc \
git \
jq \
libkrb5-dev \
libnats-dev \
libnode-dev \
libpcap-dev \
librdkafka-dev \
libssl-dev \
libuv1-dev \
libzmq3-dev \
make \
python3 \
python3-dev \
python3-pip\
python3-websockets \
sqlite3 \
swig \
wget \
@ -35,4 +39,6 @@ RUN apt-get update && apt-get -y install \
&& apt autoclean \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install websockets junit2html
# Debian trixie really doesn't like using pip to install system wide stuff, but
# doesn't seem there's a python3-junit2html package, so not sure what we'd break.
RUN pip3 install --break-system-packages junit2html

View file

@ -2,7 +2,7 @@ FROM fedora:41
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20250203
ENV DOCKERFILE_VERSION=20250905
RUN dnf -y install \
bison \

View file

@ -2,7 +2,7 @@ FROM fedora:42
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20250508
ENV DOCKERFILE_VERSION=20250905
RUN dnf -y install \
bison \

View file

@ -7,7 +7,7 @@ set -x
brew update
brew upgrade cmake
brew install cppzmq openssl@3 python@3 swig bison flex ccache libmaxminddb dnsmasq
brew install cppzmq openssl@3 python@3 swig bison flex ccache libmaxminddb dnsmasq krb5
which python3
python3 --version

View file

@ -2,7 +2,7 @@ FROM opensuse/leap:15.6
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20241024
ENV DOCKERFILE_VERSION=20250905
RUN zypper addrepo https://download.opensuse.org/repositories/openSUSE:Leap:15.6:Update/standard/openSUSE:Leap:15.6:Update.repo \
&& zypper refresh \

View file

@ -2,7 +2,7 @@ FROM opensuse/tumbleweed
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20250714
ENV DOCKERFILE_VERSION=20250905
# Remove the repo-openh264 repository, it caused intermittent issues
# and we should not be needing any packages from it.

View file

@ -0,0 +1,27 @@
#!/bin/sh
zypper refresh
zypper patch -y --with-update --with-optional
LATEST_VERSION=$(zypper search -n ${ZEEK_CI_COMPILER} |
awk -F "|" "match(\$2, / ${ZEEK_CI_COMPILER}([0-9]{2})[^-]/, a) {print a[1]}" |
sort | tail -1)
echo "Installing ${ZEEK_CI_COMPILER} ${LATEST_VERSION}"
zypper install -y "${ZEEK_CI_COMPILER}${LATEST_VERSION}"
if [ "${ZEEK_CI_COMPILER}" == "gcc" ]; then
zypper install -y "${ZEEK_CI_COMPILER}${LATEST_VERSION}-c++"
fi
update-alternatives --install /usr/bin/cc cc "/usr/bin/${ZEEK_CI_COMPILER}-${LATEST_VERSION}" 100
update-alternatives --set cc "/usr/bin/${ZEEK_CI_COMPILER}-${LATEST_VERSION}"
if [ "${ZEEK_CI_COMPILER}" == "gcc" ]; then
update-alternatives --install /usr/bin/c++ c++ "/usr/bin/g++-${LATEST_VERSION}" 100
update-alternatives --set c++ "/usr/bin/g++-${LATEST_VERSION}"
else
update-alternatives --install /usr/bin/c++ c++ "/usr/bin/clang++-${LATEST_VERSION}" 100
update-alternatives --set c++ "/usr/bin/clang++-${LATEST_VERSION}"
fi

View file

@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20241024
ENV DOCKERFILE_VERSION=20250905
RUN apt-get update && apt-get -y install \
bc \

View file

@ -4,15 +4,16 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20241024
ENV DOCKERFILE_VERSION=20250905
RUN apt-get update && apt-get -y install \
bc \
bison \
bsdmainutils \
ccache \
clang-18 \
clang++-18 \
clang-19 \
clang++-19 \
clang-tidy-19 \
cmake \
cppzmq-dev \
curl \
@ -31,7 +32,9 @@ RUN apt-get update && apt-get -y install \
make \
python3 \
python3-dev \
python3-git \
python3-pip \
python3-semantic-version \
redis-server \
ruby \
sqlite3 \
@ -47,6 +50,10 @@ RUN apt-get update && apt-get -y install \
RUN pip3 install --break-system-packages websockets junit2html
RUN gem install coveralls-lcov
# Ubuntu installs clang versions with the binaries having the version number
# appended. Create a symlink for clang-tidy so cmake finds it correctly.
RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 1000
# Download a newer pre-built ccache version that recognizes -fprofile-update=atomic
# which is used when building with --coverage.
#

View file

@ -1,10 +1,10 @@
FROM ubuntu:24.10
FROM ubuntu:25.04
ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
# A version field to invalidate Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20241115
ENV DOCKERFILE_VERSION=20250905
RUN apt-get update && apt-get -y install \
bc \

View file

@ -28,7 +28,7 @@ cd $build_dir
export ZEEK_SEED_FILE=$source_dir/testing/btest/random.seed
function run_zeek {
ZEEK_ALLOW_INIT_ERRORS=1 zeek -X $conf_file zeekygen >/dev/null
ZEEK_ALLOW_INIT_ERRORS=1 zeek -X $conf_file zeekygen
if [ $? -ne 0 ]; then
echo "Failed running zeek with zeekygen config file $conf_file" >&2

View file

@ -5,7 +5,7 @@ SHELL [ "powershell" ]
# A version field to invalidatea Cirrus's build cache when needed, as suggested in
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
ENV DOCKERFILE_VERSION 20230801
ENV DOCKERFILE_VERSION=20250905
RUN Set-ExecutionPolicy Unrestricted -Force
@ -14,8 +14,8 @@ RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePoin
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install prerequisites
RUN choco install -y --no-progress visualstudio2019buildtools --version=16.11.11.0
RUN choco install -y --no-progress visualstudio2019-workload-vctools --version=1.0.0 --package-parameters '--add Microsoft.VisualStudio.Component.VC.ATLMFC'
RUN choco install -y --no-progress visualstudio2022buildtools --version=117.14.1
RUN choco install -y --no-progress visualstudio2022-workload-vctools --version=1.0.0 --package-parameters '--add Microsoft.VisualStudio.Component.VC.ATLMFC'
RUN choco install -y --no-progress sed
RUN choco install -y --no-progress winflexbison3
RUN choco install -y --no-progress msysgit
@ -30,4 +30,4 @@ RUN mkdir C:\build
WORKDIR C:\build
# This entry point starts the developer command prompt and launches the PowerShell shell.
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "-arch=x64", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Unrestricted"]
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "-arch=x64", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Unrestricted"]

View file

@ -2,7 +2,7 @@
:: cmd current shell. This path is hard coded to the one on the CI image, but
:: can be adjusted if running builds locally. Unfortunately, the initial path
:: isn't in the environment so we have to hardcode the whole path.
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
call "c:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
mkdir build
cd build

View file

@ -1,5 +1,5 @@
:: See build.cmd for documentation on this call.
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
call "c:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
cd build

2
cmake

@ -1 +1 @@
Subproject commit fd0696f9077933660f7da5f81978e86b3e967647
Subproject commit d51c6990446cf70cb9c01bca17dad171a1db05d3

View file

@ -2,10 +2,9 @@
#pragma once
#define ZEEK_SCRIPT_INSTALL_PATH "@ZEEK_SCRIPT_INSTALL_PATH@"
#define BRO_PLUGIN_INSTALL_PATH "@ZEEK_PLUGIN_DIR@"
#define ZEEK_PLUGIN_INSTALL_PATH "@ZEEK_PLUGIN_DIR@"
#define DEFAULT_ZEEKPATH "@DEFAULT_ZEEKPATH@"
#define ZEEK_SPICY_MODULE_PATH "@ZEEK_SPICY_MODULE_PATH@"
#define ZEEK_SPICY_LIBRARY_PATH "@ZEEK_SPICY_LIBRARY_PATH@"
#define ZEEK_SPICY_DATA_PATH "@ZEEK_SPICY_DATA_PATH@"
constexpr char ZEEK_SCRIPT_INSTALL_PATH[] = "@ZEEK_SCRIPT_INSTALL_PATH@";
constexpr char ZEEK_PLUGIN_INSTALL_PATH[] = "@ZEEK_PLUGIN_DIR@";
constexpr char DEFAULT_ZEEKPATH[] = "@DEFAULT_ZEEKPATH@";
constexpr char ZEEK_SPICY_MODULE_PATH[] = "@ZEEK_SPICY_MODULE_PATH@";
constexpr char ZEEK_SPICY_LIBRARY_PATH[] = "@ZEEK_SPICY_LIBRARY_PATH@";
constexpr char ZEEK_SPICY_DATA_PATH[] = "@ZEEK_SPICY_DATA_PATH@";

View file

@ -1,4 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.
// NOLINTBEGIN(modernize-macro-to-enum)
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
#pragma once
@ -306,3 +308,6 @@
/* compiled with Spicy support */
#cmakedefine HAVE_SPICY
// NOLINTEND(cppcoreguidelines-macro-usage)
// NOLINTEND(modernize-macro-to-enum)

24
configure vendored
View file

@ -90,16 +90,9 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--disable-zkg don't install zkg
Required Packages in Non-Standard Locations:
--with-bifcl=PATH path to Zeek BIF compiler executable
(useful for cross-compiling)
--with-bind=PATH path to BIND install root
--with-binpac=PATH path to BinPAC executable
(useful for cross-compiling)
--with-bison=PATH path to bison executable
--with-broker=PATH path to Broker install root
(Zeek uses an embedded version by default)
--with-gen-zam=PATH path to Gen-ZAM code generator
(Zeek uses an embedded version by default)
--with-flex=PATH path to flex executable
--with-libkqueue=PATH path to libkqueue install root
(Zeek uses an embedded version by default)
@ -328,9 +321,6 @@ while [ $# -ne 0 ]; do
--disable-af-packet)
append_cache_entry DISABLE_AF_PACKET BOOL true
;;
--disable-archiver)
has_disable_archiver=1
;;
--disable-auxtools)
append_cache_entry INSTALL_AUX_TOOLS BOOL false
;;
@ -371,15 +361,9 @@ while [ $# -ne 0 ]; do
--disable-zkg)
append_cache_entry INSTALL_ZKG BOOL false
;;
--with-bifcl=*)
append_cache_entry BIFCL_EXE_PATH PATH $optarg
;;
--with-bind=*)
append_cache_entry BIND_ROOT_DIR PATH $optarg
;;
--with-binpac=*)
append_cache_entry BINPAC_EXE_PATH PATH $optarg
;;
--with-bison=*)
append_cache_entry BISON_EXECUTABLE PATH $optarg
;;
@ -392,9 +376,6 @@ while [ $# -ne 0 ]; do
--with-flex=*)
append_cache_entry FLEX_EXECUTABLE PATH $optarg
;;
--with-gen-zam=*)
append_cache_entry GEN_ZAM_EXE_PATH PATH $optarg
;;
--with-geoip=*)
append_cache_entry LibMMDB_ROOT_DIR PATH $optarg
;;
@ -510,8 +491,3 @@ eval ${cmake} 2>&1
echo "# This is the command used to configure this build" >config.status
echo $command >>config.status
chmod u+x config.status
if [ $has_disable_archiver -eq 1 ]; then
echo
echo "NOTE: The --disable-archiver argument no longer has any effect and will be removed in v7.1. zeek-archiver is now part of zeek-aux, so consider --disable-auxtools instead."
fi

2
doc

@ -1 +1 @@
Subproject commit 581b664b14476abfce4dd3351a057e1b735bec3c
Subproject commit 8f38ae2fd563314393eb1ca58c827d26e9966520

View file

@ -1,7 +1,7 @@
# See the file "COPYING" in the main distribution directory for copyright.
# Layer to build Zeek.
FROM debian:bookworm-slim
FROM debian:13-slim
# Make the shell split commands in the log so we can determine reasons for
# failures more easily.
@ -16,6 +16,7 @@ RUN echo 'Acquire::https::timeout "180";' >> /etc/apt/apt.conf.d/99-timeouts
# Configure system for build.
RUN apt-get -q update \
&& apt-get upgrade -q -y \
&& apt-get install -q -y --no-install-recommends \
bind9 \
bison \
@ -36,7 +37,7 @@ RUN apt-get -q update \
libz-dev \
make \
python3-minimal \
python3.11-dev \
python3-dev \
swig \
ninja-build \
python3-pip \

View file

@ -1,7 +1,7 @@
# See the file "COPYING" in the main distribution directory for copyright.
# Final layer containing all artifacts.
FROM debian:bookworm-slim
FROM debian:13-slim
# Make the shell split commands in the log so we can determine reasons for
# failures more easily.
@ -15,14 +15,15 @@ RUN echo 'Acquire::http::timeout "180";' > /etc/apt/apt.conf.d/99-timeouts
RUN echo 'Acquire::https::timeout "180";' >> /etc/apt/apt.conf.d/99-timeouts
RUN apt-get -q update \
&& apt-get upgrade -q -y \
&& apt-get install -q -y --no-install-recommends \
ca-certificates \
git \
jq \
libmaxminddb0 \
libnode108 \
libnode115 \
libpcap0.8 \
libpython3.11 \
libpython3.13 \
libssl3 \
libuv1 \
libz1 \

View file

@ -60,13 +60,13 @@ const pe_mime_types = { "application/x-dosexec" };
event zeek_init() &priority=5
{
Files::register_for_mime_types(Files::ANALYZER_PE, pe_mime_types);
Log::create_stream(LOG, [$columns=Info, $ev=log_pe, $path="pe", $policy=log_policy]);
Log::create_stream(LOG, Log::Stream($columns=Info, $ev=log_pe, $path="pe", $policy=log_policy));
}
hook set_file(f: fa_file) &priority=5
{
if ( ! f?$pe )
f$pe = [$ts=f$info$ts, $id=f$id];
f$pe = PE::Info($ts=f$info$ts, $id=f$id);
}
event pe_dos_header(f: fa_file, h: PE::DOSHeader) &priority=5

View file

@ -40,7 +40,7 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(LOG, [$columns=Info, $ev=log_ocsp, $path="ocsp", $policy=log_policy]);
Log::create_stream(LOG, Log::Stream($columns=Info, $ev=log_ocsp, $path="ocsp", $policy=log_policy));
Files::register_for_mime_type(Files::ANALYZER_OCSP_REPLY, "application/ocsp-response");
}

View file

@ -105,6 +105,29 @@ export {
## Event for accessing logged records.
global log_x509: event(rec: Info);
## The maximum number of bytes that a single string field can contain when
## logging. If a string reaches this limit, the log output for the field will be
## truncated. Setting this to zero disables the limiting.
##
## .. zeek:see:: Log::default_max_field_string_bytes
const default_max_field_string_bytes = Log::default_max_field_string_bytes &redef;
## The maximum number of elements a single container field can contain when
## logging. If a container reaches this limit, the log output for the field will
## be truncated. Setting this to zero disables the limiting.
##
## .. zeek:see:: Log::default_max_field_container_elements
const default_max_field_container_elements = 500 &redef;
## The maximum total number of container elements a record may log. This is the
## sum of all container elements logged for the record. If this limit is reached,
## all further containers will be logged as empty containers. If the limit is
## reached while processing a container, the container will be truncated in the
## output. Setting this to zero disables the limiting.
##
## .. zeek:see:: Log::default_max_total_container_elements
const default_max_total_container_elements = 1500 &redef;
}
global known_log_certs_with_broker: set[LogCertHash] &create_expire=relog_known_certificates_after &backend=Broker::MEMORY;
@ -117,7 +140,12 @@ redef record Files::Info += {
event zeek_init() &priority=5
{
Log::create_stream(X509::LOG, [$columns=Info, $ev=log_x509, $path="x509", $policy=log_policy]);
# x509 can have some very large certificates and very large sets of URIs. Expand the log size filters
# so that we're not truncating those.
Log::create_stream(X509::LOG, Log::Stream($columns=Info, $ev=log_x509, $path="x509", $policy=log_policy,
$max_field_string_bytes=X509::default_max_field_string_bytes,
$max_field_container_elements=X509::default_max_field_container_elements,
$max_total_container_elements=X509::default_max_total_container_elements));
# We use MIME types internally to distinguish between user and CA certificates.
# The first certificate in a connection always gets tagged as user-cert, all
@ -167,7 +195,7 @@ event x509_certificate(f: fa_file, cert_ref: opaque of x509, cert: X509::Certifi
{
local der_cert = x509_get_certificate_string(cert_ref);
local fp = hash_function(der_cert);
f$info$x509 = [$ts=f$info$ts, $fingerprint=fp, $certificate=cert, $handle=cert_ref];
f$info$x509 = X509::Info($ts=f$info$ts, $fingerprint=fp, $certificate=cert, $handle=cert_ref);
if ( f$info$mime_type == "application/x-x509-user-cert" )
f$info$x509$host_cert = T;
if ( f$is_orig )
@ -225,4 +253,3 @@ event file_state_remove(f: fa_file) &priority=5
Log::write(LOG, f$info$x509);
}

View file

@ -1,35 +1,12 @@
##! Activates port-independent protocol detection and selectively disables
##! analyzers if protocol violations occur.
##! Disables analyzers if protocol violations occur, and adds service information
##! to connection log.
@load ./main
module DPD;
export {
## Add the DPD logging stream identifier.
redef enum Log::ID += { LOG };
## A default logging policy hook for the stream.
global log_policy: Log::PolicyHook;
## The record type defining the columns to log in the DPD logging stream.
type Info: record {
## Timestamp for when protocol analysis failed.
ts: time &log;
## Connection unique ID.
uid: string &log;
## Connection ID containing the 4-tuple which identifies endpoints.
id: conn_id &log;
## Transport protocol for the violation.
proto: transport_proto &log;
## The analyzer that generated the violation.
analyzer: string &log;
## The textual reason for the analysis failure.
failure_reason: string &log;
};
## Deprecated, please see https://github.com/zeek/zeek/pull/4200 for details
option max_violations: table[Analyzer::Tag] of count = table() &deprecated="Remove in v8.1: This has become non-functional in Zeek 7.2, see PR #4200" &default = 5;
## Analyzers which you don't want to throw
## Analyzers which you don't want to remove on violations.
option ignore_violations: set[Analyzer::Tag] = set();
## Ignore violations which go this many bytes into the connection.
@ -45,17 +22,12 @@ export {
}
redef record connection += {
dpd: Info &optional;
## The set of services (analyzers) for which Zeek has observed a
## violation after the same service had previously been confirmed.
service_violation: set[string] &default=set() &ordered;
## The set of prototol analyzers that were removed due to a protocol
## violation after the same analyzer had previously been confirmed.
failed_analyzers: set[string] &default=set() &ordered;
};
event zeek_init() &priority=5
{
Log::create_stream(DPD::LOG, [$columns=Info, $path="dpd", $policy=log_policy]);
}
# Add confirmed protocol analyzers to conn.log service field
event analyzer_confirmation_info(atype: AllAnalyzers::Tag, info: AnalyzerConfirmationInfo) &priority=10
{
if ( ! is_protocol_analyzer(atype) && ! is_packet_analyzer(atype) )
@ -69,9 +41,11 @@ event analyzer_confirmation_info(atype: AllAnalyzers::Tag, info: AnalyzerConfirm
add c$service[analyzer];
}
event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo) &priority=10
# Remove failed analyzers from service field and add them to c$failed_analyzers
# Low priority to allow other handlers to check if the analyzer was confirmed
event analyzer_failed(ts: time, atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo) &priority=-5
{
if ( ! is_protocol_analyzer(atype) && ! is_packet_analyzer(atype) )
if ( ! is_protocol_analyzer(atype) )
return;
if ( ! info?$c )
@ -90,35 +64,21 @@ event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationI
# if statement is separate, to allow repeated removal of service, in case there are several
# confirmation and violation events
if ( analyzer in c$service_violation )
return;
if ( analyzer !in c$failed_analyzers )
add c$failed_analyzers[analyzer];
add c$service_violation[analyzer];
local dpd: Info;
dpd$ts = network_time();
dpd$uid = c$uid;
dpd$id = c$id;
dpd$proto = get_port_transport_proto(c$id$orig_p);
dpd$analyzer = analyzer;
# Encode data into the reason if there's any as done for the old
# analyzer_violation event, previously.
local reason = info$reason;
if ( info?$data )
# add "-service" to the list of services on removal due to violation, if analyzer was confirmed before
if ( track_removed_services_in_connection && Analyzer::name(atype) in c$service )
{
local ellipsis = |info$data| > 40 ? "..." : "";
local data = info$data[0:40];
reason = fmt("%s [%s%s]", reason, data, ellipsis);
local rname = cat("-", Analyzer::name(atype));
if ( rname !in c$service )
add c$service[rname];
}
dpd$failure_reason = reason;
c$dpd = dpd;
}
event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo ) &priority=5
{
if ( ! is_protocol_analyzer(atype) && ! is_packet_analyzer(atype) )
if ( ! is_protocol_analyzer(atype) )
return;
if ( ! info?$c || ! info?$aid )
@ -133,29 +93,17 @@ event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationI
if ( ignore_violations_after > 0 && size > ignore_violations_after )
return;
# analyzer already was removed or connection finished
# let's still log this.
if ( lookup_connection_analyzer_id(c$id, atype) == 0 )
{
event analyzer_failed(network_time(), atype, info);
return;
}
local disabled = disable_analyzer(c$id, aid, F);
# add "-service" to the list of services on removal due to violation, if analyzer was confirmed before
if ( track_removed_services_in_connection && disabled && Analyzer::name(atype) in c$service )
{
local rname = cat("-", Analyzer::name(atype));
if ( rname !in c$service )
add c$service[rname];
}
}
event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo ) &priority=-5
{
if ( ! is_protocol_analyzer(atype) && ! is_packet_analyzer(atype) )
return;
if ( ! info?$c )
return;
if ( info$c?$dpd )
{
Log::write(DPD::LOG, info$c$dpd);
delete info$c$dpd;
}
# If analyzer was disabled, send failed event
if ( disabled )
event analyzer_failed(network_time(), atype, info);
}

View file

@ -1,8 +1,6 @@
##! Logging analyzer confirmations and violations into analyzer.log
##! Logging analyzer violations into analyzer.log
@load base/frameworks/config
@load base/frameworks/logging
@load ./main
module Analyzer::Logging;
@ -11,16 +9,10 @@ export {
## Add the analyzer logging stream identifier.
redef enum Log::ID += { LOG };
## A default logging policy hook for the stream.
global log_policy: Log::PolicyHook;
## The record type defining the columns to log in the analyzer logging stream.
type Info: record {
## Timestamp of confirmation or violation.
## Timestamp of the violation.
ts: time &log;
## What caused this log entry to be produced. This can
## currently be "violation" or "confirmation".
cause: string &log;
## The kind of analyzer involved. Currently "packet", "file"
## or "protocol".
analyzer_kind: string &log;
@ -31,163 +23,64 @@ export {
uid: string &log &optional;
## File UID if available.
fuid: string &log &optional;
## Connection identifier if available
## Connection identifier if available.
id: conn_id &log &optional;
## Transport protocol for the violation, if available.
proto: transport_proto &log &optional;
## Failure or violation reason, if available.
failure_reason: string &log &optional;
failure_reason: string &log;
## Data causing failure or violation if available. Truncated
## to :zeek:see:`Analyzer::Logging::failure_data_max_size`.
failure_data: string &log &optional;
};
## Enable logging of analyzer violations and optionally confirmations
## when :zeek:see:`Analyzer::Logging::include_confirmations` is set.
option enable = T;
## Enable analyzer_confirmation. They are usually less interesting
## outside of development of analyzers or troubleshooting scenarios.
## Setting this option may also generated multiple log entries per
## connection, minimally one for each conn.log entry with a populated
## service field.
option include_confirmations = F;
## Enable tracking of analyzers getting disabled. This is mostly
## interesting for troubleshooting of analyzers in DPD scenarios.
## Setting this option may also generated multiple log entries per
## connection.
option include_disabling = F;
## If a violation contains information about the data causing it,
## include at most this many bytes of it in the log.
option failure_data_max_size = 40;
## Set of analyzers for which to not log confirmations or violations.
option ignore_analyzers: set[AllAnalyzers::Tag] = set();
}
## An event that can be handled to access the :zeek:type:`Analyzer::Logging::Info`
## record as it is sent on to the logging framework.
global log_analyzer: event(rec: Info);
## A default logging policy hook for the stream.
global log_policy: Log::PolicyHook;
}
event zeek_init() &priority=5
{
Log::create_stream(LOG, [$columns=Info, $path="analyzer", $policy=log_policy,
$event_groups=set("Analyzer::Logging")]);
local enable_handler = function(id: string, new_value: bool): bool {
if ( new_value )
Log::enable_stream(LOG);
else
Log::disable_stream(LOG);
return new_value;
};
Option::set_change_handler("Analyzer::Logging::enable", enable_handler);
local include_confirmations_handler = function(id: string, new_value: bool): bool {
if ( new_value )
enable_event_group("Analyzer::Logging::include_confirmations");
else
disable_event_group("Analyzer::Logging::include_confirmations");
return new_value;
};
Option::set_change_handler("Analyzer::Logging::include_confirmations",
include_confirmations_handler);
local include_disabling_handler = function(id: string, new_value: bool): bool {
if ( new_value )
enable_event_group("Analyzer::Logging::include_disabling");
else
disable_event_group("Analyzer::Logging::include_disabling");
return new_value;
};
Option::set_change_handler("Analyzer::Logging::include_disabling",
include_disabling_handler);
# Call the handlers directly with the current values to avoid config
# framework interactions like creating entries in config.log.
enable_handler("Analyzer::Logging::enable", Analyzer::Logging::enable);
include_confirmations_handler("Analyzer::Logging::include_confirmations",
Analyzer::Logging::include_confirmations);
include_disabling_handler("Analyzer::Logging::include_disabling",
Analyzer::Logging::include_disabling);
Log::create_stream(LOG, Log::Stream($columns=Info, $path="analyzer", $ev=log_analyzer, $policy=log_policy));
}
function analyzer_kind(atype: AllAnalyzers::Tag): string
function log_analyzer_failure(ts: time, atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo)
{
if ( is_protocol_analyzer(atype) )
return "protocol";
else if ( is_packet_analyzer(atype) )
return "packet";
else if ( is_file_analyzer(atype) )
return "file";
local rec = Info(
$ts=ts,
$analyzer_kind=Analyzer::kind(atype),
$analyzer_name=Analyzer::name(atype),
$failure_reason=info$reason
);
Reporter::warning(fmt("Unknown kind of analyzer %s", atype));
return "unknown";
}
function populate_from_conn(rec: Info, c: connection)
{
rec$id = c$id;
rec$uid = c$uid;
}
function populate_from_file(rec: Info, f: fa_file)
{
rec$fuid = f$id;
# If the confirmation didn't have a connection, but the
# fa_file object has exactly one, use it.
if ( ! rec?$uid && f?$conns && |f$conns| == 1 )
if ( info?$c )
{
for ( _, c in f$conns )
rec$id = info$c$id;
rec$uid = info$c$uid;
rec$proto = get_port_transport_proto(info$c$id$orig_p);
}
if ( info?$f )
{
rec$fuid = info$f$id;
# If the confirmation didn't have a connection, but the
# fa_file object has exactly one, use it.
if ( ! rec?$uid && info$f?$conns && |info$f$conns| == 1 )
{
rec$id = c$id;
rec$uid = c$uid;
for ( _, c in info$f$conns )
{
rec$id = c$id;
rec$uid = c$uid;
}
}
}
}
event analyzer_confirmation_info(atype: AllAnalyzers::Tag, info: AnalyzerConfirmationInfo) &group="Analyzer::Logging::include_confirmations"
{
if ( atype in ignore_analyzers )
return;
local rec = Info(
$ts=network_time(),
$cause="confirmation",
$analyzer_kind=analyzer_kind(atype),
$analyzer_name=Analyzer::name(atype),
);
if ( info?$c )
populate_from_conn(rec, info$c);
if ( info?$f )
populate_from_file(rec, info$f);
Log::write(LOG, rec);
}
event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo) &priority=6
{
if ( atype in ignore_analyzers )
return;
local rec = Info(
$ts=network_time(),
$cause="violation",
$analyzer_kind=analyzer_kind(atype),
$analyzer_name=Analyzer::name(atype),
$failure_reason=info$reason,
);
if ( info?$c )
populate_from_conn(rec, info$c);
if ( info?$f )
populate_from_file(rec, info$f);
if ( info?$data )
{
@ -200,19 +93,31 @@ event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationI
Log::write(LOG, rec);
}
hook Analyzer::disabling_analyzer(c: connection, atype: AllAnalyzers::Tag, aid: count) &priority=-1000 &group="Analyzer::Logging::include_disabling"
# event currently is only raised for protocol analyzers; we do not fail packet and file analyzers
event analyzer_failed(ts: time, atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo)
{
if ( atype in ignore_analyzers )
if ( ! is_protocol_analyzer(atype) )
return;
local rec = Info(
$ts=network_time(),
$cause="disabled",
$analyzer_kind=analyzer_kind(atype),
$analyzer_name=Analyzer::name(atype),
);
if ( ! info?$c )
return;
populate_from_conn(rec, c);
# log only for previously confirmed service that did not already log violation
# note that analyzers can fail repeatedly in some circumstances - e.g. when they
# are re-attached by the dynamic protocol detection due to later data.
local analyzer_name = Analyzer::name(atype);
if ( analyzer_name !in info$c$service || analyzer_name in info$c$failed_analyzers )
return;
Log::write(LOG, rec);
log_analyzer_failure(ts, atype, info);
}
# log packet and file analyzers here separately
event analyzer_violation_info(atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo )
{
if ( is_protocol_analyzer(atype) )
return;
log_analyzer_failure(network_time(), atype, info);
}

View file

@ -88,6 +88,15 @@ export {
## Returns: The analyzer name corresponding to the tag.
global name: function(tag: Analyzer::Tag) : string;
## Translates an analyzer type to a string with the analyzer's type.
##
## Possible values are "protocol", "packet", "file", or "unknown".
##
## tag: The analyzer tag.
##
## Returns: The analyzer kind corresponding to the tag.
global kind: function(tag: Analyzer::Tag) : string;
## Check whether the given analyzer name exists.
##
## This can be used before calling :zeek:see:`Analyzer::get_tag` to
@ -163,6 +172,23 @@ export {
##
## This set can be added to via :zeek:see:`redef`.
global requested_analyzers: set[AllAnalyzers::Tag] = {} &redef;
## Event that is raised when an analyzer raised a service violation and was
## removed.
##
## The event is also raised if the analyzer already was no longer active by
## the time that the violation was handled - so if it happens at the very
## end of a connection.
##
## Currently this event is only raised for protocol analyzers, as packet
## and file analyzers are never actively removed/disabled.
##
## ts: time at which the violation occurred
##
## atype: atype: The analyzer tag, such as ``Analyzer::ANALYZER_HTTP``.
##
##info: Details about the violation. This record should include a :zeek:type:`connection`
global analyzer_failed: event(ts: time, atype: AllAnalyzers::Tag, info: AnalyzerViolationInfo);
}
@load base/bif/analyzer.bif
@ -246,6 +272,19 @@ function name(atype: AllAnalyzers::Tag) : string
return __name(atype);
}
function kind(atype: AllAnalyzers::Tag): string
{
if ( is_protocol_analyzer(atype) )
return "protocol";
else if ( is_packet_analyzer(atype) )
return "packet";
else if ( is_file_analyzer(atype) )
return "file";
Reporter::warning(fmt("Unknown kind of analyzer %s", atype));
return "unknown";
}
function has_tag(name: string): bool
{
return __has_tag(name);

View file

@ -47,17 +47,17 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(Broker::LOG, [$columns=Info, $path="broker", $policy=log_policy]);
Log::create_stream(Broker::LOG, Log::Stream($columns=Info, $path="broker", $policy=log_policy));
}
function log_status(ev: string, endpoint: EndpointInfo, msg: string)
{
local r: Info;
r = [$ts = network_time(),
$ev = ev,
$ty = STATUS,
$message = msg];
r = Broker::Info($ts = network_time(),
$ev = ev,
$ty = STATUS,
$message = msg);
if ( endpoint?$network )
r$peer = endpoint$network;
@ -87,10 +87,10 @@ event Broker::error(code: ErrorCode, msg: string)
ev = subst_string(ev, "_", "-");
ev = to_lower(ev);
Log::write(Broker::LOG, [$ts = network_time(),
Log::write(Broker::LOG, Info($ts = network_time(),
$ev = ev,
$ty = ERROR,
$message = msg]);
$message = msg));
Reporter::error(fmt("Broker error (%s): %s", code, msg));
}
@ -115,8 +115,8 @@ event Broker::internal_log_event(lvl: LogSeverityLevel, id: string, description:
severity = Broker::DEBUG_EVENT;
break;
}
Log::write(Broker::LOG, [$ts = network_time(),
Log::write(Broker::LOG, Info($ts = network_time(),
$ty = severity,
$ev = id,
$message = description]);
$message = description));
}

View file

@ -28,7 +28,7 @@ export {
## Default address on which to listen for WebSocket connections.
##
## .. zeek:see:: Broker::listen_websocket
## .. zeek:see:: Cluster::listen_websocket
const default_listen_address_websocket = getenv("ZEEK_DEFAULT_LISTEN_ADDRESS") &redef;
## Default interval to retry connecting to a peer if it cannot be made to
@ -69,11 +69,6 @@ export {
## all peers.
const ssl_keyfile = "" &redef;
## The number of buffered messages at the Broker/CAF layer after which
## a subscriber considers themselves congested (i.e. tune the congestion
## control mechanisms).
const congestion_queue_size = 200 &redef &deprecated="Remove in v8.1. Non-functional since v5.0";
## The max number of log entries per log stream to batch together when
## sending log messages to a remote logger.
const log_batch_size = 400 &redef;
@ -319,27 +314,6 @@ export {
p: port &default = default_port,
retry: interval &default = default_listen_retry): port;
## Listen for remote connections using WebSocket.
##
## a: an address string on which to accept connections, e.g.
## "127.0.0.1". An empty string refers to INADDR_ANY.
##
## p: the TCP port to listen on. The value 0 means that the OS should choose
## the next available free port.
##
## retry: If non-zero, retries listening in regular intervals if the port cannot be
## acquired immediately. 0 disables retries. If the
## ZEEK_DEFAULT_LISTEN_RETRY environment variable is set (as number
## of seconds), it overrides any value given here.
##
## Returns: the bound port or 0/? on failure.
##
## .. zeek:see:: Broker::status
global listen_websocket: function(a: string &default = default_listen_address_websocket,
p: port &default = default_port_websocket,
retry: interval &default = default_listen_retry): port
&deprecated="Remove in v8.1. Switch to Cluster::listen_websocket() instead.";
## Initiate a remote connection.
##
## a: an address to connect to, e.g. "localhost" or "127.0.0.1".
@ -450,29 +424,6 @@ export {
##
## Returns: true if a new event forwarding/subscription is now registered.
global forward: function(topic_prefix: string): bool;
## Automatically send an event to any interested peers whenever it is
## locally dispatched. (For example, using "event my_event(...);" in a
## script.)
##
## topic: a topic string associated with the event message.
## Peers advertise interest by registering a subscription to some
## prefix of this topic name.
##
## ev: a Zeek event value.
##
## Returns: true if automatic event sending is now enabled.
global auto_publish: function(topic: string, ev: any): bool &deprecated="Remove in v8.1. Switch to explicit Cluster::publish() calls. Auto-publish won't work with all cluster backends.";
## Stop automatically sending an event to peers upon local dispatch.
##
## topic: a topic originally given to :zeek:see:`Broker::auto_publish`.
##
## ev: an event originally given to :zeek:see:`Broker::auto_publish`.
##
## Returns: true if automatic events will not occur for the topic/event
## pair.
global auto_unpublish: function(topic: string, ev: any): bool &deprecated="Remove in v8.1. See Broker::auto_publish()";
}
@load base/bif/comm.bif
@ -514,31 +465,6 @@ function listen(a: string, p: port, retry: interval): port
return bound;
}
event retry_listen_websocket(a: string, p: port, retry: interval)
{
@pragma push ignore-deprecations
listen_websocket(a, p, retry);
@pragma pop ignore-deprecations
}
function listen_websocket(a: string, p: port, retry: interval): port
{
local bound = __listen(a, p, Broker::WEBSOCKET);
if ( bound == 0/tcp )
{
local e = getenv("ZEEK_DEFAULT_LISTEN_RETRY");
if ( e != "" )
retry = double_to_interval(to_double(e));
if ( retry != 0secs )
schedule retry { retry_listen_websocket(a, p, retry) };
}
return bound;
}
function peer(a: string, p: port, retry: interval): bool
{
return __peer(a, p, retry);
@ -593,13 +519,3 @@ function unsubscribe(topic_prefix: string): bool
{
return __unsubscribe(topic_prefix);
}
function auto_publish(topic: string, ev: any): bool
{
return __auto_publish(topic, ev);
}
function auto_unpublish(topic: string, ev: any): bool
{
return __auto_unpublish(topic, ev);
}

View file

@ -1,6 +1,7 @@
# Load the core cluster support.
@load ./main
@load ./pools
@load ./telemetry
@if ( Cluster::is_enabled() )

View file

@ -5,13 +5,13 @@
module Cluster;
global broker_backpressure_disconnects_cf = Telemetry::register_counter_family([
global broker_backpressure_disconnects_cf = Telemetry::register_counter_family(Telemetry::MetricOpts(
$prefix="zeek",
$name="broker-backpressure-disconnects",
$unit="",
$label_names=vector("peer"),
$help_text="Number of Broker peerings dropped due to a neighbor falling behind in message I/O",
]);
));
event Broker::peer_removed(endpoint: Broker::EndpointInfo, msg: string)
{

View file

@ -7,13 +7,13 @@ module Cluster;
## This gauge tracks the current number of locally queued messages in each
## Broker peering's send buffer. The "peer" label identifies the remote side of
## the peering, containing a Zeek cluster node name.
global broker_peer_buffer_messages_gf = Telemetry::register_gauge_family([
global broker_peer_buffer_messages_gf = Telemetry::register_gauge_family(Telemetry::MetricOpts(
$prefix="zeek",
$name="broker-peer-buffer-messages",
$unit="",
$label_names=vector("peer"),
$help_text="Number of messages queued in Broker's send buffers",
]);
));
## This gauge tracks recent maximum queue lengths for each Broker peering's send
## buffer. Most of the time the send buffers are nearly empty, so this gauge
@ -23,26 +23,26 @@ global broker_peer_buffer_messages_gf = Telemetry::register_gauge_family([
## observed message. That is, Zeek keeps a timestamp of when the window started,
## and once it notices that the interval has passed, it moves the start of the
## window to current time.
global broker_peer_buffer_recent_max_messages_gf = Telemetry::register_gauge_family([
global broker_peer_buffer_recent_max_messages_gf = Telemetry::register_gauge_family(Telemetry::MetricOpts(
$prefix="zeek",
$name="broker-peer-buffer-recent-max-messages",
$unit="",
$label_names=vector("peer"),
$help_text="Maximum number of messages recently queued in Broker's send buffers",
]);
));
## This counter tracks for each Broker peering the number of times its send
## buffer has overflowed. For the "disconnect" policy this can at most be 1,
## since Broker stops the peering at this time. For the "drop_oldest" and
## "drop_newest" policies (see :zeek:see:`Broker:peer_overflow_policy`) the count
## instead reflects the number of messages lost.
global broker_peer_buffer_overflows_cf = Telemetry::register_counter_family([
global broker_peer_buffer_overflows_cf = Telemetry::register_counter_family(Telemetry::MetricOpts(
$prefix="zeek",
$name="broker-peer-buffer-overflows",
$unit="",
$label_names=vector("peer"),
$help_text="Number of overflows in Broker's send buffers",
]);
));
# A helper to track overflow counts over past peerings as well as the current

View file

@ -362,8 +362,6 @@ export {
## WebSocket server options to pass to :zeek:see:`Cluster::listen_websocket`.
type WebSocketServerOptions: record {
## The host address to listen on.
listen_host: string &optional &deprecated="Remove in v8.1: Use $listen_addr instead.";
## The address to listen on, cannot be used together with ``listen_host``.
listen_addr: addr &optional;
## The port the WebSocket server is supposed to listen on.
@ -398,7 +396,23 @@ export {
type EndpointInfo: record {
id: string;
network: NetworkInfo;
## The value of the X-Application-Name HTTP header, if any.
application_name: string &optional;
};
## A hook invoked for every :zeek:see:`Cluster::subscribe` call.
##
## Breaking from this hook has no effect.
##
## topic: The topic string as given to :zeek:see:`Cluster::subscribe`.
global on_subscribe: hook(topic: string);
## A hook invoked for every :zeek:see:`Cluster::subscribe` call.
##
## Breaking from this hook has no effect.
##
## topic: The topic string as given to :zeek:see:`Cluster::subscribe`.
global on_unsubscribe: hook(topic: string);
}
# Needs declaration of Cluster::Event type.
@ -490,7 +504,7 @@ function nodeid_to_node(id: string): NamedNode
return NamedNode($name=name, $node=n);
}
return NamedNode($name="", $node=[$node_type=NONE, $ip=0.0.0.0]);
return NamedNode($name="", $node=Node($node_type=NONE, $ip=0.0.0.0));
}
event Cluster::hello(name: string, id: string) &priority=10
@ -570,7 +584,7 @@ event zeek_init() &priority=5
terminate();
}
Log::create_stream(Cluster::LOG, [$columns=Info, $path="cluster", $policy=log_policy]);
Log::create_stream(Cluster::LOG, Log::Stream($columns=Info, $path="cluster", $policy=log_policy));
}
function create_store(name: string, persistent: bool &default=F): Cluster::StoreInfo
@ -652,7 +666,7 @@ function create_store(name: string, persistent: bool &default=F): Cluster::Store
function log(msg: string)
{
Log::write(Cluster::LOG, [$ts = network_time(), $node = node, $message = msg]);
Log::write(Cluster::LOG, Info($ts = network_time(), $node = node, $message = msg));
}
function init(): bool
@ -675,17 +689,25 @@ function listen_websocket(options: WebSocketServerOptions): bool
return Cluster::__listen_websocket(options);
}
function format_endpoint_info(ei: EndpointInfo): string
{
local s = fmt("'%s' (%s:%d)", ei$id, ei$network$address, ei$network$bound_port);
if ( ei?$application_name )
s += fmt(" application_name=%s", ei$application_name);
return s;
}
event websocket_client_added(endpoint: EndpointInfo, subscriptions: string_vec)
{
local msg = fmt("WebSocket client '%s' (%s:%d) subscribed to %s",
endpoint$id, endpoint$network$address, endpoint$network$bound_port, subscriptions);
local msg = fmt("WebSocket client %s subscribed to %s",
format_endpoint_info(endpoint), subscriptions);
Cluster::log(msg);
}
event websocket_client_lost(endpoint: EndpointInfo, code: count, reason: string)
{
local msg = fmt("WebSocket client '%s' (%s:%d) gone with code %d%s",
endpoint$id, endpoint$network$address, endpoint$network$bound_port, code,
local msg = fmt("WebSocket client %s gone with code %d%s",
format_endpoint_info(endpoint), code,
|reason| > 0 ? fmt(" and reason '%s'", reason) : "");
Cluster::log(msg);
}

View file

@ -42,7 +42,7 @@ function __init_cluster_nodes(): bool
if ( endp$role in rolemap )
typ = rolemap[endp$role];
cnode = [$node_type=typ, $ip=endp$host, $p=endp$p];
cnode = Cluster::Node($node_type=typ, $ip=endp$host, $p=endp$p);
if ( |manager_name| > 0 && cnode$node_type != Cluster::MANAGER )
cnode$manager = manager_name;
if ( endp?$metrics_port )

View file

@ -0,0 +1,39 @@
## Module for cluster telemetry.
module Cluster::Telemetry;
export {
type Type: enum {
## Creates counter metrics for incoming and for outgoing
## events without labels.
INFO,
## Creates counter metrics for incoming and outgoing events
## labeled with handler and normalized topic names.
VERBOSE,
## Creates histogram metrics using the serialized message size
## for events, labeled by topic, handler and script location
## (outgoing only).
DEBUG,
};
## The telemetry types to enable for the core backend.
const core_metrics: set[Type] = {
INFO,
} &redef;
## The telemetry types to enable for WebSocket backends.
const websocket_metrics: set[Type] = {
INFO,
} &redef;
## Table used for normalizing topic names that contain random parts.
## Map to an empty string to skip recording a specific metric
## completely.
const topic_normalizations: table[pattern] of string = {
[/^zeek\/cluster\/nodeid\/.*/] = "zeek/cluster/nodeid/__normalized__",
} &ordered &redef;
## For the DEBUG metrics, the histogram buckets to use.
const message_size_bounds: vector of double = {
10.0, 50.0, 100.0, 500.0, 1000.0, 5000.0, 10000.0, 50000.0,
} &redef;
}

View file

@ -40,14 +40,14 @@ event zeek_init() &priority=5
return;
for ( fi in config_files )
Input::add_table([$reader=Input::READER_CONFIG,
Input::add_table(Input::TableDescription($reader=Input::READER_CONFIG,
$mode=Input::REREAD,
$source=fi,
$name=cat("config-", fi),
$idx=ConfigItem,
$val=ConfigItem,
$want_record=F,
$destination=current_config]);
$destination=current_config));
}
event InputConfig::new_value(name: string, source: string, id: string, value: any)
@ -67,11 +67,11 @@ function read_config(filename: string)
local iname = cat("config-oneshot-", filename);
Input::add_event([$reader=Input::READER_CONFIG,
Input::add_event(Input::EventDescription($reader=Input::READER_CONFIG,
$mode=Input::MANUAL,
$source=filename,
$name=iname,
$fields=EventFields,
$ev=config_line]);
$ev=config_line));
Input::remove(iname);
}

View file

@ -153,7 +153,7 @@ function config_option_changed(ID: string, new_value: any, location: string): an
event zeek_init() &priority=10
{
Log::create_stream(LOG, [$columns=Info, $ev=log_config, $path="config", $policy=log_policy]);
Log::create_stream(LOG, Log::Stream($columns=Info, $ev=log_config, $path="config", $policy=log_policy));
# Limit logging to the manager - everyone else just feeds off it.
@if ( !Cluster::is_enabled() || Cluster::local_node_type() == Cluster::MANAGER )

View file

@ -341,7 +341,7 @@ global analyzer_add_callbacks: table[Files::Tag] of function(f: fa_file, args: A
event zeek_init() &priority=5
{
Log::create_stream(Files::LOG, [$columns=Info, $ev=log_files, $path="files", $policy=log_policy]);
Log::create_stream(Files::LOG, Log::Stream($columns=Info, $ev=log_files, $path="files", $policy=log_policy));
}
function set_info(f: fa_file)

View file

@ -105,10 +105,30 @@ event Intel::insert_indicator(item: Intel::Item) &priority=5
Intel::_insert(item, F);
}
function invoke_indicator_hook(store: MinDataStore, h: hook(v: string, t: Intel::Type))
{
for ( a in store$host_data )
hook h(cat(a), Intel::ADDR);
for ( sn in store$subnet_data)
hook h(cat(sn), Intel::SUBNET);
for ( [indicator_value, indicator_type] in store$string_data )
hook h(indicator_value, indicator_type);
}
# Handling of a complete MinDataStore snapshot
#
# Invoke the removed and inserted hooks using the old and new min data store
# instances, respectively. The way this event is used, the original
# min_data_store should essentially be empty.
event new_min_data_store(store: MinDataStore)
{
invoke_indicator_hook(min_data_store, Intel::indicator_removed);
min_data_store = store;
invoke_indicator_hook(min_data_store, Intel::indicator_inserted);
}
@endif

View file

@ -68,13 +68,13 @@ event zeek_init() &priority=5
if ( |path_prefix| > 0 && sub_bytes(a_file, 0, 1) != "/" )
source = cat(rstrip(path_prefix, "/"), "/", a_file);
Input::add_event([$source=source,
$reader=Input::READER_ASCII,
$mode=Input::REREAD,
$name=cat("intel-", a_file),
$fields=Intel::Item,
$ev=Intel::read_entry,
$error_ev=Intel::read_error]);
Input::add_event(Input::EventDescription($source=source,
$reader=Input::READER_ASCII,
$mode=Input::REREAD,
$name=cat("intel-", a_file),
$fields=Intel::Item,
$ev=Intel::read_entry,
$error_ev=Intel::read_error));
}
}
}

View file

@ -207,6 +207,35 @@ export {
## item: The intel item that should be inserted.
global filter_item: hook(item: Intel::Item);
## This hook is invoked when a new indicator has been inserted into
## the min data store for the first time.
##
## Calls to :zeek:see:`Intel::seen` with a matching indicator value
## and type will result in matches.
##
## Subsequent inserts of the same indicator type and value do not
## invoke this hook. Breaking from this hook has no effect.
##
## indicator: The indicator value.
##
## indicator_type: The indicator type.
##
## .. zeek::see:: Intel::indicator_removed
global indicator_inserted: hook(indicator: string, indiator_type: Type);
## This hook is invoked when an indicator has been removed from
## the min data store.
##
## After this hooks runs, :zeek:see:`Intel::seen` for the indicator
## will not return any matches. Breaking from this hook has no effect.
##
## indicator: The indicator value.
##
## indicator_type: The indicator type.
##
## .. zeek::see:: Intel::indicator_inserted
global indicator_removed: hook(indicator: string, indiator_type: Type);
global log_intel: event(rec: Info);
}
@ -251,7 +280,7 @@ global min_data_store: MinDataStore &redef;
event zeek_init() &priority=5
{
Log::create_stream(LOG, [$columns=Info, $ev=log_intel, $path="intel", $policy=log_policy]);
Log::create_stream(LOG, Log::Stream($columns=Info, $ev=log_intel, $path="intel", $policy=log_policy));
}
# Function that abstracts expiration of different types.
@ -260,7 +289,7 @@ function expire_item(indicator: string, indicator_type: Type, metas: set[MetaDat
if ( hook item_expired(indicator, indicator_type, metas) )
return item_expiration;
else
remove([$indicator=indicator, $indicator_type=indicator_type, $meta=[$source=""]], T);
remove(Item($indicator=indicator, $indicator_type=indicator_type, $meta=MetaData($source="")), T);
return 0 sec;
}
@ -507,18 +536,44 @@ function _insert(item: Item, first_dispatch: bool &default = T)
# All intelligence is case insensitive at the moment.
local lower_indicator = to_lower(item$indicator);
# Track if the indicator was inserted into the min_data_store.
# It's tempting to just use is_new above, but it seems that only works
# correctly on a worker if the manager never spuriously sends a
# Intel::insert_item(), so better to determine this locally based
# on the actual contents of the min_data_store.
local inserted = F;
local inserted_value = "";
# Insert indicator into MinDataStore (might exist already).
switch ( item$indicator_type )
{
case ADDR:
local host = to_addr(item$indicator);
if ( host !in min_data_store$host_data )
{
inserted = T;
inserted_value = cat(host);
}
add min_data_store$host_data[host];
break;
case SUBNET:
local net = to_subnet(item$indicator);
if ( net !in min_data_store$subnet_data )
{
inserted = T;
inserted_value = cat(net);
}
add min_data_store$subnet_data[net];
break;
default:
if ( [lower_indicator, item$indicator_type] !in min_data_store$string_data )
{
inserted = T;
inserted_value = lower_indicator;
}
add min_data_store$string_data[lower_indicator, item$indicator_type];
break;
}
@ -533,6 +588,9 @@ function _insert(item: Item, first_dispatch: bool &default = T)
# Announce a (possibly) new item if this is the first dispatch and
# we know it is new or have to assume that on a worker.
event Intel::new_item(item);
if ( inserted )
hook Intel::indicator_inserted(inserted_value, item$indicator_type);
}
function insert(item: Item)
@ -632,18 +690,43 @@ function remove(item: Item, purge_indicator: bool)
# Handling of indicator removal in minimal data stores.
event remove_indicator(item: Item)
{
local removed = F;
local removed_value = "";
switch ( item$indicator_type )
{
case ADDR:
local host = to_addr(item$indicator);
if ( host in min_data_store$host_data )
{
removed = T;
removed_value = cat(host);
}
delete min_data_store$host_data[host];
break;
case SUBNET:
local net = to_subnet(item$indicator);
if ( net in min_data_store$subnet_data )
{
removed = T;
removed_value = cat(net);
}
delete min_data_store$subnet_data[net];
break;
default:
delete min_data_store$string_data[to_lower(item$indicator), item$indicator_type];
local indicator_value = to_lower(item$indicator);
if ( [indicator_value, item$indicator_type] in min_data_store$string_data )
{
removed = T;
removed_value = indicator_value;
}
delete min_data_store$string_data[indicator_value, item$indicator_type];
break;
}
if ( removed )
hook Intel::indicator_removed(removed_value, item$indicator_type);
}

View file

@ -422,10 +422,30 @@ export {
## .. :zeek:see:`Log::default_max_delay_queue_size`
## .. :zeek:see:`Log::set_max_delay_queue_size`
max_delay_queue_size: count &default=default_max_delay_queue_size;
## Maximum string size for field in a log record from this stream.
##
## .. :zeek:see:`Log::default_max_field_string_bytes`
max_field_string_bytes: count &default=Log::default_max_field_string_bytes;
## Maximum total string size in a log record from this stream.
##
## .. :zeek:see:`Log::default_max_total_string_bytes`
max_total_string_bytes: count &default=Log::default_max_total_string_bytes;
## Maximum container elements for field in a log record from this stream.
##
## .. :zeek:see:`Log::default_max_field_container_elements`
max_field_container_elements: count &default=Log::default_max_field_container_elements;
## Maximum total container elements in a log record from this stream.
##
## .. :zeek:see:`Log::default_max_total_container_elements`
max_total_container_elements: count &default=Log::default_max_total_container_elements;
};
## Sentinel value for indicating that a filter was not found when looked up.
const no_filter: Filter = [$name="<not found>"];
const no_filter = Filter($name="<not found>");
## Creates a new logging stream with the default filter.
##
@ -997,7 +1017,7 @@ function flush(id: ID): bool
function add_default_filter(id: ID) : bool
{
return add_filter(id, [$name="default"]);
return add_filter(id, Filter($name="default"));
}
function remove_default_filter(id: ID) : bool
@ -1008,7 +1028,7 @@ function remove_default_filter(id: ID) : bool
event zeek_init() &priority=5
{
if ( print_to_log != REDIRECT_NONE )
Log::create_stream(PRINTLOG, [$columns=PrintLogInfo, $ev=log_print, $path=print_log_path]);
Log::create_stream(PRINTLOG, Log::Stream($columns=PrintLogInfo, $ev=log_print, $path=print_log_path));
}
function empty_post_delay_cb(rec: any, id: ID): bool {

View file

@ -7,9 +7,9 @@
##! names is printed out as meta information, with no "# fields" prepended; no
##! other meta data gets included in that mode. Example filter using this::
##!
##! local f: Log::Filter = [$name = "my-filter",
##! $writer = Log::WRITER_ASCII,
##! $config = table(["tsv"] = "T")];
##! local f = Log::Filter($name = "my-filter",
##! $writer = Log::WRITER_ASCII,
##! $config = table(["tsv"] = "T"));
##!
module LogAscii;

View file

@ -59,13 +59,13 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(NetControl::DROP_LOG, [$columns=DropInfo, $ev=log_netcontrol_drop, $path="netcontrol_drop", $policy=log_policy_drop]);
Log::create_stream(NetControl::DROP_LOG, Log::Stream($columns=DropInfo, $ev=log_netcontrol_drop, $path="netcontrol_drop", $policy=log_policy_drop));
}
function drop_connection(c: conn_id, t: interval, location: string &default="") : string
{
local e: Entity = [$ty=CONNECTION, $conn=c];
local r: Rule = [$ty=DROP, $target=FORWARD, $entity=e, $expire=t, $location=location];
local e = Entity($ty=CONNECTION, $conn=c);
local r = Rule($ty=DROP, $target=FORWARD, $entity=e, $expire=t, $location=location);
if ( ! hook NetControl::drop_rule_policy(r) )
return "";
@ -88,8 +88,8 @@ function drop_connection(c: conn_id, t: interval, location: string &default="")
function drop_address(a: addr, t: interval, location: string &default="") : string
{
local e: Entity = [$ty=ADDRESS, $ip=addr_to_subnet(a)];
local r: Rule = [$ty=DROP, $target=FORWARD, $entity=e, $expire=t, $location=location];
local e = Entity($ty=ADDRESS, $ip=addr_to_subnet(a));
local r = Rule($ty=DROP, $target=FORWARD, $entity=e, $expire=t, $location=location);
if ( ! hook NetControl::drop_rule_policy(r) )
return "";

View file

@ -383,7 +383,7 @@ global rule_entities: table[Entity, RuleType] of Rule;
event zeek_init() &priority=5
{
Log::create_stream(NetControl::LOG, [$columns=Info, $ev=log_netcontrol, $path="netcontrol", $policy=log_policy]);
Log::create_stream(NetControl::LOG, Log::Stream($columns=Info, $ev=log_netcontrol, $path="netcontrol", $policy=log_policy));
}
function entity_to_info(info: Info, e: Entity)
@ -489,22 +489,22 @@ function rule_to_info(info: Info, r: Rule)
function log_msg(msg: string, p: PluginState)
{
Log::write(LOG, [$ts=network_time(), $category=MESSAGE, $msg=msg, $plugin=p$plugin$name(p)]);
Log::write(LOG, Info($ts=network_time(), $category=MESSAGE, $msg=msg, $plugin=p$plugin$name(p)));
}
function log_error(msg: string, p: PluginState)
{
Log::write(LOG, [$ts=network_time(), $category=ERROR, $msg=msg, $plugin=p$plugin$name(p)]);
Log::write(LOG, Info($ts=network_time(), $category=ERROR, $msg=msg, $plugin=p$plugin$name(p)));
}
function log_msg_no_plugin(msg: string)
{
Log::write(LOG, [$ts=network_time(), $category=MESSAGE, $msg=msg]);
Log::write(LOG, Info($ts=network_time(), $category=MESSAGE, $msg=msg));
}
function log_rule(r: Rule, cmd: string, state: InfoState, p: PluginState, msg: string &default="")
{
local info: Info = [$ts=network_time()];
local info = Info($ts=network_time());
info$category = RULE;
info$cmd = cmd;
info$state = state;
@ -519,14 +519,14 @@ function log_rule(r: Rule, cmd: string, state: InfoState, p: PluginState, msg: s
function log_rule_error(r: Rule, msg: string, p: PluginState)
{
local info: Info = [$ts=network_time(), $category=ERROR, $msg=msg, $plugin=p$plugin$name(p)];
local info = Info($ts=network_time(), $category=ERROR, $msg=msg, $plugin=p$plugin$name(p));
rule_to_info(info, r);
Log::write(LOG, info);
}
function log_rule_no_plugin(r: Rule, state: InfoState, msg: string)
{
local info: Info = [$ts=network_time()];
local info = Info($ts=network_time());
info$category = RULE;
info$state = state;
info$msg = msg;
@ -538,16 +538,16 @@ function log_rule_no_plugin(r: Rule, state: InfoState, msg: string)
function whitelist_address(a: addr, t: interval, location: string &default="") : string
{
local e: Entity = [$ty=ADDRESS, $ip=addr_to_subnet(a)];
local r: Rule = [$ty=WHITELIST, $priority=whitelist_priority, $target=FORWARD, $entity=e, $expire=t, $location=location];
local e = Entity($ty=ADDRESS, $ip=addr_to_subnet(a));
local r = Rule($ty=WHITELIST, $priority=whitelist_priority, $target=FORWARD, $entity=e, $expire=t, $location=location);
return add_rule(r);
}
function whitelist_subnet(s: subnet, t: interval, location: string &default="") : string
{
local e: Entity = [$ty=ADDRESS, $ip=s];
local r: Rule = [$ty=WHITELIST, $priority=whitelist_priority, $target=FORWARD, $entity=e, $expire=t, $location=location];
local e = Entity($ty=ADDRESS, $ip=s);
local r = Rule($ty=WHITELIST, $priority=whitelist_priority, $target=FORWARD, $entity=e, $expire=t, $location=location);
return add_rule(r);
}
@ -561,8 +561,8 @@ function redirect_flow(f: flow_id, out_port: count, t: interval, location: strin
$dst_h=addr_to_subnet(f$dst_h),
$dst_p=f$dst_p
);
local e: Entity = [$ty=FLOW, $flow=flow];
local r: Rule = [$ty=REDIRECT, $target=FORWARD, $entity=e, $expire=t, $location=location, $out_port=out_port];
local e = Entity($ty=FLOW, $flow=flow);
local r = Rule($ty=REDIRECT, $target=FORWARD, $entity=e, $expire=t, $location=location, $out_port=out_port);
return add_rule(r);
}
@ -570,19 +570,19 @@ function redirect_flow(f: flow_id, out_port: count, t: interval, location: strin
function quarantine_host(infected: addr, dns: addr, quarantine: addr, t: interval, location: string &default="") : vector of string
{
local orules: vector of string = vector();
local edrop: Entity = [$ty=FLOW, $flow=Flow($src_h=addr_to_subnet(infected))];
local rdrop: Rule = [$ty=DROP, $target=FORWARD, $entity=edrop, $expire=t, $location=location];
local edrop = Entity($ty=FLOW, $flow=Flow($src_h=addr_to_subnet(infected)));
local rdrop = Rule($ty=DROP, $target=FORWARD, $entity=edrop, $expire=t, $location=location);
orules += add_rule(rdrop);
local todnse: Entity = [$ty=FLOW, $flow=Flow($src_h=addr_to_subnet(infected), $dst_h=addr_to_subnet(dns), $dst_p=53/udp)];
local todnse = Entity($ty=FLOW, $flow=Flow($src_h=addr_to_subnet(infected), $dst_h=addr_to_subnet(dns), $dst_p=53/udp));
local todnsr = Rule($ty=MODIFY, $target=FORWARD, $entity=todnse, $expire=t, $location=location, $mod=FlowMod($dst_h=quarantine), $priority=+5);
orules += add_rule(todnsr);
local fromdnse: Entity = [$ty=FLOW, $flow=Flow($src_h=addr_to_subnet(dns), $src_p=53/udp, $dst_h=addr_to_subnet(infected))];
local fromdnse = Entity($ty=FLOW, $flow=Flow($src_h=addr_to_subnet(dns), $src_p=53/udp, $dst_h=addr_to_subnet(infected)));
local fromdnsr = Rule($ty=MODIFY, $target=FORWARD, $entity=fromdnse, $expire=t, $location=location, $mod=FlowMod($src_h=dns), $priority=+5);
orules += add_rule(fromdnsr);
local wle: Entity = [$ty=FLOW, $flow=Flow($src_h=addr_to_subnet(infected), $dst_h=addr_to_subnet(quarantine), $dst_p=80/tcp)];
local wle = Entity($ty=FLOW, $flow=Flow($src_h=addr_to_subnet(infected), $dst_h=addr_to_subnet(quarantine), $dst_p=80/tcp));
local wlr = Rule($ty=WHITELIST, $target=FORWARD, $entity=wle, $expire=t, $location=location, $priority=+5);
orules += add_rule(wlr);

View file

@ -303,7 +303,7 @@ function create_acld(config: AcldConfig) : PluginState
add netcontrol_acld_topics[config$acld_topic];
local host = cat(config$acld_host);
local p: PluginState = [$acld_config=config, $plugin=acld_plugin, $acld_id=netcontrol_acld_current_id];
local p = PluginState($acld_config=config, $plugin=acld_plugin, $acld_id=netcontrol_acld_current_id);
if ( [config$acld_port, host] in netcontrol_acld_peers )
Reporter::warning(fmt("Peer %s:%s was added to NetControl acld plugin twice.", host, config$acld_port));

View file

@ -117,7 +117,7 @@ global debug_plugin = Plugin(
function create_debug(do_something: bool, name: string) : PluginState
{
local p: PluginState = [$plugin=debug_plugin];
local p = PluginState($plugin=debug_plugin);
# FIXME: Why's the default not working?
p$config = table();
@ -132,7 +132,7 @@ function create_debug(do_something: bool, name: string) : PluginState
function create_debug_error(name: string) : PluginState
{
local p: PluginState = copy([$plugin=debug_plugin]);
local p = copy(PluginState($plugin=debug_plugin));
p$config["name"] = name;
p$config["all"] = "1";
p$plugin$add_rule = debug_add_rule_error;
@ -141,7 +141,7 @@ function create_debug_error(name: string) : PluginState
function create_debug_exists(name: string) : PluginState
{
local p: PluginState = copy([$plugin=debug_plugin]);
local p = copy(PluginState($plugin=debug_plugin));
p$config["name"] = name;
p$config["all"] = "1";
p$plugin$add_rule = debug_add_rule_exists;

View file

@ -447,7 +447,7 @@ global openflow_plugin = Plugin(
function create_openflow(controller: OpenFlow::Controller, config: OfConfig &default=[]) : PluginState
{
local p: PluginState = [$plugin=openflow_plugin, $of_controller=controller, $of_config=config];
local p = PluginState($plugin=openflow_plugin, $of_controller=controller, $of_config=config);
return p;
}

View file

@ -106,7 +106,7 @@ global packetfilter_plugin = Plugin(
function create_packetfilter() : PluginState
{
local p: PluginState = [$plugin=packetfilter_plugin];
local p = PluginState($plugin=packetfilter_plugin);
return p;
}

View file

@ -40,7 +40,7 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(NetControl::SHUNT, [$columns=ShuntInfo, $ev=log_netcontrol_shunt, $path="netcontrol_shunt", $policy=log_policy_shunt]);
Log::create_stream(NetControl::SHUNT, Log::Stream($columns=ShuntInfo, $ev=log_netcontrol_shunt, $path="netcontrol_shunt", $policy=log_policy_shunt));
}
function shunt_flow(f: flow_id, t: interval, location: string &default="") : string
@ -51,8 +51,8 @@ function shunt_flow(f: flow_id, t: interval, location: string &default="") : str
$dst_h=addr_to_subnet(f$dst_h),
$dst_p=f$dst_p
);
local e: Entity = [$ty=FLOW, $flow=flow];
local r: Rule = [$ty=DROP, $target=MONITOR, $entity=e, $expire=t, $location=location];
local e = Entity($ty=FLOW, $flow=flow);
local r = Rule($ty=DROP, $target=MONITOR, $entity=e, $expire=t, $location=location);
local id = add_rule(r);

View file

@ -102,9 +102,9 @@ event zeek_init()
# This replaces the standard non-pretty-printing filter.
Log::add_filter(Notice::ALARM_LOG,
[$name="alarm-mail", $writer=Log::WRITER_NONE,
$interv=Log::default_mail_alarms_interval,
$postprocessor=pp_postprocessor]);
Log::Filter($name="alarm-mail", $writer=Log::WRITER_NONE,
$interv=Log::default_mail_alarms_interval,
$postprocessor=pp_postprocessor));
}
hook notice(n: Notice::Info) &priority=-5

View file

@ -381,16 +381,16 @@ function log_mailing_postprocessor(info: Log::RotationInfo): bool
event zeek_init() &priority=5
{
Log::create_stream(Notice::LOG, [$columns=Info, $ev=log_notice, $path="notice", $policy=log_policy]);
Log::create_stream(Notice::LOG, Log::Stream($columns=Info, $ev=log_notice, $path="notice", $policy=log_policy));
Log::create_stream(Notice::ALARM_LOG, [$columns=Notice::Info, $path="notice_alarm", $policy=log_policy_alarm]);
Log::create_stream(Notice::ALARM_LOG, Log::Stream($columns=Notice::Info, $path="notice_alarm", $policy=log_policy_alarm));
# If Zeek is configured for mailing notices, set up mailing for alarms.
# Make sure that this alarm log is also output as text so that it can
# be packaged up and emailed later.
if ( ! reading_traces() && mail_dest != "" )
Log::add_filter(Notice::ALARM_LOG,
[$name="alarm-mail", $path="alarm-mail", $writer=Log::WRITER_ASCII,
$interv=24hrs, $postprocessor=log_mailing_postprocessor]);
Log::Filter($name="alarm-mail", $path="alarm-mail", $writer=Log::WRITER_ASCII,
$interv=24hrs, $postprocessor=log_mailing_postprocessor));
}
function email_headers(subject_desc: string, dest: string): string

View file

@ -52,7 +52,7 @@ export {
## The peer that originated this weird. This is helpful in
## cluster deployments if a particular cluster node is having
## trouble to help identify which node is having trouble.
peer: string &log &optional &default=peer_description;
peer: string &log &default=peer_description;
## The source of the weird. When reported by an analyzer, this
## should be the name of the analyzer.
@ -318,7 +318,7 @@ const notice_actions = {
event zeek_init() &priority=5
{
Log::create_stream(Weird::LOG, [$columns=Info, $ev=log_weird, $path="weird", $policy=log_policy]);
Log::create_stream(Weird::LOG, Log::Stream($columns=Info, $ev=log_weird, $path="weird", $policy=log_policy));
}
function flow_id_string(src: addr, dst: addr): string

View file

@ -50,12 +50,12 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(OpenFlow::LOG, [$columns=Info, $ev=log_openflow, $path="openflow", $policy=log_policy]);
Log::create_stream(OpenFlow::LOG, Log::Stream($columns=Info, $ev=log_openflow, $path="openflow", $policy=log_policy));
}
function log_flow_mod(state: ControllerState, match: ofp_match, flow_mod: OpenFlow::ofp_flow_mod): bool
{
Log::write(OpenFlow::LOG, [$ts=network_time(), $dpid=state$log_dpid, $match=match, $flow_mod=flow_mod]);
Log::write(LOG, Info($ts=network_time(), $dpid=state$log_dpid, $match=match, $flow_mod=flow_mod));
if ( state$log_success_event )
event OpenFlow::flow_mod_success(state$_name, match, flow_mod);

View file

@ -175,7 +175,7 @@ event filter_change_tracking()
event zeek_init() &priority=5
{
Log::create_stream(PacketFilter::LOG, [$columns=Info, $path="packet_filter", $policy=log_policy]);
Log::create_stream(PacketFilter::LOG, Log::Stream($columns=Info, $path="packet_filter", $policy=log_policy));
# Preverify the capture and restrict filters to give more granular failure messages.
for ( id, cf in capture_filters )
@ -303,9 +303,9 @@ function install(): bool
local error_string : string;
if ( state == Pcap::fatal )
{
NOTICE([$note=Compile_Failure,
$msg=fmt("Compiling packet filter failed"),
$sub=tmp_filter]);
NOTICE(Notice::Info($note=Compile_Failure,
$msg=fmt("Compiling packet filter failed"),
$sub=tmp_filter));
error_string = fmt("Bad pcap filter '%s': %s", tmp_filter,
Pcap::get_filter_state_string(DefaultPcapFilter));
@ -326,8 +326,8 @@ function install(): bool
}
local diff = current_time()-ts;
if ( diff > max_filter_compile_time )
NOTICE([$note=Too_Long_To_Compile_Filter,
$msg=fmt("A BPF filter is taking longer than %0.1f seconds to compile", diff)]);
NOTICE(Notice::Info($note=Too_Long_To_Compile_Filter,
$msg=fmt("A BPF filter is taking longer than %0.1f seconds to compile", diff)));
# Set it to the current filter if it passed precompiling
current_filter = tmp_filter;
@ -350,9 +350,9 @@ function install(): bool
info$success = F;
info$failure_reason = Pcap::get_filter_state_string(DefaultPcapFilter);
NOTICE([$note=Install_Failure,
$msg=fmt("Installing packet filter failed"),
$sub=current_filter]);
NOTICE(Notice::Info($note=Install_Failure,
$msg=fmt("Installing packet filter failed"),
$sub=current_filter));
}
if ( reading_live_traffic() || reading_traces() )

View file

@ -24,10 +24,10 @@ event net_stats_update(last_stat: NetStats)
{
local new_recvd = ns$pkts_recvd - last_stat$pkts_recvd;
local new_link = ns$pkts_link - last_stat$pkts_link;
NOTICE([$note=Dropped_Packets,
$msg=fmt("%d packets dropped after filtering, %d received%s",
new_dropped, new_recvd + new_dropped,
new_link != 0 ? fmt(", %d on link", new_link) : "")]);
NOTICE(Notice::Info($note=Dropped_Packets,
$msg=fmt("%d packets dropped after filtering, %d received%s",
new_dropped, new_recvd + new_dropped,
new_link != 0 ? fmt(", %d on link", new_link) : "")));
}
schedule stats_collection_interval { net_stats_update(ns) };

View file

@ -40,20 +40,20 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(Reporter::LOG, [$columns=Info, $path="reporter", $policy=log_policy]);
Log::create_stream(Reporter::LOG, Log::Stream($columns=Info, $path="reporter", $policy=log_policy));
}
event reporter_info(t: time, msg: string, location: string) &priority=-5
{
Log::write(Reporter::LOG, [$ts=t, $level=INFO, $message=msg, $location=location]);
Log::write(Reporter::LOG, Info($ts=t, $level=INFO, $message=msg, $location=location));
}
event reporter_warning(t: time, msg: string, location: string) &priority=-5
{
Log::write(Reporter::LOG, [$ts=t, $level=WARNING, $message=msg, $location=location]);
Log::write(Reporter::LOG, Info($ts=t, $level=WARNING, $message=msg, $location=location));
}
event reporter_error(t: time, msg: string, location: string) &priority=-5
{
Log::write(Reporter::LOG, [$ts=t, $level=ERROR, $message=msg, $location=location]);
Log::write(Reporter::LOG, Info($ts=t, $level=ERROR, $message=msg, $location=location));
}

View file

@ -145,14 +145,14 @@ global did_sig_log: set[string] &read_expire = 1 hr;
event zeek_init() &priority=5
{
Log::create_stream(Signatures::LOG, [$columns=Info, $ev=log_signature, $path="signatures", $policy=log_policy]);
Log::create_stream(Signatures::LOG, Log::Stream($columns=Info, $ev=log_signature, $path="signatures", $policy=log_policy));
}
event sig_summary(orig: addr, id: string, msg: string)
{
NOTICE([$note=Signature_Summary, $src=orig,
$msg=fmt("%s: %s", orig, msg),
$n=count_per_orig[orig,id] ]);
NOTICE(Notice::Info($note=Signature_Summary, $src=orig,
$msg=fmt("%s: %s", orig, msg),
$n=count_per_orig[orig,id]));
}
event signature_match(state: signature_state, msg: string, data: string)
@ -189,16 +189,16 @@ event signature_match(state: signature_state, msg: string, data: string)
if ( action != SIG_QUIET && action != SIG_COUNT_PER_RESP )
{
local info: Info = [$ts=network_time(),
$note=Sensitive_Signature,
$uid=state$conn$uid,
$src_addr=src_addr,
$src_port=src_port,
$dst_addr=dst_addr,
$dst_port=dst_port,
$event_msg=fmt("%s: %s", src_addr, msg),
$sig_id=sig_id,
$sub_msg=data];
local info = Info($ts=network_time(),
$note=Sensitive_Signature,
$uid=state$conn$uid,
$src_addr=src_addr,
$src_port=src_port,
$dst_addr=dst_addr,
$dst_port=dst_port,
$event_msg=fmt("%s: %s", src_addr, msg),
$sig_id=sig_id,
$sub_msg=data);
Log::write(Signatures::LOG, info);
}
@ -211,12 +211,12 @@ event signature_match(state: signature_state, msg: string, data: string)
local dst = state$conn$id$resp_h;
if ( ++count_per_resp[dst,sig_id] in count_thresholds )
{
NOTICE([$note=Count_Signature, $conn=state$conn,
$msg=msg,
$n=count_per_resp[dst,sig_id],
$sub=fmt("%d matches of signature %s on host %s",
count_per_resp[dst,sig_id],
sig_id, dst)]);
NOTICE(Notice::Info($note=Count_Signature, $conn=state$conn,
$msg=msg,
$n=count_per_resp[dst,sig_id],
$sub=fmt("%d matches of signature %s on host %s",
count_per_resp[dst,sig_id],
sig_id, dst)));
}
}
@ -241,10 +241,10 @@ event signature_match(state: signature_state, msg: string, data: string)
}
if ( notice )
NOTICE([$note=Sensitive_Signature,
$conn=state$conn, $src=src_addr,
$dst=dst_addr, $msg=fmt("%s: %s", src_addr, msg),
$sub=data]);
NOTICE(Notice::Info($note=Sensitive_Signature,
$conn=state$conn, $src=src_addr,
$dst=dst_addr, $msg=fmt("%s: %s", src_addr, msg),
$sub=data));
if ( action == SIG_FILE_BUT_NO_SCAN || action == SIG_SUMMARY )
return;
@ -273,12 +273,12 @@ event signature_match(state: signature_state, msg: string, data: string)
orig, sig_id, hcount);
Log::write(Signatures::LOG,
[$ts=network_time(), $note=Multiple_Sig_Responders,
$src_addr=orig, $sig_id=sig_id, $event_msg=msg,
$host_count=hcount, $sub_msg=horz_scan_msg]);
Info($ts=network_time(), $note=Multiple_Sig_Responders,
$src_addr=orig, $sig_id=sig_id, $event_msg=msg,
$host_count=hcount, $sub_msg=horz_scan_msg));
NOTICE([$note=Multiple_Sig_Responders, $src=orig,
$msg=msg, $n=hcount, $sub=horz_scan_msg]);
NOTICE(Notice::Info($note=Multiple_Sig_Responders, $src=orig,
$msg=msg, $n=hcount, $sub=horz_scan_msg));
last_hthresh[orig] = hcount;
}
@ -290,16 +290,16 @@ event signature_match(state: signature_state, msg: string, data: string)
orig, vcount, resp);
Log::write(Signatures::LOG,
[$ts=network_time(),
$note=Multiple_Signatures,
$src_addr=orig,
$dst_addr=resp, $sig_id=sig_id, $sig_count=vcount,
$event_msg=fmt("%s different signatures triggered", vcount),
$sub_msg=vert_scan_msg]);
Info($ts=network_time(),
$note=Multiple_Signatures,
$src_addr=orig,
$dst_addr=resp, $sig_id=sig_id, $sig_count=vcount,
$event_msg=fmt("%s different signatures triggered", vcount),
$sub_msg=vert_scan_msg));
NOTICE([$note=Multiple_Signatures, $src=orig, $dst=resp,
$msg=fmt("%s different signatures triggered", vcount),
$n=vcount, $sub=vert_scan_msg]);
NOTICE(Notice::Info($note=Multiple_Signatures, $src=orig, $dst=resp,
$msg=fmt("%s different signatures triggered", vcount),
$n=vcount, $sub=vert_scan_msg));
last_vthresh[orig] = vcount;
}

View file

@ -126,7 +126,7 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(Software::LOG, [$columns=Info, $ev=log_software, $path="software", $policy=log_policy]);
Log::create_stream(Software::LOG, Log::Stream($columns=Info, $ev=log_software, $path="software", $policy=log_policy));
}
type Description: record {
@ -163,7 +163,7 @@ function parse(unparsed_version: string): Description
else
v = Version($major=extract_count(vs));
return [$version=v, $unparsed_version=unparsed_version, $name=software_name];
return Description($version=v, $unparsed_version=unparsed_version, $name=software_name);
}
}
else
@ -236,7 +236,7 @@ function parse(unparsed_version: string): Description
}
}
return [$version=v, $unparsed_version=unparsed_version, $name=alternate_names[software_name]];
return Description($version=v, $unparsed_version=unparsed_version, $name=alternate_names[software_name]);
}
global parse_cache: table[string] of Description &read_expire=65secs;
@ -269,13 +269,13 @@ function parse_mozilla(unparsed_version: string): Description
{
software_name = "MSIE";
if ( /Trident\/4\.0/ in unparsed_version )
v = [$major=8,$minor=0];
v = Version($major=8,$minor=0);
else if ( /Trident\/5\.0/ in unparsed_version )
v = [$major=9,$minor=0];
v = Version($major=9,$minor=0);
else if ( /Trident\/6\.0/ in unparsed_version )
v = [$major=10,$minor=0];
v = Version($major=10,$minor=0);
else if ( /Trident\/7\.0/ in unparsed_version )
v = [$major=11,$minor=0];
v = Version($major=11,$minor=0);
else
{
parts = split_string_all(unparsed_version, /MSIE [0-9]{1,2}\.*[0-9]*b?[0-9]*/);
@ -373,7 +373,7 @@ function parse_mozilla(unparsed_version: string): Description
v = parse(parts[1])$version;
}
return [$version=v, $unparsed_version=unparsed_version, $name=software_name];
return Description($version=v, $unparsed_version=unparsed_version, $name=software_name);
}

View file

@ -8,8 +8,8 @@ export {
event max_file_depth_exceeded(f: fa_file, args: Files::AnalyzerArgs, limit: count)
{
NOTICE([
$note=Spicy::Spicy_Max_File_Depth_Exceeded,
$msg=fmt("Maximum file depth exceeded for file %s", f$id)
]);
NOTICE(Notice::Info(
$note=Spicy::Spicy_Max_File_Depth_Exceeded,
$msg=fmt("Maximum file depth exceeded for file %s", f$id)
));
}

View file

@ -81,30 +81,46 @@ export {
function open_backend(btype: Storage::Backend, options: Storage::BackendOptions,
key_type: any, val_type: any): Storage::OperationResult
{
return Storage::Async::__open_backend(btype, options, key_type, val_type);
if ( options$forced_sync )
return Storage::Sync::__open_backend(btype, options, key_type, val_type);
else
return Storage::Async::__open_backend(btype, options, key_type, val_type);
}
function close_backend(backend: opaque of Storage::BackendHandle)
: Storage::OperationResult
{
return Storage::Async::__close_backend(backend);
if ( Storage::is_forced_sync(backend) )
return Storage::Sync::__close_backend(backend);
else
return Storage::Async::__close_backend(backend);
}
function put(backend: opaque of Storage::BackendHandle, args: Storage::PutArgs)
: Storage::OperationResult
{
return Storage::Async::__put(backend, args$key, args$value, args$overwrite,
args$expire_time);
if ( Storage::is_forced_sync(backend) )
return Storage::Sync::__put(backend, args$key, args$value, args$overwrite,
args$expire_time);
else
return Storage::Async::__put(backend, args$key, args$value, args$overwrite,
args$expire_time);
}
function get(backend: opaque of Storage::BackendHandle, key: any)
: Storage::OperationResult
{
return Storage::Async::__get(backend, key);
if ( Storage::is_forced_sync(backend) )
return Storage::Sync::__get(backend, key);
else
return Storage::Async::__get(backend, key);
}
function erase(backend: opaque of Storage::BackendHandle, key: any)
: Storage::OperationResult
{
return Storage::Async::__erase(backend, key);
if ( Storage::is_forced_sync(backend) )
return Storage::Sync::__erase(backend, key);
else
return Storage::Async::__erase(backend, key);
}

View file

@ -3,6 +3,9 @@
module Storage;
export {
# Default value for the BackendOptions::forced_sync field.
const default_forced_sync: bool = F &redef;
## Base record for backend options that can be passed to
## :zeek:see:`Storage::Async::open_backend` and
## :zeek:see:`Storage::Sync::open_backend`. Backend plugins can redef this record
@ -10,6 +13,11 @@ export {
type BackendOptions: record {
## The serializer used for converting Zeek data.
serializer: Storage::Serializer &default=Storage::STORAGE_SERIALIZER_JSON;
## Sets the backend into forced-synchronous mode. All operations will run
## in synchronous mode, even if the async functions are called. This
## should generally only be set to ``T`` during testing.
forced_sync : bool &default=Storage::default_forced_sync;
};
## Record for passing arguments to :zeek:see:`Storage::Async::put` and
@ -29,4 +37,7 @@ export {
## backend.
expire_time: interval &default=0sec;
};
# The histogram buckets to use for operation latency metrics, in seconds.
const latency_metric_bounds: vector of double = { 0.001, 0.01, 0.1, 1.0, } &redef;
}

View file

@ -312,7 +312,7 @@ event zeek_init() &priority=100000
function init_resultval(r: Reducer): ResultVal
{
local rv: ResultVal = [$begin=network_time(), $end=network_time()];
local rv = ResultVal($begin=network_time(), $end=network_time());
hook init_resultval_hook(r, rv);
return rv;
}

View file

@ -54,7 +54,7 @@ hook register_observe_plugins()
if ( r$num_last_elements > 0 )
{
if ( ! rv?$last_elements )
rv$last_elements = Queue::init([$max_len=r$num_last_elements]);
rv$last_elements = Queue::init(Queue::Settings($max_len=r$num_last_elements));
Queue::put(rv$last_elements, obs);
}
});

View file

@ -245,16 +245,6 @@ export {
label_values: labels_vector,
measurement: double): bool;
## Interval at which the :zeek:see:`Telemetry::sync` hook is invoked.
##
## By default, the hook is invoked on demand, setting this option to
## a positive interval allows to invoke it regularly, too. Regular
## invocations are relative to Zeek's network time.
##
## Note that on-demand hook invocation will happen even if this
## is set.
option sync_interval = 0sec &deprecated="Remove in 8.1. If you require regular sync invocation, do so explicitly in a scheduled event.";
## Collect all counter and gauge metrics matching the given *name* and *prefix*.
##
## For histogram metrics, use the :zeek:see:`Telemetry::collect_histogram_metrics`.
@ -296,12 +286,12 @@ function register_counter_family(opts: MetricOpts): CounterFamily
}
# Fallback Counter returned when there are issues with the labels.
global error_counter_cf = register_counter_family([
global error_counter_cf = register_counter_family(MetricOpts(
$prefix="zeek",
$name="telemetry_counter_usage_error",
$unit="",
$help_text="This counter is returned when label usage for counters is wrong. Check reporter.log if non-zero."
]);
));
function counter_with(cf: CounterFamily, label_values: labels_vector): Counter
{
@ -355,12 +345,12 @@ function register_gauge_family(opts: MetricOpts): GaugeFamily
}
# Fallback Gauge returned when there are issues with the label usage.
global error_gauge_cf = register_gauge_family([
global error_gauge_cf = register_gauge_family(MetricOpts(
$prefix="zeek",
$name="telemetry_gauge_usage_error",
$unit="",
$help_text="This gauge is returned when label usage for gauges is wrong. Check reporter.log if non-zero."
]);
));
function gauge_with(gf: GaugeFamily, label_values: labels_vector): Gauge
{
@ -424,13 +414,13 @@ function register_histogram_family(opts: MetricOpts): HistogramFamily
}
# Fallback Histogram when there are issues with the labels.
global error_histogram_hf = register_histogram_family([
global error_histogram_hf = register_histogram_family(MetricOpts(
$prefix="zeek",
$name="telemetry_histogram_usage_error",
$unit="",
$help_text="This histogram is returned when label usage for histograms is wrong. Check reporter.log if non-zero.",
$bounds=vector(1.0)
]);
));
function histogram_with(hf: HistogramFamily, label_values: labels_vector): Histogram
{
@ -465,31 +455,18 @@ function collect_histogram_metrics(prefix: string, name: string): vector of Hist
return Telemetry::__collect_histogram_metrics(prefix, name);
}
event run_sync_hook()
{
hook Telemetry::sync();
@pragma push ignore-deprecations
schedule sync_interval { run_sync_hook() };
@pragma pop ignore-deprecations
}
# Expose the Zeek version as Prometheus style info metric
global version_gauge_family = Telemetry::register_gauge_family([
global version_gauge_family = Telemetry::register_gauge_family(Telemetry::MetricOpts(
$prefix="zeek",
$name="version_info",
$unit="",
$help_text="The Zeek version",
$label_names=vector("version_number", "major", "minor", "patch", "commit",
"beta", "debug","version_string")
]);
));
event zeek_init()
{
@pragma push ignore-deprecations
if ( sync_interval > 0sec )
schedule sync_interval { run_sync_hook() };
@pragma pop ignore-deprecations
local v = Version::info;
local labels = vector(cat(v$version_number),
cat(v$major), cat(v$minor), cat (v$patch),

View file

@ -15,6 +15,13 @@ export {
## HTTP. The default value means Zeek won't expose the port.
const metrics_port = 0/unknown &redef;
## Every metric automatically receives a label with the following name
## and the metrics_endpoint_name as value to identify the originating
## cluster node.
## The label was previously hard-code as "endpoint", and that's why
## the variable is called the way it is, but "node" is the better label.
const metrics_endpoint_label = "node" &redef;
## ID for the metrics exporter. This is used as the 'endpoint' label
## value when exporting data to Prometheus. In a cluster setup, this
## defaults to the name of the node in the cluster configuration.

View file

@ -92,7 +92,7 @@ export {
event zeek_init() &priority=5
{
Log::create_stream(Tunnel::LOG, [$columns=Info, $path="tunnel", $policy=log_policy]);
Log::create_stream(Tunnel::LOG, Log::Stream($columns=Info, $path="tunnel", $policy=log_policy));
}
function register_all(ecv: EncapsulatingConnVector)

Some files were not shown because too many files have changed in this diff Show more