* 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>
* Support base64 decoding during scans
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Add failing tests for the case when the match starts outside the decoded value
* Align locations for overlapping, encoded matches
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Add --max-decode-depth flag and update README help output
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Move keywords off of fragment
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Fix comment typo
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Refactor how keywords are used in detect
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Clarify comments and rename method to match
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Improve performance
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Fix issues after rebase
Only adjust matchIndex to fix the following line issue when not working
with encoded segments since they handle adjusting the index themselves.
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Update detect/decoder.go
Don't escape characters that don't need escaping
Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
* Update flag help text
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
* Add meta data tags from decoding
rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
---------
Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
* drop travis
* remove travis
* rename, use example
* typo
* different syntax
* rename to test
* split test and build into two jobs
* add gosec job
* drop gosec for now
* Pass the entropy data back to the Leak struct
Do this to make it easier to tune entropy checks and make decisions in
systems consuming the output.
~ B'ezrat Hashem ~
* Return negative number when entropy not checked
That way you can tell the difference between not checking or an
actual entropy level of 0
~ B'ezrat Hashem ~
* Make sure to handle range checks properly
Make sure to show when something had an entropy returned but was outside
range, or didn't have a hit at all, etc...
~ B'zrat Hashem ~
* Add a few doc strings
Follow the project's conventiona add a comment above the methods
~ B'ezrat Hashem ~
* Update tests and get them to pass
~ B'ezrat Hashem ~
* Remove checked in `.got` files
~ B'ezrat Hashem ~
* Add `*.got` to the `.gitignore`
Make sure the test output files aren't checked-in
~ B'ezrat Hashem ~
* 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
* 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