Skip to content

Commit 1e1974b

Browse files
committed
Merge branch 'dev' of github.com:dxa4481/truffleHog into dev
2 parents 09824b0 + 9def4f5 commit 1e1974b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,29 @@ pip install truffleHog
2626

2727
## Customizing
2828

29-
Custom regexes can be added to the following file:
29+
Custom regexes can be added with the following flag `--rules /path/to/rules`. This should be a json file of the following format:
3030
```
31-
truffleHog/truffleHog/regexChecks.py
31+
{
32+
"RSA private key": "-----BEGIN EC PRIVATE KEY-----"
33+
}
3234
```
3335
Things like subdomain enumeration, s3 bucket detection, and other useful regexes highly custom to the situation can be added.
3436

3537
Feel free to also contribute high signal regexes upstream that you think will benifit the community. Things like Azure keys, Twilio keys, Google Compute keys, are welcome, provided a high signal regex can be constructed.
3638

39+
Trufflehog's base rule set sources from https://github.com/dxa4481/truffleHogRegexes/blob/master/truffleHogRegexes/regexes.json
40+
3741
## How it works
3842
This module will go through the entire commit history of each branch, and check each diff from each commit, and check for secrets. This is both by regex and by entropy. For entropy checks, trufflehog will evaluate the shannon entropy for both the base64 char set and hexidecimal char set for every blob of text greater than 20 characters comprised of those character sets in each diff. If at any point a high entropy string >20 characters is detected, it will print to the screen.
3943

4044
## Help
4145

4246
```
47+
usage: trufflehog [-h] [--json] [--regex] [--rules RULES]
48+
[--entropy DO_ENTROPY] [--since_commit SINCE_COMMIT]
49+
[--max_depth MAX_DEPTH]
50+
git_url
51+
4352
Find secrets hidden in the depths of git.
4453
4554
positional arguments:
@@ -49,6 +58,7 @@ optional arguments:
4958
-h, --help show this help message and exit
5059
--json Output in JSON
5160
--regex Enable high signal regex checks
61+
--rules RULES Ignore default regexes and source from json list file
5262
--entropy DO_ENTROPY Enable entropy checks
5363
--since_commit SINCE_COMMIT
5464
Only scan from a given commit hash

0 commit comments

Comments
 (0)