nixpkgs/pkgs/applications/networking/ids/zeek/default.nix

65 lines
1.7 KiB
Nix
Raw Normal View History

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
, python3
2020-07-28 00:00:00 +00:00
, swig
, gettext
, coreutils
, 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";
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";
sha256 = "1nrkwaj0dilyzhfl6yma214vyakvpi97acyffdr7n4kdm4m6pvik";
2019-09-30 02:21:21 +00:00
};
nativeBuildInputs = [ cmake flex bison file ];
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
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}"
"-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
'';
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";
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;
};
}