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.

73 lines
1.5 KiB
Nix
Raw Normal View History

2024-04-16 11:34:43 +03:00
{
lib,
python3,
fetchFromGitHub,
2021-04-19 02:11:14 +03:00
}:
2021-06-30 20:42:16 +03:00
2023-08-30 11:29:02 +03:00
python3.pkgs.buildPythonPackage rec {
2021-04-19 02:11:14 +03:00
pname = "flare-floss";
version = "3.1.0";
pyproject = true;
2021-04-19 02:11:14 +03:00
src = fetchFromGitHub {
owner = "mandiant";
2021-04-19 02:11:14 +03:00
repo = "flare-floss";
rev = "refs/tags/v${version}";
fetchSubmodules = true; # for tests
hash = "sha256-a20q7kavWwCsfnAW02+IY0jKERMxkJ+2nid/CwQxC9E=";
2021-04-19 02:11:14 +03:00
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "==" ">="
substituteInPlace floss/main.py \
--replace 'sigs_path = os.path.join(get_default_root(), "sigs")' 'sigs_path = "'"$out"'/share/flare-floss/sigs"'
'';
build-system = with python3.pkgs; [
setuptools
setuptools-scm
];
2024-04-16 11:34:43 +03:00
dependencies =
with python3.pkgs;
[
binary2strings
halo
networkx
pefile
pydantic
2024-04-16 11:34:43 +03:00
rich
tabulate
tqdm
viv-utils
vivisect
]
++ viv-utils.optional-dependencies.flirt;
2021-04-19 02:11:14 +03:00
2023-08-30 11:29:02 +03:00
nativeCheckInputs = with python3.pkgs; [
pytest-sugar
2021-06-30 20:42:16 +03:00
pytestCheckHook
pyyaml
2021-04-19 02:11:14 +03:00
];
postInstall = ''
mkdir -p $out/share/flare-floss/
cp -r floss/sigs $out/share/flare-floss/
'';
2021-04-19 02:11:14 +03:00
preCheck = ''
export HOME=$(mktemp -d)
'';
2021-04-19 02:11:14 +03:00
meta = with lib; {
description = "Automatically extract obfuscated strings from malware";
homepage = "https://github.com/mandiant/flare-floss";
changelog = "https://github.com/mandiant/flare-floss/releases/tag/v${version}";
2021-04-19 02:11:14 +03:00
license = licenses.asl20;
mainProgram = "floss";
maintainers = with maintainers; [ fab ];
2021-04-19 02:11:14 +03:00
};
}