No description
Find a file
Christian Kreibich f5fbad23ff Add peer buffer update tracking to the Broker manager's event_observer
This implements basic tracking of each peering's current fill level, the maximum
level over a recent time interval (via a new Broker::buffer_stats_reset_interval
tunable, defaulting to 1min), and the number of times a buffer overflows. For
the disconnect policy this is the number of depeerings, but for drop_newest and
drop_oldest it implies the number of messages lost.

This doesn't use "proper" telemetry metrics for a few reasons: this tracking is
Broker-specific, so we need to track each peering via endpoint_ids, while we
want the metrics to use Cluster node name labels, and the latter live in the
script layer. Using broker::endpoint_id directly as keys also means we rely on
their ability to hash in STL containers, which should be fast.

This does not track the buffer levels for Broker "clients" (as opposed to
"peers"), i.e. WebSockets, since we currently don't have a way to name these,
and we don't want to use ephemeral Broker IDs in their telemetry.

To make the stats accessible to the script layer the Broker manager (via a new
helper class that lives in the event_observer) maintains a TableVal mapping
Broker IDs to a new BrokerPeeringStats record. The table's members get updated
every time that table is requested. This minimizes new val instantiation and
allows the script layer to customize the BrokerPeeringStats record by redefing,
updating fields, etc. Since we can't use Zeek vals outside the main thread, this
requires some care so all table updates happen only in the Zeek-side table
updater, PeerBufferState::GetPeeringStatsTable().
2025-04-24 22:47:18 -07:00
.github/workflows Add libnode-dev to docs github runner, update docs to include ZeekJS 2025-04-17 08:58:54 -07:00
auxil Updating submodule(s) [nomail] 2025-04-23 10:40:07 -07:00
ci CI: No more Ubuntu 20.04 [skip ci] 2025-04-23 15:05:23 +02:00
cmake@fd0696f907 Update cmake submodule for krb5 fixes [nomail] 2025-04-18 11:35:54 -07:00
cmake_templates Add configure option to enable/disable spicy SSL 2024-06-04 14:13:59 +01:00
doc@d583c2abfe Update doc submodule [nomail] [skip ci] 2025-04-24 00:26:49 +00:00
docker docker: Add cppzmq/libzmq dependencies 2024-12-10 20:33:02 +01:00
man Use the same rules as cmake submodule to reformat Zeek 2023-05-09 08:31:43 -07:00
scripts Add peer buffer update tracking to the Broker manager's event_observer 2025-04-24 22:47:18 -07:00
src Add peer buffer update tracking to the Broker manager's event_observer 2025-04-24 22:47:18 -07:00
testing Add peer buffer update tracking to the Broker manager's event_observer 2025-04-24 22:47:18 -07:00
.cirrus.yml CI: No more Ubuntu 20.04 [skip ci] 2025-04-23 15:05:23 +02:00
.clang-format Update COPYING date to now and fix some [skip CI] 2025-01-09 08:38:45 -05:00
.clang-tidy Fix indentation in .clang-tidy 2025-03-07 11:00:44 -07:00
.cmake-format.json Always break lines when formatting spicy_add_analyzer 2025-03-03 11:24:20 +01:00
.dockerignore Add .dockerignore to suppress btest artifacts 2021-09-24 17:04:26 -07:00
.git-blame-ignore-revs Update .git-blame-ignore-revs 2023-10-30 09:42:39 +01:00
.gitattributes GH-1497: Support CRLF line-endings in Zeek scripts and signature files 2021-04-08 20:32:30 -07:00
.gitignore Update .gitignore to add Emacs and Vim temp files 2024-02-07 12:12:58 -07:00
.gitmodules Add martinmoene/expected-lite as a submodule 2025-03-18 09:32:34 -07:00
.pre-commit-config.yaml pre-commit: Ensure testing files have @TEST lines commented 2025-04-17 16:30:23 +02:00
.typos.toml Bump pre-commit hooks 2025-03-04 08:14:26 +01:00
.update-changes.cfg Add script to update external test repo commit pointers 2019-04-05 17:09:01 -07:00
CHANGES Merge remote-tracking branch 'origin/topic/awelzel/cluster-fix-tsan-zeromq-do-terminate' 2025-04-24 14:04:11 +02:00
CMakeLists.txt Make sure clang-tidy and iwyu are added to all targets 2025-04-17 09:26:55 -07:00
CODE_OF_CONDUCT.md Add code of conduct and contributing to repo. 2025-03-06 13:11:17 +00:00
configure Add ability to enable iwyu and clang-tidy at configure time 2025-03-07 11:00:44 -07:00
CONTRIBUTING.md Add code of conduct and contributing to repo. 2025-03-06 13:11:17 +00:00
COPYING Update COPYING date to now and fix some [skip CI] 2025-01-09 08:38:45 -05:00
COPYING-3rdparty COPYING-3rdparty: Add some missing submodules [skip ci] 2025-04-23 14:57:51 +02:00
INSTALL Update documentation to include "Book of Zeek" revisions 2021-02-01 15:54:36 -08:00
Makefile Fix warning about grealpath when running 'make dist' on Linux 2024-07-11 13:45:14 -07:00
NEWS NEWS: Add entry about WebSocket client events 2025-04-24 09:50:04 +02:00
README Add tooling section to README 2023-01-27 13:03:52 -07:00
README.md Fix dead links in README 2025-02-17 08:32:04 -07:00
ruff.toml Swap pre-commit yapf for ruff/ruff-format, fix findings 2024-12-11 11:08:37 -07:00
SECURITY.md Add SECURITY.md, pointing at the website 2025-01-13 08:21:28 -07:00
vcpkg.json Switch all of the conan configuration to vcpkg 2024-02-02 14:52:16 -07:00
VERSION Merge remote-tracking branch 'origin/topic/awelzel/cluster-fix-tsan-zeromq-do-terminate' 2025-04-24 14:04:11 +02:00
zeek-path-dev.in Move CMake template files to separate directory 2023-06-26 13:39:59 -07:00

