forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add step to scan for secrets with trufflehog
- Loading branch information
1 parent
7187b4a
commit 0fbf7f5
Showing
6 changed files
with
70 additions
and
5 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
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
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 @@ | ||
{ | ||
"RSA private key": "-----BEGIN RSA PRIVATE KEY-----", | ||
"SSH (DSA) private key": "-----BEGIN DSA PRIVATE KEY-----", | ||
"SSH (EC) private key": "-----BEGIN EC PRIVATE KEY-----", | ||
"PGP private key block": "-----BEGIN PGP PRIVATE KEY BLOCK-----", | ||
"AWS API Key": "((?:A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16})", | ||
"GitHub": "[gG][iI][tT][hH][uU][bB].*['|\"][0-9a-zA-Z]{35,40}['|\"]", | ||
"Generic API Key": "[aA][pP][iI]_?[kK][eE][yY].*['|\"][0-9a-zA-Z]{32,45}['|\"]", | ||
"Generic Secret": "[sS][eE][cC][rR][eE][tT].*['|\"][0-9a-zA-Z]{32,45}['|\"]", | ||
"Heroku API Key": "[hH][eE][rR][oO][kK][uU].*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}", | ||
"Password in URL": "[a-zA-Z]{3,10}://[^/\\s:@]{3,20}:[^/\\s:@]{3,20}@.{1,100}[\"'\\s]", | ||
"DJANGO_SECRET_KEY": "DJANGO_SECRET_KEY=[A-Za-z0-9]{50}", | ||
"JWT_KEY": "JWT_KEY=[A-Za-z0-9]+" | ||
} |
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
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,34 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if ! [ -x "$(command -v truffleHog)" ]; then | ||
echo The command truffleHog is not available, installing... | ||
|
||
# Install truffleHog in a venv | ||
python -m venv trufflehog-check | ||
source trufflehog-check/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install truffleHog | ||
else | ||
echo The command truffleHog is available | ||
fi | ||
|
||
echo "trufflehog-check.sh: Scanning repo ..." | ||
|
||
last_merge=$(git log --format=format:"%H" -n 1 raft-tdp-main) | ||
|
||
# $1 - The first argument to this script, the current git branch name | ||
# --since_commit - Look at all commits since the last merge into raft-tdp-main | ||
# --entropy=True - Entropy checks on large git diffs | ||
python ./trufflehog-check/lib/python3.8/site-packages/truffleHog/truffleHog.py \ | ||
--regex \ | ||
--entropy=True \ | ||
--branch "$1" \ | ||
--since_commit "$last_merge" \ | ||
--exclude_paths ./trufflehog-exclude-patterns.txt \ | ||
--rules ./regexes.json \ | ||
https://github.com/raft-tech/TANF-app | ||
|
||
# if there are issues, they will be listed then script will abort here | ||
|
||
echo "trufflehog-check.sh: No issues found" |
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,7 @@ | ||
(.*/)?test/(.*/)? | ||
(.*/)?htmlcov/(.*/)? | ||
(.*/)?docs/(.*/)? | ||
(.*/)?static/index_files/analytics.js | ||
(.*/)?regexes.json | ||
(.*/)?yarn.lock | ||
(.*/)?Pipfile.lock |