forked from kedacore/keda
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.56 KB
/
template-trivy-scan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Reusable workflow to run trivy scan
on:
workflow_call:
inputs:
runs-on:
required: true
type: string
scan-type:
required: true
type: string
format:
required: true
type: string
output:
required: false
type: string
default: trivy.sarif
image-ref:
required: false
type: string
default: ""
severity:
required: false
type: string
default: "CRITICAL,HIGH"
exit-code:
required: true
type: number
publish:
required: true
type: boolean
jobs:
trivy-scan:
name: Trivy - ${{ inputs.runs-on }} - ${{ inputs.scan-type }} ${{ inputs.image-ref }}
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Run Trivy
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0
env:
TRIVY_DB_REPOSITORY: ghcr.io/kedacore/trivy-db
with:
scan-type: ${{ inputs.scan-type }}
image-ref: ${{ inputs.image-ref }}
ignore-unfixed: false
format: ${{ inputs.format }}
output: ${{ inputs.output }}
exit-code: ${{ inputs.exit-code }}
severity: ${{ inputs.severity }}
trivy-config: trivy.yml
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: ${{ inputs.publish }}
with:
sarif_file: ${{ inputs.output }}