Commit graph

208 commits

Author SHA1 Message Date
Christian Kreibich
a6b0fde65f Add zeek-client via new submodule
The new module resides in auxil/zeek-client. It does not get installed unless
one configures with --enable-zeek-client.
2021-07-08 13:12:53 -07:00
Seth Hall
d08230ef8c Switch to more accurate source and binary references in cmake
This is mostly involved with moving CMAKE_SOURCE_DIR and
CMAKE_BINARY_DIR to PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR because it
enables zeek to be built as a subproject of another.

There is another branch in the cmake repository with the same name that
is also required for this to fully work.
2021-06-23 10:26:17 +00:00
Seth Hall
8222193525 Fixes for the builtin plugin functionality 2021-06-11 18:52:03 +00:00
Seth Hall
e399b537ca Added --include-plugins configure argument 2021-06-10 10:39:13 -07:00
Johanna Amann
f76a95a2c2 Merge remote-tracking branch 'origin/topic/christian/install-btest-tooling'
* origin/topic/christian/install-btest-tooling:
  Explain zeek-config options in help output
  Sort variables at top of zeek-config alphabetically
  Install Zeek's btest tooling with the distribution
2021-05-10 10:26:59 +01:00
Jon Siwek
444fd8ff43 GH-960: Fix include order of bundled header files
Previously, a system-wide installation of any bundled auxil/ software
(like CAF) may get found/included rather than the bundled version and
possibly break the build.
2021-03-26 16:26:49 -07:00
Vlad Grigorescu
4557b0907c Expose a configure-time option to set the plugin path.
I believe that this is the last option presented during the build summary which wasn't available to be set by the user.
2021-03-12 21:22:01 -06:00
Christian Kreibich
463d159bfc Install Zeek's btest tooling with the distribution
This creates $PREFIX/share/btest in the install tree, with the
following folders:

- scripts/ for the canonifiers
- data/ for random.seed
- data/pcaps for the test pcaps

The pcaps can be skipped by configuring with --disable-btest-pcaps.
2021-03-11 13:00:15 -08:00
Jon Siwek
8a8a983c49 Add missing zeek/ to header includes
Related to https://github.com/zeek/zeek/pull/1377
2021-01-29 19:16:29 -08:00
Christian Kreibich
a6e086b662 Install BTest with Zeek
Configuring with --disable-btest skips the installation. The main
reason for doing this is that many Zeek packages come with testsuites
that nearly always require btest, so providing btest out of the box
makes sense. Note that zkg's recent additions to its PATH environment
variable management mean that this btest instance is automatically
found also when the Zeek installation's binary folder isn't in the
path.
2021-01-20 13:52:14 -08:00
Dominik Charousset
1faea1d73d Remove explicit use of config mode for finding CAF 2020-12-15 16:13:53 +01:00
Christian Kreibich
d1d218b5cc Install zkg as part of the Zeek distribution.
- Add auxil/package-manager submodule as an optional build
  source. When the submodule is present, zkg gets installed into the
  Zeek installation's bin directory, its config file into etc/zkg, and
  its state into var/lib/zkg. Like zeekctl, zkg finds its own module
  independently of any PYTHONPATH. Installation via pip remains
  supported. You can skip zkg explicitly via --disable-zkg. See the
  NEWS update for details.

- Establish a "zeek/python" subdirectory under libdir as the common place
  for Python modules in the Zeek distribution. This now separates out
  the Broker Python bindings, ZeekControl, and zkg's Python module.

- Add configure flags to allow customizing this Python folder, in
  three ways: --python-dir, --python-prefix, and --python-home. These
  differ in the logic they automatically add to the path, and build on
  the logic already used in Broker.

- Include a (comented-out) @load for zkg's packages folder in
  local.zeek.

- Bump zeekctl to move to this new location.

- Bump doc to include installation instructions

- Update NEWS accordingly.
2020-12-11 18:43:47 -08:00
Jon Siwek
bb11ce47a0 Merge remote-tracking branch 'origin/topic/neverlord/caf-migration'
Merge adjustments:
- Fix the `--with-caf=` option from emitting messages about a variable
  having an unset value.
- Fix the `zeek-config --caf_root` option

* origin/topic/neverlord/caf-migration:
  Update submodule(s)
  Fix message ordering of Broker messages
  Fix UB in shutdown of Broker manager
  Preserve string output of Broker errors
  Migrate to CAF 0.18
2020-12-10 14:14:38 -08:00
Dominik Charousset
cf2b5f7e05 Migrate to CAF 0.18 2020-12-07 14:56:19 +01:00
Jon Siwek
3605e04d83 Update minimum required CMake to 3.5
Also now uses CMake's ENABLE_EXPORTS target property for the zeek
executable to ensure symbols are visible to plugins.  Prior to CMake
3.4, the policy was to export symbols by default for certain platforms,
but later versions need either the explicit target property or policy.
2020-12-01 22:13:52 -08:00
Jon Siwek
eeec219a66 Update CMake logic to enforce Python >= 3.5 2020-11-25 14:57:09 -08:00
Christian Kreibich
e70b308c16
Update CMakeLists.txt to make portability symlink absolute
Co-authored-by: Jon Siwek <jsiwek@corelight.com>
2020-11-24 12:05:03 -08:00
Christian Kreibich
ec76b2510a Improve support for custom libdir locations
- Remove hardwiring of $ZEEK_ROOT/lib throughout the three and
  defaults the name of Zeek's library directory to the default on the
  given platform (e.g. lib64), via GNUInstallDirs.

