Skip to content

Releases: gitleaks/gitleaks

v8.28.0

20 Jul 16:18
4fb4382
Compare
Choose a tag to compare

Changelog

Optimizations

#1909 waits to find newlines until a match. This ends up saving a boat load of time since before we were finding newlines for every fragment regardless if a rule matched or not.
#1908 promoted @rgmz excellent stopword optimization

Composite Rules (Multi-part or required Rules) #1905

In v8.28.0 Gitleaks introduced composite rules, which are made up of a single "primary" rule and one or more auxiliary or required rules. To create a composite rule, add a [[rules.required]] table to the primary rule specifying an id and optionally withinLines and/or withinColumns proximity constraints. A fragment is a chunk of content that Gitleaks processes at once (typically a file, part of a file, or git diff), and proximity matching instructs the primary rule to only report a finding if the auxiliary required rules also find matches within the specified area of the fragment.

Proximity matching: Using the withinLines and withinColumns fields instructs the primary rule to only report a finding if the auxiliary required rules also find matches within the specified proximity. You can set:

  • withinLines: N - required findings must be within N lines (vertically)
  • withinColumns: N - required findings must be within N characters (horizontally)
  • Both - creates a rectangular search area (both constraints must be satisfied)
  • Neither - fragment-level matching (required findings can be anywhere in the same fragment)

Here are diagrams illustrating each proximity behavior:

p = primary captured secret
a = auxiliary (required) captured secret
fragment = section of data gitleaks is looking at


    *Fragment-level proximity*               
    Any required finding in the fragment
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”                       
   β”Œβ”€β”€β”€β”€β”€β”€β”€fragmentβ”œβ”€β”€β”€β”€β”€β”                 
   β”‚      └──────┬──     β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”       
   β”‚             β”‚aβ”‚β—€β”€β”€β”€β”€β”Όβ”€β”‚βœ“ MATCHβ”‚       
   β”‚          β”Œβ”€β”β””β”€β”˜     β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”˜       
   β”‚β”Œβ”€β”       β”‚pβ”‚        β”‚                 
   β”‚β”‚aβ”‚    β”Œβ”€β”β””β”€β”˜        β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”       
   β”‚β””β”€β”˜    β”‚aβ”‚β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”‚βœ“ MATCHβ”‚       
   β””β”€β–²β”€β”€β”€β”€β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜       
     β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”                        
     β””β”€β”€β”€β”€β”‚βœ“ MATCHβ”‚                        
          β””β”€β”€β”€β”€β”€β”€β”€β”˜                        
                                           
                                           
   *Column bounded proximity*
   `withinColumns = 3`                    
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”                       
   β”Œβ”€β”€β”€β”€β”¬β”€β”€fragmentβ”œβ”€β”¬β”€β”€β”€β”                 
   β”‚      └──────┬──     β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   
   β”‚    β”‚        β”‚a│◀┼───┼─│+1C βœ“ MATCHβ”‚   
   β”‚          β”Œβ”€β”β””β”€β”˜     β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   
   β”‚β”Œβ”€β” β”‚     β”‚pβ”‚    β”‚   β”‚                 
β”Œβ”€β”€β–Άβ”‚aβ”‚  β”Œβ”€β”  β””β”€β”˜        β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   
β”‚  β”‚β””β”€β”˜ β”‚β”‚a│◀────────┼───┼─│-2C βœ“ MATCHβ”‚   
β”‚  β”‚       β”˜             β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   
β”‚  └── -3C ───0C─── +3C β”€β”˜                 
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                             
β”‚  β”‚ -4C βœ— NOβ”‚                             
└──│  MATCH  β”‚                             
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                             
                                           
                                           
   *Line bounded proximity*
   `withinLines = 4`                      
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”                        
   β”Œβ”€β”€β”€β”€β”€β”€fragmentβ”œβ”€β”€β”€β”€β”€β”                  
  +4L─ ─ β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”€ ─ ─│                  
   β”‚                    β”‚                  
   β”‚              β”Œβ”€β”   β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   
   β”‚         β”Œβ”€β”  β”‚a│◀──┼─│+1L βœ“ MATCH β”‚   
   0L  β”Œβ”€β”   β”‚pβ”‚  β””β”€β”˜   β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   
   β”‚   β”‚a│◀──┴─┴────────┼─│-1L βœ“ MATCH β”‚   
   β”‚   β””β”€β”˜              β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   
   β”‚                    β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”      
  -4L─ ─ ─ ─ ─ ─ ─ β”€β”Œβ”€β”β”€β”‚ β”‚-5L βœ— NO β”‚      
   β”‚                β”‚a│◀┼─│  MATCH  β”‚      
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”΄β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      
                                           
                                           
   *Line and column bounded proximity*
   `withinLines = 4`                      
   `withinColumns = 3`                    
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”                        
   β”Œβ”€β”€β”€β”€β”€β”€fragmentβ”œβ”€β”€β”€β”€β”€β”                  
  +4L   β”Œβ””β”€β”€β”€β”€β”€β”€β”€β”€β”΄ ┐   β”‚                  
   β”‚            β”Œβ”€β”     β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚    β”‚       β”‚a│◀┼───┼─│+2L/+1C βœ“ MATCHβ”‚
   β”‚         β”Œβ”€β”β””β”€β”˜     β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   0L   β”‚    β”‚pβ”‚    β”‚   β”‚                  
   β”‚         β””β”€β”˜        β”‚                  
   β”‚    β”‚           β”‚   β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   
  -4L    ─ ─ ─ ─ ─ β”€β”Œβ”€β” β”‚ β”‚-5L/+3C βœ— NOβ”‚   
   β”‚                β”‚a│◀┼─│   MATCH    β”‚   
   └───-3C────0L───+3Cβ”΄β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   

