60 Commits
Author SHA1 Message Date
dependabot[bot] d8fafb2396 build(deps): bump github.com/mholt/archives from 0.1.2 to 0.1.5
Bumps [github.com/mholt/archives](https://github.com/mholt/archives) from 0.1.2 to 0.1.5.
- [Release notes](https://github.com/mholt/archives/releases)
- [Commits](https://github.com/mholt/archives/compare/v0.1.2...v0.1.5)

---
updated-dependencies:
- dependency-name: github.com/mholt/archives
  dependency-version: 0.1.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-01 19:30:09 +00:00
Richard Gomez b66ac75e4f build: switch to Go 1.24 (#2002) 2025-12-09 09:15:58 -06:00
4ed0ca4902 build: upgrade Go & alpine version (#1989)
Co-authored-by: Michel Tu <michel.tu@databricks.com>
Co-authored-by: Jiri Stary <72435227+Jiri-Stary@users.noreply.github.com>
2025-11-20 07:29:50 -06:00
Zachary Rice 3821f30b06 Config min version (#1955)
* init

* minVersion set

* sigh

* addressed some comments, fixed double validate bug
2025-10-16 13:53:00 -05:00
Christophe Goessen 7fb4eda723 Fix: CVEs on go and go crypto (#1868)
* fix(CVE-2025-22871): update go to 1.23.8

* fix(CVE-2025-22869): update go crypto to 0.35.0
2025-07-08 09:13:33 -05:00
bplaxcoandAlex Layne 782f310478 Archive support (#1872)
* Start Files Source

* Keep cmd the same for now

* Get tests to pass

* s.MaxTargetMegaBytes -> s.MaxFileSize

* Tweak some log messages & use q semgroup for files

* Just call yield inside the semgroup

* Refactor a check and revert some log lines

* Move mg && misc tuning

* Add `make profile`

(Benchmark results are only added if tools are installed)

Example output:

```
========================================================================
generating profile data
------------------------------------------------------------------------
- mode: dir
  benchmark:
    tool: hyperfine
    path: profile/1748019612/dir/benchmark.json
    results:
      mean: 1.12852930166
      stddev: 0.12163775966037399
      median: 1.07242928416
      user: 3.9699382799999996
      system: 0.04382341999999999
      min: 1.03207673016
      max: 1.3913475181600001
  profile:
    - mode: cpu
      path: profile/1748019612/dir/cpu.pprof
      view: go tool pprof -http=localhost: ./gitleaks profile/1748019612/dir/cpu.pprof
    - mode: mem
      path: profile/1748019612/dir/mem.pprof
      view: go tool pprof -http=localhost: ./gitleaks profile/1748019612/dir/mem.pprof
    - mode: trace
      path: profile/1748019612/dir/trace.out
      view: go tool trace profile/1748019612/dir/trace.out
- mode: git
  ...snip...
```

* Archive support for File based sources

* Move Git to Source interface

* Scan archives in git

* Misc linter fixes

* Exclude certain diffs: --diff-filter=tuxdb

* Add git archives tests

* Log error instead of fatal

* Fix spacing in test config

* Refine source comments/wording

* Make MB conversions more readable

* Format cmd

* Adjust DetectSource logging

* MiB -> MB in logs

* Add testdata/repos/archives/dotGit/refs/.gitkeep

Without it the refs folder gets deleted and the
and then it isn't detected as a git repo ¯\_(ツ)_/¯

So then the test starts scanning the whole gitleaks
repo instead :D

* Handle finding links for archives

* Working on archive depth

* Fixes from failfast test

* cmd max-archive-depth

* added comments, fixed warnings

* removed test print

* Update README.md

* Set archive depth for DetectFiles

* Tweak logs & pass max archive for readers

* Pass ctx to Fragments

* Add make lint target and address some issues

* Fix compat issue

* Report path in fragment errors

* Apply PR suggestions & misc changes

- Update blobReader.Close() to discard the buffer
- Misc logger issues & uses
- Tweak .golangci.yaml to default to none
- Discard remaining blobReader data on close
- Undo a De Morgan's Law suggestion (and disable QF1001)

* Add http mode for diagnostics

gitleaks --diagnostics=http ...
-----

From the net/http/pprof docs:

Use the pprof tool to look at the heap profile:
```
go tool pprof http://localhost:6060/debug/pprof/heap
```

Or to look at a 30-second CPU profile:
```
go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
```

Or to look at the goroutine blocking profile, after calling runtime.SetBlockProfileRate in your program:
```
go tool pprof http://localhost:6060/debug/pprof/block
```

Or to look at the holders of contended mutexes, after calling runtime.SetMutexProfileFraction in your program:
```
go tool pprof http://localhost:6060/debug/pprof/mutex
```

(For more info see https://pkg.go.dev/net/http/pprof)

---------

Co-authored-by: Alex Layne <alayne@redhat.com>
2025-06-01 11:29:34 -05:00
Richard Gomez 3fdc9c13d2 build: upgrade rs/zerolog, spf13/cobra, and spf13/viper (#1769)
This eliminates golang.org/x/text@v0.3.0 from the dependency chain, which is associated with a critical CVE that can cause Gitleaks to be flagged in regulated environments.
2025-02-24 08:50:31 -06:00
Christophe GoessenandChristophe Goessen 96b92c3d07 fix: upgrade x/crypto to 0.31.0 to get rid of CVE-2024-45337 (#1768)
Co-authored-by: Christophe Goessen <christophe@gssn.net>
2025-02-24 08:42:05 -06:00
Daniel Bos 9122a2d359 chore: Update github.com/wasilibs/go-re2 to v1.9.0 (#1763)
Fixes #1751
2025-02-19 05:15:04 -06:00
Richard Gomez 7357adca5e build: add 'toolchain' to go.mod (#1682) 2024-12-30 10:08:24 -06:00
Richard Gomez 7cb5f6f64c build: upgrade sprig v2->v3 (#1674) 2024-12-20 19:44:18 -06:00
ahrav a91c6717a0 replace std library regex engine with go-re2 (#1669) 2024-12-20 09:53:01 -06:00
Zach a9e6d8c9a7 go mod 1.23 2024-12-19 09:27:43 -06:00
Richard Gomez 83e99bacf1 feat(report): allow user-defined templates (#1650) 2024-12-10 18:56:11 -06:00
Richard Gomez 8ea608595c build: upgrade gitleaks/go-gitdiff to v0.9.1 (#1559) 2024-10-13 06:46:44 -05:00
Richard Gomez c5b15c9d74 refactor(config): keyword map (#1538) 2024-09-30 07:32:25 -05:00
Roger Meier a0f2f4671c feat: bump go to 1.22 (#1537)
support for 1.19 ended, see https://endoflife.date/go
2024-09-29 11:59:46 -05:00
Richard Gomez ed19c4e8b4 fix(config): extend allowlist & handle extend when validating (#1524) 2024-09-25 08:20:19 -05:00
dutchhaag 247a5e7214 patching golang.org/x/text for CVE-2021-38561 and CVE-2022-32149 (#1342) 2024-02-15 11:54:47 -06:00
eyalatox 8b8920d4c3 --max-target-megabytes flag now supported for --no-git flag as well (#1330) 2024-01-24 16:08:05 -06:00
Zachary Rice a82ac29976 switch out libs (#1259) 2023-08-29 12:01:36 -05:00
Savely Krasovsky 45266551ba refactor: fix #722 properly (#1250)
* refactor: fix #722 properly

* fix(deps): update go-gitdiff to v0.9.0

* refactor: second attempt

* refactor: better git package api

* fix: add comments
2023-08-22 14:00:33 -05:00
Gaige B Paulsen bc599446dc chore: update deps to fix solaris link (#1159) 2023-06-13 13:27:30 -05:00
naoki kuroda e93d8cb696 Upgrade go version to 1.19 (#987)
* upgrade go version to 1.19

* upgrade go version to 1.19 in dockerfile and test.yml
2022-09-25 09:06:50 -05:00
Zachary Rice 96eed6aa0f Pretty output (#973)
pretty output
2022-09-04 08:58:57 -05:00
Zachary Rice b6b7cfb6d3 draft: bump gitdiff, add git.Err state, better log messages (#954)
* bump gitdiff, add git.Err state, better log messages

* remove cmd.Start

* forgot to start...
2022-08-16 19:36:25 -05:00
Zachary Rice 82f7d61593 Update dockerfile (#848)
* bump alpine and add default safe dir for git

* comment out safe dir fix

* update deps
2022-04-20 18:19:33 -05:00
Zachary Rice 3474c58c9e Generate tps (#845)
* WIP

* simplify tp generation
2022-04-18 21:59:38 -05:00
Zachary Rice 48b79facfa optimize keywords (#841)
* optimize keywords

* use defaults for concurrency again
2022-04-16 17:41:40 -05:00
Adam Shannon 0cabbf8ca8 detect: skip binary files with --no-git (#810) 2022-03-22 14:32:47 -05:00
Zachary Rice 6e72472b60 Refactor detect, add entropy to all findings (#804)
Refactor `detect`, add `entropy` to all findings
2022-03-12 11:50:01 -06:00
rui 4b6f4d0de5 build: updates for go1.17 (#769)
* build: remove `GO111MODULE` as it turned on by default

Signed-off-by: Rui Chen <rui@chenrui.dev>

* build: update for go1.17

* run test

Signed-off-by: Rui Chen <rui@chenrui.dev>

* lint: remove unused code
2022-02-22 16:49:45 -06:00
Zach Rice 631d8dcf03 bump go-gitdiff 2021-12-12 12:23:59 -06:00
Zachary Rice 089639e9fb bump go-gitdiff (#731) 2021-12-02 08:29:38 -06:00
Zachary Rice 93f292c3df Introducing v8.0.0 changes (#701)
* Introducing v8.0.0 changes
2021-11-22 10:43:51 -06:00
Zachary Rice abc73e2443 use embed pkg for default config, update deps (#616) 2021-09-02 14:42:14 -05:00
rui 0ce1249b95 chore(deps): bump go to v1.16 (#525)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2021-02-18 09:14:10 -05:00
Zachary Rice 86cfe0848b Allow list bugs (#484)
* fix allowlist bug
2020-12-09 13:21:15 -05:00
Zachary Rice 65f42020af Go repo scan (#480)
* Real fast

* Addressing some golint stuff
2020-12-08 17:22:28 -05:00
zricethezav 389d45e380 Removing limiting line/offender length 2020-12-03 09:28:30 -05:00
Zachary Rice c50906373c update to V7 (#469) 2020-12-02 17:07:31 -05:00
Zachary Rice fae366a404 Global allowlist regex (#422)
* work in progress

* Update test configs

* adding test

* golint and change to allowlist

* fix race condition, this mistakenly got committed

* Updating tests and examples

* bump to v6 as this is a breaking change to the config

* More consistent variables
2020-08-12 17:18:25 -04:00
Zachary Rice 6ca7a11d88 Add line number to report plus some other things (#409)
* Init refactor

* think i got it working

* we got em

* Updating tests

* fixing tests

* Better comments, more test fixing

* Bumping to v5

* Fixing golint messages

* Replacing usage of audit with scan in comments

* bumping go-git

* Updating to v5 in some other spots
2020-07-24 10:49:03 -04:00
Zachary Rice 473d0d55a7 Whitelist repo (#378)
* fixing commit latest bug

* bumping go-git and adding repo whitelist

* adding tests
2020-05-09 10:38:02 -04:00
Zachary Rice 11dcb44e41 bump to go 1.14 and alpine to 3.11 (#363) 2020-04-05 09:38:27 -04:00
Zachary Rice dae5c142d7 Fix host clone auth (#350)
* trying auth fix

* fixing github private user auth and donate msg

* formatting

* go fmt...
2020-02-29 13:30:08 -05:00
Zachary Rice 8b3ce2cb1e forgot to bump in code... (#347) 2020-02-26 20:41:54 -05:00
Zachary Rice 94cae90d1e duplicate leak logic includes the line in hash (#345) 2020-02-26 17:38:16 -05:00
zricethezav ce95cafd54 fixing modules, adding v3 in path 2020-01-22 10:21:00 -05:00
Zach Rice a0f72a4e35 Adding commit range feature via 'commit-to' and 'commit-from' options 2020-01-11 16:46:58 -05:00