- Consistently use that lib directory, instead of two lib folders
  resulting when using a custom libdir.

- Remove the old lib directory in the installation prefix, if one exists

- Add --lib_dir to zeek-config (and sort its options a bit).

- Bump submodules for corresponding changes
2020-11-19 23:27:10 -08:00
Jon Siwek
a2577891e0 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1180-include-external-headers'
* origin/topic/jsiwek/gh-1180-include-external-headers:
  Add external dependency include paths to `zeek-config --include_dir`
2020-10-02 10:50:14 -07:00
Jon Siwek
f96e10da75 Add external dependency include paths to zeek-config --include_dir
Addresses https://github.com/zeek/zeek/issues/1180

This helps ensure successful compilation of a plugin that includes a
Zeek header which includes an external dependency header even if the
plugin itself doesn't necessarily depend on that external library.
2020-09-24 14:08:26 -07:00
Jon Siwek
efcbf979f5 Add framework for running UndefinedBehaviorSanitizer in CI
Many checks are initially disabled because they do cause failures
when running the test suites.
2020-09-18 11:32:05 -07:00
Jon Siwek
1a4990fc7e Add zeek-archiver tool as submodule
This is added to the default Zeek build as a convenience since it's the
new suggested method for archiving the logs produced by a Supervised
Zeek Cluster.
2020-07-20 16:06:44 -07:00
Andrew Benson
7e5f9b857e cmake: Make musl support more distro agnostic 2020-06-16 18:04:15 -05:00
Jon Siwek
23ad81400b Rename aux/ to auxil/
Since "aux" is not an allowed file/dir name on Windows.
2020-06-04 15:18:44 -07:00
Johanna Amann
892023ed9a Merge remote-tracking branch 'origin/master' into topic/johanna/hash-unification
* origin/master:
  Use zeek::detail namespace for fuzzer utils
  Set terminating flag during fuzzer cleanup
  Add missing include to standalone fuzzer driver
  Improve standalone fuzzer driver error messages
  Test fuzzers against seed corpus under CI ASan build
  Update fuzzing README with OSS-Fuzz integration notes
  Link fuzzers against shared library to reduce executable sizes
  Improve FuzzBuffer chunking
  Fix compiler warning in standalone fuzzer driver
  Adjust minor fuzzing documentation
  Exit immediately after running unit tests
  Add OSS-Fuzz Zeek script search path to fuzzers
  Assume libFuzzer when LIB_FUZZING_ENGINE file doesn't exist
  Change handling of LIB_FUZZING_ENGINE
  Change --enable-fuzzing to --enable-fuzzers
  Add standalone driver for fuzz targets
  Add basic structure for fuzzing targets
2020-05-13 14:19:44 +00:00
Johanna Amann
ce8b121e12 Hash unification: address PR feedback 2020-05-13 14:07:59 +00:00
Johanna Amann
7f137b7d50 Update architecture checks for highwayhash
Now we use cmake to determine which compiler flags are set to
determine which implementation of highwayhash to compile. This should
be much more robust.

Also - fix missing include on old ubuntus.
2020-05-12 12:03:10 -07:00
Johanna Amann
330b997e3a Add highwayhash in a more cmake-y way 2020-05-11 17:19:31 -07:00
Jon Siwek
8ec807bd76 Link fuzzers against shared library to reduce executable sizes 2020-04-27 20:04:33 -07:00
Johanna Amann
bb050910bb Fix plugin compile problems with highwayhash
The way this is included is still hacky as hell - but now all tests pass.
2020-04-24 13:11:39 -07:00
Jon Siwek
6721685202 Change --enable-fuzzing to --enable-fuzzers
Since it controls whether to build the fuzzer targets, not whether those
fuzzer targets actually use a fuzzing engine.
2020-04-24 11:59:10 -07:00
Jon Siwek
78b0b2183d Add standalone driver for fuzz targets
Useful for cases that don't need to use a fuzzing engine, but just run
the fuzz targets over some set of inputs, like for regression/CI tests.

