1{ lib
2, fetchFromGitHub
3, python3
4}:
5
6python3.pkgs.buildPythonApplication rec {
7 pname = "log4j-detect";
8 version = "unstable-2021-12-14";
9 format = "other";
10
11 src = fetchFromGitHub {
12 owner = "takito1812";
13 repo = pname;
14 rev = "2f5b7a598a6d0b4aee8111bb574ea72c6a1c76d6";
15 sha256 = "sha256-fFKW7uPBfrnze0UoPL3Mfwd4sFOuHYuDP7kv6VtdM3o=";
16 };
17
18 propagatedBuildInputs = with python3.pkgs; [
19 requests
20 ];
21
22 postPatch = ''
23 sed -i "1 i #!/usr/bin/python" ${pname}.py
24 '';
25
26 installPhase = ''
27 runHook preInstall
28 install -vD ${pname}.py $out/bin/${pname}
29 runHook postInstall
30 '';
31
32 meta = with lib; {
33 description = "Tool to detect the log4j vulnerability";
34 homepage = "https://github.com/takito1812/log4j-detect";
35 license = licenses.unfree;
36 maintainers = with maintainers; [ fab ];
37 };
38}