Commit graph

13480 commits

Author SHA1 Message Date
Christian Kreibich
3120fbc75e Management framework: distinguish internally and externally requested deployments
The controller's deployment request state now features a bit that indicates
whether the deployment was requested by a client, or triggered internally. This
affects logging and the transmission of deployment response events via Broker,
which are skipped when the deployment is internal.

This is in preparation of resilience features when the controller (re-)boots.
2022-06-21 17:22:45 -07:00
Christian Kreibich
7787d84739 Management framework: track instances by their Broker IDs
This allows us to handle loss of Broker peerings, updating instance state as we
see instances go away. This also tweaks logging slightly to differentiate
between an instance checking in for the first time, and checking in when the
controller already knows it.
2022-06-21 17:22:45 -07:00
Christian Kreibich
633535d8da Management framework: tweak Supervisor event logging
We now log Supervisor event interaction just like we do transmission/receipt of
other Management framework events.
2022-06-21 17:22:45 -07:00
Christian Kreibich
d7e88fc079 Management framework: make helper function a local 2022-06-21 17:22:45 -07:00
Christian Kreibich
35ea566223 Management framework: rename "log_level" to "level"
"Management::Log::log_level" looks redundant.
2022-06-21 17:22:45 -07:00
Christian Kreibich
8bc142f73c Management framework: add "finish" callback to requests
These callbacks are handy for stringing together codepaths separated by event
request/response transactions: when such a transaction completes, the callback
allows locating a parent request for the finished one, to continue its
processing.
2022-06-21 17:22:45 -07:00
Christian Kreibich
a2525e44ba Management framework: add a helper for rendering result vectors to a string 2022-06-21 17:22:45 -07:00
Christian Kreibich
d367f1bad9 Management framework: agents now skip re-deployment of current config
When an agent is already running the configuration it's asked to deploy,
it will now recognize this and by default do nothing. The requester can force
it if needed, via a new argument to the deploy_request event.
2022-06-21 17:22:45 -07:00
Christian Kreibich
a68ee13939 Management framework: suppress notify_agent_hello upon Supervisor peering
The agent's Broker::peer_added handler now recognizes the Supervisor and does
not trigger a notify_agent_hello event upon it. It might still send such events
repeatedly as other things peer with the agent.
2022-06-21 17:22:45 -07:00
Christian Kreibich
46db4a0e71 Management framework: introduce state machine for configs and persist them
The controller now knows three states that a cluster configuration can be in:

- STAGED: as uploaded by the client
- READY: with needed tweaks applied, e.g. to fill in ports
- DEPLOYED: as sent off to agents for deployment

These states aren't exclusive, they represent checkpoints that a config goes
through from upload through deployment. A deployed configuration will also exist
in its STAGED and READY versions, unless a client has uploaded a new
configuration, which will overwrite the STAGED and READY ones.

The controller saves all of these in a table, which lets us use Broker to
persist all states to disk. We use &broker_allow_complex_type, since we only
ever store entire configurations.
2022-06-21 17:22:45 -07:00
Christian Kreibich
77556e9f11 Management framework: introduce deployment API in controller
This separates uploading a configuration from deploying it to the instances into
separate event transactions. set_configuration_request/response remains, but now
only conducts validation and storage of the new configuration (upon validation
success, and not yet persisted to disk). The response event indicates success or
the list of validation errors. Successful upload now returns the configuration's
ID in the result record's data struct.

The new deploy_request/response event takes a previously uploaded configuration
and deploys it to the agents.

The controller now tracks uploaded and deployed configurations
separately. Uploading assigns g_config_staged; deployment assigns
g_config_deployed. Deployment does not affect g_config_staged.

The get_config_request/response event pair now allows selecting the
configuration the caller would like to retrieve.
2022-06-21 17:22:45 -07:00
Christian Kreibich
0480b5f39c Management framework: rename agent "set_configuration" to "deploy"
This renames the agent's functionality for setting a configuration to reflect
the controller's upcoming separation of set_configuration and deployment.
2022-06-21 17:22:45 -07:00
Christian Kreibich
f353ac22a5 Management framework: consistency fixes to the Result record
The instance and error fields are now optional instead of defaulting to empty
strings, which caused minor output deviations in the client.

Agents now ensure that any Result record they create has the instance field
filled in.
2022-06-21 17:22:45 -07:00
Christian Kreibich
3ac5fdfc59 Management framework: trivial changes and comment-only rewording 2022-06-21 17:22:45 -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
Tim Wojtulewicz
f8193e7ecf Merge remote-tracking branch 'origin/topic/johanna/fedora36'
* origin/topic/johanna/fedora36:
  CI: Add Fedora 36, remove Fedora 34
2022-06-21 12:23:29 -07:00
Tim Wojtulewicz
5b85cd6dfd Update broker submodule to fix put_unique issues from 5.0RC1 2022-06-21 12:14:04 -07:00
Johanna Amann
94e1d5786e CI: Add Fedora 36, remove Fedora 34 2022-06-21 18:06:00 +01:00
Christian Kreibich
09e412c941 Management framework: bump external cluster testsuite 2022-06-19 01:20:22 -07:00
Christian Kreibich
7fbb008f85 Management framework: bump zeek-client 2022-06-19 01:20:22 -07:00
Christian Kreibich
d6042cf516 Management framework: add config validation
During `set_configuration_request` handling the controller now validates
received configurations, checking for a few common gotchas around naming and
port use. Validation continues once it finds a problem, resulting in a list
summarizing all identified problems.
2022-06-19 01:20:16 -07:00
Christian Kreibich
620db4d4eb Management framework: improvements to port auto-enumeration
The numbering process now accounts for the possibility of colliding with the
agent port, as well as with ports explicitly assigned in the configuration. It
also avoids nondeterminism that could result from traversal of sets.
2022-06-19 01:19:54 -07:00
Christian Kreibich
0c20f16055 Management framework: control output-to-console in Supervisor
It helps during testing to be able to control whether the Supervisor process
also routs node output to the console, in addition to writing to output
files. Since the Supervisor runs as the main process in Docker containers, its
output becomes visible in "docker logs" that way, simplifying diagnostics.
2022-06-19 01:19:54 -07:00
Christian Kreibich
5592beaf31 Management framework: handle no-instances corner case in set-config correctly
When the controller receives a configuration with no instances (and thus no
nodes), it needs to roundtrip to agents and can send the response right away.
2022-06-19 01:19:47 -07:00
Vern Paxson
5a0a88526e removed deprecated capture-by-reference closures 2022-06-17 15:55:43 -07:00
Tim Wojtulewicz
6a4c8e4e70 Merge remote-tracking branch 'origin/topic/johanna/opensuse-leap-ci'
* origin/topic/johanna/opensuse-leap-ci:
  CI: Add OpenSuSE Leap 15.4, fix 15.3
2022-06-17 09:21:56 -07:00
Tim Wojtulewicz
740c6e2207 Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump Spicy and spicy-plugin to latest dev snapshot.
2022-06-17 09:10:12 -07:00
Benjamin Bannier
d15ba08890 Bump Spicy and spicy-plugin to latest dev snapshot.
This bump brings in fixes for the following issues:

- zeek/spicy#1204
- zeek/spicy#1208
- zeek/spicy#1210
- zeek/spicy-plugin#112
- zeek/spicy-plugin#117
2022-06-17 11:09:52 +02:00
zeek-bot
f46b2318d3 Update doc submodule [nomail] [skip ci] 2022-06-17 00:47:27 +00: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
Tim Wojtulewicz
6c57046404 Revert "Merge remote-tracking branch 'turrisxyz/Dependabot-GitHub-Actions'"
This reverts commit 910e3b3024, reversing
changes made to 6419865520.
2022-06-16 14:28:10 -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
Tim Wojtulewicz
5ccba54335 Merge remote-tracking branch 'origin/topic/timw/docs-gen-ccache'
* origin/topic/timw/docs-gen-ccache:
  Use ccache for docs gen github workflow
