Commit graph

14697 commits

Author SHA1 Message Date
Arne Welzel
04a2ee7220 Merge remote-tracking branch 'origin/topic/timw/increase-ci-hardware-limits'
* origin/topic/timw/increase-ci-hardware-limits:
  Update Cirrus memory limits to avoid timeouts when building
2023-03-30 09:37:18 +02:00
Arne Welzel
81063d5561 Merge remote-tracking branch 'origin/topic/awelzel/get-child-analyzer'
* origin/topic/awelzel/get-child-analyzer:
  Analyzer: Add GetChildAnalyzer() and IsPreventedChildAnalyzer()
2023-03-30 09:36:22 +02:00
Tim Wojtulewicz
0a6f975a4b Update Cirrus memory limits to avoid timeouts when building 2023-03-29 17:17:47 -07:00
Tim Wojtulewicz
224e60a3f3 Merge remote-tracking branch 'origin/topic/bbannier/bump-spicy'
* origin/topic/bbannier/bump-spicy:
  Bump Spicy and spicy-plugin to their latest development snapshots.
2023-03-29 14:34:42 -07:00
Benjamin Bannier
53652a0673 Bump Spicy and spicy-plugin to their latest development snapshots. 2023-03-29 16:54:41 +02:00
Arne Welzel
b03e678438 Analyzer: Add GetChildAnalyzer() and IsPreventedChildAnalyzer()
GetChildAnalyzer() has the same semantics as HasChildAnalyzer(), but returns
the raw pointer to the child analyzer. Main issue is memory management: That
pointer is not guaranteed to stay valid. It might be disabled from script
land or otherwise removed from the analyzer tree and subsequent
deleted in one of the Forward* methods.

IsPreventedChildAnalyzer() provides minimal introspection for prevented
child analyzer tags and allows to remove some duplicated code.
2023-03-29 13:05:43 +02:00
Tim Wojtulewicz
136d54a68e Merge remote-tracking branch 'origin/topic/timw/std-move-warnings'
* origin/topic/timw/std-move-warnings:
  Fix a bunch of -Wunqualified-std-cast-call warnings from clang 15
2023-03-28 09:20:09 -07:00
Arne Welzel
2f5b9ce038 Merge remote-tracking branch 'origin/topic/awelzel/broker-no-network-time-init'
* origin/topic/awelzel/broker-no-network-time-init:
  btest/broker: Add test using Python bindings and zeek -r
  Broker: Remove network time initialization
2023-03-27 21:33:14 +02:00
Arne Welzel
cd0d55e3d6 btest/broker: Add test using Python bindings and zeek -r
This came up in community.zeek.org as a use-case and there
were a few gaps and holes, so add a test showing minimally
the current behavior.
2023-03-27 21:13:03 +02:00
Tim Wojtulewicz
7aa310ee50 Fix a bunch of -Wunqualified-std-cast-call warnings from clang 15 2023-03-24 13:58:01 -07:00
Arne Welzel
59b1e29e81 Broker: Remove network time initialization
Remove the special case of initializing network time if it hasn't
happened yet. The argument about broker.log containing 0.0 timestamps
is more a problem of the log, not something that would justify modifying
network time globally. For broker.log and possibly cluster.log, it might
be more reasonable to use current time, anyway.

I was a bit wary about tables backed by broker stores being populated
with network_time set to 0.0, but there seems to exist logic and assumptions
that this is okay: It should be the same as if one populates a table with
expirations set within zeek_init().

In fact, staring a bit more, *not setting* network time might be more correct
as workers that don't see packets would never set zeek_start_network_time
which is used within the expiration computation.
2023-03-24 15:13:29 +01:00
Arne Welzel
96bbb96b35 Merge remote-tracking branch 'origin/topic/awelzel/no-container-images-on-prs'
* origin/topic/awelzel/no-container-images-on-prs:
  cirrus: No container images on PRs
2023-03-24 09:12:26 +01:00
zeek-bot
0478c45f81 Update doc submodule [nomail] [skip ci] 2023-03-24 00:29:58 +00:00
Arne Welzel
71f487bd20 Merge remote-tracking branch 'origin/topic/timw/zeek-security-master-builds'
* origin/topic/timw/zeek-security-master-builds:
  Ensure master/release builds run for zeek-security
2023-03-23 13:40:37 +01:00
Arne Welzel
890d2b5e07 Merge remote-tracking branch 'origin/topic/awelzel/try-update-network-time'
* origin/topic/awelzel/try-update-network-time:
  NEWS: Some notes about timing related changes
  iosource: Remove non-existing ManagerBase friend
  broker::Manager: use_realtime_false when allow_network_time_forward=F
  A set of tests around set_network_time() and timer expiration
  Remove suspend-processing test
  Add a set of suspend_processing tests
  btest: More verbose recursive-event output
  broker::Manager: No more network_time forwarding
  TimerMgr: No network_time updates in Process()
  Event: No more network_time updates
  RunState: Implement forward_network_time_if_applicable()
  PktSrc: Add HasBeenIdleFor() method
  PktSrc: Move termination pseduo_realtime special case to RunState
