mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-10 14:14:20 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
46 lines
1018 B
Nix
46 lines
1018 B
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, python3
|
|
}:
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
pname = "log4j-scan";
|
|
version = "unstable-2021-12-18";
|
|
format = "other";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "fullhunt";
|
|
repo = pname;
|
|
rev = "070fbd00f0945645bd5e0daa199a554ef3884b95";
|
|
sha256 = "sha256-ORSc4KHyAMjuA7QHReDh6SYY5yZRunBBN1+lkCayqL4=";
|
|
};
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
pycryptodome
|
|
requests
|
|
termcolor
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace log4j-scan.py \
|
|
--replace "headers.txt" "../share/headers.txt"
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -vD ${pname}.py $out/bin/${pname}
|
|
install -vD headers.txt headers-large.txt -t $out/share
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Scanner for finding hosts which are vulnerable for log4j";
|
|
mainProgram = "log4j-scan";
|
|
homepage = "https://github.com/fullhunt/log4j-scan";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|