Commit graph

17299 commits

Author SHA1 Message Date
Johanna Amann
35ad35ad0f Options for SQLite log writer, eliminate duplicate definitions
Patch provided by Arne Welzel, see GH-4063
2024-11-26 16:31:13 +00:00
Johanna Amann
d592942ccb Test synchronous/journal mode options for SQLite log writer
Also adds some small tweaks and adds the new feature to NEWS.
2024-11-26 12:26:38 +00:00
Mymaqn
3ca56f7e0f Added default options for synchronous and journal mode
Added enum options SQLITE_SYNCHRONOUS_DEFAULT and SQLITE_JOURNAL_MODE_DEFAULT
and changed the default to be these instead.
2024-11-26 11:08:30 +00:00
Mymaqn
6e026ba313 Support for synchronous and journal_mode 2024-11-26 11:08:18 +00:00
zeek-bot
a1d64ad6ae Update doc submodule [nomail] [skip ci] 2024-11-23 00:20:35 +00:00
Arne Welzel
40a780bb24 Merge remote-tracking branch 'origin/topic/awelzel/test-init-hooks-plugin'
* origin/topic/awelzel/test-init-hooks-plugin:
  btest/plugins: Add a plugin testing Init and Done hooks
2024-11-22 18:38:06 +01:00
Arne Welzel
542640db00 Merge remote-tracking branch 'origin/topic/awelzel/skip-core-expr-error'
* origin/topic/awelzel/skip-core-expr-error:
  Disable core.expr-execption btest under ZAM to fix CI builds
2024-11-22 15:29:48 +01:00
Tim Wojtulewicz
24d913c0a9 Disable core.expr-execption btest under ZAM to fix CI builds
Relates to #4052.
2024-11-22 15:28:14 +01:00
Arne Welzel
39b43e8dd6 btest/plugins: Add a plugin testing Init and Done hooks
Follow-up for #4047.
2024-11-22 13:37:03 +01:00
Arne Welzel
97f05b2f8c Merge remote-tracking branch 'origin/topic/awelzel/pluggable-cluster-backends-part1'
* origin/topic/awelzel/pluggable-cluster-backends-part1:
  btest: Test Broker::make_event() together with Cluster::publish_hrw()
  btest: Add cluster dir, minimal test for enum value
  broker: Add shim plugin adding a backend component
  zeek-setup: Instantiate backend::manager
  cluster: Add to src/CMakeLists.txt
  cluster: Add Components and ComponentManager for new components
  cluster/Backend: Interface for cluster backends
  cluster/Serializer: Interface for event and log serializers
  logging: Introduce logging/Types.h
  SerialTypes/Field: Allow default construction and add move constructor
  DebugLogger: Add cluster debugging stream
  plugin: Add component enums for pluggable cluster backends
  broker: Pass frame to MakeEvent()
2024-11-22 12:53:23 +01:00
Arne Welzel
baca6ba769 btest: Test Broker::make_event() together with Cluster::publish_hrw() 2024-11-22 10:43:55 +01:00
Arne Welzel
de9d39cd01 btest: Add cluster dir, minimal test for enum value 2024-11-22 10:43:55 +01:00
Arne Welzel
6fb73aa9da broker: Add shim plugin adding a backend component
For broker, this isn't really functioning, but at least makes the
CLUSTER_BACKEND_BROKER enum available.
2024-11-22 10:43:55 +01:00
Arne Welzel
60b5cf9730 zeek-setup: Instantiate backend::manager
Required to allow registration of cluster components.
2024-11-22 10:43:55 +01:00
Arne Welzel
ac9594ffae cluster: Add to src/CMakeLists.txt 2024-11-22 10:43:55 +01:00
Arne Welzel
23ca625c03 cluster: Add Components and ComponentManager for new components 2024-11-22 10:43:54 +01:00
Arne Welzel
fb23a06f6f cluster/Backend: Interface for cluster backends 2024-11-22 10:43:50 +01:00
Arne Welzel
e94e30616d cluster/Serializer: Interface for event and log serializers 2024-11-22 10:06:59 +01:00
Arne Welzel
a946b27faf logging: Introduce logging/Types.h
Header and implementation for types shared between the cluster and
logging framework. The logging framework will be adapted later to
use these. For now, the new cluster components will simply reference
them.
2024-11-22 10:06:59 +01:00
Arne Welzel
60fb212f17 SerialTypes/Field: Allow default construction and add move constructor
This is in preparation of using SerialTypes to serialize and
unserialize complete log batches which include Field instances
and not just Value's.
2024-11-22 10:06:59 +01:00
Arne Welzel
d2633163bd DebugLogger: Add cluster debugging stream 2024-11-22 10:06:59 +01:00
Arne Welzel
35eadf0ceb plugin: Add component enums for pluggable cluster backends 2024-11-22 10:06:59 +01:00
Arne Welzel
349d88153f broker: Pass frame to MakeEvent()
This was lost in a prior change.
2024-11-22 10:06:59 +01:00
zeek-bot
66aec5ba2f Update doc submodule [nomail] [skip ci] 2024-11-22 00:20:09 +00:00
Arne Welzel
9883b3a917 Merge remote-tracking branch 'origin/topic/awelzel/sumstats-non-cluster-final-epoch'
* origin/topic/awelzel/sumstats-non-cluster-final-epoch:
  sumstat/non-cluster: Move last epoch processing to zeek_done()
