Commit graph

13262 commits

Author SHA1 Message Date
Christian Kreibich
bef0597ac9 Merge branch 'topic/christian/gh-2152-check-for-websockets-module'
* topic/christian/gh-2152-check-for-websockets-module:
  Make broker.web-socket-events test require the Python websockets package
2022-06-02 13:16:56 -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
Christian Kreibich
74c21618bf Merge branch 'topic/christian/gcc12-memset-warning-fix'
* topic/christian/gcc12-memset-warning-fix:
  Fix a -Wstringop-overflow memset size warning with GCC 12
2022-06-02 12:18:46 -07:00
Tim Wojtulewicz
d3cba26974 Updating submodule(s) [nomail] 2022-06-02 11:49:55 -07:00
Robin Sommer
24c2090ffb
Merge remote-tracking branch 'origin/topic/robin/websocket'
* origin/topic/robin/websocket:
  Add WebSocket support for exchanging events with external clients.
2022-06-02 12:08:31 +02: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
Phil Rzewski
c08fe7c237 Define geo_autonomous_system record type 2022-06-01 18:39:07 -07:00
Christian Kreibich
80f6b1ee5e Fix a -Wstringop-overflow memset size warning with GCC 12 2022-06-01 18:30:24 -07:00
Christian Kreibich
892a3a8452 Add Intel::send_store_on_node_up boolean to control min_data_store delivery
This adds a redefinable const to the internals of the Intel framework, to allow
suppression of the manager sending its current min_data_store when a worker
connects. This feature is desirable for nodes that check in "late" to bring them
up to speed, but during testing it introduces nondeterminism.
2022-06-01 17:45:19 -07:00
Phil Rzewski
7fe5a9cfa2 Add lookup_autonomous_system() BIF that returns AS number and org 2022-06-01 17:44:26 -07:00
Tim Wojtulewicz
4b0e1063ed Merge remote-tracking branch 'origin/topic/timw/update-submodules'
* origin/topic/timw/update-submodules:
  Update auxil/package-manager submodule [nomail]
  Update submodule(s) [nomail]
2022-06-01 11:10:15 -07:00
Tim Wojtulewicz
bee8b2a708 Merge remote-tracking branch 'origin/topic/timw/2136-iosource-shutdown'
* origin/topic/timw/2136-iosource-shutdown:
  GH-2136: Clean up DNS_Mgr before shutting down
2022-06-01 11:08:54 -07:00
Christian Kreibich
e98a194869 Update auxil/package-manager submodule [nomail] 2022-06-01 09:54:49 -07:00
Tim Wojtulewicz
050e94f5c7 Update submodule(s) [nomail] 2022-06-01 09:47:10 -07:00
Tim Wojtulewicz
82576f8de2 GH-2136: Clean up DNS_Mgr before shutting down 2022-06-01 09:22:29 -07:00
Tim Wojtulewicz
38702053bd Merge remote-tracking branch 'origin/topic/timw/c-ares-include-path'
* origin/topic/timw/c-ares-include-path:
  GH-2101: Update cmake submodule to fix c-ares include path problem
2022-06-01 09:20:33 -07:00
Tim Wojtulewicz
8bd8f83a9b GH-2101: Update cmake submodule to fix c-ares include path problem 2022-06-01 09:20:07 -07:00
zeek-bot
9fb7b2c194 Update doc submodule [nomail] [skip ci] 2022-06-01 00:39:59 +00: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
3320e46132 Management framework: bump zeek-client to pull in set-config rendering 2022-05-31 12:55:21 -07:00
Christian Kreibich
f10b94de39 Management framework: enable stdout/stderr reporting
This uses the new frameworks/management/supervisor functionality to maintain
stdout/stderr files, and hooks output context into set_configuration error
results.
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
f74f21767a Management framework: disambiguate redef field names in agent and controller
During Zeekygen's doc generation both the agent's and controller's main.zeek get
loaded. This just happened to not throw errors so far because the redefs either
matched perfectly or used different field names.
2022-05-31 12:55:21 -07:00
Christian Kreibich
49b9f1669c Management framework: move to ResultVec in agent's set_configuration response
We so far reported one result record per agent, which made it hard to report
per-node outcomes for the new configuration. Agents now report one result record
per node they're responsible for.
2022-05-31 12:55:21 -07:00
Christian Kreibich
83c60fd8ac Management framework: tune request timeout granularity and interval
When the controller relays requests to agents, we want agents to time out more
quickly than the corresponding controller requests. This allows agents to
respond with more meaningful errors, while the controller's timeout acts mostly
as a last resort to ensure a response to the client actually happens.

