diff --git a/pkgs/by-name/se/search-vulns/package.nix b/pkgs/by-name/se/search-vulns/package.nix new file mode 100644 index 000000000000..ec0f84ff5f8f --- /dev/null +++ b/pkgs/by-name/se/search-vulns/package.nix @@ -0,0 +1,71 @@ +{ + lib, + python3, + fetchFromGitHub, +}: + +python3.pkgs.buildPythonApplication rec { + pname = "search-vulns"; + version = "0.8.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ra1nb0rn"; + repo = "search_vulns"; + tag = "v${version}"; + hash = "sha256-lvFx+ozbw7cYAJvaEFkeFxG+CfvbvDO0VRuNJ/Ub+bA="; + fetchSubmodules = true; + }; + + pythonRelaxDeps = [ "cpe-search" ]; + + build-system = with python3.pkgs; [ hatchling ]; + + dependencies = with python3.pkgs; [ + aiohttp + aiolimiter + cpe-search + cvss + requests + tqdm + ujson + ]; + + optional-dependencies = with python3.pkgs; { + all = [ + aiohttp + aiolimiter + cpe-search + cvss + flask + gevent + gunicorn + mariadb + markdown + requests + tqdm + ujson + ]; + mariadb = [ mariadb ]; + web = [ + flask + gevent + gunicorn + markdown + ]; + }; + + pythonImportsCheck = [ "search_vulns" ]; + + # Re-evaluate with the next release + doCheck = false; + + meta = { + description = "Search for known vulnerabilities in software using software titles or a CPE 2.3 string"; + homepage = "https://github.com/ra1nb0rn/search_vulns"; + changelog = "https://github.com/ra1nb0rn/search_vulns/blob/${src.tag}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + mainProgram = "search_vulns"; + }; +} diff --git a/pkgs/development/python-modules/cpe-search/default.nix b/pkgs/development/python-modules/cpe-search/default.nix new file mode 100644 index 000000000000..d514f42e084c --- /dev/null +++ b/pkgs/development/python-modules/cpe-search/default.nix @@ -0,0 +1,59 @@ +{ + lib, + aiohttp, + aiolimiter, + buildPythonPackage, + fetchFromGitHub, + hatchling, + mariadb, + requests, + ujson, +}: + +buildPythonPackage rec { + pname = "cpe-search"; + version = "0.1.7"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ra1nb0rn"; + repo = "cpe_search"; + tag = "v${version}"; + hash = "sha256-gCWKVSVDJNspRwDzHi7+vUETGErWYs3jlpsqkOqSY4I="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + aiohttp + aiolimiter + requests + ujson + ]; + + optional-dependencies = { + all = [ + aiohttp + aiolimiter + mariadb + requests + ujson + ]; + mariadb = [ + mariadb + ]; + }; + + # Tests requires DB and API access + doCheck = false; + + pythonImportsCheck = [ "cpe_search" ]; + + meta = { + description = "Search for Common Platform Enumeration (CPE) strings using software names and titles"; + homepage = "https://github.com/ra1nb0rn/cpe_search"; + changelog = "https://github.com/ra1nb0rn/cpe_search/blob/${src.tag}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 80fc70c67757..981127be3815 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3178,6 +3178,8 @@ self: super: with self; { cpe = callPackage ../development/python-modules/cpe { }; + cpe-search = callPackage ../development/python-modules/cpe-search { }; + cppe = callPackage ../development/python-modules/cppe { inherit (pkgs) cppe; }; cppheaderparser = callPackage ../development/python-modules/cppheaderparser { };