Commit graph

3906 commits

Author SHA1 Message Date
Tim Wojtulewicz
509718b51c GH-2229: Fix some typos in weak-keys.zeek 2022-06-30 15:12:10 -07:00
Tim Wojtulewicz
fb16ce3711 Remove other general deprecations 2022-06-30 19:17:13 +00:00
Tim Wojtulewicz
6130d32440 Remove some deprecated ocsp/ssl base scripts 2022-06-30 19:17:08 +00:00
Tim Wojtulewicz
644ed5d314 Remove deprecated protocol_confirmation/violation events and methods 2022-06-30 19:11:57 +00:00
Tim Wojtulewicz
70e63d4749 Remove deprecated MemoryAllocation() methods and related code 2022-06-30 18:56:52 +00:00
Christian Kreibich
b3de9a0faf Merge branch 'topic/christian/external-testsuite-tweaks'
* topic/christian/external-testsuite-tweaks:
  Add helpers for syncing commit files with external testsuites
  Fix typo in update-timing target for external testsuites
2022-06-30 09:56:46 -07:00
Christian Kreibich
bf9b1ebbbe Add helpers for syncing commit files with external testsuites
This provides "make sync-repos" to check out all locally available testsuites at
the commits indicated in their commit files, and "make sync-commits" to update
the commit files to the HEADs of the local testsuite repos.

Also adds the commit -> repo sync for the Makefile init target so initialization
always lands on the right version, and removes the corresponding explicit
checkout from the CI repo setup.
2022-06-28 13:20:14 -07:00
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
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
7c4fd382d9 Code modernization: Convert from deprecated C standard library headers 2022-06-27 09:47:31 -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
Christian Kreibich
ec25723283 Management framework: bump external cluster testsuite 2022-06-23 00:02:11 -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
Christian Kreibich
661774eb6e Management framework: bump external cluster testsuite 2022-06-22 11:54:58 -07:00
Christian Kreibich
4deacefa4c Merge branch 'topic/christian/management-config-validation'
* topic/christian/management-config-validation:
  Management framework: bump external cluster testsuite
  Management framework: bump zeek-client
  Management framework: add config validation
  Management framework: improvements to port auto-enumeration
  Management framework: control output-to-console in Supervisor
  Management framework: handle no-instances corner case in set-config correctly
2022-06-21 16:59:32 -07:00
Christian Kreibich
09e412c941 Management framework: bump external cluster testsuite 2022-06-19 01:20:22 -07:00
Vern Paxson
5a0a88526e removed deprecated capture-by-reference closures 2022-06-17 15:55:43 -07:00
Tim Wojtulewicz
e7a7b2923b Merge remote-tracking branch 'origin/topic/vern/history-tweak'
* origin/topic/vern/history-tweak:
  tie to revised private testing repo
  flip connections that begin with SYN-ACKs if subsequent acks or data seen
2022-06-16 15:57:44 -07:00
Vern Paxson
a94afdec47 tie to revised private testing repo 2022-06-16 14:33:11 -07:00
Christian Kreibich
e7f60d4128 Merge branch 'topic/christian/management-schedule-archiver'
* topic/christian/management-schedule-archiver:
  Management framework: bump external cluster testsuite
  Management framework: make agents support zeek-archiver invocations
  Management framework: fix module naming typo
2022-06-16 11:12:07 -07:00
Vern Paxson
847963e94d flip connections that begin with SYN-ACKs if subsequent acks or data seen 2022-06-15 14:01:32 -07:00
Christian Kreibich
e92c787987 Management framework: bump external cluster testsuite 2022-06-14 12:32:49 -07:00
Christian Kreibich
216aaa5774 Merge branch 'topic/christian/management-default-listen-interfaces'
* topic/christian/management-default-listen-interfaces:
  Management framework: bump external cluster testsuite
  Management framework: switch default network visibilities
2022-06-14 12:03:08 -07:00
Christian Kreibich
5a5c702967 Management framework: bump external cluster testsuite 2022-06-10 21:56:25 -07:00
Christian Kreibich
763b0c8d10 Merge branch 'topic/christian/management-auto-assign-ports'
* topic/christian/management-auto-assign-ports:
  Management framework: bump zeek-client to pull in relaxed port handling
  Management framework: bump external cluster testsuite
  Management framework: also use send_set_configuration_response_error elsewhere
  Management framework: minor log formatting tweak, for consistency
  Management framework: support auto-assignment of ports in cluster nodes
