Commit graph

12374 commits

Author SHA1 Message Date
Tim Wojtulewicz
58a5118149 Merge remote-tracking branch 'origin/topic/robin/update-doctest'
* origin/topic/robin/update-doctest:
  Update 3rdparty submodule to pull in doctest to 2.4.6.
2021-07-19 08:55:19 -07:00
Tim Wojtulewicz
449a5e0fc3 Merge remote-tracking branch 'origin/topic/robin/fix-plugin-port-registration'
* origin/topic/robin/fix-plugin-port-registration:
  Fix registration of protocol analyzers from inside plugins.
2021-07-19 08:54:42 -07:00
Robin Sommer
bb59e7e0c8 Update 3rdparty submodule to pull in doctest to 2.4.6.
Our old version didn't support compilation on Apple's M1 yet.
2021-07-18 10:07:01 +02:00
Robin Sommer
a7343ee019 Fix registration of protocol analyzers from inside plugins.
With the recent packet manager work, it broke to register a protocol
analyzer for a specific port from inside a plugin's initialization code.
That's because that registration now depends on the packet manager being
set up, which isn't case at that time a plugin's `InitPostInit()` runs.
This fix contains two parts:

    - Initialize the packet manager before the analyzer manager, so that
      the latter's `InitPostScript()` can rely on the former being
      ready.

    - Change the analyzer manager to (only) record port registrations
      happening before it's fully initialized. Its `InitPostScript()`
      then performs the actual registrations, knowing it can use the
      packet manager now.

This comes with a `cmake/` to add a missing include directory.
2021-07-18 10:00:49 +02:00
Tim Wojtulewicz
6e3d2d4516 Merge remote-tracking branch 'origin/topic/timw/caf-0-18-5'
* origin/topic/timw/caf-0-18-5:
  Update broker submodule for new CAF version
2021-07-16 22:44:18 -07:00
Tim Wojtulewicz
1d69a698de Update broker submodule for new CAF version 2021-07-16 19:07:17 -07:00
zeek-bot
b330a95050 Update doc submodule [nomail] [skip ci] 2021-07-16 00:31:40 +00:00
Christian Kreibich
9f8b21fc51 Bump highwayhash to pull in FreeBSD 14 fix 2021-07-15 17:04:11 -07:00
Tim Wojtulewicz
db72849bdb Setup generate-docs workflow to run on push to test branch 2021-07-15 15:14:05 -07:00
Tim Wojtulewicz
3c7a2b1450 Merge remote-tracking branch 'origin/topic/vlad/dns_rr_fixes'
* origin/topic/vlad/dns_rr_fixes:
  Add a TODO to return a correct status for ParseRR_WKS
  Remove unnecessary if
  Generate dns_WKS_reply event
  dns_HINFO_reply event was never being generated.
2021-07-15 11:33:44 -07:00
Vlad Grigorescu
5e021f7d3c Add a TODO to return a correct status for ParseRR_WKS 2021-07-15 13:03:38 -05:00
Vlad Grigorescu
5f3fa57298 Remove unnecessary if 2021-07-15 13:02:23 -05:00
Tim Wojtulewicz
e75a40edb3 Update scripts/site/local-compat test for 4.2 cycle 2021-07-15 17:36:13 +00:00
Tim Wojtulewicz
62aa2fe7ba Merge remote-tracking branch 'origin/topic/robin/vector-string-tests'
* origin/topic/robin/vector-string-tests:
  Remove tests for deprecated operators.
  Add tests for operations on vectors of string.
2021-07-15 09:50:36 -07:00
Vlad Grigorescu
8b4c2a88a5 Generate dns_WKS_reply event 2021-07-15 10:11:48 -05:00
Vlad Grigorescu
15b294098c dns_HINFO_reply event was never being generated.
On top of that, I modified the event to pass the relevant fields from the DNS message.
2021-07-15 09:56:38 -05:00
Vlad Grigorescu
a2a8870931 Add btest for DNS WKS RR. 2021-07-14 21:43:36 -05:00
Vlad Grigorescu
01660553d6 Add btest for DNS NSEC3PARAM RR. 2021-07-14 20:22:06 -05:00
zeek-bot
eeee2c41a3 Update doc submodule [nomail] [skip ci] 2021-07-15 00:37:00 +00:00
Tim Wojtulewicz
09c4908573 Merge remote-tracking branch 'origin/topic/christian/fix-inputframework-test-race'
* origin/topic/christian/fix-inputframework-test-race:
  Fix race conditions in scripts.base.frameworks.input.reread
  Fix race condition in scripts.base.frameworks.input.invalid*
