Skip to content

Commit f62ced9

Browse files
authored
Add trivy_severity input
1 parent dc5f0c9 commit f62ced9

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.github/actions/build-node-python/action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ inputs:
6363
description: "Enable trivy scans on lock files"
6464
default: "false" # Enable this by default?
6565
required: false
66+
trivy_severity:
67+
description: "Severity level for trivy"
68+
required: false
6669
chromatic_enable:
6770
description: "Enable Chromatic tests"
6871
required: false
@@ -299,8 +302,8 @@ runs:
299302
scan-type: "fs"
300303
scan-ref: "uv.lock"
301304
exit-code: "1"
302-
scaners: "vuln"
303-
severity: "CRITICAL" # HIGH,CRITICAL may be too strict
305+
scanners: "vuln"
306+
severity: ${{ inputs.trivy_severity || 'CRITICAL' }}
304307
ignore-unfixed: false
305308
# The cache update takes quite long, so let's try to disable it for now: https://github.com/aquasecurity/trivy-action#cache
306309
cache: "false"
@@ -312,8 +315,8 @@ runs:
312315
scan-type: "fs"
313316
scan-ref: "yarn.lock"
314317
exit-code: "1"
315-
scaners: "vuln"
316-
severity: "CRITICAL" # HIGH,CRITICAL may be too strict
318+
scanners: "vuln"
319+
severity: ${{ inputs.trivy_severity || 'CRITICAL' }}
317320
ignore-unfixed: false
318321
# The cache update takes quite long, so let's try to disable it for now: https://github.com/aquasecurity/trivy-action#cache
319322
cache: "false"

.github/workflows/build-docker-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ jobs:
294294
image-ref: ${{ matrix.component.image_ref }}
295295
# Disable scanning the current directory (defaults to .)
296296
scan-ref: "/dev/null"
297-
format: "table"
297+
format: "github"
298298
exit-code: "1"
299299
ignore-unfixed: false
300300
vuln-type: "os,library"

.github/workflows/build-node-python.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ on:
7979
default: false # Enable this by default?
8080
type: boolean
8181
required: false
82+
trivy_severity:
83+
description: "Severity for the trivy scans"
84+
type: string
85+
required: false
8286
chromatic_enable:
8387
description: 'Enable Chromatic tests'
8488
required: false
@@ -157,6 +161,7 @@ jobs:
157161
# We probably won't need Rust on Node builds...
158162
# enable_rust: ${{ inputs.rust_enable }}
159163
trivy_enable: ${{ inputs.trivy_enable }}
164+
trivy_severity: ${{ inputs.trivy_severity }}
160165
run_parallel: ${{ inputs.run_parallel }}
161166
node_version: ${{ vars.NODE_VERSION || inputs.node_version }}
162167
npm_registry: ${{ vars.NPM_REGISTRY }}
@@ -198,6 +203,7 @@ jobs:
198203
enable_node: false
199204
enable_python: true
200205
trivy_enable: ${{ inputs.trivy_enable }}
206+
trivy_severity: ${{ inputs.trivy_severity }}
201207
enable_rust: ${{ inputs.rust_enable }}
202208
run_parallel: ${{ inputs.run_parallel }}
203209
node_version: ${{ vars.NODE_VERSION || inputs.node_version }}
@@ -290,6 +296,7 @@ jobs:
290296
uses: ./tmp/github-workflows/.github/actions/build-node-python
291297
with:
292298
trivy_enable: ${{ inputs.trivy_enable }}
299+
trivy_severity: ${{ inputs.trivy_severity }}
293300
enable_rust: ${{ inputs.rust_enable }}
294301
run_parallel: ${{ inputs.run_parallel }}
295302
node_version: ${{ vars.NODE_VERSION || inputs.node_version }}
@@ -434,6 +441,7 @@ jobs:
434441
uses: ./tmp/github-workflows/.github/actions/build-node-python
435442
with:
436443
trivy_enable: ${{ inputs.trivy_enable }}
444+
trivy_severity: ${{ inputs.trivy_severity }}
437445
enable_rust: ${{ inputs.rust_enable }}
438446
run_parallel: ${{ inputs.run_parallel }}
439447
node_version: ${{ vars.NODE_VERSION || inputs.node_version }}

0 commit comments

Comments
 (0)