Skip to content

Commit 4469f74

Browse files
committed
wrap trufflehog and add 'write to file' entrypoint'
1 parent c699b90 commit 4469f74

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

components/scanners/trufflehog/README.md

+1-19
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,8 @@ as the following:
1919
|--------------------------|--------|----------|------------|---------------------------------------------------------|
2020
| TRUFFLEHOG\_RAW\_OUT\_FILE\_PATH | string | yes | - | The path where to find the trufflehog report |
2121
| TRUFFLEHOG\_TARGET\_TYPE | string | false | repository | The type of target that was used to generate the report |
22+
| RAW\_OUT\_FILE | string | yes | "{{ scratchWorkspace }}/trufflehog.json" | The path where to put the trufflehog report
2223

2324
## Test data
2425

2526
The `trufflehog.json` file used in tests was generated with the following steps:
26-
27-
* Cloning:
28-
29-
```shell
30-
git clone https://github.com/smithy-security/e2e-monorepo
31-
```
32-
33-
* Running trufflehog
34-
35-
```shell
36-
docker run \
37-
--rm -it -v "$PWD:/pwd" \
38-
trufflesecurity/trufflehog:latest \
39-
filesystem --json \
40-
--no-fail \
41-
--no-update \
42-
--log-level=-1 \
43-
--directory="/pwd"
44-
```

components/scanners/trufflehog/component.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ parameters:
66
type: "string"
77
value: "TARGET_TYPE_REPOSITORY"
88
steps:
9+
- name: "run-trufflehog"
10+
image: ghcr.io/trufflesecurity/trufflehog:3.88.23
11+
executable: /bin/bash
12+
args:
13+
- -c
14+
- >-
15+
echo "Running trufflehog and sending output to {{ scratchWorkspace }}/trufflehog.json" &&
16+
/etc/entrypoint.sh filesystem --json --no-fail --directory="{{sourceCodeWorkspace}}" |
17+
tee {{ scratchWorkspace }}/trufflehog.json
918
- name: "secret-scanner"
1019
image: "components/scanners/trufflehog"
1120
executable: "/bin/app"

examples/trufflehog/overrides.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
git-clone:
2+
- name: "repo_url"
3+
type: "string"
4+
value: "https://github.com/OWASP/igoat"

examples/trufflehog/workflow.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
description: Trufflehog based workflow
2+
name: trufflehog
3+
components:
4+
- component: file://components/targets/git-clone/component.yaml
5+
- component: file://components/scanners/trufflehog/component.yaml
6+
- component: file://components/enrichers/custom-annotation/component.yaml
7+
- component: file://components/reporters/json-logger/component.yaml

0 commit comments

Comments
 (0)