2021-07-14 15:01:29 -07:00
Tim Wojtulewicz
5d38bb029a Merge remote-tracking branch 'origin/topic/timw/structure-packing'
* origin/topic/timw/structure-packing:
  Reorder fields in some classes for more compact memory layout
  Redo how reassembled flag is accessed in IP_Hdr, filling in a memory hole
2021-07-14 15:00:23 -07:00
Tim Wojtulewicz
9b15db25f6 Reorder fields in some classes for more compact memory layout 2021-07-14 14:59:49 -07:00
Tim Wojtulewicz
f849f024e5 Redo how reassembled flag is accessed in IP_Hdr, filling in a memory hole 2021-07-14 14:59:49 -07:00
Robin Sommer
8d19c43429 Remove tests for deprecated operators. 2021-07-14 11:23:13 +02:00
Robin Sommer
7f2769bd17 Add tests for operations on vectors of string. 2021-07-14 11:21:42 +02:00
zeek-bot
aa76cb3925 Update doc submodule [nomail] [skip ci] 2021-07-14 00:35:33 +00:00
Tim Wojtulewicz
3038ec9578 Merge remote-tracking branch 'origin/topic/vlad/bogon'
* origin/topic/vlad/bogon:
  Zeekygen doesn't support comments on set members
  Add 6to4 addresses, if the matching IPv4 address is private
  Update Site::private_address_space to latest IANA networks
2021-07-13 12:25:32 -07:00
Tim Wojtulewicz
a865a2cc9b Update submodule(s) [nomail] [skip ci] 2021-07-13 12:22:24 -07:00
Tim Wojtulewicz
cdcfa154e2 Fix formatting in 4.1 NEWS entry [nomail] [skip ci] 2021-07-13 12:22:11 -07:00
Christian Kreibich
136a9baa42 Fix race conditions in scripts.base.frameworks.input.reread
On FreeBSD, this test showed two problems: (1) reordering problems
based on writing the predicate, event, and end-of-data updates into a
single file, (2) a race condition based on printing the entirety of
the table description argument in update events. The description
contains the destination table, and its content at the time an update
event gets processed isn't deterministic: depending on the number
of updates the reader thread has sent, the table will contain a
varying number of entries.
2021-07-12 13:25:03 -07:00
Christian Kreibich
4e75662963 Fix race condition in scripts.base.frameworks.input.invalid*
The invalidset and invalidtext tests loaded an input file via table
and event reads, in parallel. On FreeBSD this triggers an occasional
reordering of messages coming out of the reader thread vs the input
managers. This commit makes the table and event reads sequential,
avoiding the race.
2021-07-09 18:16:14 -07:00
zeek-bot
8bcaa64d8f Update doc submodule [nomail] [skip ci] 2021-07-10 00:34:12 +00:00
Tim Wojtulewicz
6bf742466f Update doc submodule [nomail] [skip ci] 2021-07-09 12:57:12 -07:00
Tim Wojtulewicz
8f86f8b75a Update submodule(s) [nomail] [skip ci] 2021-07-09 12:21:22 -07:00
Christian Kreibich
281eef398f Merge branch 'topic/vlad/doc_tweaks'
* topic/vlad/doc_tweaks:
  docs: escape * in documentation
  Update the mail_dest documentation with the new email_dest field
2021-07-09 12:02:32 -07:00
Tim Wojtulewicz
f8389c92e0 Merge remote-tracking branch 'origin/topic/timw/freebsd-warning'
* origin/topic/timw/freebsd-warning:
  Fix a compile warning on FreeBSD
2021-07-08 18:00:34 -07:00
Christian Kreibich
8db985ea78 Merge branch 'topic/christian/cluster-controller'
* topic/christian/cluster-controller:
  Add a cluster controller testcase for agent-controller checkin
  Add zeek-client via new submodule
  Update baselines affected by cluster controller changes
  Introduce cluster controller and cluster agent scripting
  Establish a separate init script when using the supervisor
  Add optional bare-mode boolean flag to Supervisor's node configuration
  Add support for making the supervisor listen for requests
  Add support for setting environment variables via supervisor
