Commit graph

15378 commits

Author SHA1 Message Date
Christian Kreibich
9f3dfbdb13 Fix typo in update-timing target for external testsuites
Also includes whitespace tweaks for consistency.
2022-06-28 13:20:03 -07:00
Tim Wojtulewicz
86f874b31b Merge remote-tracking branch 'origin/topic/timw/bump-broker'
* origin/topic/timw/bump-broker:
  Update broker submodule [nomail]
2022-06-28 09:25:19 -07:00
Tim Wojtulewicz
342354343c Update broker submodule [nomail] 2022-06-27 15:56:39 -07:00
Tim Wojtulewicz
9e953f50cb Merge remote-tracking branch 'origin/topic/vern/remove-deprecated-closures'
* origin/topic/vern/remove-deprecated-closures:
  removed deprecated capture-by-reference closures
2022-06-27 13:04:57 -07:00
Tim Wojtulewicz
11bcb26ab5 Merge remote-tracking branch 'origin/topic/timw/2183-checksum-variables'
* origin/topic/timw/2183-checksum-variables:
  GH-2183: Rework Packet checksummed variable naming
2022-06-27 11:43:37 -07:00
Tim Wojtulewicz
1b5741d905 GH-2183: Rework Packet checksummed variable naming 2022-06-27 11:07:31 -07:00
Tim Wojtulewicz
1af3039ca3 Merge remote-tracking branch 'origin/topic/timw/modernize-cpp-headers'
* origin/topic/timw/modernize-cpp-headers:
  Code modernization: Convert from deprecated C standard library headers
  Bump cmake submodule for run-clang-tidy fix [skip ci] [nomail]
2022-06-27 10:37:25 -07:00
Tim Wojtulewicz
7c4fd382d9 Code modernization: Convert from deprecated C standard library headers 2022-06-27 09:47:31 -07:00
Tim Wojtulewicz
823d80494b Bump cmake submodule for run-clang-tidy fix [skip ci] [nomail] 2022-06-27 09:27:50 -07:00
Tim Wojtulewicz
c5b435f2cc Merge remote-tracking branch 'origin/topic/timw/2021-signal-handler-deadlock'
* origin/topic/timw/2021-signal-handler-deadlock:
  Mark bools in BasicThread as atomic to avoid data races
  Avoid calling DBG_LOG during signal handling
  Fixes for iosource::Manager for deadlocks during shutdown
2022-06-27 09:27:07 -07:00
Tim Wojtulewicz
268ebbaffd Mark bools in BasicThread as atomic to avoid data races 2022-06-26 20:54:04 +00:00
Tim Wojtulewicz
f50777cdab Avoid calling DBG_LOG during signal handling 2022-06-26 20:54:04 +00:00
Tim Wojtulewicz
d06387d4d3 Fixes for iosource::Manager for deadlocks during shutdown 2022-06-26 20:54:04 +00:00
Tim Wojtulewicz
6acb626ece Add initial NEWS block for 5.1 2022-06-25 08:23:16 -07:00
Tim Wojtulewicz
bf7b6e5ed0 Merge remote-tracking branch 'origin/topic/timw/bump-broker'
* origin/topic/timw/bump-broker:
  Bump broker submodule to pick up two fixes
2022-06-24 14:18:54 -07:00
Tim Wojtulewicz
a6dd3af831 Bump broker submodule to pick up two fixes
- https://github.com/zeek/broker/pull/244
- https://github.com/zeek/broker/pull/245
2022-06-24 14:18:23 -07:00
Johanna Amann
e14eddeb97 SSL Analyzer: track connection direction by messages
This PR changes the way in which the SSL analyzer tracks the direction
of connections. So far, the SSL analyzer assumed that the originator of
a connection would send the client hello (and other associated
client-side events), and that the responder would be the SSL servers.

In some circumstances this is not true, and the initiator of a
connection is the server, with the responder being the client. So far
this confused some of the internal statekeeping logic and could lead to
mis-parsing of extensions.

This reversal of roles can happen in DTLS, if a connection uses STUN -
and potentially in some StartTLS protocols.

This PR tracks the direction of a TLS connection using the hello
request, client hello and server hello handshake messages. Furthermore,
it changes the SSL events from providing is_orig to providing is_client,
where is_client is true for the client_side of a connection. Since the
argument positioning in the event has not changed, old scripts will
continue to work seamlessly - the new semantics are what everyone
writing SSL scripts will have expected in any case.

There is a new event that is raised when a connection is flipped. A
weird is raised if a flip happens repeatedly.

