Commit graph

3869 commits

Author SHA1 Message Date
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
Tim Wojtulewicz
271d3c4038 GH-2054: Allow nulls as separators for join_string_vec 2022-05-25 17:03:26 -07:00
Tim Wojtulewicz
f8bc23d3e1 Propagate BPF_Program error message to script land 2022-05-25 09:41:35 -07:00
Benjamin Bannier
3b7adde599 Clean up test spicy.spicyz-jit.
This test was created from a copy of `spicy.spicyz-aot`, but updated
incompletly. This patch removes the last ahead-of-time compilation bits.
2022-05-25 15:01:46 +02:00
Christian Kreibich
d4ecfa0a67 Merge branch 'topic/christian/installation-dirs-in-scriptland'
* topic/christian/installation-dirs-in-scriptland:
  Add scripts.base.misc.installation btest
  Add base/misc/installation.zeek, with Zeek installation directories
  Ensure presence of Zeek-related directories in toplevel CMakeLists.txt
2022-05-24 12:12:05 -07:00
Christian Kreibich
04c91736a1 Add scripts.base.misc.installation btest 2022-05-23 14:16:59 -07:00
Christian Kreibich
84a09debe3 Add base/misc/installation.zeek, with Zeek installation directories
This makes several of the installation's main directories available to the
script layer.
2022-05-23 14:16:59 -07:00
Tim Wojtulewicz
73273fc87b Merge remote-tracking branch 'origin/topic/vern/ZAM-inlining'
* origin/topic/vern/ZAM-inlining:
  speed up ZAM compilation by capping function size when inlining
2022-05-19 11:45:50 -07:00
Christian Kreibich
0641d032c3 Zeekify the scripts.base.utils.paths test 2022-05-19 09:51:36 -07:00
Christian Kreibich
9d59a48ae2 Expand build_path() function to handle empty dir arguments gracefully
When passing an empty string as a directory, the function would produce
filenames starting with a slash even when the given file_name is not an absolute
path. Defaulting to the root directory is likely never intended and might
conveivably be dangerous. The middle "/" is now skipped also if dir is an empty
string.
2022-05-19 09:45:52 -07:00
Tim Wojtulewicz
aaaca5d5a6 Merge remote-tracking branch 'origin/topic/bbannier/spicy'
* origin/topic/bbannier/spicy:
  Add NEWS item for new requirements due to default-enabled Spicy support.
  Include headers in binary dir before other headers.
  Increase memory in CI.
  Add tests for bundled Spicy infrastructure.
  Include spicy in build.
  Add `bare_mode` bif.
  Change test so included plugins can load notice framework.
  Do not log function arguments in test.
2022-05-17 08:50:33 -07:00
Tim Wojtulewicz
3233400930 Merge remote-tracking branch 'origin/topic/timw/1857-input-log-messages'
* origin/topic/timw/1857-input-log-messages:
  Move some repetitive code into a separate method
  Store location during Ascii input parsing for use in error messages
  Include file information in input reader error messages
2022-05-16 17:00:34 -07:00
Tim Wojtulewicz
3d133ccb0a Merge remote-tracking branch 'origin/topic/vern/CPP-feature-complete'
* origin/topic/vern/CPP-feature-complete:
  NEWS items for script profiling, "footprint" BiFs, and Trigger method deprecations
  tweaks per reviewing feedback
  make deprecation advice a bit more helpful
  format shell scripts per style guide
  add deprecation for Trigger Cache/Lookup interfaces
  helper scripts for -O C++ maintenance
  "-O use-C++" now fails if no C++ bodies wound up being applicable
  update environemnt variable names to match command-line arguments
  final changes for -O C++ feature completeness, mainly "when" statement support
  Change "when" statements that don't require closures to use new implementation. Provide hooks for script optimization access to "when" statements. Regularize treatment of naming and timeouts for Triggers.
  switch cached Trigger values to be opaque-and-generic, rather than assuming CallExpr's
  tracking of when statements/expressions occur in a "when" context
  fix bug that sometimes associated the wrong location with global statements
  fix incomplete AST traversal of "when" statements
  add some missing "when" closures
  regularize test suite names to avoid custom/outdated suffices
2022-05-16 16:59:59 -07:00
Tim Wojtulewicz
ec50b66ff3 Store location during Ascii input parsing for use in error messages 2022-05-16 13:15:06 -07:00
Tim Wojtulewicz
098a5d3348 Include file information in input reader error messages 2022-05-16 13:15:06 -07:00
Tim Wojtulewicz
1d20e28e5c Merge remote-tracking branch 'origin/topic/timw/retry-update-traces'
* origin/topic/timw/retry-update-traces:
  Add --retry to curl invocations in update-traces
2022-05-16 09:09:47 -07:00
Tim Wojtulewicz
55297a2e73 Merge remote-tracking branch 'origin/topic/timw/2103-bifs-footprint-leak'
* origin/topic/timw/2103-bifs-footprint-leak:
  GH-2103: Disable leak detection for bifs.footprint in another way