2023-03-23 13:37:28 +01:00
Arne Welzel
fd15a33f8c NEWS: Some notes about timing related changes 2023-03-23 12:41:56 +01:00
Arne Welzel
833dd158de iosource: Remove non-existing ManagerBase friend 2023-03-23 12:41:56 +01:00
Arne Welzel
9b8ab7b210 broker::Manager: use_realtime_false when allow_network_time_forward=F
Run the broker in non-realtime mode when allow_network_time_forward=F.
This may need an extra option for really advanced use-cases, but for
now this seems reasonable.
2023-03-23 12:41:56 +01:00
Arne Welzel
8734f23724 A set of tests around set_network_time() and timer expiration
This tests that timer expiration happens after a call to set_network_time()
upon the next time around the loop. This should be fairly stable, but
suspect major changes in the main loop or around timer expiration may
subtly change behavior things.
2023-03-23 12:41:56 +01:00
Arne Welzel
4a6ce8b2ad Remove suspend-processing test
This tested that timers continue working even if one calls
suspend_processing() in zeek -r mode. The new behavior is
that timers do not function in that scenario and the test
invalid.
2023-03-23 12:41:56 +01:00
Arne Welzel
aad66b3cff Add a set of suspend_processing tests
Placed into core/ but relies on a few not-so-core things.
2023-03-23 12:41:56 +01:00
Arne Welzel
9c5b439e8f btest: More verbose recursive-event output
I don't think something broken, but the one line output.
2023-03-23 12:41:56 +01:00
Arne Welzel
3269310e61 broker::Manager: No more network_time forwarding
network_time forwarding will happen in the main-loop before draining the
EventMgr so timers/events scheduled based on broker messages should
behave similarly. This also keeps network_time unaffected during
non pseudo-realtime trace processing.
2023-03-23 12:41:56 +01:00
Arne Welzel
c30b5cbc4d TimerMgr: No network_time updates in Process()
network_time forwarding will now happen centrally in the main loop.
The TimerMgr returns a valid timeout that can be waited for and will
trigger network_time advancement, so we don't need to do it.
2023-03-23 12:41:56 +01:00
Arne Welzel
2e8176305b Event: No more network_time updates
The whole docs read like this was only used to update the
network_time, so there may be a follow-up to ditch EventMgr
even being an IOSource (which could be argued it's not IO).
2023-03-23 12:41:56 +01:00
Arne Welzel
d4e31e7d2b RunState: Implement forward_network_time_if_applicable()
Add a central place where the decision when it's okay to update network time
to the current time (wallclock) is. It checks for pseudo_realtime and packet
source existence as well as packet source idleness.

A new const &redef allows to completely disable forwarding of network time.
2023-03-23 12:40:39 +01:00
Arne Welzel
eefa0150b9 PktSrc: Add HasBeenIdleFor() method
This method will be used by the main loop to determine if an interface
has become idle. Initially this will be used to determine when it is
acceptable to update network_time to the current time (wallclock).
2023-03-23 12:40:25 +01:00
Arne Welzel
a9f8627dd9 PktSrc: Move termination pseduo_realtime special case to RunState
This also removes setting pseduo_realtime to 0.0 in the main loop
when the packet source has been closed. I had tried to understand
the implications it actually seems, if we shutdown the iosource::Manager
anyway, it shouldn't and it's just confusing.
2023-03-23 12:33:32 +01:00
Tim Wojtulewicz
5882299730 Ensure master/release builds run for zeek-security 2023-03-22 15:49:37 -07:00
Christian Kreibich
a9cec2e4f4 Bump zeekctl and doc submodule for updates regarding Site::local_nets 2023-03-22 13:34:54 -07:00
zeek-bot
4f45d9e00a Update doc submodule [nomail] [skip ci] 2023-03-22 00:33:38 +00:00
Arne Welzel
93305ad9f4 Merge remote-tracking branch 'origin/topic/awelzel/make-some-deprecations-errors'
* origin/topic/awelzel/make-some-deprecations-errors:
  Expr: Factor out type tag extraction
  Var: Add version to deprecated initialization
  Stmt: Error on deprecated when/local usage
  Expr: Remove vector scalar operations
  parse.y: Make out-of-scope use errors
  scan.l: Remove unused deprecated_attr
2023-03-21 19:18:41 +01:00
Arne Welzel
63be88a1f8 Merge remote-tracking branch 'origin/topic/awelzel/supervisor-pcap-file'
* origin/topic/awelzel/supervisor-pcap-file:
  Add pcap_file option to supervised nodes.
2023-03-21 16:40:51 +01:00
Jan Grashoefer
1882307cf3 Add pcap_file option to supervised nodes.
This allows to start Supervised nodes with a pcap_file argument
rather than interface.

This is based on changes from @J-Gras.
2023-03-21 16:18:02 +01:00
Arne Welzel
859ecc7b8b Merge remote-tracking branch 'origin/topic/awelzel/main-loop-allow-multiple-zero-timeouts'
* origin/topic/awelzel/main-loop-allow-multiple-zero-timeouts:
  NEWS: main-loop changes around zero-timeout sources
  Add a new plugin test with verbose IO source output
  iosource: Make poll intervals configurable
  iomanager/Poll: Add zero-timeout timeout_src also when there's other events ready
  iomanager: Collect all sources with zero timeouts as ready
2023-03-21 10:11:56 +01:00
Arne Welzel
2b14503c3d NEWS: main-loop changes around zero-timeout sources 2023-03-21 09:25:15 +01:00
Arne Welzel
38c4611c7e Add a new plugin test with verbose IO source output
This is mostly for documentation/verification purposes of how the IO loop
currently does draining and when it picks up FD based (non packet) IO
source. For example, it shows that currently FD based sources are processed
fairly delayed and that we now also process two timeout sources that are ready.
2023-03-21 09:15:39 +01:00
Arne Welzel
46c432dc8b iosource: Make poll intervals configurable
This probably should not be changed by users, but it's useful for
testing and experimentation rather than needing to recompile.

Processing 100 packets without checking an FD based IO source can
actually mean that FD based sources are never checked during a read
of a very small pcap...
2023-03-21 09:15:33 +01:00
Arne Welzel
5f1a85803a iomanager/Poll: Add zero-timeout timeout_src also when there's other events ready
This would generally happen the next loop iteration around anyway, but
seems nice to ensure a zero timeout source will be processed at the same
time as sources with ready FDs.
2023-03-21 09:15:33 +01:00
Arne Welzel
f3fcaf776c iomanager: Collect all sources with zero timeouts as ready
Previously, if two iosources returned 0.0 as their timeout, only
one of them would be considered ready. An always ready source
therefore may starve other ready ones due to this and minimally
this behavior seems surprising.

Offline pcap sources are always ready and return 0.0 for
GetNextTimeout() (unless in pseudo-realtime), so we can
also remove the offline source special case.

One subtle side-effect of this change is that if an IO source
returns a 0.0 timeout *and* it's file descriptor is ready in
the same loop iteration, it may be processed twice.
2023-03-21 09:15:33 +01:00
Arne Welzel
cb5c43ecbd Expr: Factor out type tag extraction 2023-03-21 09:06:50 +01:00
Arne Welzel
c1f51cbf2a Var: Add version to deprecated initialization
This has been added for Zeek 5.0, so mark it for removal in Zeek 6.1.
2023-03-20 21:36:01 +01:00
Arne Welzel
bb80d80218 Stmt: Error on deprecated when/local usage
This has been around since Zeek v4.1, so it was warned about in Zeek 5.0
LTS and we could've removed it with 5.1.

Also removed merge_top_scope() from the zeek::detail namespace, it's
unused now.

Updated the when-aggregates test somehow. I'm not quite sure what had
been tested there :-/
2023-03-20 21:35:53 +01:00
Arne Welzel
5ef62b2de8 Expr: Remove vector scalar operations
These seem to have been deprecated since 2018, so do it now.
Unfortunately the message didn't contain a version when it'll
be removed, but it's been long enough.
2023-03-20 21:35:48 +01:00
Arne Welzel
12d5dca70f parse.y: Make out-of-scope use errors
This was marked to be done in Zeek 5.1, so do it now. The message
didn't include a version, unfortunately, but minimally there was
a comment when it should happen.
2023-03-20 21:35:48 +01:00
Arne Welzel
5b2c82c1e9 scan.l: Remove unused deprecated_attr 2023-03-20 21:35:48 +01:00
Tim Wojtulewicz
5cba1e0b09 Merge remote-tracking branch 'origin/topic/timw/update-zeekctl-test-baseline'
* origin/topic/timw/update-zeekctl-test-baseline:
  ci/centos-stream-8: Add which command
  Update zeekctl test baseline for command.peerstatus test
  Update zeekctl test baseline for changes to Site::local_nets
2023-03-20 10:05:12 -07:00
Arne Welzel
79ea84e5f4 ci/centos-stream-8: Add which command 2023-03-20 10:04:20 -07:00
Tim Wojtulewicz
1b6b6b3209 Update zeekctl test baseline for command.peerstatus test 2023-03-20 10:04:20 -07:00
Arne Welzel
1599235b58 cirrus: No container images on PRs
Skip building container images (and skip cluster testing)
unless running with fullci.

They don't provide a lot of additional testing coverage, so
should be fine to just run them after merges to master.
2023-03-20 12:27:01 +01:00