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

63 lines
1.7 KiB
Nix
Raw Normal View History

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
, python3
2020-07-28 01:00:00 +01:00
, swig
, gettext
, coreutils
, ncurses
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";
version = "4.0.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";
sha256 = "0m7zy5k2595vf5xr2r4m75rfsdddigrv2hilm1c3zaif4srxmvpj";
2019-09-30 03:21:21 +01: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 03:21:21 +01:00
outputs = [ "out" "lib" "py" ];
2020-04-10 10:20:00 +01:00
2019-09-30 03:21:21 +01:00
cmakeFlags = [
"-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
'';
meta = with lib; {
2019-09-30 03:21:21 +01: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 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;
};
}