File tree 7 files changed +45
-19
lines changed
components/scanners/trufflehog
7 files changed +45
-19
lines changed Original file line number Diff line number Diff line change @@ -19,26 +19,8 @@ as the following:
19
19
| --------------------------| --------| ----------| ------------| ---------------------------------------------------------|
20
20
| TRUFFLEHOG\_ RAW\_ OUT\_ FILE\_ PATH | string | yes | - | The path where to find the trufflehog report |
21
21
| 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
22
23
23
24
## Test data
24
25
25
26
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
- ```
Original file line number Diff line number Diff line change @@ -6,6 +6,16 @@ parameters:
6
6
type : " string"
7
7
value : " TARGET_TYPE_REPOSITORY"
8
8
steps :
9
+ - name : " run-trufflehog"
10
+ image : " components/scanners/trufflehog/scanner"
11
+ executable : /smithy_entrypoint.sh
12
+ env_vars :
13
+ RAW_OUT_FILE : " {{ scratchWorkspace }}/trufflehog.json"
14
+ args :
15
+ - filesystem
16
+ - --json
17
+ - --no-fail
18
+ - --directory="{{sourceCodeWorkspace}}"
9
19
- name : " secret-scanner"
10
20
image : " components/scanners/trufflehog"
11
21
executable : " /bin/app"
Original file line number Diff line number Diff line change
1
+ FROM ghcr.io/trufflesecurity/trufflehog:3.88.23
2
+
3
+ COPY smithy_entrypoint.sh /smithy_entrypoint.sh
4
+ RUN chmod +x /smithy_entrypoint.sh
5
+ ENTRYPOINT [ "/smithy_entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ .PHONY : image
2
+
3
+ BUILD_ARCHITECTURE =
4
+ COMPONENT_REGISTRY =
5
+ COMPONENT_REPOSITORY =
6
+ COMPONENT_TAG =
7
+ BUILD_LABELS =
8
+
9
+ image :
10
+ docker build $$([ "${BUILD_ARCHITECTURE}" != "" ] && echo "--platform=${BUILD_ARCHITECTURE}" ) \
11
+ --label " $( BUILD_LABELS) " \
12
+ --tag $(COMPONENT_REGISTRY ) /$(COMPONENT_REPOSITORY ) :$(COMPONENT_TAG ) \
13
+ --file Dockerfile .
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -xe
3
+
4
+ echo " Running trufflehog with args {$@ } sending output to ${RAW_OUT_FILE} "
5
+ /etc/entrypoint.sh $@ | tee ${RAW_OUT_FILE}
Original file line number Diff line number Diff line change
1
+ git-clone :
2
+ - name : " repo_url"
3
+ type : " string"
4
+ value : " https://github.com/OWASP/igoat"
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments