Commit graph

328 commits

Author SHA1 Message Date
Christian Kreibich
9860b5686d Ensure presence of Zeek-related directories in toplevel CMakeLists.txt
This establishes several of the Zeek installation's directories in
CMakeLists.txt, and adds a new ZEEK_STATE_DIR (via `configure --state-dir`) for
arbitrary Zeek-related variable state. It defaults to ZEEK_ROOT/var/lib.

This leaves the existing, zeekctl-related ZEEK_LOCAL_STATE_DIR unchanged and
does not use it. We'll likely deprecate it when removal of zeekctl approaches.
2022-05-23 14:16:59 -07:00
Benjamin Bannier
c68cfd8d8e Always generate helper scripts for Spicy.
We previously only generated these files if configuring a build which
included Spicy. This meant that e.g., `zeek-path-dev.*` scripts would
emit errors for non-existing paths if Spicy was not included.

We now always generate the helper scripts so we can reference them
regardless of build configuration. If Spicy is not included the files
will still be sourced, but have no actual effect.
2022-05-18 09:49:09 +02:00
Benjamin Bannier
83b36dfc54 Include headers in binary dir before other headers.
If e.g., optional dependencies are installed in the same prefix as a
previous Zeek installation, the build would have previously found
`zeek-config.h` from the external prefix instead of from the current
build.

With this patch we now include the current binary dir before any
previously configured include directories (here in particular: optional
dependencies). With that the correct `zeek-config.h` is found.
2022-05-16 09:07:11 +02:00
Benjamin Bannier
95aff9a1e3 Include spicy in build. 2022-05-16 09:07:11 +02:00
Tim Wojtulewicz
c2bf602d94 Add out_ptr, use for c-ares interface calls 2022-04-22 13:10:37 -07:00
Tim Wojtulewicz
336c6ae5c2 Replace nb_dns library with C-Ares 2022-04-22 13:10:37 -07:00
Tim Wojtulewicz
c6023774a3 Enable vptr undefined behavior check 2022-04-20 17:18:57 -07:00
Tim Wojtulewicz
1941fd80f2 Disable object-size analysis if optimization set to -O0 2022-04-14 08:59:05 -07:00
Christian Kreibich
145c7063c6 Add cmake-time reporting of bifcl, binpac, and gen-zam used for build
Cross-compilation requires providing those pre-built for the build host, so it
helps to see confirmation of the three --with-... overrides.
2022-03-21 15:30:10 -07:00
Christian Kreibich
e403dd5fe1 Build Gen-ZAM from a submodule and support use of pre-existing executable
This separates Gen-ZAM from the main Zeek distribution and places it in a
submodule at auxil/gen-zam, reflecting binpac and bifcl. Configuring with
--with-gen-zam=... allws reuse of an existing executable.
2022-03-21 15:30:07 -07:00
Robin Sommer
5f1f005142
Merge remote-tracking branch 'origin/topic/neverlord/hide-caf'
* origin/topic/neverlord/hide-caf:
  Fix GCC builds and string output for Broker errors
  Update to latest Broker without public CAF dep
2022-02-07 16:25:22 +01:00
Tim Wojtulewicz
059120003f Fix --with-jemalloc configure option on FreeBSD 2022-01-12 10:16:15 -07:00
Tim Wojtulewicz
c786dc8f48 Enable null check for UBSan 2022-01-10 11:11:04 -07:00
Craig Leres
8f2ac836f8 Make FreeBSD more flexible, don't look for jemalloc unless we were
given a specific path for it.
2022-01-04 17:19:43 -08:00
Dominik Charousset
56f30b500a Update to latest Broker without public CAF dep 2021-12-20 08:16:21 +01:00
Craig Leres
47a267130b Set JEMALLOC_FOUND when on FreeBSD (suggested by Tim Wojtulewicz) 2021-12-03 15:23:50 -08:00
Craig Leres
1778bc5fa8 FreeBSD: don't look for jemalloc as a package, it's in the base system 2021-12-03 14:46:09 -08:00
Johanna Amann
253d214126 OpenSSL 3: fix warnings and tests
This commit fixes the compile-time warnings that OpenSSL 3.0 raises for
our source-code. For the cases where this was necessary we now have two
implementations - one for OpenSSL 1.1 and earlier, and one for OpenSSL
3.0.

This also makes our testsuite pass with OpenSSL 3.0

Relates to GH-1379
2021-11-17 13:33:49 +00:00
Tim Wojtulewicz
0369ca01bc Disable the scripts.base.frameworks.logging.sqlite.simultaneous-writes test under TSan
Due to a bug (or intentional code) in SQLite, we disabled enabling the shared cache
in sqlite3 if running under ThreadSanitizer (see cf1fefbe0b0a6163b389cc92b5a6878c7fc95f1f).
Unfortunately, this has the side-effect of breaking the simultaneous-writes test because
the shared cache is disabled. This is hopefully a temporary fix until SQLite fixes the
issue on their side.
2021-09-03 10:38:15 -07:00
Tim Wojtulewicz
a9deb1bfd2 GH-1654: Exclude the .git directory when installing cmake files 2021-07-29 15:30:21 -07:00
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