2021-03-01 23:30:56 +01:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
2021-01-19 21:56:03 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gitleaks";
|
2021-05-06 06:26:05 +02:00
|
|
|
version = "7.5.0";
|
2021-01-19 21:56:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zricethezav";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-06 06:26:05 +02:00
|
|
|
sha256 = "sha256-s7EOCoGciGT5+Fose9BffsHHE/SsSMmNoWGmeAv6Agk=";
|
2021-01-19 21:56:03 +01:00
|
|
|
};
|
|
|
|
|
2021-03-10 23:43:46 +01:00
|
|
|
vendorSha256 = "sha256-Cc4DJPpOMHxDcH22S7znYo7QHNRXv8jOJhznu09kaE4=";
|
2021-01-19 21:56:03 +01:00
|
|
|
|
2021-03-02 08:37:24 +01:00
|
|
|
preBuild = ''
|
|
|
|
buildFlagsArray+=("-ldflags" "-s -w -X github.com/zricethezav/gitleaks/v${lib.versions.major version}/version.Version=${version}")
|
|
|
|
'';
|
|
|
|
|
2021-01-19 21:56:03 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Scan git repos (or files) for secrets";
|
|
|
|
longDescription = ''
|
|
|
|
Gitleaks is a SAST tool for detecting hardcoded secrets like passwords,
|
|
|
|
API keys, and tokens in git repos.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/zricethezav/gitleaks";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|