This dials down the table_expire_interval to 2 seconds in both agent and
controller, for more predictable timeout behavior. It also dials the agent-side
request expiration interval down to 5 seconds, compared to the agent's 10
seconds.

We may have to revisit this to allow custom expiration intervals per
request/response message type.
2022-05-31 12:55:21 -07:00
Christian Kreibich
4371c17d4c Management framework: verify node starts when deploying a configuration
We so far hoped for the best when an agent asked the Supervisor to launch a
node. Since the Management::Node::API::notify_node_hello events arriving from
new nodes signal when such nodes are up and running, we can use those events to
track once/whether all launched nodes have checked in, and respond accordingly.

This delays the set_configuration_response event until these checkins have
occurred, or a timeout kicks in. In case of error, the agent's response to the
controller is in error state and has the remaining, unresponsive/failed  set of
nodes as its data member.
2022-05-31 12:55:21 -07:00
Christian Kreibich
c922f749c5 Management framework: a bit of debug-level logging for troubleshooting 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
Tim Wojtulewicz
5a07aa9a0b Merge remote-tracking branch 'origin/topic/vern/find-unused'
* origin/topic/vern/find-unused:
  Update spicy-plugin with change that checks for zeek version
  deprecation messages for unused base script functions
  clearer messages for warning about unused functions
  Fixes from review, post-rebase
  code formatting and more btest updates
  baseline & btest updates
  annotate orphan base script components with &deprecated
  annotate base scripts with &is_used as needed
  --no-usage-warnings flag to suppress analysis
  support for associating &is_used attributes with functions
  classes for evaluating function/hook/event usage
  broader support for AST traversal, including Attr and Attributes objects
  include attributes in descriptions of sets and tables
  low-level tidying
2022-05-31 11:14:22 -07:00
Tim Wojtulewicz
7c9d6c1f3f Update spicy-plugin with change that checks for zeek version 2022-05-31 10:19:22 -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
Vern Paxson
07cf5cb089 deprecation messages for unused base script functions 2022-05-27 14:36:30 -07:00
Vern Paxson
a120bcd7d7 clearer messages for warning about unused functions 2022-05-27 14:35:52 -07:00
Tim Wojtulewicz
bdfa7e70f5 Merge remote-tracking branch 'origin/topic/timw/fix-rst-warning'
* origin/topic/timw/fix-rst-warning:
  Update zeek-aux submodule to fix a compiler warning
2022-05-27 14:34:01 -07:00
Tim Wojtulewicz
9372c4453b Update zeek-aux submodule to fix a compiler warning 2022-05-27 09:51:51 -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
zeek-bot
b6dacd3f30 Update doc submodule [nomail] [skip ci] 2022-05-27 00:44:06 +00:00
Vern Paxson
a9f67f52a5 baseline & btest updates 2022-05-26 17:39:47 -07:00
Vern Paxson
6dc711c39e annotate orphan base script components with &deprecated 2022-05-26 17:39:17 -07:00
Vern Paxson
9b8ac44169 annotate base scripts with &is_used as needed 2022-05-26 17:39:17 -07:00
Vern Paxson
d9479c0502 --no-usage-warnings flag to suppress analysis 2022-05-26 17:39:15 -07:00
Vern Paxson
763b448aef support for associating &is_used attributes with functions 2022-05-26 17:38:38 -07:00
Vern Paxson
91f1ecd1ff classes for evaluating function/hook/event usage 2022-05-26 17:38:38 -07:00
Vern Paxson
a0fc8ca5e4 broader support for AST traversal, including Attr and Attributes objects 2022-05-26 17:38:34 -07:00
Vern Paxson
9a2200e60a include attributes in descriptions of sets and tables 2022-05-26 17:01:10 -07:00