Commit graph

4598 commits

Author SHA1 Message Date
Arne Welzel
2389f6f6c5 quic: Add spicy-events.zeek 2023-10-19 10:48:24 +02:00
Arne Welzel
536686f02d gre-over-udp: Update testing pcap with both endpoints
The first pcap only contained packets from the originator, not the responder.

What stands out here is that the Linux kernel doesn't seem to use a symmetric
flow hash for the tunneled connection, resulting in a total of four tunnel
connections for the two inner connections. Sigh.
2023-10-17 12:30:14 +02:00
Tim Wojtulewicz
6d9d4523bc Add registration for GRE-over-UDP 2023-10-16 11:42:24 -07:00
Tim Wojtulewicz
738c39379f Start of 6.2.0 development 2023-10-13 10:58:29 -07:00
Arne Welzel
007bcefd09 Merge remote-tracking branch 'origin/topic/awelzel/2326-import-quic'
* origin/topic/awelzel/2326-import-quic:
  ci/btest: Remove spicy-quic helper, disable Spicy on CentOS 7
  btest/core/ppp: Run test in bare mode
  btest/quic: Update other tests
  testing/quic: Fixups and simplification after Zeek integration
  quic: Integrate as default analyzer
  quic: Include Copyright lines to the analyzer's source code contributed by Fox-IT
  quic: Squashed follow-ups: quic.log, tests, various fixes, performance
  quic: Initial implementation
2023-10-11 18:05:14 +02:00
Arne Welzel
1774a25f00 ci/btest: Remove spicy-quic helper, disable Spicy on CentOS 7
The have-quic pattern wasn't great and it wouldn't scale.
2023-10-11 17:17:23 +02:00
Arne Welzel
01bf1d4764 Merge remote-tracking branch 'origin/topic/awelzel/update-zeekygen-docs-show-stderr'
* origin/topic/awelzel/update-zeekygen-docs-show-stderr:
  ci/update-zeekygen-docs.sh: Do output stderr by default
  zeekygen: Disable zeek_init() handlers causing error output
  zeekygen/example: Squelch unused function warning
2023-10-11 15:21:31 +02:00
Arne Welzel
94a8cf2a09 Merge remote-tracking branch 'origin/topic/awelzel/pcap-reading-configurable-buffer'
* origin/topic/awelzel/pcap-reading-configurable-buffer:
  iosource/pcap: Support configurable buffer size
  util/setvbuf: Respect buf argument
2023-10-11 15:20:17 +02:00
Arne Welzel
e51d7815f2 btest/core/ppp: Run test in bare mode 2023-10-11 15:13:23 +02:00
Arne Welzel
f814be4484 btest/quic: Update other tests 2023-10-11 15:13:18 +02:00
Arne Welzel
6fd68bc607 zeekygen/example: Squelch unused function warning 2023-10-11 14:28:33 +02:00
Arne Welzel
3f99aa7996 testing/quic: Fixups and simplification after Zeek integration 2023-10-11 14:10:22 +02:00
Arne Welzel
359f8d2ae6 quic: Squashed follow-ups: quic.log, tests, various fixes, performance 2023-10-11 14:10:22 +02:00
Joost
44d7c45723 quic: Initial implementation 2023-10-11 14:10:22 +02:00
Arne Welzel
ffc35d90ba Merge remote-tracking branch 'origin/topic/awelzel/ldap-follow-up'
* origin/topic/awelzel/ldap-follow-up:
  protocol/ldap: Add doc-id/doc-description to .evt file
  spicy/manager: Ensure Zeekygen knows identifier for registered types
2023-10-11 14:09:32 +02:00
Arne Welzel
101c6696b9 spicy/manager: Ensure Zeekygen knows identifier for registered types
Without this, Zeekygen won't generate documentation about exported
enum types as it can not resolve the identifier. Also, only register a
type as item with the Spicy plugin if there's no _module_info currently
active.
2023-10-11 13:31:20 +02:00
Arne Welzel
72df1a0216 Merge remote-tracking branch 'origin/topic/bbannier/issue-3234'
* origin/topic/bbannier/issue-3234:
  Introduce dedicated `LDAP::Info`
  Remove redundant storing of protocol in LDAP logs
  Use LDAP `RemovalHook` instead of implementing `connection_state_remove`
  Tidy up LDAP code by using local references
  Pluralize container names in LDAP types
  Move LDAP script constants to their own file
  Name `LDAP::Message` and `LDAP::Search` `*Info`
  Make ports for LDAP analyzers fully configurable
  Require have-spicy for tests which log spicy-ldap information
  Fix LDAP analyzer setup for when Spicy analyzers are disabled
  Bump zeek-testing-private
  Integrate spicy-ldap test suite
  Move spicy-ldap into Zeek protocol analyzer tree
  Explicitly use all of spicy-ldap's modules
  Explicitly list `asn1.spicy` as spicy-ldap source
  Remove uses of `zeek` module in spicy-ldap
  Fix typos in spicy-ldap
  Remove project configuration files in spicy-ldap
  Integrate spicy-ldap into build
  Import zeek/spicy-ldap@57b5eff988
