Commit graph

17107 commits

Author SHA1 Message Date
zeek-bot
fc42074c7c Update doc submodule [nomail] [skip ci] 2024-10-25 00:22:10 +00:00
Christian Kreibich
66173633f4 Merge branch 'topic/christian/telemetry-make-bifs-primary'
* topic/christian/telemetry-make-bifs-primary:
  Telemetry framework: move BIFs to the primary-bif stage
  Minor comment tweaks for init-frameworks-and-bifs.zeek
2024-10-24 07:09:16 -07:00
Christian Kreibich
f2b4c9d553 Update broker submodule [nomail]
This pulls in zeek/broker#424, zeek/broker#430, zeek/broker#431.
2024-10-23 05:52:07 -07:00
zeek-bot
b65a7d427c Update doc submodule [nomail] [skip ci] 2024-10-23 00:12:55 +00:00
Arne Welzel
daa358c840 Merge remote-tracking branch 'origin/topic/awelzel/3947-telemetry-hook-scrape'
* origin/topic/awelzel/3947-telemetry-hook-scrape:
  btest/telemetry: Fix "Note compilable" typo
  misc/stats: Add zeek_net_timestamp_seconds
  telemetry/Manager: Remove variant include
  telemetry: Invoke Telemetry::sync() only at scrape/collection time
2024-10-22 19:04:51 +02:00
Arne Welzel
3d053a94f7 btest/telemetry: Fix "Note compilable" typo 2024-10-22 18:50:32 +02:00
Arne Welzel
e20aa66eae misc/stats: Add zeek_net_timestamp_seconds
Adding a metric for the network time value itself should make it
possible to observe it stopping or growing slowly as compared to
realtime when Zeek isn't able to keep up.

Also, modify the telemetry/log.zeek test to include misc/stats and
log at a higher frequency with a more interesting pcap.
2024-10-22 18:49:17 +02:00
Arne Welzel
1822f4f6fe telemetry/Manager: Remove variant include 2024-10-22 18:49:16 +02:00
Arne Welzel
70872673a1 telemetry: Invoke Telemetry::sync() only at scrape/collection time
This stops invoking Telemetry::sync() via a scheduled event and instead
only invokes it on-demand. This makes metric collection network time
independent and lazier, too.

With Prometheus scrape requests being processed on Zeek's main thread
now, we can safely invoke the script layer Telemetry::sync() hook.

Closes #3947
2024-10-22 18:49:11 +02:00
Arne Welzel
d74b073852 Merge remote-tracking branch 'origin/topic/awelzel/3978-zeekjs-0.12.1-bump'
* origin/topic/awelzel/3978-zeekjs-0.12.1-bump:
  Bump zeekjs to 0.12.1
2024-10-22 11:25:05 +02:00
Arne Welzel
ee18b8911c Bump zeekjs to 0.12.1
7ec0953 ci: Bump actions/upload-artifact
    8e5914d ci/docker: Bump distros, update some OBS repos
    129b737 Fix crash during shutdown

Closes #3978
2024-10-22 11:09:35 +02:00
zeek-bot
5428ddbdeb Update doc submodule [nomail] [skip ci] 2024-10-22 00:10:53 +00:00
Arne Welzel
4763282f36 Merge branch 'modbus-fixes' of https://github.com/zambo99/zeek
* 'modbus-fixes' of https://github.com/zambo99/zeek:
  Prevent non-Modbus on port 502 to be reported as Modbus
2024-10-21 15:54:11 +02:00
Emmanuele Zambon
05d92dc2a5 Prevent non-Modbus on port 502 to be reported as Modbus
This commit prevents most non-Modbus TCP traffic on port 502 to be
reported as Modbus in conn.log as well as in modbus.log.
To do so, we have introduced two &enforce checks in the Modbus
protocol definition that checks that some specific fields of the
(supposedly) Modbus header are compatible with values specified in
the specs.

To ensure non-regression, with this commit we also introduce a
new btest.

Closes #3962
2024-10-21 14:40:45 +02:00
Christian Kreibich
2e576b058d Merge branch 'topic/vern/script-opt-headers-factoring'
* topic/vern/script-opt-headers-factoring:
  factored CPP source's main header into collection of per-source-file headers
  renamed script optimization Attrs.h header to prepare for factoring large Compile.h
  factored ZAM source's main header into collection of per-source-file headers
2024-10-18 17:51:19 -07:00
Vern Paxson
744628f115 factored CPP source's main header into collection of per-source-file headers 2024-10-18 17:37:33 -07:00
Vern Paxson
a2495d028e renamed script optimization Attrs.h header to prepare for factoring large Compile.h 2024-10-18 17:37:33 -07:00
Vern Paxson
64de2dbf31 factored ZAM source's main header into collection of per-source-file headers 2024-10-18 17:37:33 -07:00
zeek-bot
d6c1d0640e Update doc submodule [nomail] [skip ci] 2024-10-19 00:13:12 +00:00
Christian Kreibich
71f7e89974 Telemetry framework: move BIFs to the primary-bif stage
This moves the Telemetry framework's BIF-defined functionalit from the
secondary-BIFs stage to the primary one. That is, this functionality is now
available from the end of init-bare.zeek, not only after the end of
init-frameworks-and-bifs.zeek.

