diff --git a/pkgs/tools/security/trufflehog/default.nix b/pkgs/tools/security/trufflehog/default.nix index 27574241576a..76ccda498b47 100644 --- a/pkgs/tools/security/trufflehog/default.nix +++ b/pkgs/tools/security/trufflehog/default.nix @@ -1,43 +1,33 @@ { lib -, python3Packages +, fetchFromGitHub +, buildGoModule }: -let - truffleHogRegexes = python3Packages.buildPythonPackage rec { - pname = "truffleHogRegexes"; - version = "0.0.7"; - src = python3Packages.fetchPypi { - inherit pname version; - sha256 = "b81dfc60c86c1e353f436a0e201fd88edb72d5a574615a7858485c59edf32405"; - }; +buildGoModule rec { + pname = "trufflehog"; + version = "3.21.0"; + + src = fetchFromGitHub { + owner = "trufflesecurity"; + repo = "trufflehog"; + rev = "refs/tags/v${version}"; + hash = "sha256-rse5uyQ7EUBhs0IyC92B/Z7YCeNIXTlZEqrlcjFekgA="; }; -in - python3Packages.buildPythonApplication rec { - pname = "truffleHog"; - version = "2.2.1"; - src = python3Packages.fetchPypi { - inherit pname version; - hash = "sha256-fw0JyM2iqQrkL4FAXllEozJdkKWELS3eAURx5NZcceQ="; - }; + vendorHash = "sha256-KyyJ7hUWF29L8oB9GkJ918/BQoLMsz+tStT2T9Azunk="; - # Relax overly restricted version constraint - postPatch = '' - substituteInPlace setup.py --replace "GitPython ==" "GitPython >= " - ''; + # Test cases run git clone and require network access + doCheck = false; - propagatedBuildInputs = [ - python3Packages.gitpython - truffleHogRegexes - ]; + postInstall = '' + rm $out/bin/{generate,snifftest} + ''; - # Test cases run git clone and require network access - doCheck = false; - - meta = with lib; { - homepage = "https://github.com/dxa4481/truffleHog"; - description = "Searches through git repositories for high entropy strings and secrets, digging deep into commit history"; - license = with licenses; [ gpl2 ]; - maintainers = with maintainers; [ bhipple ]; - }; - } + meta = with lib; { + description = "Find credentials all over the place"; + homepage = "https://github.com/trufflesecurity/trufflehog"; + changelog = "https://github.com/trufflesecurity/trufflehog/releases/tag/v${version}"; + license = with licenses; [ agpl3 ]; + maintainers = with maintainers; [ ]; + }; +}