Commit graph

18267 commits

Author SHA1 Message Date
Arne Welzel
68bc6111ed Merge remote-tracking branch 'origin/topic/awelzel/fix-listen-websocket-ubsan-port-count-confusion'
* origin/topic/awelzel/fix-listen-websocket-ubsan-port-count-confusion:
  cluster/cluster.bif: Fix CountVal casted to PortVal
2025-04-23 15:55:59 +02:00
Arne Welzel
dc428b2da2 cluster/cluster.bif: Fix CountVal casted to PortVal
Thanks UBSAN!
2025-04-23 15:48:15 +02:00
Arne Welzel
2b7b42e4df Merge remote-tracking branch 'origin/topic/awelzel/no-more-ubuntu-20.04'
* origin/topic/awelzel/no-more-ubuntu-20.04:
  CI: No more Ubuntu 20.04 [skip ci]
2025-04-23 15:08:06 +02:00
Arne Welzel
99f36ce01a CI: No more Ubuntu 20.04 [skip ci]
Ubuntu 20.04's default Python doesn't deal well with the type annotations
used in btest/Files/wstest.py. Given that it's about to be EOL, just remove it.
2025-04-23 15:05:23 +02:00
Arne Welzel
f6fae00122 COPYING-3rdparty: Add some missing submodules [skip ci] 2025-04-23 14:57:51 +02:00
Arne Welzel
3b80630996 Merge remote-tracking branch 'origin/topic/awelzel/cluster-broker-hub-websocket-support'
* origin/topic/awelzel/cluster-broker-hub-websocket-support: (24 commits)
  Add NEWS entry for WebSocket functionality
  btest/cluster: Add broker logging test for sanity
  broker/WebSocketShim: Add tests for endpoint, hubs and subscribers
  broker: Deprecate NodeID(), use SetNodeId()
  cluster/Backend: Do not inline Init()
  cluster: Add Backend::SetNodeId()
  cluster/websocket: Make websocket dispatcher queue size configurable
  cluster/zeromq: Attempt publish during termination
  broker/main: Reference Cluster::publish() for auto_publish() deprecation
  broker/main: Deprecate Broker::listen_websocket()
  cluster/websocket: Remove comment about broker
  btest/cluster/websocket: Add tests using broker
  btest/cluster/websocket: Move ZeroMQ test and use wstest.py
  btest/files: Introduce wstest.py
  cluster/websocket: Special case broker backend for shim usage
  broker: Add WebSocketShim backend
  broker/Manager: Add MakeHub() and ReleaseHub()
  Bump broker submodule
  cluster/Backend: Add ProcessError()
  cluster/Backend: Rename EnqueueLocalEvent() to ProcessLocalEvent()
  ...
2025-04-23 14:29:33 +02:00
Arne Welzel
74f171801c Add NEWS entry for WebSocket functionality 2025-04-23 14:27:43 +02:00
Arne Welzel
f2e60fdaff btest/cluster: Add broker logging test for sanity
Not very related to the PR, but created to help provoke an issue
with the broker changes.
2025-04-23 14:27:43 +02:00
Arne Welzel
7acedd18d0 broker/WebSocketShim: Add tests for endpoint, hubs and subscribers
These are really testing broker functionality, mostly added to ensure
the behavior is as expected by the WebSocketShim functionality.
2025-04-23 14:27:43 +02:00
Arne Welzel
cb243e2d28 broker: Deprecate NodeID(), use SetNodeId() 2025-04-23 14:27:43 +02:00
Arne Welzel
bfb033622f cluster/Backend: Do not inline Init() 2025-04-23 14:27:43 +02:00
Arne Welzel
a90a41a8b5 cluster: Add Backend::SetNodeId() 2025-04-23 14:27:43 +02:00
Arne Welzel
011029addc cluster/websocket: Make websocket dispatcher queue size configurable
Limit the number WebSocket events queued from external clients to
dispatcher instances to produce back pressure to the clients if
Zeek's IO loop is overloaded.
2025-04-23 14:27:43 +02:00
Arne Welzel
6bd624d9b2 cluster/zeromq: Attempt publish during termination
Explicitly notify the internal thread about the shutdown via the
inproc socket pair. This ensures that the internal thread processes
all previous messages on the inproc socket before terminating.