2024-11-21 16:39:18 +01:00
Arne Welzel
94ffcd6535 Merge remote-tracking branch 'origin/topic/awelzel/plugin-init-pre-execution'
* origin/topic/awelzel/plugin-init-pre-execution:
  plugin: Add InitPreExecution()
2024-11-21 14:41:14 +01:00
Arne Welzel
aac640ebff Merge remote-tracking branch 'origin/topic/awelzel/bump-zeekjs-0-14-0'
* origin/topic/awelzel/bump-zeekjs-0-14-0:
  Bump zeekjs to v0.14.0
2024-11-21 10:22:44 +01:00
Arne Welzel
4b2fbfb57c Bump zeekjs to v0.14.0
79b0c21 version: 0.14.0
    b75b384 docker: Use Fedora 41 packages
    d65cbc8 Minor header cleanup
    4fd7e8b scripts: Remove __preload__.zeek and types.zeek
    93a8113 CreateEnvironment: Unset kOwnsProcessState and kOwnsInspector
    3b1f5d3 Instance::Init(): Replace parameters with Options struct
2024-11-21 10:15:33 +01:00
zeek-bot
eb76da1aa2 Update doc submodule [nomail] [skip ci] 2024-11-21 00:10:29 +00:00
Benjamin Bannier
4a96d34af6 Merge remote-tracking branch 'origin/topic/bbannier/doc-have-spicy' 2024-11-20 09:34:10 +01:00
Benjamin Bannier
a65598ff20 Fix documentation for have_spicy [skip CI]
The continued line was incorrectly marked up (as a plain comment instead
of a Zeekygen comment) which caused only half of the docstring to be
rendered by Zeekygen.
2024-11-19 21:04:35 +01:00
Arne Welzel
6e916efe8d Merge remote-tracking branch 'origin/topic/awelzel/bump-zeekjs-0-13-2'
* origin/topic/awelzel/bump-zeekjs-0-13-2:
  Bump zeekjs to 0.13.2
2024-11-19 19:17:48 +01:00
Tim Wojtulewicz
d9a74680e0 Merge remote-tracking branch 'origin/topic/timw/speed-up-zam-ci-testing'
* origin/topic/timw/speed-up-zam-ci-testing:
  CI: Use test.sh script for running ZAM tests, but disable parts of it
2024-11-19 10:53:21 -07:00
Tim Wojtulewicz
ead3a625f8 CI: Use test.sh script for running ZAM tests, but disable parts of it
This ensures that the normal test setup is run, which enables greedy
mode on Cirrus allowing us to over-provision the testing. This should
help speed up the ZAM builds a bit.
2024-11-19 10:52:44 -07:00
Arne Welzel
f15c49c334 Bump zeekjs to 0.13.2
41ec748 cmake: Use foreach range
    2b90a56 tests: Update new-event to run with 7.1+, remove ip_proto elsewhere
    a596f6f Makefile: Update outdated commands
    b954661 Enable `cmake/FindNodejs.cmake` to find more libnode versions
2024-11-19 18:51:37 +01:00
Christian Kreibich
96273b4550 Merge branch 'topic/christian/fix-rulematcher-iteration'
* topic/christian/fix-rulematcher-iteration:
  Order rule traversal in RuleMatcher::Match() operations by Rule index
2024-11-18 10:13:18 -08:00
Christian Kreibich
b24c5c0e46 Order rule traversal in RuleMatcher::Match() operations by Rule index
This ordering fixes a test failure we're seeing on Alpine for the
signatures/tcp-end-of-match btest, since discrepancies in rule match traversal
could lead to discrepancies in corresponding event ordering.