2021-07-08 16:51:11 -07:00
Vlad Grigorescu
8d2a6f48e8 docs: escape * in documentation 2021-07-08 18:26:42 -05:00
Tim Wojtulewicz
12ac62645a Fix a compile warning on FreeBSD 2021-07-08 16:10:19 -07:00
Christian Kreibich
db600b7393 Merge branch 'topic/christian/policy-hook-docfix'
* topic/christian/policy-hook-docfix:
  Fix reference in the logging framework docs re. Log::StreamPolicyHook
2021-07-08 16:00:43 -07:00
Christian Kreibich
6eddaed62d Fix reference in the logging framework docs re. Log::StreamPolicyHook 2021-07-08 15:39:46 -07:00
Vlad Grigorescu
10159a3fdf Update the mail_dest documentation with the new email_dest field 2021-07-08 16:01:21 -05:00
Christian Kreibich
767cf2b518 Add a cluster controller testcase for agent-controller checkin
This verifies that in a setup with the supervisor creating both controller and
agent, the agent successfully checks in with the controller.
2021-07-08 13:12:53 -07:00
Christian Kreibich
a6b0fde65f Add zeek-client via new submodule
The new module resides in auxil/zeek-client. It does not get installed unless
one configures with --enable-zeek-client.
2021-07-08 13:12:53 -07:00
Christian Kreibich
04dda8b4a7 Update baselines affected by cluster controller changes 2021-07-08 13:12:53 -07:00
Christian Kreibich
c744702f94 Introduce cluster controller and cluster agent scripting
This is a preliminary implementation of a subset of the functionality set out in
our cluster controller architecture. The controller is the central management
node, existing once in any Zeek cluster. The agent is a node that runs once per
instance, where an instance will commonly be a physical machine. The agent in
turn manages the "data cluster", i.e. the traditional notion of a Zeek cluster
with manager, worker nodes, etc.

Agent and controller live in the policy folder, and are activated when loading
policy/frameworks/cluster/agent and policy/frameworks/cluster/controller,
respectively. Both run in nodes forked by the supervisor. When Zeek doesn't use
the supervisor, they do nothing. Otherwise, boot.zeek instructs the supervisor
to create the respective node, running main.zeek.

Both controller and agent have their own config.zeek with relevant knobs. For
both, controller/types.zeek provides common data types, and controller/log.zeek
provides basic logging (without logger communication -- no such node might
exist).

A primitive request-tracking abstraction can be found in controller/request.zeek
to track outstanding request events and their subsequent responses.
2021-07-08 13:12:53 -07:00
Christian Kreibich
a3623bfb2d Establish a separate init script when using the supervisor
The supervisor does not require the full weight of scripts that
init-default.zeek brings with it. The new file, init-supervisor.zeek, contains
only what's required by the supervisor in addition to the other always-loaded
init files.
2021-07-08 13:12:53 -07:00
Christian Kreibich
7bee79b400 Add optional bare-mode boolean flag to Supervisor's node configuration
When omitted, the node inherits the Supervisor's bare-mode
status. When true/false, the new Zeek node will enable/disable bare
mode, respectively. It continues to load any scripts passed at the
command line and in the additional scripts list already provided in
the node configuration.

Includes testcase.
2021-07-08 13:12:53 -07:00
Christian Kreibich
efaa9ec3be Add support for making the supervisor listen for requests
The supervisor now starts listening on the configured Broker default address and
port when the new boolean SupervisorControl::enable_listen is T. Listening
remains disabled by default. Listening allows nodes to communicate with the
supervisor via the events laid out in control.zeek, to conduct further node
management.
2021-07-08 13:12:53 -07:00
Christian Kreibich
36051dc9a1 Add support for setting environment variables via supervisor
The NodeConfig record now has a table for specifying environment variable names
and values, which the supervisor sets in the created node.

This also repositions the cpu_affinity member to keep the order the same in
the corresponding script-layer and in-core types.

Includes testcase.
2021-07-08 13:12:53 -07:00