This fixes the scenario where a backend is created, a few messages published
and then immediately terminated as can be done with WebSocket clients.
Previously, some of the messages published might have still been in the
inproc socket's queue and were simply discarded.

Adds the same test for Broker and ZeroMQ backends.
2025-04-23 14:27:43 +02:00
Arne Welzel
ab25e5d24b broker/main: Reference Cluster::publish() for auto_publish() deprecation
In hindsight, this is the better thing to do and with Zeek 7.2 we should
be confident enough that it'll work.
2025-04-23 14:27:43 +02:00
Arne Welzel
a7423104e1 broker/main: Deprecate Broker::listen_websocket()
Optimistically deprecate Broker::listen_websocket() and promote
Cluster::listen_websocket() instead.
2025-04-23 14:27:43 +02:00
Arne Welzel
b9569cb06f cluster/websocket: Remove comment about broker 2025-04-23 14:27:43 +02:00
Arne Welzel
0c8f52664d btest/cluster/websocket: Add tests using broker
Add tests to verify Cluster::listen_websocket() with the Broker backend
is functional.
2025-04-23 14:27:43 +02:00
Arne Welzel
3319615c65 btest/cluster/websocket: Move ZeroMQ test and use wstest.py
Adapt the test to be the same as Broker, to have "expected" behavior.
2025-04-23 14:27:43 +02:00
Arne Welzel
1191f6b66d btest/files: Introduce wstest.py
This adds a minimal helper library for reusing some of the code to
test WebSocket client access to Zeek using Python.
2025-04-23 14:27:43 +02:00
Arne Welzel
193350483e cluster/websocket: Special case broker backend for shim usage
When Cluster::backend is configured with CLUSTER_BACKEND_BROKER, switch
WebSocketClients to CLUSTER_BACKEND_BROKER_WEBSOCKET_SHIM instead.

Instead of the special case, we could also add something to Backend
called NewWebSocketBackend(), but if it only affects broker, I think
the special case is okay for now.
2025-04-23 14:27:43 +02:00
Arne Welzel
76c508f001 broker: Add WebSocketShim backend
This adds a cluster backend implementation using broker's hub primitive
to connect WebSocket clients with the local broker endpoint for pub/sub
functionality.
2025-04-23 14:27:43 +02:00
Arne Welzel
591e3400d4 broker/Manager: Add MakeHub() and ReleaseHub()
These are used by WebSocket clients to create broker::hub instances
2025-04-23 14:27:43 +02:00
Arne Welzel
c9d7418a23 Bump broker submodule 2025-04-23 14:27:43 +02:00
Arne Welzel
3d3b7a0759 cluster/Backend: Add ProcessError()
Allow backends to pass errors to a strategy. Locally, these raise
Cluster::Backend::error() events that are logged to the reporter
as errors.
2025-04-23 14:19:08 +02:00
Arne Welzel
fcc0f45c57 cluster/Backend: Rename EnqueueLocalEvent() to ProcessLocalEvent() 2025-04-23 14:19:08 +02:00
Arne Welzel
f8ef5addaa cluster/Backend: Rename HandleRemoteEvent() to ProcessEvent()
...also add Backend::ProcessEvent() for backends to trigger event
processing without needing to use ProcessEventMessage().
2025-04-23 14:19:08 +02:00
Arne Welzel
390a4fc1bb cluster/websocket: Fix websocket_client_added id value 2025-04-23 14:19:08 +02:00
Arne Welzel
6c44bfa3fb broker: Include log event identifier in stderr output 2025-04-23 14:19:08 +02:00
Arne Welzel
ba5dcb1d84 cluster/websocket: Debug output fixes 2025-04-23 14:19:08 +02:00
Robin Sommer
e6700670fb
Bump Spicy. 2025-04-23 12:24:10 +02:00
Tim Wojtulewicz
b8382a126c Update zeek-aux submodule [nomail] 2025-04-22 21:06:43 -07:00
zeek-bot
b42f9b49d3 Update doc submodule [nomail] [skip ci] 2025-04-23 00:14:55 +00:00
Tim Wojtulewicz
b8587c4fa9 Merge remote-tracking branch 'origin/topic/timw/upgrade-cares-to-1.34.5'
* origin/topic/timw/upgrade-cares-to-1.34.5:
  Update c-ares to v1.34.5 and vcpkg to a version that includes it