Zeek Logo

The Zeek Network Security Monitor

A powerful framework for network traffic analysis and security monitoring.

Key FeaturesDocumentationGetting StartedDevelopmentLicense

Follow us on Twitter at @zeekurity.

Coverage Status Build Status

Slack Discourse

Key Features

  • In-depth Analysis Zeek ships with analyzers for many protocols, enabling high-level semantic analysis at the application layer.

  • Adaptable and Flexible Zeek's domain-specific scripting language enables site-specific monitoring policies and means that it is not restricted to any particular detection approach.

  • Efficient Zeek targets high-performance networks and is used operationally at a variety of large sites.

  • Highly Stateful Zeek keeps extensive application-layer state about the network it monitors and provides a high-level archive of a network's activity.

Getting Started

The best place to find information about getting started with Zeek is our web site www.zeek.org, specifically the documentation section there. On the web site you can also find downloads for stable releases, tutorials on getting Zeek set up, and many other useful resources.

You can find release notes in NEWS, and a complete record of all changes in CHANGES.

To work with the most recent code from the development branch of Zeek, clone the master git repository:

git clone --recursive https://github.com/zeek/zeek

With all dependencies in place, build and install:

./configure && make && sudo make install

Write your first Zeek script:

# File "hello.zeek"

event zeek_init()
    {
    print "Hello World!";
    }

And run it:

zeek hello.zeek

For learning more about the Zeek scripting language, try.zeek.org is a great resource.

Development

Zeek is developed on GitHub by its community. We welcome contributions. Working on an open source project like Zeek can be an incredibly rewarding experience and, packet by packet, makes the Internet a little safer. Today, as a result of countless contributions, Zeek is used operationally around the world by major companies and educational and scientific institutions alike for securing their cyber infrastructure.

If you're interested in getting involved, we collect feature requests and issues on GitHub here and you might find these to be a good place to get started. More information on Zeek's development can be found here, and information about its community and mailing lists (which are fairly active) can be found here.

License

Zeek comes with a BSD license, allowing for free use with virtually no restrictions. You can find it here.

Tooling

We use the following tooling to help discover issues to fix, amongst a number of others.