bplaxco
d29ee55171
Reduce aws-access-token false positives ( #1876 )
...
* Adjust aws-access-token regex
AWS Access Key IDs are [base32 encoded][1] so the numerical values here
will [only be 2-7][2]
[1]: https://medium.com/@TalBeerySec/a-short-note-on-aws-key-id-f88cc4317489
[2]: https://en.wikipedia.org/wiki/Base32#Base_32_Encoding_with_Extended_Hex_Alphabet_per_%C2%A77:~:text=It%20uses%20an%20alphabet%20of%20A%E2%80%93Z%2C%20followed%20by%202%E2%80%937
* Update config/gitleaks.toml during build and test
Summary:
- Add `config/gitleaks.toml` make target
- Make it a dep of `build` and `test`
- Update CONTRIBUTING.md to reference the new target
Reason: Makes dev easier because you can just tweak the code and run
`make test` without an extra step.
* Resolve lint issues in cmd/diagnostics.go
```
$ golangci-lint run cmd/
cmd/diagnostics.go:128:10: Error return value of `f.Close` is not checked (errcheck)
f.Close()
^
cmd/diagnostics.go:191:10: Error return value of `f.Close` is not checked (errcheck)
f.Close()
^
2 issues:
* errcheck: 2
```
2025-05-27 09:37:52 -05:00
Richard Gomez
cfdeb0d7e0
feat(rule): validate & sort rule when generating ( #1817 )
2025-04-12 10:09:19 -05:00
Richard Gomez
3f4d91fc22
build: support either stdlib or 3rd-party regexp ( #1706 )
2025-01-20 10:45:31 -06:00
ahrav
a91c6717a0
replace std library regex engine with go-re2 ( #1669 )
2024-12-20 09:53:01 -06:00
Richard Gomez
83e99bacf1
feat(report): allow user-defined templates ( #1650 )
2024-12-10 18:56:11 -06:00
Richard Gomez
c11adc91ad
Generate comprehensive secret samples ( #1484 )
...
* feat(config): comprehensive samples
* refactor(config): use new generate func
* chore(config): comment unsupported cases
* feat(config): enable '?=' case
* feat(config): enable '+=' case
* feat(config): enable escaped json case
* feat(config): enable '<' (xml) case
* feat(config): enable multiline yaml case
* chore(config): add comment case
* feat(config): add php cases
* feat(config): add java case
* chore(config): address review comments
* fix(config): prevent matching '=='
* feat(config): add URL cases
* chore(config): revert regex changes
To be tackled in separate PRs.
2024-10-30 09:34:21 -05:00
Ben-grmbl
d1d9054ef0
fix(aws): detect token in url ( #1615 )
2024-10-30 08:21:14 -05:00
Ben-grmbl
a158e4fc15
fix(aws-access-token): only match if correct length ( #1584 )
...
Previously, the rule matched for any long string
containing e.g. ASIA, ACCA somewhere,
as long as the next 16 chars were also uppercase letters.
This change checks for word boundaries before and after the secret.
Also the prefix (AKIA|ASIA|...) was moved from the non-capturing group
into the secret matching group,
since it is part of the token
fix(aws-access-token): non-capture for prefix
Review findings https://github.com/gitleaks/gitleaks/pull/1584/files#r1807793907
2024-10-28 08:19:48 -05:00
Richard Gomez
9152eaa57a
feat(aws): add entropy & allowlist ( #1582 )
2024-10-19 19:47:45 -05:00
Richard Gomez
bd81872eee
Make config generation utils public ( #1480 )
...
* chore(generate): make utils public
* chore(generate): change validate log messages
* chore(generate): split functions into files
* chore(config): add warning for public funcs
2024-08-26 13:11:18 -05:00
Kieran Smith
76c9e3175b
Remove IAM identifiers for non-credential resources in the aws-access-token rule ( #1307 )
...
* Remove IAM identifiers for non-credential resources
Only detects:
AWS STS service bearer token
Context-specific credential
Access key
Temporary (AWS STS) access key IDs use this prefix, but are unique only in combination with the secret access key and the session token.
* Update gitleaks.toml
* Update testdata
* Update tests
2024-01-31 13:21:53 -06:00
Liron Biam
8de8938ad4
Enhance Secret Descriptions ( #1300 )
...
* Enhance secret descriptions in gitleaks.toml
* adjust the rule configuration descriptions
* missing spaces in gitleaks.toml
2023-11-29 17:03:11 -06:00
Zachary Rice
e63b657bcf
remove secretgroup from default config ( #1288 )
...
* remove secretgroup from default config
* update test data and AWS
* leave secretgroup
2023-11-10 12:53:07 -06:00
Zachary Rice
8481f0e9cd
adding stopwords ( #849 )
...
* adding stopwords
* format readme, update default config
2022-04-21 08:31:58 -05:00
Zachary Rice
3474c58c9e
Generate tps ( #845 )
...
* WIP
* simplify tp generation
2022-04-18 21:59:38 -05:00
Zachary Rice
606bb1a13b
Standardize/alphabetize rules, add cmd/generate/config package ( #840 )
2022-04-12 21:40:48 -05:00