It looks safe to rely on across platforms since the index is driven by signature
load order, which shouldn't deviate. If this somehow doesn't hold in the future,
we'll only wind up with a test failure, not incorrect match behavior.

(Correction to 2e03fbb8b0, which I pushed
accidentally.)
2024-11-18 09:45:09 -08:00
Christian Kreibich
5e0e2a8bd8 Merge branch 'topic/christian/fix-rulematcher-iteration'
* topic/christian/fix-rulematcher-iteration:
  Define ordering on Rule instances and use on sets in RuleMatcher
2024-11-18 09:39:22 -08:00
Arne Welzel
7ae52ea4d2 Merge remote-tracking branch 'origin/topic/awelzel/zam-baseline-updates'
* origin/topic/awelzel/zam-baseline-updates:
  communityid: Use GetField() over GetFieldAs()
  btest/Baseline.zam: Updates for proto addition
2024-11-18 17:28:37 +01:00
Arne Welzel
91f5945f92 sumstat/non-cluster: Move last epoch processing to zeek_done()
@Sheco reported that standalone epoch processing may exclude scheduled
events when the final sumstat epoch runs before. For example, this easily
happens when attempting to do sumstat observations within connection_state_remove().

Delay final epoch processing to zeek_done() instead.

This doesn't deal with the clustered version - this would need something
more elaborate and potentially a mechanism to delay the shutdown of
other cluster nodes until/after sumstat processing completed.
2024-11-18 15:58:01 +01:00
Arne Welzel
993cdd03e0 plugin: Add InitPreExecution()
Currently, plugins do not have a way to further inspect or even mutate
script functions after ZAM optimization ran. One use-case here is
zeek-perf-support [1]. This plugin wraps Stmt instances of functions,
events and hooks hooks with a small assembly stub to support JIT map
files [2] and for integration with perf tools.

This change introduces a new InitPreExecution() hook that runs after
ZAM optimization completed, just before the zeek_init() event is enqueued.

Additionally, remove the existing CPP_activation_hook. It doesn't seem
to be used. If it becomes necessary in the future, the new
InitPreExecution() hook can be leveraged instead.

[1] https://github.com/zeek/zeek-perf-support
[2] https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt
2024-11-18 13:53:56 +01:00
Tim Wojtulewicz
62bc324fe1 Merge remote-tracking branch 'origin/topic/christian/debug-stream-tweaks'
* origin/topic/christian/debug-stream-tweaks:
  Make debug stream names use "-", and handle "_" transparently
  Make "-B all" apply to plugin streams as well.
  Sort streams in "-B help" output, and match case-insensitively throughout
2024-11-16 09:34:42 -07:00
Christian Kreibich
26cc378471 Merge branch 'topic/timw/avoid-unknown-ip-transport-weirds'
* topic/timw/avoid-unknown-ip-transport-weirds:
  Don't forward out of the unknown IP transport analyzer
2024-11-15 19:08:33 -08:00
Christian Kreibich
b1e0e26484 Make debug stream names use "-", and handle "_" transparently
This looks consistent, and doesn't break any existing uses with underscores.
2024-11-15 17:53:29 -08:00
Tim Wojtulewicz
5c1c592554 Don't forward out of the unknown IP transport analyzer
We already accept that the packets coming into this analyzer won't
be processed, so forwarding out of it will just result in a failure.
Forwarding will also report a weird for every packet which just
results in extra noise.
2024-11-15 16:54:53 -07:00
Tim Wojtulewicz
bb2456129a Merge remote-tracking branch 'origin/topic/timw/ip-proto-btests'
* origin/topic/timw/ip-proto-btests:
  The cisco-fabric-path pcap used in tests doesn't need the -C argument
  Add btests for ip_proto policy files
2024-11-15 16:51:15 -07:00
Tim Wojtulewicz
d30f480ca9 The cisco-fabric-path pcap used in tests doesn't need the -C argument 2024-11-15 16:50:10 -07:00
Tim Wojtulewicz
fbaf438a1d Add btests for ip_proto policy files 2024-11-15 16:49:10 -07:00
Christian Kreibich
7563af4906 Make "-B all" apply to plugin streams as well. 2024-11-15 13:53:06 -08:00
Christian Kreibich
5e4942bcc0 Sort streams in "-B help" output, and match case-insensitively throughout
Matching of plugins' debug streams was still case-sensitive. Also contains some
minor output tweaks.

It'd be nice to only list plugin debug streams actually _used_ by plugins. I
didn't see a quick way to do that so that's for another time.
2024-11-15 12:50:13 -08:00