This allows us to use script-layer telemetry in our Zeek's own code that get
pulled in during init-frameworks-and-bifs.

This change splits up the BIF features into functions, constants, and types,
because that's the granularity most workable in Func.cc and NetVar. It also now
defines the Telemetry::MetricsType enum once, not redundantly in BIFs and script
layer.

Due to subtle load ordering issues between the telemetry and cluster frameworks
this pushes the redef stage of Telemetry::metrics_port and address into
base/frameworks/telemetry/options.zeek, which is loaded sufficiently late in
init-frameworks-and-bifs.zeek to sidestep those issues. (When not doing this,
the effect is that the redef in telemetry/main.zeek doesn't yet find the
cluster-provided values, and Zeek does not end up listening on these ports.)

The need to add basic Zeek headers in script_opt/ZAM/ZBody.cc as a side-effect
of this is curious, but looks harmless.

Also includes baseline updates for the usual btests and adds a few doc strings.
2024-10-18 09:56:29 -07:00
Christian Kreibich
acdd7a7934 Minor comment tweaks for init-frameworks-and-bifs.zeek 2024-10-18 09:56:29 -07:00
Christian Kreibich
c28442a9a1 Merge remote-tracking branch 'origin/topic/bbannier/fix-docs-ci-again'
* origin/topic/bbannier/fix-docs-ci-again:
  Fix installation of Python packages in generate docs CI job again
2024-10-18 09:55:33 -07:00
Benjamin Bannier
42762aa06e Fix installation of Python packages in generate docs CI job again
This pins the generate-docs GH workflow to run on a fixed version of
ubuntu so we get defined semantics of `pip install` wrt system packages.
We were previously using the `ubuntu-latest` image and GH has been
switching this from ubuntu-22.04 to 24.04 and back again, also see
https://github.com/actions/runner-images/issues/10636.
2024-10-18 08:51:18 +02:00
zeek-bot
ec9d6932fc Update doc submodule [nomail] [skip ci] 2024-10-16 00:40:34 +00:00
Benjamin Bannier
cb612cd48a Merge branch 'topic/bbannier/fix-sphinx-build' 2024-10-15 17:12:22 +02:00
Benjamin Bannier
cfd66ec6f3 Fix invalid Sphinx directive in docstring
Use of `:zeek::see:..` instead of `:zeek:see:..` caused a Sphinx build
failure which prevented automatic regeneration of docs.
2024-10-15 12:47:39 +02:00
Benjamin Bannier
a1aff92c1a Merge remote-tracking branch 'origin/topic/bbannier/ci-pre-commit' 2024-10-15 12:15:30 +02:00
Benjamin Bannier
5110af3c13 Bump GH actions for generate-docs job 2024-10-15 10:45:28 +02:00
Benjamin Bannier
34490edae0 Fix installation of Python packages in generate docs CI job
This job uses `ubuntu-latest`, i.e., it will automatically use the
newest version of Ubuntu available. On current versions `pip install`
refuses to install packages into the system since this might break
system packages. Users are expected to explicitly opt into this
potential breakage by passing the `--break-system-packages` flag. This
is an acceptable workaround here since we do not distribute this setup,
and currently things appear to not break.
2024-10-15 10:43:52 +02:00
Benjamin Bannier
7747182dbd Bump GH actions for pre-commit job 2024-10-15 10:33:41 +02:00
Benjamin Bannier
d9072c0932 Pin distribution for pre-commit CI job
The GH action `pre-commit/action` installs `pre-commit` into the system
with `pip`.[^1] On newer distributions this is discouraged as it might break
system packages and would require a dedicated flag
`--break-system-packages` in order to pass.

Since the action does not work in such environments yet, instead pin the
distribution we use for the workflow to a fixed, older and working version.

[^1]: 576ff52938/action.yml (L11)
2024-10-15 10:30:44 +02:00
Benjamin Bannier
391fb4de07 Merge remote-tracking branch 'origin/topic/etyp/enshrine-event-order' 2024-10-15 09:57:36 +02:00
Evan Typanski
0c79849a0f Test .evt file &priority
This was not documented nor tested, so this tests the behavior.
Documentation should be added later.
2024-10-14 08:51:58 -04:00
zeek-bot
1e24980901 Update doc submodule [nomail] [skip ci] 2024-10-10 00:12:02 +00:00
Christian Kreibich
1208555ee3 Merge remote-tracking branch 'origin/topic/vern/remove-teredo-gtpv1-script-opt-insts'
* origin/topic/vern/remove-teredo-gtpv1-script-opt-insts:
  removed specialized ZAM instructions for GTPv1 and Teredo cleanup BiFs