v8.27.2

09 Jun 00:35
Compare
Choose a tag to compare

Changelog

v8.27.1

08 Jun 01:59
Compare
Choose a tag to compare

Changelog

  • 80468ef Merge branch 'master' of github.com:gitleaks/gitleaks
  • ef82237 fix(atlassian): reduce false-positives for v1 pattern (#1892)
  • 2463f11 Fix log suppresion issue (#1887)
  • 6f251ee Added Heroku API Key New Version (#1883)
  • 20f9a1d Add Platform Bitbucket (#1886)
  • 722ce82 Add Platform Gitea (#1884)
  • 79780b8 Merge branch 'master' of github.com:gitleaks/gitleaks
  • c5683ca prevent default warn message when max-archive-depth not set (#1881)
  • 0357c3c prevent default warn message when max-archive-depth not set

v8.27.0

01 Jun 16:36
782f310
Compare
Choose a tag to compare

Changelog

Got another @bplaxco release. Cheers!

Archive Scanning

Sometimes secrets are packaged within archive files like zip files or tarballs,
making them difficult to discover. Now you can tell gitleaks to automatically
extract and scan the contents of archives. The flag --max-archive-depth
enables this feature for both dir and git scan types. The default value of
"0" means this feature is disabled by default.

Recursive scanning is supported since archives can also contain other archives.
The --max-archive-depth flag sets the recursion limit. Recursion stops when
there are no new archives to extract, so setting a very high max depth just
sets the potential to go that deep. It will only go as deep as it needs to.

The findings for secrets located within an archive will include the path to the
file inside the archive. Inner paths are separated with !.

Example finding (shortened for brevity):

Finding:     DB_PASSWORD=8ae31cacf141669ddfb5da
...
File:        testdata/archives/nested.tar.gz!archives/files.tar!files/.env.prod
Line:        4
Commit:      6e6ee6596d337bb656496425fb98644eb62b4a82
...
Fingerprint: 6e6ee6596d337bb656496425fb98644eb62b4a82:testdata/archives/nested.tar.gz!archives/files.tar!files/.env.prod:generic-api-key:4
Link:        https://github.com/leaktk/gitleaks/blob/6e6ee6596d337bb656496425fb98644eb62b4a82/testdata/archives/nested.tar.gz

This means a secret was detected on line 4 of files/.env.prod. which is in
archives/files.tar which is in testdata/archives/nested.tar.gz.

Currently supported formats:

The compression
and archive
formats supported by mholt's archives package
are supported.

v8.26.0

12 May 21:03
78eebac
Compare
Choose a tag to compare

Changelog

Calling this one @bplaxco's release as he introduced a really clever method for mixed decoding without sacrificing too much performance. As I stated in his PR, I think he's either a wizard or some time traveling AI. Dude is wicked smaht

Anyways, Gitleaks now supports the following decoders: hex, percent(url enconding), and b64. It's relatively straight forward to add a new decoder so if you're motivated, community contributions are welcomed!

Here's an example:

~/code/gitleaks-org/gitleaks (master) cat decode.txt
text below
aGVsbG8sIHdvcmxkIQ%3D%3D%0A
text above
~/code/gitleaks-org/gitleaks (master) ./gitleaks dir decode.txt --max-decode-depth=2 --log-level=debug

    β—‹
    β”‚β•²
    β”‚ β—‹
    β—‹ β–‘
    β–‘    gitleaks

4:08PM DBG using stdlib regex engine
4:08PM DBG unable to load gitleaks config from decode.txt/.gitleaks.toml since --source=decode.txt is a file, using default config
4:08PM DBG found .gitleaksignore file: .gitleaksignore
4:08PM DBG segment found: original=[29,38] pos=[29,38]: "%3D%3D%0A" -> "==\n"
4:08PM DBG segment found: original=[11,38] pos=[11,31]: "aGVsbG8sIHdvcmxkIQ==" -> "hello, world!"
4:08PM INF scanned ~50 bytes (50 bytes) in 1.5ms
4:08PM INF no leaks found

v8.25.1

30 Apr 13:51
d1c7759
Compare
Choose a tag to compare

Changelog

Big thanks @rgmz

v8.25.0

29 Apr 14:53
4451b45
Compare
Choose a tag to compare

Changelog

  • 4451b45 feat(config): define multiple global allowlists (#1777) (cause for the minor bump change)
  • 7fb21a4 feat(rules): Add Perplexity AI API key detection (#1825)
  • f6193bc feat(gcp): increase rule entropy (#1840)
  • 9bc7257 Adding clickhouse scanner (#1826)
  • b6cc71a fix(baseline): work with --redact (#1741)
  • cfdeb0d feat(rule): validate & sort rule when generating (#1817)

v8.24.3

11 Apr 14:27
107a418
Compare
Choose a tag to compare

Changelog

  • 107a418 Add support for GitLab Runner Tokens (Routable) (#1820)
  • 7fac002 bump repo version in pre-commit example (#1815)
  • 4b54104 Fix currentLine out of bounds error (#1810)
  • af7d5bc add support for Azure DevOps platform in SCM detection and link (#1807)
  • 3e8cd2d Add MaxMind license key rule (#1771)
  • ddcc753 implement new openai regex pattern (#1780)
  • 9708e65 A first attempt adding hooks.slack.com/triggers/ (#1792)
  • 198e410 feat(generic): tweak false-positives (#1803)
  • e273a97 chore: tweak logging and readme for GITLEAKS_CONFIG_TOML feature (#1802)
  • a503b58 feat: add option to set config from env var with toml content (#1662)

v8.24.2

22 Mar 12:08
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v8.24.0...v8.24.2

v8.24.0

20 Feb 02:11
c2afd56
Compare
Choose a tag to compare

Changelog