Merge pull request #119581 from fabaff/karton-mwdb-reporter

This commit is contained in:
Sandro 2021-04-16 01:24:33 +02:00 committed by GitHub
commit 53c17ed45c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,32 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "beautifultable";
version = "1.0.1";
src = fetchFromGitHub {
owner = "pri22296";
repo = pname;
rev = "v${version}";
sha256 = "12ci6jy8qmbphsvzvj98466nlhclfzs0a0pmbsv3mf5bfcdwvbh7";
};
checkInputs = [
pytestCheckHook
];
pytestFlagsArray = [ "test.py" ];
pythonImportsCheck = [ "beautifultable" ];
meta = with lib; {
description = "Python package for printing visually appealing tables";
homepage = "https://github.com/CERT-Polska/mwdblib";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}

View File

@ -0,0 +1,42 @@
{ lib
, buildPythonPackage
, chardet
, fetchFromGitHub
, karton-core
, mwdblib
, python
}:
buildPythonPackage rec {
pname = "karton-mwdb-reporter";
version = "1.0.0";
src = fetchFromGitHub {
owner = "CERT-Polska";
repo = pname;
rev = "v${version}";
sha256 = "0ks8jrc4v87q6zhwqg40w6xv2wfkzslmnfmsmmkfjj8mak8nk70f";
};
propagatedBuildInputs = [
karton-core
mwdblib
];
postPatch = ''
substituteInPlace requirements.txt \
--replace "karton-core==4.0.4" "karton-core" \
--replace "mwdblib==3.3.1" "mwdblib"
'';
# Project has no tests
doCheck = false;
pythonImportsCheck = [ "karton.mwdb_reporter" ];
meta = with lib; {
description = "Karton service that uploads analyzed artifacts and metadata to MWDB Core";
homepage = "https://github.com/CERT-Polska/karton-mwdb-reporter";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ fab ];
};
}

View File

@ -0,0 +1,49 @@
{ lib
, beautifultable
, buildPythonPackage
, click
, click-default-group
, fetchFromGitHub
, humanize
, keyring
, python
, python-dateutil
, requests
}:
buildPythonPackage rec {
pname = "mwdblib";
version = "3.4.0";
src = fetchFromGitHub {
owner = "CERT-Polska";
repo = pname;
rev = "v${version}";
sha256 = "0dbdmps4a3mav02m4h37bj2bw8pg6h52yf3gpdkhi3k9hl9f942h";
};
propagatedBuildInputs = [
beautifultable
click
click-default-group
humanize
keyring
python-dateutil
requests
];
checkPhase = ''
runHook preCheck
${python.interpreter} -m unittest discover
runHook postCheck
'';
pythonImportsCheck = [ "mwdblib" ];
meta = with lib; {
description = "Python client library for the mwdb service";
homepage = "https://github.com/CERT-Polska/mwdblib";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ fab ];
};
}

View File

@ -992,6 +992,8 @@ in {
beautifulsoup4 = callPackage ../development/python-modules/beautifulsoup4 { }; beautifulsoup4 = callPackage ../development/python-modules/beautifulsoup4 { };
beautifultable = callPackage ../development/python-modules/beautifultable { };
bedup = callPackage ../development/python-modules/bedup { }; bedup = callPackage ../development/python-modules/bedup { };
behave = callPackage ../development/python-modules/behave { }; behave = callPackage ../development/python-modules/behave { };
@ -3687,6 +3689,8 @@ in {
karton-core = callPackage ../development/python-modules/karton-core { }; karton-core = callPackage ../development/python-modules/karton-core { };
karton-mwdb-reporter = callPackage ../development/python-modules/karton-mwdb-reporter { };
karton-yaramatcher = callPackage ../development/python-modules/karton-yaramatcher { }; karton-yaramatcher = callPackage ../development/python-modules/karton-yaramatcher { };
kazoo = callPackage ../development/python-modules/kazoo { }; kazoo = callPackage ../development/python-modules/kazoo { };
@ -4516,6 +4520,8 @@ in {
mwclient = callPackage ../development/python-modules/mwclient { }; mwclient = callPackage ../development/python-modules/mwclient { };
mwdblib = callPackage ../development/python-modules/mwdblib { };
mwlib = callPackage ../development/python-modules/mwlib { }; mwlib = callPackage ../development/python-modules/mwlib { };
mwlib-ext = callPackage ../development/python-modules/mwlib-ext { }; mwlib-ext = callPackage ../development/python-modules/mwlib-ext { };