nixpkgs/pkgs/tools/security/flare-floss/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
1.8 KiB
Nix
Raw Normal View History

2021-04-18 23:11:14 +00:00
{ lib
2021-06-30 17:42:16 +00:00
, python3
2021-04-18 23:11:14 +00:00
, fetchFromGitHub
}:
let
py = python3.override {
packageOverrides = final: prev: {
# required for networkx 2.5.1
decorator = prev.decorator.overridePythonAttrs (o: o // rec {
version = "4.4.2";
src = o.src.override {
inherit version;
sha256 = "sha256-46YvBSAXJEDKDcyCN0kxk4Ljd/N/FAoLme9F/suEv+c=";
};
});
2021-06-30 17:42:16 +00:00
# flare-floss requires this exact version (newer versions are incompatible)
networkx = prev.networkx.overridePythonAttrs (o: o // rec {
version = "2.5.1";
src = o.src.override {
inherit version;
sha256 = "sha256-EJzVhcrEEpf3EQPDxCrG73N58peI61TLdRvlpmO7I1o=";
};
});
};
};
in
py.pkgs.buildPythonPackage rec {
2021-04-18 23:11:14 +00:00
pname = "flare-floss";
version = "2.0.0";
2021-04-18 23:11:14 +00:00
src = fetchFromGitHub {
owner = "mandiant";
2021-04-18 23:11:14 +00:00
repo = "flare-floss";
rev = "v${version}";
fetchSubmodules = true; # for tests
sha256 = "sha256-V4OWYcISyRdjf8x93B6h2hJwRgmRmk32hr8TrgRDu8Q=";
2021-04-18 23:11:14 +00:00
};
postPatch = ''
substituteInPlace setup.py \
--replace "==" ">="
substituteInPlace floss/main.py \
--replace 'sigs_path = os.path.join(get_default_root(), "sigs")' 'sigs_path = "'"$out"'/share/flare-floss/sigs"'
'';
propagatedBuildInputs = with py.pkgs; [
halo
networkx
pydantic
2021-04-18 23:11:14 +00:00
tabulate
tqdm
2021-04-18 23:11:14 +00:00
viv-utils
vivisect
] ++ viv-utils.optional-dependencies.flirt;
2021-04-18 23:11:14 +00:00
checkInputs = with py.pkgs; [
pytest-sugar
2021-06-30 17:42:16 +00:00
pytestCheckHook
pyyaml
2021-04-18 23:11:14 +00:00
];
postInstall = ''
mkdir -p $out/share/flare-floss/
cp -r sigs $out/share/flare-floss/
'';
2021-04-18 23:11:14 +00:00
meta = with lib; {
description = "Automatically extract obfuscated strings from malware";
homepage = "https://github.com/mandiant/flare-floss";
2021-04-18 23:11:14 +00:00
license = licenses.asl20;
maintainers = teams.determinatesystems.members;
};
}