2022-06-08 13:44:29 -07:00
Christian Kreibich
c0a4bc3ade Management framework: bump external cluster testsuite 2022-06-08 13:29:25 -07:00
Vern Paxson
1724ddfebf ZAM test suite updates due to recent changes 2022-06-03 14:58:22 -07:00
Tim Wojtulewicz
48a858f5db Update local-compat test for 5.1 2022-06-03 12:38:20 -07:00
Christian Kreibich
ec4015e28c Management framework: bump external cluster testsuite 2022-06-03 10:38:31 -07:00
Tim Wojtulewicz
9964a46402 Fix hang in DNS analyzer with malformed packet
(cherry picked from commit dfc9f77b68f6d02d059ade322b9c132e32c26872)
2022-06-03 10:32:03 -07:00
Christian Kreibich
08d1f93292 Management framework: bump external cluster testsuite 2022-06-03 02:18:35 -07:00
Christian Kreibich
72acf24f52 Management framework: expand notify_agent_hello event arguments
This swaps the host event argument for the Broker ID. The latter is more useful,
since the sending agent doesn't necessarily know its IP address as visible to
the controller, and the controller can pull up the full Broker context via the
ID.

It also adds an explicit argument to the event to indicate whether the agent
connected to the controller or vice versa. This simplifies the controller's
internal logic.

Also minor tweaks to logging to show Broker IDs.
2022-06-03 02:12:19 -07:00
Christian Kreibich
26692c1249 Make broker.web-socket-events test require the Python websockets package 2022-06-02 13:11:06 -07:00
Christian Kreibich
1cebdd569d Merge branch 'topic/christian/gh-2134-fix-intel-test-races'
* topic/christian/gh-2134-fix-intel-test-races:
  Expand scripts.base.frameworks.intel.cluster-transparency test
  Fix races in scripts.base.frameworks.intel.cluster-transparency-with-proxy test
  Add Intel::send_store_on_node_up boolean to control min_data_store delivery
2022-06-02 12:20:06 -07:00
Robin Sommer
d99f041ac5
Add WebSocket support for exchanging events with external clients.
This exposes Broker's new WebSocket support in Zeek. To enable it,
call `Broker::listen_websocket()`. Zeek will then start listening on
port 9997 for incoming WebSocket connections.

See the Broker documentation for a description of the message format
expected over these WebSocket connections.
2022-06-02 10:31:52 +02:00
Christian Kreibich
984d6c0136 Expand scripts.base.frameworks.intel.cluster-transparency test
This simply expands this test to match the behavior of
cluster-transparency-with-proxy, since the two are so similar. This test does
not seem to need disabling the worker's initial send of the data store.
2022-06-01 22:26:25 -07:00
Christian Kreibich
ed5d60f758 Fix races in scripts.base.frameworks.intel.cluster-transparency-with-proxy test
This test was unstable for two reasons:

- Nothing verified whether the two workers had checked in with the proxy,
meaning that messages between the workers and proxies could get lost. This adds
an extra node_up event that the proxy generates synthetically, with values
recognizable to the manager, once the proxy sees both workers connected. This is
a test-level workaround for what should really be a cluster-is-ready event in
the cluster framework proper.

- More subtle: the Intel framework makes the manager send its current
min_data_store to newly connected workers, which in the case of this tests
introduces a race: since the data store, arriving at the worker, replaces the
existing value, it could actually remove already established items if timing was
right. This would lead to the count in the test reaching 3, assuming that 3
intel items are available, when in reality it was less, causing the
Intel::seen() call to do nothing. We now disable the sending of the data store
upon connect, via the global added in the previous commit.

This also expands the test slightly so that both workers call Intel::seen() for
the items inserted by the other worker. This is added validation for the second
point above, because in the presence of that race one occasionally sees one log
entry make it, and the other fail.
2022-06-01 22:23:07 -07:00
Christian Kreibich
65589c9bcb Merge branch 'topic/christian/management-verify-nodestarts'
* topic/christian/management-verify-nodestarts:
  Management framework: bump external cluster testsuite
  Management framework: bump zeek-client to pull in set-config rendering
  Management framework: enable stdout/stderr reporting
  Management framework: Supervisor extensions for stdout/stderr handling
  Management framework: disambiguate redef field names in agent and controller
  Management framework: move to ResultVec in agent's set_configuration response
  Management framework: tune request timeout granularity and interval
  Management framework: verify node starts when deploying a configuration
  Management framework: a bit of debug-level logging for troubleshooting
