Skip to content

Commit d5db5f8

Browse files
feat: allow changing Docker image for scan job
Allows changing Docker image used for the scan job, this is useful if the Docker images should be pulled from a different place than the GitHub Container Registry. Such situations usually occur with air-gapped systems or places where Docker registry access is restricted.
1 parent 0f6e0cd commit d5db5f8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,8 @@ TruffleHog statically detects [https://canarytokens.org/](https://canarytokens.o
612612
base:
613613
# Scan commits until here (usually dev branch).
614614
head: # optional
615+
# Docker image to use for scanning, defaults to ghcr.io/trufflesecurity/trufflehog.
616+
image: # optional
615617
# Extra args to be passed to the trufflehog cli.
616618
extra_args: --log-level=2 --results=verified,unknown
617619
```
@@ -672,7 +674,7 @@ TruffleHog will send a JSON POST request containing the regex matches to a
672674
configured webhook endpoint. If the endpoint responds with a `200 OK` response
673675
status code, the secret is considered verified.
674676

675-
Custom Detectors support a few different filtering mechanisms: entropy, regex targeting the entire match, regex targeting the captured secret,
677+
Custom Detectors support a few different filtering mechanisms: entropy, regex targeting the entire match, regex targeting the captured secret,
676678
and excluded word lists checked against the secret (captured group if present, entire match if capture group is not present). Note that if
677679
your custom detector has multiple `regex` set (in this example `hogID`, and `hogToken`), then the filters get applied to each regex. [Here](examples/generic_with_filters.yml) is an example of a custom detector using these filters.
678680

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
default: ""
1919
description: Extra args to be passed to the trufflehog cli.
2020
required: false
21+
image:
22+
default: "ghcr.io/trufflesecurity/trufflehog"
23+
description: Docker image to use for scanning.
24+
required: false
2125
version:
2226
default: "latest"
2327
description: Scan with this trufflehog cli version.
@@ -36,6 +40,7 @@ runs:
3640
HEAD: ${{ inputs.head }}
3741
ARGS: ${{ inputs.extra_args }}
3842
COMMIT_IDS: ${{ toJson(github.event.commits.*.id) }}
43+
IMAGE: ${{ inputs.image }}
3944
VERSION: ${{ inputs.version }}
4045
run: |
4146
##########################################
@@ -94,7 +99,7 @@ runs:
9499
## Run TruffleHog ##
95100
##########################################
96101
docker run --rm -v .:/tmp -w /tmp \
97-
ghcr.io/trufflesecurity/trufflehog:${VERSION} \
102+
"${IMAGE}:${VERSION}" \
98103
git file:///tmp/ \
99104
--since-commit \
100105
${BASE:-''} \

0 commit comments

Comments
 (0)