Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Limit gitleaks scanned files to 50MB. TODO: make configurable (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
akpsgit authored Sep 6, 2023
1 parent f3a933d commit c01a552
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/shared/families/secrets/gitleaks/gitleaks.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ func (a *Scanner) Run(sourceType utils.SourceType, userInput string) error {
}()
reportPath := file.Name()

// ./gitleaks detect --source=<source> --no-git -r <report-path> -f json --exit-code 0
// ./gitleaks detect --source=<source> --no-git -r <report-path> -f json --exit-code 0 --max-target-megabytes 50
// nolint:gosec
cmd := exec.Command(a.config.BinaryPath, "detect", fmt.Sprintf("--source=%v", userInput), "--no-git", "-r", reportPath, "-f", "json", "--exit-code", "0")
cmd := exec.Command(a.config.BinaryPath, "detect", fmt.Sprintf("--source=%v", userInput), "--no-git", "-r", reportPath, "-f", "json", "--exit-code", "0", "--max-target-megabytes", "50")
a.logger.Infof("Running gitleaks command: %v", cmd.String())
_, err = sharedutils.RunCommand(cmd)
if err != nil {
Expand Down

0 comments on commit c01a552

Please sign in to comment.