Commit graph

15276 commits

Author SHA1 Message Date
Arne Welzel
3f3df93ac1 Merge remote-tracking branch 'origin/topic/timw/2914-truncated-tunnel-plus-things'
* origin/topic/timw/2914-truncated-tunnel-plus-things:
  Address wire/capture length feedback
  packet_analysis/TCP: Do not use untrusted len for DeliverPacket()
  Add regression test using pcap from GH-2683
  Add btest to test Geneve->VXLAN->Truncated inner packet
  IP: Update packet->len with accumulated fragment size
  UDP: Forward any remaining data (also empty) to session-analysis
  IPTunnel: Compute inner wire length based on cap_len differences.
  IP: fix weird name to not be ipv6 specific
  UDP: don't validate checksum if caplen < len
  PIA: Modernize how struct initialization is done
2023-05-25 20:19:20 +02:00
Tim Wojtulewicz
2bf0ebae32 Merge remote-tracking branch 'origin/topic/awelzel/auto-hilti-cxx-compiler-launcher-in-btest'
* origin/topic/awelzel/auto-hilti-cxx-compiler-launcher-in-btest:
  btest.cfg: Set HILTI_CXX_COMPILER_LAUNCHER based on build/CMakeCache.txt
2023-05-25 09:03:49 -07:00
Tim Wojtulewicz
540e0c8da8 Merge remote-tracking branch 'origin/topic/bbannier/spicy-test-speedup'
* origin/topic/bbannier/spicy-test-speedup:
  Speed up Spicy-related tests.
2023-05-25 09:03:22 -07:00
Benjamin Bannier
8049d3a002 Speed up Spicy-related tests.
This patch changes invocations of `spicyz` and similar Spicy tools in
tests which perform compilation to use debug mode via passing `-d`. This
in turn leads to Spicy compiling generated C++ code in debug as opposed
to release mode which typically seems to require less CPU time and RAM.
For a local test running with `btest -j 16` and no caching via
`HILTI_CXX_COMPILER_LAUNCER` this sped up running of BTests under
`spicy/` by about 40s on my machine (120s vs 160s).
2023-05-25 14:59:10 +02:00
Arne Welzel
b9803e157b btest.cfg: Set HILTI_CXX_COMPILER_LAUNCHER based on build/CMakeCache.txt
If CMakeCache.txt indicates the Zeek build was done with ccache,
take the CCACHE_PROGRAM:FILEPATH= line and populate the
HILTI_CXX_COMPILER_LAUNCHER environment.

For local development with ccache, this speeds up the spicy tests
significantly after the initial run without knowing or needing know
that setting HILTI_CXX_COMPILER_LAUNCHER would've helped.
2023-05-25 13:42:12 +02:00
Arne Welzel
c4d159d1ff Address wire/capture length feedback 2023-05-25 09:48:14 +02:00
zeek-bot
7e356cfd31 Update doc submodule [nomail] [skip ci] 2023-05-25 00:32:57 +00:00
Tim Wojtulewicz
0e3780d983 Update docs submodule [nomail] 2023-05-24 12:11:10 -07:00
Arne Welzel
6941e44aba packet_analysis/TCP: Do not use untrusted len for DeliverPacket()
We should not be passing the untrusted TCP header length into
DeliverPacket(). Also, DeliverPacket() cap len parameter should
be the capture length of the packet, not remaining data.
2023-05-24 16:41:52 +02:00
Arne Welzel
a41dfb28d5 Add regression test using pcap from GH-2683 2023-05-24 16:34:25 +02:00
Tim Wojtulewicz
d9718342ac Add btest to test Geneve->VXLAN->Truncated inner packet 2023-05-24 16:34:25 +02:00
Arne Welzel
568946ec18 IP: Update packet->len with accumulated fragment size
With packet->len representing the wire length and other places
relying on it, ensure it's updated for fragments as well. This
assumes non-truncated fragments right now. Otherwise we'd need
to teach the FragmentReassembler to somehow track this independently
but it would be a mess.
2023-05-24 16:34:22 +02:00
Arne Welzel
2b9de839b0 UDP: Forward any remaining data (also empty) to session-analysis
The protocol analyzers are prepared to receive truncated data and
this way we give analyzers a chance to look at data. We previously
allowed empty data being passed: When len ended up 0 and remaining
was 0 too.
2023-05-24 16:31:11 +02:00
Arne Welzel
5654f81dee IPTunnel: Compute inner wire length based on cap_len differences. 2023-05-24 16:31:08 +02:00
Tim Wojtulewicz
18a30a7a53 IP: fix weird name to not be ipv6 specific 2023-05-24 16:29:29 +02:00
Tim Wojtulewicz
47ff5a4f61 UDP: don't validate checksum if caplen < len
This may happen with truncated packets and will cause asan builds to bail out
before the packet can be forwarded along. The TCP analyzer already has this
check, but it's missing for UDP.
2023-05-24 16:01:08 +02:00
Tim Wojtulewicz
b8313c2487 PIA: Modernize how struct initialization is done 2023-05-24 16:01:08 +02:00
Arne Welzel
3efb27c963 Add NEWS entry about negative vector index 2023-05-24 10:51:37 +02:00
Arne Welzel
8967e347df Merge remote-tracking branch 'origin/topic/awelzel/telemetry-net-lag'
* origin/topic/awelzel/telemetry-net-lag:
  stats: Add zeek-net-packet-lag-seconds metric