2023-10-10 20:07:03 +02:00
Benjamin Bannier
346d2c49a9 Introduce dedicated LDAP::Info 2023-10-10 18:49:25 +02:00
Benjamin Bannier
301d8722bf Remove redundant storing of protocol in LDAP logs 2023-10-10 18:49:25 +02:00
Benjamin Bannier
3a60a60619 Pluralize container names in LDAP types 2023-10-10 18:49:25 +02:00
Benjamin Bannier
0c126f3c6b Move LDAP script constants to their own file 2023-10-10 18:28:13 +02:00
Benjamin Bannier
c43bc52e18 Name LDAP::Message and LDAP::Search *Info 2023-10-10 18:28:13 +02:00
Benjamin Bannier
9b02b93889 Make ports for LDAP analyzers fully configurable
This moves the ports the LDAP analyzers should be triggered on from the
EVT file to the Zeek module. This gives users full control over which
ports the analyzers are registered for while previously they could only
register them for additional ports (there is no Zeek script equivalent
of `Manager::UnregisterAnalyzerForPort`).

The analyzers could still be triggered via DPD, but this is intentional.
To fully disable analyzers users can use e.g.,

```zeek
event zeek_init()
    {
    Analyzer::disable_analyzer(Analyzer::ANALYZER_LDAP_TCP);
    }
```
2023-10-10 18:28:13 +02:00
Arne Welzel
7fac5837c3 iosource/pcap: Support configurable buffer size
On Linux with a default ext4 or tmpfs filesystem, the default buffer size for
reading a pcap is chosen as 4k (strace/gdb validated). When reading large pcaps
containing raw data transfers, the syscall overhead for read becomes visible
in profiles. Support configurability of the buffer size and default to 128kb.

When processing a ~830M PCAP (16 UDP connections, each transferring ~50MB) in
bare mode, this change improves runtime from 1.39 sec to 1.29 sec. Increasing
the buffer further didn't provide a noticeable boost.
2023-10-10 15:08:51 +02:00
Benjamin Bannier
c0daacfbd1 Require have-spicy for tests which log spicy-ldap information 2023-10-10 09:21:57 +02:00
Benjamin Bannier
53d4052d68 Fix LDAP analyzer setup for when Spicy analyzers are disabled 2023-10-10 09:21:57 +02:00
Benjamin Bannier
20ae1129ea Bump zeek-testing-private 2023-10-10 09:21:57 +02:00
Benjamin Bannier
d7db52dff6 Integrate spicy-ldap test suite 2023-10-10 09:21:57 +02:00
Benjamin Bannier
f172febbcb Move spicy-ldap into Zeek protocol analyzer tree 2023-10-10 09:21:57 +02:00
Benjamin Bannier
080d7418d7 Import zeek/spicy-ldap@57b5eff988 2023-10-10 09:21:57 +02:00
Arne Welzel
48b27f30c9 Merge remote-tracking branch 'origin/topic/awelzel/plugin-hooks-bare-mode'
* origin/topic/awelzel/plugin-hooks-bare-mode:
  btest/plugins/hooks: Run in bare mode
2023-10-09 16:27:10 +02:00
Arne Welzel
2ed89ff84f Bump cmake submodule for 3.15 requirement 2023-10-09 16:23:12 +02:00
Arne Welzel
07ac6fa074 btest/plugins/hooks: Run in bare mode
Motivation is basically the same as in 88bb527026.
For plugin.hooks, one example is that adding a new option in the default script
changes the baseline due registration of change handlers. Also, the connection
record is printed in various places, resulting in churn when the default
scripts change.
2023-10-09 16:13:59 +02:00
Arne Welzel
998ab80385 btest/coverage: Add record-fields test
Justin pointed out that the misc/dump-events test shows added fields to
the connection record. Add a new test that prints the connection record
recursively in bare and default mode to cover that use-case
specifically.
2023-10-09 13:58:08 +02:00
Arne Welzel
88bb527026 btest/dump-events: Run in bare mode, load conn and smtp scripts only
The dump-events baseline changes are pure noise and have spurred confusion
for internal and external contributors. For example, adding new
analyzers have perturbed orderings of sets holding analyzer tags.

Running in non-bare mode, the baselines change almost whenever any of the
record types attached to connections change in the default scripts. This
causes continuous and seemingly little useful updates to the baselines.

This change switches the test to run in bare mode and explicitly loads
just base/protocols/conn and base/protocols/smtp. The primary intention
of the test should be testing the functionality of the misc/dump-events
script, not the raised events of all loaded default scripts (for that the
used PCAP is too narrow).

