about summary refs log tree commit diff
path: root/pkgs/tools/security/trufflehog
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2022-12-30 05:01:53 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2022-12-30 05:01:53 +0100
commitc18d193adc1fbcdb8bb1d221e5f1c51e79cdc4ce (patch)
tree1276997bea809d5801c070000508975c23fb36b0 /pkgs/tools/security/trufflehog
parenta8ce53810a43b1bf26d027f92e730dc4358250d4 (diff)
trufflehog: 2.2.1 -> 3.21.0
Diffstat (limited to 'pkgs/tools/security/trufflehog')
-rw-r--r--pkgs/tools/security/trufflehog/default.nix59
1 files changed, 24 insertions, 35 deletions
diff --git a/pkgs/tools/security/trufflehog/default.nix b/pkgs/tools/security/trufflehog/default.nix
index 27574241576ad..9e2b2e44f33a8 100644
--- a/pkgs/tools/security/trufflehog/default.nix
+++ b/pkgs/tools/security/trufflehog/default.nix
@@ -1,43 +1,32 @@
 { lib
-, python3Packages
+, fetchFromGitHub
+, buildGoModule
 }:
 
-let
-  truffleHogRegexes = python3Packages.buildPythonPackage rec {
-    pname = "truffleHogRegexes";
-    version = "0.0.7";
-    src = python3Packages.fetchPypi {
-      inherit pname version;
-      sha256 = "b81dfc60c86c1e353f436a0e201fd88edb72d5a574615a7858485c59edf32405";
-    };
-  };
-in
-  python3Packages.buildPythonApplication rec {
-    pname = "truffleHog";
-    version = "2.2.1";
+buildGoModule rec {
+  pname = "trufflehog";
+  version = "3.21.0";
 
-    src = python3Packages.fetchPypi {
-      inherit pname version;
-      hash = "sha256-fw0JyM2iqQrkL4FAXllEozJdkKWELS3eAURx5NZcceQ=";
-    };
+  src = fetchFromGitHub {
+    owner = "trufflesecurity";
+    repo = "trufflehog";
+    rev = "v${version}";
+    sha256 = "sha256-rse5uyQ7EUBhs0IyC92B/Z7YCeNIXTlZEqrlcjFekgA=";
+  };
 
-    # Relax overly restricted version constraint
-    postPatch = ''
-      substituteInPlace setup.py --replace "GitPython ==" "GitPython >= "
-    '';
+  vendorSha256 = "sha256-KyyJ7hUWF29L8oB9GkJ918/BQoLMsz+tStT2T9Azunk=";
 
-    propagatedBuildInputs = [
-      python3Packages.gitpython
-      truffleHogRegexes
-    ];
+  # Test cases run git clone and require network access
+  doCheck = false;
 
-    # Test cases run git clone and require network access
-    doCheck = false;
+  postInstall = ''
+    rm $out/bin/{generate,snifftest}
+  '';
 
-    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";
+    license = with licenses; [ agpl3 ];
+    maintainers = with maintainers; [ ];
+  };
+}