2023-05-24 09:58:00 +02:00
Arne Welzel
25947f3854 Merge remote-tracking branch 'origin/topic/timw/3060-negative-vector-indices'
* origin/topic/timw/3060-negative-vector-indices:
  GH-3060: Support negative index lookups for vectors
2023-05-24 09:40:05 +02:00
Arne Welzel
f396c2b16e stats: Add zeek-net-packet-lag-seconds metric
While writing documentation about troubleshooting and looking a bit
at the older stats.log, realized we don't have the packet lag metric
exposed as metric/telemetry. Add it.

This is a Zeek instance lagging behind in network time ~6second because
it's very overloaded:

    zeek_net_packet_lag_seconds{endpoint=""} 6.169406 1684848998092
2023-05-24 09:12:01 +02:00
Tim Wojtulewicz
351e68b66a GH-3060: Support negative index lookups for vectors 2023-05-23 13:48:58 -07:00
Tim Wojtulewicz
cdb9c74054 Merge remote-tracking branch 'origin/topic/timw/update-broker'
* origin/topic/timw/update-broker:
  Update broker submodule [nomail]
2023-05-23 12:15:14 -07:00
Tim Wojtulewicz
ee79a88265 Update broker submodule [nomail] 2023-05-23 11:41:15 -07:00
Tim Wojtulewicz
a9f8bd5166 Update binpac and bifcl to released versions [nomail] 2023-05-23 11:00:53 -07:00
Tim Wojtulewicz
cf996a66e6 Updating submodule(s) [nomail] 2023-05-23 10:52:57 -07:00
Arne Welzel
f6fb0aca87 Merge remote-tracking branch 'origin/topic/awelzel/ci-tumbleweed-disable-openh264-repo'
* origin/topic/awelzel/ci-tumbleweed-disable-openh264-repo:
  ci: Disable openh264 repository on tumbleweed
2023-05-23 19:32:32 +02:00
Arne Welzel
9f5ef553d5 ci: Disable openh264 repository on tumbleweed
zypper refresh failed on it and we should not be needing packages
either.
2023-05-23 18:39:57 +02:00
Arne Welzel
af00ffec24 Merge remote-tracking branch 'origin/topic/robin/cmake-spicy-link-fix'
* origin/topic/robin/cmake-spicy-link-fix:
  Bump cmake to fix build of multiple Spicy analyzers in a package.
2023-05-23 17:35:48 +02:00
Arne Welzel
b2c22f0dcf Merge remote-tracking branch 'origin/topic/bbannier/issue-3071'
* origin/topic/bbannier/issue-3071:
  Fix crashing when disable_analyzer() called on root analyzers