Protocol specific scripts that do want to leverage misc/dump-events for
baseline creation of their or their analyzer's events can add additional
specific tests with suitable PCAP files.
2023-10-09 12:20:10 +02:00
Christian Kreibich
26897bf906 Merge branch 'topic/christian/normalize-file-paths'
* topic/christian/normalize-file-paths:
  Btest for normalized reporter path reporting
  Normalize file paths in find_file_in_path()
2023-10-04 22:46:54 -07:00
Arne Welzel
8109bbc52f Var/Func: Render function parameters using comma, not semicolon
A bit larger follow-up to what Tim pointed out: Function prototype descriptions
previously used semicolons to separate parameters.

Switch to use commas when a RecordType is used as function parameter.
Use existing "func_args" naming for consistency.
2023-10-04 17:42:30 +02:00
Arne Welzel
8ede22f6ec Var: Fix null-pointer deref on redefinition of lambdas
Closes #3314
2023-10-04 15:18:24 +02:00
Christian Kreibich
e84a7ab7f1 Btest for normalized reporter path reporting 2023-10-03 22:16:00 -07:00
Tim Wojtulewicz
9dcf1b4cd1 Merge remote-tracking branch 'origin/topic/awelzel/3342-fix-broker-composite-key-tables-deletion'
* origin/topic/awelzel/3342-fix-broker-composite-key-tables-deletion:
  broker/Manager: Fix deletion of composite keys
  Add btest for brokerstore delete with complex index.
2023-10-02 11:43:19 -07:00
Jan Grashoefer
bba07cea8b Add btest for brokerstore delete with complex index.
Slightly adapted. I wasn't sure how much guarantee we have around the
change propagation when calling terminate() right after the delete.
Flipped it around a bit, having the worker outlive the manger instead.
2023-09-28 18:31:34 +02:00
Vern Paxson
3addda28d3 removed order-of-evaluation ambiguity from new BTest 2023-09-27 11:36:22 -07:00
Vern Paxson
59db8a11bd ZAM BTest update to match recent change to one of the tests 2023-09-26 13:29:07 -07:00
Benjamin Bannier
a4c4a23ba7 Use unique port for test scripts.base.utils.active-http 2023-09-26 12:49:59 +02:00
Benjamin Bannier
5f1b015500 Do not automatically load Spicy modules in dot paths. 2023-09-26 11:56:52 +02:00
Benjamin Bannier
0896f09081 Exclude dot directories when searching ZEEK_PLUGIN_PATH
Dot directories rarely contain anything we would want to load as a
dynamic plugin. Even worse, they likely contain files with externally
controlled lifetimes which might be removed while we are using them
(see e.g., zeek/btest#98).

With this patch we do not search _discovered_ dot directories anymore.
We continue to load from a user-specified `ZEEK_PLUGIN_PATH`, even if
its name starts with a dot.

Since this patch changes previous behavior it is a **BREAKING CHANGE**.
2023-09-26 11:56:47 +02:00
Robin Sommer
a89694b32d
Zeekygen: Merge in Spicy analyzer documentation.
This now merges information on analyzers from both plugins and Spicy.

Closes #3306.
2023-09-21 10:54:03 +02:00
Robin Sommer
6f882af7cc
Spicy: Support additional documentation tags inside EVT files.
So far we had trouble documenting Spicy analyzers through Zeekygen
because they would show up as components belonging to the
`Zeek::Spicy` plugin; whereas traditional analyzers would be their own
plugins and hence documented individually on their own. This commit
teaches Zeekygen to track Spicy analyzers separately inside their own
`Info` instances. This information isn't further used in this commit
yet, but will be merged with the plugin output in a subsequent change
to get the expected joint output.

To pass additional information to Zeekygen, EVT files now also support
two new tags for Zeekygen purposes:

- `%doc-id = ID;` defines the global ID under which everything inside
  the EVT file will be documented by Zeekygen, conceptually comparable
  to plugin names (e.g., `Zeek::Syslog`).

- `%doc-description = "text" provides additional text to go into the
  documentation (comparable to plugin descriptions).

This information is carried through into the HLTO runtime
initialization code, from where it's registered with Zeekygen.

This commit also removes a couple of previous hacks of how Spicy
integrated with Zeekygen which (1) ended up generating broken doc output
for Spicy components, and (2) don't seem to be necessary anymore
anyways.
2023-09-21 10:54:02 +02:00
Robin Sommer
f31aa0580a
Spicy: Fix support for exporting bitfields.
Anonymous bitfields now have their fields lifted into the surrounding
record.

Closes #3298.
2023-09-21 09:55:12 +02:00
Benjamin Bannier
0b940d8b3c Merge branch 'topic/bbannier/spicyz-export-with-debug-output' 2023-09-20 13:05:04 +02:00