2024-10-09 15:36:52 -07:00
Christian Kreibich
2651de64bf Merge remote-tracking branch 'origin/topic/vern/script-opt-baselines.Oct24'
* origin/topic/vern/script-opt-baselines.Oct24:
  -a zam baseline updates reflecting recent changes to main baselines
2024-10-09 15:36:21 -07:00
Christian Kreibich
2a23e9fc19 Merge branch 'topic/awelzel/3957-raw-reader-spinning'
* topic/awelzel/3957-raw-reader-spinning:
  input/Raw: Rework GetLine()
2024-10-09 14:26:54 -07:00
Arne Welzel
ecfa03ea1d input/Raw: Rework GetLine()
This isn't a straightforward fix, unfortunately. The existing GetLine()
implementation didn't deal well with input that's incrementally produced
where individually read chunks wouldn't end with the separator.

The prior implementation increased the buffer each time it failed to find
a separator in the current buffer, but then also ended up not searching the
full new buffer size for the terminator, doing that endlessly.

This change reworks the Raw reader to rely only on bufpos for reading
and searching purposes and skip reallocation if the buffer size if it
wasn't actually exhausted.

Closes #3957
2024-10-09 14:21:07 -07:00
Vern Paxson
b4bfbcc8d2 removed specialized ZAM instructions for GTPv1 and Teredo cleanup BiFs 2024-10-05 15:39:47 -07:00
Vern Paxson
99f2bcef41 -a zam baseline updates reflecting recent changes to main baselines 2024-10-05 14:57:50 -07:00
Arne Welzel
4656faed6c POP3: Rework unbounded pending command fix
Processing out-of-order commands or finishing commands based on invalid
server responses resulted in inconsistent analyzer state, potentially
triggering null pointer references for crafted traffic.

This commit reworks cf9fe91705 such that
too many pending commands are simply discarded, rather than any attempt
being made to process them. Further, invalid server responses do not
result in command completion anymore.

Test PCAP was crafted based on traffic produced by the OSS-Fuzz reproducer.

Closes #215
2024-10-04 12:45:59 -07:00
Christian Kreibich
d70bb6a889 Merge branch 'topic/christian/bump-cluster-testing'
* topic/christian/bump-cluster-testing:
  Bump zeek-testing-cluster to pull in a baseline update
2024-10-04 12:45:22 -07:00
Christian Kreibich
4ccf1dd470 Bump zeek-testing-cluster to pull in a baseline update
The recently expanded `Describe()` output (c0ffaabe) caused one test to
complain.
2024-10-04 12:44:11 -07:00
Arne Welzel
c826118385 Merge remote-tracking branch 'origin/topic/etyp/centos-missing-file-test-fail'
* origin/topic/etyp/centos-missing-file-test-fail:
  Fix flaky `missing-file-initially` test
2024-10-04 19:32:48 +02:00
Evan Typanski
5c6f172c0a Fix flaky missing-file-initially test
That test got flaky probably from #3949 on centosstream9 CI. You can
replicate that behavior by increasing the sleep time when waiting for
the file such that the test will attempt to read the missing file again.
Since the one second wait for file is glacially slow for this, speeding
it up should mean that the file gets created sooner and so the test
won't try to open the file again. But, it's always still technically
possible, since the test will wait for 10 seconds and the heartbeat
seems to be 1 second. At least if that happens, it's probably a bug or
massive slowdown of some kind.
2024-10-04 12:27:34 -04:00
Benjamin Bannier
ac5522f03a Merge branch 'topic/bbannier/spicyz-usage' 2024-10-04 13:34:49 +02:00
Benjamin Bannier
2358e8b608 Add missing newline in spicyz usage message 2024-10-04 12:56:19 +02:00
Arne Welzel
e118887771 Merge remote-tracking branch 'origin/topic/etyp/bg-test-nondeterminism'
* origin/topic/etyp/bg-test-nondeterminism:
  Fix input error test nondeterminism
2024-10-02 20:17:38 +02:00
Evan Typanski
e8872b4c7f Fix input error test nondeterminism
It seems like other similar tests get by because they have more "stuff"
before they call `terminate()` most likely. But, to be safe, just
removing the "received termination signal" line seems like the best
approach.
2024-10-02 13:26:41 -04:00
Arne Welzel
6aeb302bfc Merge remote-tracking branch 'origin/topic/etyp/remove-duplicate-table-warns'
* origin/topic/etyp/remove-duplicate-table-warns:
  Report suppressed warnings count
  Avoid duplicating warnings when reading table
2024-10-01 11:52:02 +02:00