248 Commits
Author SHA1 Message Date
Zachary Rice 80093b8a7b Update Readme 2026-05-21 07:29:43 -05:00
Zachary Rice 9febafb621 broken link
Removed Gitleaks Playground badge and link from README.
2026-05-13 08:53:48 -05:00
Zachary Rice b5cb8ad01b Update README.md
Removed GitHub Action section from README.md.
2026-05-13 08:53:02 -05:00
Zachary Rice 67fcd836b3 Update README.md 2026-03-20 21:23:42 -05:00
bplaxco c5ccbb9468 Respect contexts with timeouts (#1948)
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
2025-10-24 12:30:13 -05:00
Zachary Rice 228396b37b Add GitHub Sponsors section and Discord link
Updated README to add GitHub Sponsors section and reintroduced Discord link.
2025-09-16 19:00:16 -05:00
Zachary Rice 4fb43823ef cant count 2025-07-20 11:14:25 -05:00
Zachary Rice b1c9c7ecbe Composite rules (#1905)
* composite rules

* add test config

* tests

* taking care of some pr comments

* naming
2025-07-20 11:13:38 -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
Zachary Rice 489d13c14e Update README.md 2025-05-31 14:12:05 -05:00
Zachary Rice 82f7e32b71 Diagnostics (#1856)
* init diagnostics

* update usage readme
2025-05-13 09:22:20 -05:00
bplaxco 78eebaca9d Percent/URL Decoding Support (#1831)
* Add initial percent decoding support

* Refactor multi encoding support

* Add detect tests to confirm positions

* Avoid a few extra passes during decoding

* Do multiple passes for finding encodings re

* Fix issue with overlapping encodings when doing separate passes
2025-05-12 11:22:36 -05:00
Richard Gomez 4451b455f3 feat(config): define multiple global allowlists (#1777) 2025-04-29 08:49:04 -05:00
Yann Lacroix 7fac002325 bump repo version in pre-commit example (#1815) 2025-04-06 19:32:32 -05:00
Richard Gomez e273a970a4 chore: tweak logging and readme for GITLEAKS_CONFIG_TOML feature (#1802) 2025-03-22 13:03:09 -05:00
Roger MeierandRichard Gomez a503b583ba feat: add option to set config from env var with toml content (#1662)
* feat: add option to set config from env var with toml content

* Update README.md

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* fix: check if config provided by GITLEAKS_CONFIG_TOML can be loaded

* docs: move load configuration section to have it before configuration

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
2025-03-22 10:03:52 -05:00
Zachary Rice b4df42364d Update README.md 2025-03-17 19:26:18 -05:00
Jesse Portnoy 4344b00934 Readme badge revisions (#1744)
* - Added badges:
    * Go docs
    * Go report card
    * License
- Replaced HTML code for badges with Markdown

* Amend CI badge
2025-03-17 16:08:57 -05:00
Roger Meier 398d0c46dd docs: describe extended rules take precedence over base rules (#1563)
Closes #1384
2025-02-11 07:53:00 -06:00
William Bille Meyling cc71bb1e9a update version for pre-commit in README.md (#1699) 2025-01-15 15:12:07 -06:00
Richard Gomez 0e5f644b67 feat(config): disable extended rule (#1535) 2025-01-14 18:52:57 -06:00
Zachary Rice b022d1c856 friendship ended with tines 2025-01-02 10:24:13 -06:00
Zachary Rice dbe3746455 twitter really does suck ass now 2024-12-28 10:22:25 -06:00
Richard Gomez 83e99bacf1 feat(report): allow user-defined templates (#1650) 2024-12-10 18:56:11 -06:00
Taiki Ono 8e94f98e92 Add option to include Line field in report (#1616)
Signed-off-by: Taiki Ono <taiki@finatext.com>
2024-10-31 15:51:53 -05:00
Zachary Rice 259946000b Update README.md 2024-10-31 08:31:50 -05:00
Zachary Rice 8ffb980ee5 nop for stupid build 2024-10-31 08:30:57 -05:00
ReRetriever d07b394b08 Update spelling in README.md (#1574) 2024-10-17 10:53:30 -05:00
Richard Gomez aabe381539 Define multiple allowlists per rule (#1496)
* feat: multiple rule allowlists

* feat(config): add allowlist 'condition'
2024-10-14 19:17:37 -05:00
bplaxcoandRichard Gomez 2278a2a97e Decode Base64 (#1488)
* 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>
2024-10-02 19:33:55 -05:00
Roger Meier a971a324fa fix: use regexTarget for extend config (#1536)
* fix: use regexTarget for extend config

* fix: add keywords from base and extended rule into global keywords list

* docs: add an example to extend default rules

* chore: update project URL references
2024-09-29 15:45:56 -05:00
Zachary Rice 0874ebcc3f Update README.md 2024-09-14 05:46:28 -05:00
Zachary Rice 44ad62e0b1 Deprecate detect and protect. Add git, dir, stdin (#1504)
* init backwards compatible cmd

* update readme, todos

* ...

* moar comments, sprucing up root

* readme change
2024-09-13 19:44:22 -05:00
Zachary Rice 4c5195b700 Update README.md 2024-06-14 15:22:23 -04:00
Zachary Rice 9a4538c4d6 coderabbit.ai <3 2024-06-13 09:16:17 -04:00
Katrin Leinweber 57ac4b3dc7 Update "contributing guidelines" link (#1390) 2024-04-15 09:13:43 -05:00
Zachary Rice abfd0f3fdc Update README.md 2023-08-28 13:10:03 -05:00
Matjaž Domen Pečan db4bc0fe76 Resolve #1170 - Enable selection of a single rule (#1183)
* Gitleaks issue #1170 - Feature request to add a flag to enable a subset of rules on the command line.

* Added documentation.
2023-08-24 09:56:17 -05:00
Ian Moroney 3f894cbafc Fixed docker run command in README.md (#1194)
The docker run command was missing `ghcr.io/` in the image name, which resulted in an error:

Unable to find image 'gitleaks/gitleaks:latest' locally
docker: Error response from daemon: pull access denied for gitleaks/gitleaks, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
2023-06-15 07:15:57 -05:00
Malte Morgenstern 0dbdde837f Add junit report format (#920)
* add junit report format

* add fingerprint to expected test result to fix tests

* fix expected junit test report
2023-06-13 13:37:32 -05:00
Oleksandr Redko 6705461b33 Fix typos in *.md, comments and logs (#1185) 2023-05-30 07:08:42 -05:00
Zachary Rice 9869eab4c2 Update README.md 2023-05-01 19:01:05 -05:00
Zachary Rice 8d80a5a5a2 Adding discord channel to readme 2023-05-01 16:43:06 -05:00
Edward Wang 839f114f2b Fix typo (#1142) 2023-04-08 17:56:58 -05:00
Zachary Rice 63c3076ea2 No color (#1136)
* safer out of bounds

* no color option

* readme
2023-03-29 16:56:01 -05:00
Zachary Rice b5a726e96a Update README.md 2023-03-29 14:33:34 -05:00
SADIK KUZU 6fa63f41d8 Update pre-commit address and rev tag in README (#1125)
* Update pre-commit address and rev tag in README

* Upgrade actions/checkout@v2 to v3
2023-03-22 10:18:07 -05:00
Zachary Rice c3b7a98911 Update README.md 2023-03-22 09:59:48 -05:00
Zachary Rice 6c4a88c5a4 Update README.md 2023-03-21 08:53:29 -05:00
sergiomarotco db79d8194f fix README.md !? (#1123) 2023-03-21 08:07:22 -05:00