nixpkgs/pkgs/tools/security/ioccheck/default.nix

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

94 lines
2.1 KiB
Nix
Raw Normal View History

2021-09-29 15:18:29 +02:00
{ lib
, fetchFromGitHub
, python3
}:
2021-11-13 00:49:47 +01:00
let
py = python3.override {
packageOverrides = self: super: {
emoji = super.emoji.overridePythonAttrs rec {
2022-07-20 22:32:41 +02:00
version = "1.7.0";
src = fetchFromGitHub {
owner = "carpedm20";
repo = "emoji";
rev = "v${version}";
sha256 = "sha256-vKQ51RP7uy57vP3dOnHZRSp/Wz+YDzeLUR8JnIELE/I=";
};
};
2021-11-13 00:49:47 +01:00
# Support for later tweepy releases is missing
# https://github.com/ranguli/ioccheck/issues/70
tweepy = super.tweepy.overridePythonAttrs rec {
2021-11-13 00:49:47 +01:00
version = "3.10.0";
src = fetchFromGitHub {
owner = "tweepy";
repo = "tweepy";
rev = "v${version}";
sha256 = "0k4bdlwjna6f1k19jki4xqgckrinkkw8b9wihzymr1l04rwd05nw";
};
doCheck = false;
};
2021-11-13 00:49:47 +01:00
};
};
in
with py.pkgs;
buildPythonApplication rec {
2021-09-29 15:18:29 +02:00
pname = "ioccheck";
version = "unstable-2021-09-29";
format = "pyproject";
src = fetchFromGitHub {
owner = "ranguli";
repo = pname;
rev = "db02d921e2519b77523a200ca2d78417802463db";
2023-02-21 10:33:23 +01:00
hash = "sha256-qf5tHIpbj/BfrzUST+EzohKh1hUg09KwF+vT0tj1+FE=";
2021-09-29 15:18:29 +02:00
};
2021-11-13 00:49:47 +01:00
nativeBuildInputs = with py.pkgs; [
2021-09-29 15:18:29 +02:00
poetry-core
];
2021-11-13 00:49:47 +01:00
propagatedBuildInputs = with py.pkgs; [
2021-09-29 15:18:29 +02:00
backoff
click
emoji
jinja2
pyfiglet
ratelimit
requests
shodan
tabulate
termcolor
tweepy
vt-py
];
nativeCheckInputs = with py.pkgs; [
2021-09-29 15:18:29 +02:00
pytestCheckHook
];
postPatch = ''
# Can be removed with the next release
substituteInPlace pyproject.toml \
2021-11-10 10:24:07 +01:00
--replace '"hurry.filesize" = "^0.9"' "" \
2022-08-15 11:53:53 +02:00
--replace 'vt-py = ">=0.6.1,<0.8.0"' 'vt-py = ">=0.6.1"' \
2022-09-19 03:48:13 +02:00
--replace 'backoff = "^1.10.0"' 'backoff = ">=1.10.0"' \
2023-02-21 10:33:23 +01:00
--replace 'termcolor = "^1.1.0"' 'termcolor = "*"' \
--replace 'tabulate = "^0.8.9"' 'tabulate = "*"'
2021-09-29 15:18:29 +02:00
'';
2021-11-10 10:24:07 +01:00
pythonImportsCheck = [
"ioccheck"
];
2021-09-29 15:18:29 +02:00
meta = with lib; {
description = "Tool for researching IOCs";
homepage = "https://github.com/ranguli/ioccheck";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}