about summary refs log tree commit diff
path: root/pkgs/tools/security/log4j-detect
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-12-14 20:59:55 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2021-12-15 08:28:36 +0100
commitc0aa017887551d8eb3a34ccb369974e0d2bfcbf4 (patch)
tree8fd1d71c2947a3ae64dd447b96c86c0b7387dbea /pkgs/tools/security/log4j-detect
parenta1b519b496ab586f13ee0ea7ab383cbfed0e5454 (diff)
log4j-detect: init at unstable-2021-12-14
Diffstat (limited to 'pkgs/tools/security/log4j-detect')
-rw-r--r--pkgs/tools/security/log4j-detect/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/tools/security/log4j-detect/default.nix b/pkgs/tools/security/log4j-detect/default.nix
new file mode 100644
index 0000000000000..aaad1fb94efbc
--- /dev/null
+++ b/pkgs/tools/security/log4j-detect/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, fetchFromGitHub
+, python3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "log4j-detect";
+  version = "unstable-2021-12-14";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "takito1812";
+    repo = pname;
+    rev = "2f5b7a598a6d0b4aee8111bb574ea72c6a1c76d6";
+    sha256 = "sha256-fFKW7uPBfrnze0UoPL3Mfwd4sFOuHYuDP7kv6VtdM3o=";
+  };
+
+  propagatedBuildInputs = with python3.pkgs; [
+    requests
+  ];
+
+  postPatch = ''
+    sed -i "1 i #!/usr/bin/python" ${pname}.py
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -vD ${pname}.py $out/bin/${pname}
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Tool to detect the log4j vulnerability";
+    homepage = "https://github.com/takito1812/log4j-detect";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ fab ];
+  };
+}