Addresses GH-2198.
2022-06-24 18:35:44 +01:00
Tim Wojtulewicz
5162732598 Add NEWS entry for 5.0 management changes [nomail] [skip ci] 2022-06-24 09:09:31 -07:00
Tim Wojtulewicz
693a0c71c4 Merge remote-tracking branch 'origin/topic/johanna/bf-news'
* origin/topic/johanna/bf-news:
  News entry about Bloom Filter changes in 5.0.
2022-06-24 09:08:19 -07:00
Johanna Amann
ce410b7ed5 News entry about Bloom Filter changes in 5.0. 2022-06-24 14:52:54 +02:00
zeek-bot
a7aa345c76 Update doc submodule [nomail] [skip ci] 2022-06-24 00:43:53 +00:00
Tim Wojtulewicz
e60c305ac1 Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump Spicy to the latest development version.
2022-06-23 13:04:08 -07:00
Christian Kreibich
3287b8b793 Merge branch 'topic/christian/management-restart'
* topic/christian/management-restart:
  Management framework: bump external cluster testsuite
  Management framework: bump zeek-client
  Management framework: edit pass over docstrings
  Management framework: node restart support
  Management framework: more consistent Supervisor interaction in the agent
  Management framework: log the controller's startup deployment attempt
  Management framework: bugfix for a get_id_value corner case
  Management framework: minor timeout bugfix
  Management framework: make "result" argument plural in multi-result response events
