summary refs log tree commit diff
path: root/pkgs/tools/security/trufflehog/default.nix
blob: 9492f2bb6eac540486ba4943be6f1bca140f6b43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib, pythonPackages }:

let
  truffleHogRegexes = pythonPackages.buildPythonPackage rec {
    pname = "truffleHogRegexes";
    version = "0.0.4";
    src = pythonPackages.fetchPypi {
      inherit pname version;
      sha256 = "09vrscbb4h4w01gmamlzghxx6cvrqdscylrbdcnbjsd05xl7zh4z";
    };
  };
in
  pythonPackages.buildPythonApplication rec {
    pname = "truffleHog";
    version = "2.0.97";

    src = pythonPackages.fetchPypi {
      inherit pname version;
      sha256 = "034kpv1p4m90286slvc6d4mlrzaf0b5jbd4qaj87hj65wbpcpg8r";
    };

    # Relax overly restricted version constraint
    postPatch = ''
      substituteInPlace setup.py --replace "GitPython ==" "GitPython >= "
    '';

    propagatedBuildInputs = [ pythonPackages.GitPython truffleHogRegexes ];

    # Test cases run git clone and require network access
    doCheck = false;

    meta = {
      homepage = https://github.com/dxa4481/truffleHog;
      description = "Searches through git repositories for high entropy strings and secrets, digging deep into commit history";
      license = with lib.licenses; [ gpl2 ];
      maintainers = with lib.maintainers; [ bhipple ];
    };
  }