2021-02-26 01:13:36 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-07-28 01:00:00 +01:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, openssl
|
|
|
|
, libpcap
|
|
|
|
, zlib
|
|
|
|
, file
|
|
|
|
, curl
|
|
|
|
, libmaxminddb
|
|
|
|
, gperftools
|
2021-03-01 04:20:00 +00:00
|
|
|
, python3
|
2020-07-28 01:00:00 +01:00
|
|
|
, swig
|
|
|
|
, gettext
|
2020-09-11 23:59:31 +01:00
|
|
|
, coreutils
|
2021-03-01 04:20:00 +00:00
|
|
|
, ncurses
|
2021-03-05 11:00:00 +00:00
|
|
|
, caf
|
2020-07-28 01:00:00 +01:00
|
|
|
}:
|
2021-02-26 01:13:36 +00:00
|
|
|
|
2019-09-30 03:21:21 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zeek";
|
2022-01-25 23:09:49 +00:00
|
|
|
version = "4.2.0";
|
2019-09-30 03:21:21 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-04-18 10:20:00 +01:00
|
|
|
url = "https://download.zeek.org/zeek-${version}.tar.gz";
|
2022-01-25 23:09:49 +00:00
|
|
|
sha256 = "sha256-jZoCjKn+x61KnkinY+KWBSOEz0AupM03FXe/8YPCdFE=";
|
2019-09-30 03:21:21 +01:00
|
|
|
};
|
|
|
|
|
2022-01-25 23:09:49 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
cmake
|
|
|
|
file
|
|
|
|
flex
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
gperftools
|
|
|
|
libmaxminddb
|
|
|
|
libpcap
|
|
|
|
ncurses
|
|
|
|
openssl
|
|
|
|
python3
|
|
|
|
swig
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
gettext
|
|
|
|
];
|
2019-09-30 03:21:21 +01:00
|
|
|
|
2021-03-01 04:20:00 +00:00
|
|
|
outputs = [ "out" "lib" "py" ];
|
2020-04-10 10:20:00 +01:00
|
|
|
|
2019-09-30 03:21:21 +01: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 03:21:21 +01: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; {
|
2022-01-25 23:09:49 +00:00
|
|
|
description = "Network analysis framework much different from a typical IDS";
|
2019-09-30 03:21:21 +01:00
|
|
|
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 03:21:21 +01:00
|
|
|
license = licenses.bsd3;
|
2019-10-02 10:00:00 +01:00
|
|
|
maintainers = with maintainers; [ pSub marsam tobim ];
|
2019-09-30 03:21:21 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|