about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/log4shell-detector/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/log4shell-detector/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/log4shell-detector/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/log4shell-detector/default.nix b/nixpkgs/pkgs/tools/security/log4shell-detector/default.nix
new file mode 100644
index 000000000000..6c51c5bcd6e9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/log4shell-detector/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, fetchFromGitHub
+, python3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "log4shell-detector";
+  version = "unstable-2021-12-16";
+  format = "setuptools";
+
+  src = fetchFromGitHub {
+    owner = "Neo23x0";
+    repo = pname;
+    rev = "622b88e7ea36819da23ce6ac090785cd6cca77f9";
+    sha256 = "sha256-N81x9hq473LfM+bQIQLWizCAsVc/pzyB84PV7/N5jk4=";
+  };
+
+  propagatedBuildInputs = with python3.pkgs; [
+    zstandard
+  ];
+
+  checkInputs = with python3.pkgs; [
+    pytestCheckHook
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -vD ${pname}.py $out/bin/${pname}
+    install -vd $out/${python3.sitePackages}/
+    cp -R Log4ShellDetector $out/${python3.sitePackages}
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Detector for Log4Shell exploitation attempts";
+    homepage = "https://github.com/Neo23x0/log4shell-detector";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}