2023-05-23 15:45:48 +02:00
Arne Welzel
e9cd849843 Fix crashing when disable_analyzer() called on root analyzers
Closes #3071.
2023-05-23 15:44:14 +02:00
Robin Sommer
1859a34726
Bump cmake to fix build of multiple Spicy analyzers in a package. 2023-05-23 12:05:31 +02:00
Tim Wojtulewicz
614f1a9e5f Merge remote-tracking branch 'origin/topic/timw/further-cmake-fixes'
* origin/topic/timw/further-cmake-fixes:
  Revert part of previous CMake debug type fix
2023-05-22 16:39:07 -07:00
Tim Wojtulewicz
120ea779cb Merge remote-tracking branch 'origin/topic/awelzel/3053-fix-raw-reread-mode'
* origin/topic/awelzel/3053-fix-raw-reread-mode:
  btest/input/raw: Fix reread test
  input/Raw: Avoid reading file twice in MODE_REREAD
2023-05-22 16:34:17 -07:00
Tim Wojtulewicz
ef2473564e Revert part of previous CMake debug type fix 2023-05-22 16:11:58 -07:00
Arne Welzel
09b956562e btest/input/raw: Fix reread test
This seems to have relied on the reading file twice behavior simply
testing that 16 lines are observed. Switch to using two separate
files and doing a system("mv ...") to trigger the REREAD logic, there's
not force_update() needed and it wouldn't do anything if the file
hadn't changed anyway.
2023-05-22 11:06:54 +02:00
Arne Welzel
d8b5bdf758 input/Raw: Avoid reading file twice in MODE_REREAD
Found while writing documentation and being confused why
all lines and end_of_data() arrive twice during startup.

The test is a bit fuzzy, but does fail reliably without
the changes to Raw.cc

Also fix not checking dev in the MODE_REREAD path.

Closes #3053
2023-05-22 11:06:25 +02:00
Arne Welzel
3b28f59c3b Merge remote-tracking branch 'origin/topic/christian/gh-3061-fix-cmake-build-type-lower'
* origin/topic/christian/gh-3061-fix-cmake-build-type-lower:
  Fix CMAKE_BUILD_TYPE_LOWER definition-vs-use ordering problem
2023-05-22 10:14:52 +02:00
zeek-bot
2e586b506d Update doc submodule [nomail] [skip ci] 2023-05-20 00:33:41 +00:00
Christian Kreibich
3a55cf3911 Fix CMAKE_BUILD_TYPE_LOWER definition-vs-use ordering problem
It needs to be defined by the time we create zeek-config, which happens before
its current definition. To avoid a redundant TOLOWER when we check for presence
of --enable-debug at the beginning, this also switches this to a case-unadjusted
comparison to "Debug", which we use elsewhere in the file too.
2023-05-19 17:08:10 -07:00
Vern Paxson
890010915a change base scripts to use run-time if's or @if ... &analyze 2023-05-19 13:26:27 -07:00
Vern Paxson
e749638380 a number of BTests updated with @if ... &analyze 2023-05-19 13:13:26 -07:00
Vern Paxson
8e375d34b7 update for scripting coverage BTest demonstrating utility of @if ... &analyze 2023-05-19 13:04:03 -07:00
Vern Paxson
be87f9f6ec BTests for new @if ... &analyze functionality 2023-05-19 13:02:37 -07:00
Vern Paxson
9f4da24644 "if ( ... ) &analyze" language feature 2023-05-19 12:46:01 -07:00
Vern Paxson
052cda9df0 classes for tracking "@if (...) &analyze" notion of code being/not being "activated" 2023-05-19 12:43:12 -07:00
Vern Paxson
9aff0287f0 RemoveGlobal() method for Scope class + simplifying interfaces 2023-05-19 12:41:32 -07:00
Tim Wojtulewicz
222f604452 Merge remote-tracking branch 'origin/topic/neverlord/allow-find-zeek-in-plugins'
* origin/topic/neverlord/allow-find-zeek-in-plugins:
  Allow plugins to call find_package(Zeek)
2023-05-19 10:51:45 -07:00
Tim Wojtulewicz
3757a350cd Updating submodule(s) [nomail] 2023-05-19 09:50:22 -07:00
Arne Welzel
d4c99e7c3f files: Warn once for missing get_file_handle()
Repeating the message for every new call to get_file_handle() is not
very useful. It's pretty much an analyzer configuration issue so logging
it once should be enough.
2023-05-19 09:37:51 -07:00