2022-05-16 09:09:17 -07:00
Benjamin Bannier
e40aa0f6d2 Add tests for bundled Spicy infrastructure. 2022-05-16 09:07:11 +02:00
Benjamin Bannier
95aff9a1e3 Include spicy in build. 2022-05-16 09:07:11 +02:00
Benjamin Bannier
e83c4c834d Add bare_mode bif. 2022-05-16 09:07:11 +02:00
Benjamin Bannier
0f1dd8ef1b Change test so included plugins can load notice framework. 2022-05-16 09:07:11 +02:00
Benjamin Bannier
1e4f368c68 Do not log function arguments in test.
This was excercising hooks to validate that they were called. For that
it uses pretty verbose logging. Since version numbers are not stable and
hard to canonify this script already unloads the version module (there
is e.g., code in `base/misc/version` which splits the version strings
and works on single components which might appear like pretty ordinary
floating point numbers in the log).

This test however worked under the assumption that nothing in bare mode
loads `base/misc/version` which is hard to guarantee, especially
considering that plugins can be embedded and might load that module
themself.

With this patch we now make the logging slightly less verbose so that
function call arguments are not logged anymore.
2022-05-16 09:07:11 +02:00
Vern Paxson
7d00ce0082 speed up ZAM compilation by capping function size when inlining 2022-05-14 14:52:31 -07:00
Tim Wojtulewicz
bd1ea5edda Merge remote-tracking branch 'origin/topic/johanna/bloomfilter'
* origin/topic/johanna/bloomfilter:
  Bloom filter changes: address review feedback
  Bloom-filter: fix documentation syntax problem
  Bloomfilter related clang-format fixes
  Correcly typify bloom filters in all cases during merge
  Add intersect operation for bloom filters
  Add bloomfilter_decrement bif
2022-05-13 16:49:13 -07:00
Tim Wojtulewicz
56fe393691 GH-2103: Disable leak detection for bifs.footprint in another way 2022-05-13 16:26:41 -07:00
Tim Wojtulewicz
107f4fdc99 Add --retry to curl invocations in update-traces 2022-05-13 11:54:27 -07:00
Vern Paxson
8928aa57e7 add some missing "when" closures 2022-05-12 13:39:26 -07:00
Vern Paxson
025b9b1534 regularize test suite names to avoid custom/outdated suffices 2022-05-12 13:32:49 -07:00
Johanna Amann
5118e7f86b Merge remote-tracking branch 'origin/topic/johanna/cert-weak-key'
* origin/topic/johanna/cert-weak-key:
  Include certificate information in SSL::Weak_Key notice
2022-05-12 11:04:34 +01:00
Tim Wojtulewicz
8b0263cb39 Merge remote-tracking branch 'origin/topic/vern/script-profiling'
* origin/topic/vern/script-profiling:
  tidy up after generating profile
  test suite updates for refined script coverage, use of new BiF to speed startup
  fix for coverage reporting for functions that use "when" statements
  new global_options() BiF to speed up startup, plus a micro-preen
  hooks for new --profile-scripts option
  classes for managing script profiles
  address some holes in script coverage
  fix for script coverage missing on-exit activity
  memory management fixes for loggers
  make curr_CPU_time() broadly available rather than just isolated to ZAM
2022-05-11 12:56:41 -07:00
Johanna Amann
5f04f216bc Include certificate information in SSL::Weak_Key notice 2022-05-11 18:56:04 +01:00
Johanna Amann
0aafc8ae6c Merge remote-tracking branch 'origin/topic/vern/type-names'
* origin/topic/vern/type-names:
  regularize deprecation warning
  make DoDescribe protected for a tidier interface mark use of DESC_PORTABLE as deprecated
  when printing a description of a type, use its name if available
2022-05-09 11:15:36 +01:00
Christian Kreibich
8d101f21be Merge branch 'topic/christian/management-consistency-tweaks'
* topic/christian/management-consistency-tweaks:
  Management framework: consistency tweaks in zeek-client, plus test updates
2022-05-06 15:28:48 -07:00
Tim Wojtulewicz
cf51931615 Merge remote-tracking branch 'origin/topic/vern/footprint'
* origin/topic/vern/footprint:
  new environment variable to enable BTests to skip ASAN checks
  skip new BiF test for ASAN CI runs
  btest update to include recursive value that doesn't require a record
  to avoid recursion, track all aggregates, not just records isolate the internal methods
  simpler public calling interface for computing footprint
  use stack-based set to prevent infinite recursion rather than a static one
  change value_footprint() to val_footprint() to be more similar to val_size()
  make including count of container elements non-optional
  btest for mutually-recursive case
  fix for tracking footprints of mutually-recursive records
  added value_footprint() and global_container_footprints() BiFs
2022-05-06 11:32:49 -07:00
Christian Kreibich
8c76af6ab9 Management framework: consistency tweaks in zeek-client, plus test updates
A minor changeset that reflects zeek-client updates, with some effects on
its output and hence test cases.
2022-05-06 11:22:48 -07:00
Christian Kreibich
7198c847e8 Merge branch 'topic/christian/management-get-config'
* topic/christian/management-get-config:
  Management framework: add get_configuration_request/response transaction
2022-05-05 18:10:46 -07:00
Vern Paxson
a387157ead skip new BiF test for ASAN CI runs 2022-05-05 17:07:46 -07:00
Vern Paxson
d5f60cfaba btest update to include recursive value that doesn't require a record 2022-05-05 16:55:03 -07:00