-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(trufflehog): add Trufflehog action. (#141)
- Loading branch information
Charles Sullivan
authored
Apr 28, 2021
1 parent
9b8b85e
commit 69d5c16
Showing
6 changed files
with
61 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
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,18 @@ | ||
FROM python:3.7-alpine | ||
|
||
LABEL "com.github.actions.name"="Trufflehog Actions Scan" | ||
LABEL "com.github.actions.description"="Scan repository for secrets with basic trufflehog defaults in place for easy setup." | ||
LABEL "com.github.actions.icon"="shield" | ||
LABEL "com.github.actions.color"="yellow" | ||
|
||
COPY requirements.txt /tmp/ | ||
RUN pip install --requirement /tmp/requirements.txt | ||
|
||
RUN apk --update add git less openssh && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
rm /var/cache/apk/* | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ADD https://raw.githubusercontent.com/dxa4481/truffleHogRegexes/master/truffleHogRegexes/regexes.json /regexes.json | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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,12 @@ | ||
name: 'Trufflehog Actions Scan' | ||
description: 'Scan repository for secrets with basic trufflehog defaults in place for easy setup.' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
inputs: | ||
scanArguments: | ||
description: 'Argument options for scan.' | ||
required: false | ||
branding: | ||
icon: 'shield' | ||
color: 'yellow' |
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,16 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e # Abort script at first error | ||
|
||
args="--regex --entropy=False --max_depth=50" # Default trufflehog options | ||
|
||
if [ -n "${INPUT_SCANARGUMENTS}" ]; then | ||
args="${INPUT_SCANARGUMENTS}" # Overwrite if new options string is provided | ||
fi | ||
|
||
# By default the 'WORKDIR' of our Docker image is set to the 'GITHUB_WORKSPACE' | ||
# which is mounted into our image. This means, as long as a checkout action was | ||
# done before our action runs, we'll have access to the repository. | ||
githubRepo="file://$(pwd)" # Default target repository | ||
query="$args $githubRepo" # Build args query with repository url | ||
trufflehog $query |
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,6 @@ | ||
gitdb2==3.0.0 | ||
GitPython==2.1.1 | ||
smmap==4.0.0 | ||
smmap2==3.0.1 | ||
truffleHog==2.0.99 | ||
truffleHogRegexes==0.0.7 |