2021-02-26 01:13:36 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-07-28 00:00:00 +00:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, openssl
|
|
|
|
, libpcap
|
|
|
|
, zlib
|
|
|
|
, file
|
|
|
|
, curl
|
|
|
|
, libmaxminddb
|
|
|
|
, gperftools
|
2021-03-01 04:20:00 +00:00
|
|
|
, python3
|
2020-07-28 00:00:00 +00:00
|
|
|
, swig
|
|
|
|
, gettext
|
2020-09-11 22:59:31 +00:00
|
|
|
, coreutils
|
2021-03-01 04:20:00 +00:00
|
|
|
, ncurses
|
2021-03-05 11:00:00 +00:00
|
|
|
, caf
|
2020-07-28 00:00:00 +00:00
|
|
|
}:
|
2021-02-26 01:13:36 +00:00
|
|
|
|
2019-09-30 02:21:21 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zeek";
|
2021-07-06 04:20:00 +00:00
|
|
|
version = "4.0.3";
|
2019-09-30 02:21:21 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-04-18 09:20:00 +00:00
|
|
|
url = "https://download.zeek.org/zeek-${version}.tar.gz";
|
2021-07-06 04:20:00 +00:00
|
|
|
sha256 = "1nrkwaj0dilyzhfl6yma214vyakvpi97acyffdr7n4kdm4m6pvik";
|
2019-09-30 02:21:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake flex bison file ];
|
2021-03-01 04:20:00 +00:00
|
|
|
buildInputs = [ openssl libpcap zlib curl libmaxminddb gperftools python3 swig ncurses ]
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ gettext ];
|
2019-09-30 02:21:21 +00:00
|
|
|
|
2021-03-01 04:20:00 +00:00
|
|
|
outputs = [ "out" "lib" "py" ];
|
2020-04-10 09:20:00 +00:00
|
|
|
|
2019-09-30 02:21:21 +00:00
|
|
|
cmakeFlags = [
|
2021-03-05 11:00:00 +00:00
|
|
|
"-DCAF_ROOT=${caf}"
|
2021-03-01 04:20:00 +00:00
|
|
|
"-DZEEK_PYTHON_DIR=${placeholder "py"}/lib/${python3.libPrefix}/site-packages"
|
2019-09-30 02:21:21 +00:00
|
|
|
"-DENABLE_PERFTOOLS=true"
|
|
|
|
"-DINSTALL_AUX_TOOLS=true"
|
|
|
|
];
|
|
|
|
|
2021-02-26 01:13:36 +00:00
|
|
|
postInstall = ''
|
|
|
|
for file in $out/share/zeek/base/frameworks/notice/actions/pp-alarms.zeek $out/share/zeek/base/frameworks/notice/main.zeek; do
|
|
|
|
substituteInPlace $file \
|
|
|
|
--replace "/bin/rm" "${coreutils}/bin/rm" \
|
|
|
|
--replace "/bin/cat" "${coreutils}/bin/cat"
|
|
|
|
done
|
|
|
|
|
|
|
|
for file in $out/share/zeek/policy/misc/trim-trace-file.zeek $out/share/zeek/base/frameworks/logging/postprocessors/scp.zeek $out/share/zeek/base/frameworks/logging/postprocessors/sftp.zeek; do
|
|
|
|
substituteInPlace $file --replace "/bin/rm" "${coreutils}/bin/rm"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-09-30 02:21:21 +00:00
|
|
|
description = "Powerful network analysis framework much different from a typical IDS";
|
|
|
|
homepage = "https://www.zeek.org";
|
2020-12-20 04:20:00 +00:00
|
|
|
changelog = "https://github.com/zeek/zeek/blob/v${version}/CHANGES";
|
2019-09-30 02:21:21 +00:00
|
|
|
license = licenses.bsd3;
|
2019-10-02 09:00:00 +00:00
|
|
|
maintainers = with maintainers; [ pSub marsam tobim ];
|
2019-09-30 02:21:21 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|