![]() Zeek scripts located on separate filesystems, but sharing the same inode number leads to scripts not being loaded. The reason is that a `ScannedFile` is only identified by `st_ino` which is not enough to uniquely identify a file in a system. This problem may be hit when `ZEEKPATH` points to separate filesystems and two script files happen have the same `st_ino` value - definitely not very likely, but possibly very confusing when it happens. The following test case creates two zeek scripts on separate filesystems. As the filesystems are freshly created and of the same type, the files will (tested a few times with xfs/ext4) have the same `st_ino` values. #!/bin/bash ZEEKDIR=${ZEEKDIR:-/home/awelzel/projects/zeek} export ZEEKPATH=.:${ZEEKDIR}/build/scripts:${ZEEKDIR}/scripts cat << EOF > hello.zeek event zeek_init() { print("Hello, once or twice?"); } EOF for i in 1 2 ; do dd if=/dev/urandom of=img${i} count=16 bs=1M 2>/dev/null sudo mkfs.xfs -q ./img${i} mkdir -p mount${i} sudo mount ./img${i} ./mount${i} sudo cp hello.zeek ./mount${i}/hello.zeek done ls ./mount*/*zeek stat -c "%n: device=%d inode=%i" ./mount*/hello.zeek ${ZEEKDIR}/build/src/zeek -b ./mount1/hello.zeek ./mount2/hello.zeek # Cleanup for i in 1 2 ; do sudo umount ./mount${i} rm -rfv ./img${i} ./mount${i} rm -rfv hello.zeek done Before this patch, `Hello, once or twice?` is printed only once, afterwards twice: $ sh testcase.sh [sudo] password for awelzel: ./mount1/hello.zeek ./mount2/hello.zeek ./mount1/hello.zeek: device=1794 inode=6915 ./mount2/hello.zeek: device=1795 inode=6915 Hello, once or twice? Hello, once or twice? |
||
---|---|---|
.github/workflows | ||
aux | ||
ci | ||
cmake@84e81d909d | ||
doc@16d3ab7149 | ||
man | ||
scripts | ||
src | ||
testing | ||
.cirrus.yml | ||
.clang-tidy | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
.update-changes.cfg | ||
CHANGES | ||
CMakeLists.txt | ||
configure | ||
COPYING | ||
COPYING.3rdparty | ||
INSTALL | ||
Makefile | ||
NEWS | ||
README | ||
README.md | ||
VERSION | ||
zeek-config.h.in | ||
zeek-config.in | ||
zeek-path-dev.in | ||
zeek-wrapper.in |
The Zeek Network Security Monitor
A powerful framework for network traffic analysis and security monitoring.
Key Features — Documentation — Getting Started — Development — License
Follow us on Twitter at @zeekurity.
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.