Also added a POP3 fuzzer dictionary, seed corpus, and README with
examples.
2020-04-23 20:14:11 -07:00
Jon Siwek
ba9c06fc2b Move rapidjson submodule to aux directory
This also now installs the full rapidjson include/ tree in order to
allow external plugins to properly build if they include
threading/formatters/JSON.h
2020-03-05 19:24:13 -08:00
Jon Siwek
48fba11c51 GH-808: Add ZEEK_VERSION_NUMBER definition to zeek-config.h
This is the result of (major * 10000 + minor * 100 + patch), for example
3.1.2 becomes 30102.  This definition may be helpful for external code
that requires conditional compilation to support multiple Zeek
versions with differing APIs.
2020-02-23 09:55:20 +00:00
Fabrice Fontaine
63344b32f5 CMakeLists.txt: fix cross-compilation with binpac
When cross-compiling, BINPAC_EXE_PATH will be set by the user to the
host binpac binary which is fine however aux/binpac won't be built which
will raise a build failure as target binpac (headers, library) won't be
installed or built

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-02-01 14:38:17 +01:00
Tim Wojtulewicz
4fa3e4b9b4 Modify IOSource Manager to implement new loop architecture
- Removes entire FindSoonest method that includes all of the calls to select() for checking for ready sources
- Removes FD_Set checking against IOSources
- Adds system for registering and unregistering file descriptors from IOSources. This allows individual sources to mark themselves as ready to be checked by the loop as they become available.
- Adds entirely new loop architecture based on checking the IOSources for when their next timeout is, and then waiting for either that timeout or when the next source is ready. This also implements the polling based on what the OS supports, instead of just calling select() on all platforms. Currently it supports kqueue, epoll, and plain poll.
- Adds system for pinging the loop to force it to wake up
2020-01-31 10:13:09 -07:00
Robin Sommer
0063a81410 Remove bro-config.h.in and bro-path-dev.in. 2020-01-29 12:08:10 +00:00
Jon Siwek
3273169385 Preserve optimization setting for sanitizer build 2020-01-07 20:58:35 -08:00
Jon Siwek
4735165d31 Improve --sanitizers configure option
* Rename SANITIZERS CMake variable to ZEEK_SANITIZERS for clarity

* Use -O1 by default to improve speed (set NO_OPTIMIZATIONS env. var.
  to override and use -O0).  Uses -fno-optimize-sibling-calls with -O1
  to still get "perfect stack traces".

* Updates various sub-projects with sanitizer improvements:
  binpac and bifcl, by default, now ignore leaks reported by LeakSanitizer
  so that it doesn't interfere with the Zeek build
2019-12-30 14:09:26 -08:00
Jon Siwek
25ae6d90b7 Merge remote-tracking branch 'origin/topic/jsiwek/openbsd'
* origin/topic/jsiwek/openbsd:
  Adjust btests for OpenBSD portability
  Convert pcapng test suite files to pcap format
  Fix undefined symbols loading libbroker on OpenBSD
  Fix compile warnings on OpenBSD
2019-11-15 18:26:50 -08:00
Jon Siwek
17fd371eae Merge remote-tracking branch 'origin/topic/neverlord/doctest'
- Minor whitespace tweaks
- Add line to build summary output for whether unit tests are enabled

* origin/topic/neverlord/doctest:
  Add doctest license and copyright
  Integrate review feedback
  Fix submodule reference for doctest
  Add initial scaffold for unit testing via doctest
2019-11-14 19:17:37 -08:00
Dominik Charousset
773adab76b Integrate review feedback 2019-11-14 09:15:50 +01:00
Dominik Charousset
f6407a4e0f Add initial scaffold for unit testing via doctest 2019-11-12 10:03:49 +01:00
Jon Siwek
b182c35762 Fix undefined symbols loading libbroker on OpenBSD
python3.7:/usr/local/lib/libbroker.so.2: undefined symbol '__inet_ntop'
python3.7:/usr/local/lib/libbroker.so.2: undefined symbol '__inet_pton'

An independent Broker build doesn't have that problem because it
usually picks up those functions from libc.  But when building Broker
as part of Zeek, include search paths were already modified to reflect
Zeek's libbind dependency and Broker ends up using libbind headers
which defines its own version of these, but then does not link to
libbind (since it's a dependency of Zeek, not Broker) to actually get
those symbols (e.g. when dlopen'ing independently from Zeek, like for
the Python bindings).  Solution is to re-order include_directories()
for Zeek dependencies such that they won't effect sub-projects.
2019-11-08 12:30:56 -08:00
Dominik Charousset
24d5ffa7a1 Fix position of project(), require CMake 3
The call to `project` must come after `cmake_minimum_required` in CMake
in order to get the correct policy settings.
2019-10-28 13:31:46 +01:00
Jon Siwek
2c6cb6e5f3 GH-585: Require C++17 2019-10-24 12:51:06 -07:00
Dominik Charousset
b618c7d0e2 Fix build with external CAF but bundled Broker 2019-10-01 21:08:14 +02:00
Jon Siwek
7613ab0af0 GH-602: fix paraglob header inclusion, installation, and search paths 2019-09-26 17:39:25 -07:00
Dominik Charousset
68bb0e21a3 Fix overly specific include_directories usage
Calling `find_package(CAF)` puts all include directory paths into a
single variable. Picking the paths individually is not only error prone
and cumbersome, but can also lead to bulid errors. For example, when
using a build directory for CAF_ROOT then CAF_INCLUDE_DIRS will have one
extra path to find CAF's `config.hpp` (which is part of the build
directory).
2019-09-21 11:46:06 +02:00
Jon Siwek
f6f471f4b7 Update Broker include dir search path
Related to https://github.com/zeek/broker/issues/51
2019-09-04 16:29:04 -07:00