You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sast-snyk-check: added feature to ignore directories and files
Resolves: https://issues.redhat.com/browse/OSH-795
The parameter IGNORE has been added where users can input a list of files and directories (comma-separated) and they will be ignored using the snyk ignore functionality
Copy file name to clipboardExpand all lines: pipelines/docker-build-multi-platform-oci-ta/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,6 +219,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
219
219
|---|---|---|---|
220
220
|ARGS| Append arguments.|||
221
221
|CACHI2_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.|| '$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)'|
222
+
|IGNORE_FILE_PATHS| Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components.|||
222
223
|IMP_FINDINGS_ONLY| Report only important findings. Default is true. To report all findings, specify "false"| true||
223
224
|KFP_GIT_URL| URL from repository to download known false positives files|||
224
225
|PROJECT_NAME| Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used.|||
Copy file name to clipboardExpand all lines: pipelines/docker-build-oci-ta/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,6 +216,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
216
216
|---|---|---|---|
217
217
|ARGS| Append arguments.|||
218
218
|CACHI2_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.|| '$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)'|
219
+
|IGNORE_FILE_PATHS| Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components.|||
219
220
|IMP_FINDINGS_ONLY| Report only important findings. Default is true. To report all findings, specify "false"| true||
220
221
|KFP_GIT_URL| URL from repository to download known false positives files|||
221
222
|PROJECT_NAME| Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used.|||
Copy file name to clipboardExpand all lines: pipelines/docker-build/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
191
191
|name|description|default value|already set by|
192
192
|---|---|---|---|
193
193
|ARGS| Append arguments.|||
194
+
|IGNORE_FILE_PATHS| Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components.|||
194
195
|IMP_FINDINGS_ONLY| Report only important findings. Default is true. To report all findings, specify "false"| true||
195
196
|KFP_GIT_URL| URL from repository to download known false positives files|||
196
197
|PROJECT_NAME| Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used.|||
Copy file name to clipboardExpand all lines: pipelines/maven-zip-build-oci-ta/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
121
121
|---|---|---|---|
122
122
|ARGS| Append arguments.|||
123
123
|CACHI2_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.|| '$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)'|
124
+
|IGNORE_FILE_PATHS| Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components.|||
124
125
|IMP_FINDINGS_ONLY| Report only important findings. Default is true. To report all findings, specify "false"| true||
125
126
|KFP_GIT_URL| URL from repository to download known false positives files|||
126
127
|PROJECT_NAME| Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used.|||
Copy file name to clipboardExpand all lines: pipelines/maven-zip-build/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
98
98
|name|description|default value|already set by|
99
99
|---|---|---|---|
100
100
|ARGS| Append arguments.|||
101
+
|IGNORE_FILE_PATHS| Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components.|||
101
102
|IMP_FINDINGS_ONLY| Report only important findings. Default is true. To report all findings, specify "false"| true||
102
103
|KFP_GIT_URL| URL from repository to download known false positives files|||
103
104
|PROJECT_NAME| Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used.|||
Copy file name to clipboardExpand all lines: task/sast-snyk-check-oci-ta/0.3/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ See https://snyk.io/product/snyk-code/ and https://snyk.io/ for more information
13
13
|---|---|---|---|
14
14
|ARGS|Append arguments.|""|false|
15
15
|CACHI2_ARTIFACT|The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.|""|false|
16
+
|IGNORE_FILE_PATHS|Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components.|""|false|
16
17
|IMP_FINDINGS_ONLY|Report only important findings. Default is true. To report all findings, specify "false"|true|false|
17
18
|KFP_GIT_URL|URL from repository to download known false positives files|""|false|
18
19
|PROJECT_NAME|Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used.|""|false|
| SNYK_SECRET | Name of secret which contains Snyk token. | snyk-secret | true |
16
-
| ARGS | Append arguments. | "" | false |
17
-
| IMP_FINDINGS_ONLY | Report only important findings. To report all findings, specify "false" | true | true |
18
-
| KFP_GIT_URL | Link to the known-false-positives repository. If left blank, results won't be filtered | "" | false |
19
-
| PROJECT_NAME | Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used. | ${metadata.labels['appstudio.openshift.io/component']} | false |
20
-
| RECORD_EXCLUDED | Write excluded records in file. Useful for auditing. | false | false |
| SNYK_SECRET | Name of secret which contains Snyk token. | snyk-secret | true |
16
+
| ARGS | Append arguments. | "" | false |
17
+
| IGNORE_FILE_PATHS | Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components. | "" | false |
18
+
| IMP_FINDINGS_ONLY | Report only important findings. To report all findings, specify "false" | true | true |
19
+
| KFP_GIT_URL | Link to the known-false-positives repository. If left blank, results won't be filtered | "" | false |
20
+
| PROJECT_NAME | Name of the scanned project, used to find path exclusions. By default, the Konflux component name will be used. | "" | false |
21
+
| RECORD_EXCLUDED | Write excluded records in file. Useful for auditing. | false | false |
21
22
22
23
## How to obtain a snyk-token and enable snyk task on the pipeline:
Copy file name to clipboardExpand all lines: task/sast-snyk-check/0.3/sast-snyk-check.yaml
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,10 @@ spec:
57
57
type: string
58
58
description: Write excluded records in file. Useful for auditing (defaults to false).
59
59
default: "false"
60
+
- name: IGNORE_FILE_PATHS
61
+
type: string
62
+
description: Directories or files to be excluded from Snyk scan (Comma-separated). Useful to split the directories of a git repo across multiple components.
63
+
default: ""
60
64
volumes:
61
65
- name: snyk-secret
62
66
secret:
@@ -87,6 +91,8 @@ spec:
87
91
value: $(params.SNYK_SECRET)
88
92
- name: ARGS
89
93
value: $(params.ARGS)
94
+
- name: IGNORE_FILE_PATHS
95
+
value: $(params.IGNORE_FILE_PATHS)
90
96
- name: IMP_FINDINGS_ONLY
91
97
value: $(params.IMP_FINDINGS_ONLY)
92
98
- name: KFP_GIT_URL
@@ -142,6 +148,15 @@ spec:
142
148
if [ "${IMP_FINDINGS_ONLY}" == "false" ]; then
143
149
SEVERITY_THRESHOLD="low"
144
150
fi
151
+
152
+
# We ignore files using snyk ignore if the user set up the IGNORE variable
153
+
if [[ -n "${IGNORE_FILE_PATHS}" ]]; then
154
+
paths="(${IGNORE_FILE_PATHS//,/ })" # Split by comma into an array
0 commit comments