2022-06-23 12:27:19 -07:00
Benjamin Bannier
dd2fe2548b Bump Spicy to the latest development version. 2022-06-23 21:09:00 +02:00
Christian Kreibich
ec25723283 Management framework: bump external cluster testsuite 2022-06-23 00:02:11 -07:00
Christian Kreibich
99cd416552 Management framework: bump zeek-client 2022-06-23 00:02:10 -07:00
Christian Kreibich
3aa0409792 Management framework: edit pass over docstrings
This expands cross-referencing in the doc strings and adds a bit more
explanation.
2022-06-22 23:26:11 -07:00
Christian Kreibich
b9879a50a0 Management framework: node restart support
This adds restart request/response event pairs that restart nodes in the running
Zeek cluster. The implementation is very similar to get_id_value, which also
involves distributing a list of nodes to agents and aggregating the responses.
2022-06-22 23:26:11 -07:00
Christian Kreibich
bd39207772 Management framework: more consistent Supervisor interaction in the agent
This declares our helper functions for sending events to the Supervisor, and
makes them return the created request objects to enable the caller to modify
them. It also adds a helper for restart and status requests, uses the helpers
throughout the module, and makes all handlers more resilient in case Supervisor
events other than the agent's arrive.
2022-06-22 23:26:11 -07:00
Christian Kreibich
d994f33636 Management framework: log the controller's startup deployment attempt
The controller now logs its deployment attempt of a persisted configuration at
startup. This is generally helpful to see recorded, and also explains timeout of
the underlying request in case of failure (which triggers a timeout message).
2022-06-22 23:26:11 -07:00
Christian Kreibich
05447c413f Management framework: bugfix for a get_id_value corner case
For the case of a running cluster with no connected agents, use the
g_instances_known table instead of g_instances. The latter reflects the contents
of the last deployed config, not the live scenario of actually attached agents.
2022-06-22 23:26:06 -07:00
Christian Kreibich
1af9bba76e Management framework: minor timeout bugfix
The timeout result wasn't actually stored in requests timing out in the
agent. (So far that's for deployment requests.) Also log the timing out of any
request state, similar to the controller.
2022-06-22 23:25:15 -07:00
Christian Kreibich
b2f9e29bae Management framework: make "result" argument plural in multi-result response events
No functional change, just a consistency tweak. Since agent and controller send
response events via Broker::publish(), the arguments aren't named and so this
only affects the API definition.
2022-06-22 23:25:15 -07:00
Christian Kreibich
54f2f28047 Merge branch 'topic/christian/management-deploy'
* topic/christian/management-deploy: (21 commits)
  Management framework: bump external cluster testsuite
  Management framework: bump zeek-client
  Management framework: rename set_configuration events to stage_configuration
  Management framework: trigger deployment upon when instances are ready
  Management framework: more resilient node shutdown upon deployment
  Management framework: re-trigger deployment upon controller launch
  Management framework: move most deployment handling to internal function
  Management framework: distinguish internally and externally requested deployments
  Management framework: track instances by their Broker IDs
  Management framework: tweak Supervisor event logging
  Management framework: make helper function a local
  Management framework: rename "log_level" to "level"
  Management framework: add "finish" callback to requests
  Management framework: add a helper for rendering result vectors to a string
  Management framework: agents now skip re-deployment of current config
  Management framework: suppress notify_agent_hello upon Supervisor peering
  Management framework: introduce state machine for configs and persist them
  Management framework: introduce deployment API in controller
  Management framework: rename agent "set_configuration" to "deploy"
  Management framework: consistency fixes to the Result record
  ...
2022-06-22 22:59:53 -07:00
zeek-bot
a7552b6e84 Update doc submodule [nomail] [skip ci] 2022-06-23 00:38:34 +00:00
Christian Kreibich
d0578cf345 Merge branch 'topic/christian/enable-zeekclient'
* topic/christian/enable-zeekclient:
  Provide zeek-client by default
2022-06-22 12:06:12 -07:00
Christian Kreibich
661774eb6e Management framework: bump external cluster testsuite 2022-06-22 11:54:58 -07:00
Christian Kreibich
3c3d0f0c1e Management framework: bump zeek-client 2022-06-22 11:54:58 -07:00
Christian Kreibich
2c1cd1d401 Management framework: rename set_configuration events to stage_configuration
This reflects corresponding renaming of the client's set-config command to
stage-config, to make it more clear what's happening.
2022-06-22 11:54:58 -07:00
Tim Wojtulewicz
0ae485f715 Merge remote-tracking branch 'origin/topic/timw/1991-tunnel-swapping'
* origin/topic/timw/1991-tunnel-swapping:
  GH-1991: Add option to limit the number of tunnel_changed events
2022-06-22 09:40:14 -07:00
Tim Wojtulewicz
a9fd4a60e0 GH-1991: Add option to limit the number of tunnel_changed events 2022-06-22 09:39:42 -07:00
Christian Kreibich
0be74a0aa8 Provide zeek-client by default
The user so far had to configure with --enable-zeek-client to trigger
installation of the client (from auxil/zeek-client). This flips it around to
allow disabling the installation, and removes --enable-zeek-client from the
Docker build in CI, where we've already been using it to allow the cluster
testsuite to run tests with that image.
2022-06-21 18:17:51 -07:00
Christian Kreibich
68558e2874 Management framework: trigger deployment upon when instances are ready
More resilience: when an agent restarts, it checks in with the controller. If
the controller has deployed a config, this check-in may lead to an internal
notify_agents_ready event. At that point, we now trigger a deployment when there
currently isn't already one running. This ensures that any agents not yet
running the current cluster will start to do so, and does nothing when those
agents already run it, since they ignore the request in that case.
2022-06-21 17:22:45 -07:00
Christian Kreibich
a622e28eab Management framework: more resilient node shutdown upon deployment
When agents had to terminate existing Zeek cluster nodes at the beginning of a
new deployment, they so far used their internal state to look up the nodes and
fired off requests to the Supervisor to shut these down. This has a problem:
when an agent restarts unexpectedly, it has no internal state, and when it then
tries to create nodes that already exist, the Supervisor complains with error
messages.

To avoid this, the agent now tears down all Supervised nodes other than agents
and controllers. In order to do so, it first needs to query the Supervisor for
the current node status, which means there are now two such status requests: one
upon deployment, and one during get_nodes requests. In order to disambiguate
these contexts in the SupervisorControl::status_request/response transactions,
we use the finish() callback in the corresponding request state to continue
execution as needed.
2022-06-21 17:22:45 -07:00
Christian Kreibich
1faf1ab8b7 Management framework: re-trigger deployment upon controller launch
A resilience feature: when a booting controller has a previously deployed
configuration (just reloaded from persistent state), it now triggers a
deployment. When agents at this point run something else, this restores the
controller's understanding of what's deployed, and if the agents do still run
this configuration, does nothing since agents ignore deployment of a
configuration they already run.
2022-06-21 17:22:45 -07:00
Christian Kreibich
c4862e7c5e Management framework: move most deployment handling to internal function
The controller now runs most of a config deployment via an internal function,
allowing it to be called from multiple places instead of just the deploy_request
event handler.
2022-06-21 17:22:45 -07:00
Christian Kreibich
3120fbc75e Management framework: distinguish internally and externally requested deployments
The controller's deployment request state now features a bit that indicates
whether the deployment was requested by a client, or triggered internally. This
affects logging and the transmission of deployment response events via Broker,
which are skipped when the deployment is internal.

This is in preparation of resilience features when the controller (re-)boots.
2022-06-21 17:22:45 -07:00
Christian Kreibich
7787d84739 Management framework: track instances by their Broker IDs
This allows us to handle loss of Broker peerings, updating instance state as we
see instances go away. This also tweaks logging slightly to differentiate
between an instance checking in for the first time, and checking in when the
controller already knows it.
2022-06-21 17:22:45 -07:00
Christian Kreibich
633535d8da Management framework: tweak Supervisor event logging
We now log Supervisor event interaction just like we do transmission/receipt of
other Management framework events.
2022-06-21 17:22:45 -07:00
Christian Kreibich
d7e88fc079 Management framework: make helper function a local 2022-06-21 17:22:45 -07:00