2022-06-16 10:08:57 -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
Tim Wojtulewicz
a26b504b8e Use ccache for docs gen github workflow 2022-06-15 10:25:30 -07:00
Johanna Amann
35121779f1 Merge remote-tracking branches 'origin/dependabot/github_actions/actions/download-artifact-3', 'origin/dependabot/github_actions/docker/setup-buildx-action-2', 'origin/dependabot/github_actions/pre-commit/action-3.0.0' and 'origin/dependabot/github_actions/docker/build-push-action-3'
* origin/dependabot/github_actions/actions/download-artifact-3:
  Bump actions/download-artifact from 2 to 3

* origin/dependabot/github_actions/docker/setup-buildx-action-2:
  Bump docker/setup-buildx-action from 1 to 2

* origin/dependabot/github_actions/pre-commit/action-3.0.0:
  Bump pre-commit/action from 2.0.3 to 3.0.0

* origin/dependabot/github_actions/docker/build-push-action-3:
  Bump docker/build-push-action from 2 to 3
2022-06-15 10:34:12 +01:00
Johanna Amann
538e7977bc CI: Add OpenSuSE Leap 15.4, fix 15.3
15.3 included the wrong update repo in the Dockerfile
2022-06-15 09:43:00 +01:00
Johanna Amann
ff1c52df1d Merge remote-tracking branch 'origin/topic/johanna/ubuntu2204'
* origin/topic/johanna/ubuntu2204:
  CI: Add Ubuntu 22.04 (LTS Release, EOL 04/2027)
2022-06-15 09:35:29 +01:00
zeek-bot
b58f81e66f Update doc submodule [nomail] [skip ci] 2022-06-15 00:43:25 +00:00
dependabot[bot]
5fd07215af
Bump docker/build-push-action from 2 to 3
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 3.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 22:45:37 +00:00
dependabot[bot]
00a63f8916
Bump actions/download-artifact from 2 to 3
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 22:45:33 +00:00
dependabot[bot]
0ed36129d1
Bump pre-commit/action from 2.0.3 to 3.0.0
Bumps [pre-commit/action](https://github.com/pre-commit/action) from 2.0.3 to 3.0.0.
- [Release notes](https://github.com/pre-commit/action/releases)
- [Commits](https://github.com/pre-commit/action/compare/v2.0.3...v3.0.0)

---
updated-dependencies:
- dependency-name: pre-commit/action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 22:45:20 +00:00
dependabot[bot]
5a1df07e26
Bump docker/setup-buildx-action from 1 to 2
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 22:45:18 +00:00
Tim Wojtulewicz
073f16a119 Merge remote-tracking branch 'origin/dependabot/github_actions/dawidd6/action-send-mail-3.6.1'
* origin/dependabot/github_actions/dawidd6/action-send-mail-3.6.1:
  Fix pattern matching in Cirrus dependabot check
  Bump dawidd6/action-send-mail from 3.4.1 to 3.6.1
2022-06-14 15:44:00 -07:00
Tim Wojtulewicz
c3d1f6f454 Fix pattern matching in Cirrus dependabot check 2022-06-14 15:39:48 -07:00
dependabot[bot]
e2ccef67d8
Bump dawidd6/action-send-mail from 3.4.1 to 3.6.1
Bumps [dawidd6/action-send-mail](https://github.com/dawidd6/action-send-mail) from 3.4.1 to 3.6.1.
- [Release notes](https://github.com/dawidd6/action-send-mail/releases)
- [Commits](https://github.com/dawidd6/action-send-mail/compare/v3.4.1...v3.6.1)

---
updated-dependencies:
- dependency-name: dawidd6/action-send-mail
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 21:41:42 +00:00
Tim Wojtulewicz
d8cfdba71a Merge remote-tracking branch 'origin/topic/timw/ci-ignore-dependabot-prs'
* origin/topic/timw/ci-ignore-dependabot-prs:
  Ignore dependabot PRs on Cirrus
2022-06-14 14:39:13 -07:00
Tim Wojtulewicz
02da9a79a7 Merge remote-tracking branch 'origin/topic/timw/merge-timer-mgr'
* origin/topic/timw/merge-timer-mgr:
  Merge PQ_Timer into base TimerMgr class
2022-06-14 14:34:49 -07:00
Tim Wojtulewicz
b77ede4bed Merge PQ_Timer into base TimerMgr class 2022-06-14 12:59:14 -07:00