-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip examples folder * Rename examples.md to README.md
- Loading branch information
1 parent
36aa145
commit 995eb64
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Examples | ||
This folder contains various examples like custom detectors, scripts, etc. Feel free to contribute! | ||
|
||
### Generic Detector | ||
An often requested feature for TruffleHog is a generic detector. By default, we do not support generic detection as it would result in lots of false positives. However, if you want to attempt detect generic secrets you can use a custom detector. | ||
|
||
#### Try it out: | ||
``` | ||
wget UPDATE ONCE MERGED | ||
trufflehog filesystem --config=$PWD/generic.yml $PWD | ||
# to filter so that _only_ generic credentials are logged: | ||
trufflehog filesystem --config=$PWD/generic.yml --json --no-verification $PWD | awk '/generic-api-key/{print $0}' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
detectors: | ||
- name: generic-api-key | ||
keywords: | ||
- key | ||
- api | ||
- token | ||
- secret | ||
- client | ||
- passwd | ||
- password | ||
- auth | ||
- access | ||
regex: | ||
# borrowing the gitleaks generic-api-key regex | ||
generic-api-key: "(?i)(?:key|api|token|secret|client|passwd|password|auth|access)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|\"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\"|\\s|=|\\x60){0,5}([0-9a-z\\-_.=]{10,150})(?:['|\"|\\n|\\r|\\s|\\x60|;]|$)" |