2025-04-22 08:44:37 -07:00
Christian Kreibich
ed161692dd Merge branch 'topic/christian/gh4318-track-broker-peerings'
* topic/christian/gh4318-track-broker-peerings:
  Use Broker peering directionality when re-peering after backpressure overflows
  Expand Broker APIs to allow tracking directionality of peering establishment
2025-04-21 17:21:03 -07:00
Christian Kreibich
549e678dff Use Broker peering directionality when re-peering after backpressure overflows
This avoids creating pointless connection reattempts to ephemeral TCP
client-side ports, which have been cluttering up the Broker logs since 7.1.
2025-04-21 14:08:42 -07:00
Christian Kreibich
b430d5235c Expand Broker APIs to allow tracking directionality of peering establishment
This provides ways to figure out for a given peer, or a given address/port pair,
whether the local node originally established the peering.
2025-04-21 14:08:42 -07:00
Tim Wojtulewicz
d59f6014b8 Update broker submodule [nomail] 2025-04-18 12:36:28 -07:00
Tim Wojtulewicz
ee64cf0863 Update c-ares to v1.34.5 and vcpkg to a version that includes it 2025-04-18 12:03:16 -07:00
Tim Wojtulewicz
953c039603 Merge remote-tracking branch 'origin/topic/timw/test-cmake-krb5-fixes'
* origin/topic/timw/test-cmake-krb5-fixes:
  Use longer path when including krb5.h to match the cmake lookup
  Update cmake submodule for krb5 fixes [nomail]
2025-04-18 11:36:26 -07:00
Tim Wojtulewicz
90f0fae7cc Use longer path when including krb5.h to match the cmake lookup 2025-04-18 11:35:54 -07:00
Tim Wojtulewicz
ce0a6931df Update cmake submodule for krb5 fixes [nomail] 2025-04-18 11:35:54 -07:00
Tim Wojtulewicz
b808967d1f Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump auxil/spicy to latest development snapshot
2025-04-17 17:48:53 -07:00
Benjamin Bannier
5fea3eced6 Bump auxil/spicy to latest development snapshot 2025-04-17 20:30:10 +02:00
Tim Wojtulewicz
89d22f6133 Merge branch 'topic/timw/clang-tidy-iwyu-for-all-targets'
* topic/timw/clang-tidy-iwyu-for-all-targets:
  Update src/3rdparty submodule to disable clang-format
  Disable linting for files generated by bison
  Make sure clang-tidy and iwyu are added to all targets
2025-04-17 09:29:11 -07:00
Tim Wojtulewicz
94d742d314 Update src/3rdparty submodule to disable clang-format 2025-04-17 09:26:55 -07:00
Tim Wojtulewicz
7111d6a143 Disable linting for files generated by bison
These files will report lots of findings in the code that we have no
control over.
2025-04-17 09:26:55 -07:00
Tim Wojtulewicz
64e2fccc2b Make sure clang-tidy and iwyu are added to all targets 2025-04-17 09:26:55 -07:00
Tim Wojtulewicz
ce7ef3ce6a Merge remote-tracking branch 'origin/topic/timw/include-zeekjs-in-docs-by-default'
* origin/topic/timw/include-zeekjs-in-docs-by-default:
  Add libnode-dev to docs github runner, update docs to include ZeekJS
2025-04-17 08:59:41 -07:00
Tim Wojtulewicz
586a4fc4c5 Add libnode-dev to docs github runner, update docs to include ZeekJS 2025-04-17 08:58:54 -07:00