2022-05-31 12:59:18 -07:00
Christian Kreibich
c13b367ede Management framework: bump external cluster testsuite 2022-05-31 12:55:21 -07:00
Christian Kreibich
24a495da42 Management framework: Supervisor extensions for stdout/stderr handling
This improves the framework's handling of Zeek node stdout and stderr by
extending the (script-layer) Supervisor functionality.

- The Supervisor _either_ directs Zeek nodes' stdout/stderr to files _or_ lets
you hook into it at the script level. We'd like both: files make sense to allow
inspection outside of the framework, and the framework would benefit from
tapping into the streams e.g. for error context. We now provide the file
redirection functionality in the Supervisor, in addition to the hook
mechanism. The hook mechanism also builds up rolling windows of up to
100 lines (configurable) into stdout/stderr.

- The new Mangement::Supervisor::API::notify_node_exit event notifies
subscribers (agents, really) that a particular node has exited (and is possibly
being restarted by the Supervisor). The event includes the name of the node,
plus its recent stdout/stderr context.
2022-05-31 12:55:21 -07:00
Christian Kreibich
93bed5a261 Merge branch 'topic/christian/node-status-notification'
* topic/christian/node-status-notification:
  Add Supervisor::node_status notification event
2022-05-31 12:53:18 -07:00
Christian Kreibich
14188fc7a7 Add Supervisor::node_status notification event
The Supervisor generates this event every time it receives a status update from
the stem, meaning a node got created or re-created. A corresponding
SupervisorControl::node_status event relays the same information for users
interacting with the Supervisor over Broker.
2022-05-30 21:36:35 -07:00
Tim Wojtulewicz
5ca0bb79c8 Fixes from review, post-rebase 2022-05-26 18:39:01 -07:00
Vern Paxson
9f05fe5bfa code formatting and more btest updates 2022-05-26 18:15:48 -07:00
Vern Paxson
a9f67f52a5 baseline & btest updates 2022-05-26 17:39:47 -07:00
Vern Paxson
a0fc8ca5e4 broader support for AST traversal, including Attr and Attributes objects 2022-05-26 17:38:34 -07:00
Christian Kreibich
415bbe17d6 Merge branch 'topic/christian/management-cluster-dirs'
* topic/christian/management-cluster-dirs:
  Management framework: bump zeek-client to pull in instance serialization fixes
  Management framework: bump external cluster testsuite
  Management framework: update agent-checkin test to reflect recent changes
  Management framework: place each Zeek process in its own working dir
  Management framework: set defaults for log rotation and persistent state
  Management framework: add spool and state directory config settings
  Management framework: establish stdout/stderr files also for cluster nodes
  Management framework: default to having agents check in with the (local) controller
  Management framework: move role variable from logging into framework-wide config
  Management framework: distinguish supervisor/supervisee when loading agent/controller
  Management framework: simplify agent and controller stdout/stderr files
  Management framework: prefix the management logs with "management-"
  Management framework: comment and layouting tweaks, no functional change
  Management framework: rename env var that labels agents/controllers
  Management framework: increase robustness of agent/controller naming
2022-05-26 16:10:14 -07:00
Christian Kreibich
aeb29413a2 Management framework: bump external cluster testsuite 2022-05-26 13:32:08 -07:00
Christian Kreibich
328e663060 Management framework: update agent-checkin test to reflect recent changes
This keeps logs produced locally and without rotation, and adopts the simpler
stdout/sterr file naming.
2022-05-26 12:57:13 -07:00
Christian Kreibich
d1cd409e59 Management framework: set defaults for log rotation and persistent state
This adds management/persistence.zeek to establish common configuration for log
rotation and persistent variable state. Log-writing Zeek processes initially
write locally in their working directory, and rotate into subdirectory
"log-queue" of the spool. Since agent and controller have no logger,
persistence.zeek puts in place compatible configurations for them.

Storage folders for Broker-backed tables and clusterized stores default to
subdirectories of the new Zeek-level state folder.

When setting the ZEEK_MANAGEMENT_TESTING environment variable, persistent state
is kept in the local directory, and log rotation remains disabled.

This also tweaks @loads a bit in favor of simply loading frameworks/management,
which is easier to keep track of.
2022-05-26 12:55:10 -07:00