Commit graph

13201 commits

Author SHA1 Message Date
Phil Rzewski
c08fe7c237 Define geo_autonomous_system record type 2022-06-01 18:39:07 -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
Vern Paxson
772169f8e0 low-level tidying 2022-05-26 17:01:10 -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
1165193df8 Management framework: bump zeek-client to pull in instance serialization fixes 2022-05-26 13:32:08 -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
93ea03a081 Management framework: place each Zeek process in its own working dir
This establishes a directory "nodes" in Management::state_dir and places each
Zeek process into a subdirectory in it, named after the Zeek process. For
example, node "worker-01" runs with cwd <state_dir>/nodes/worker-01/.

Explicitly configured directories can override the naming logic, and also ignore
the state directory if they're absolute paths. One exception remains: the
Supervisor itself -- we'd have to use LogAscii::logdir to automatically place it
too in its own directory, but that feature currently does not interoperate with
log rotation.
2022-05-26 12:56:02 -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
Tim Wojtulewicz
bc90cc0003 Add some missing NEWS entries 2022-05-26 12:49:42 -07:00
Tim Wojtulewicz
fb01c8967a Merge remote-tracking branch 'origin/topic/timw/2054-null-string-join'
* origin/topic/timw/2054-null-string-join:
  GH-2054: Allow nulls as separators for join_string_vec
2022-05-26 08:23:53 -07:00
zeek-bot
26152b8c7a Update doc submodule [nomail] [skip ci] 2022-05-26 00:38:12 +00:00
Tim Wojtulewicz
271d3c4038 GH-2054: Allow nulls as separators for join_string_vec 2022-05-25 17:03:26 -07:00