30
30
runs-on : ubuntu-22.04
31
31
steps :
32
32
- name : Checkout
33
- uses : actions/checkout@v4
34
-
33
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
35
34
- name : Run Trivy in config mode for deployments
36
- uses : aquasecurity/trivy-action@master
35
+ uses : aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2 # 0.21.0
37
36
with :
38
37
scan-type : config
39
38
scan-ref : deployments/
49
48
runs-on : ubuntu-22.04
50
49
steps :
51
50
- name : Checkout
52
- uses : actions/checkout@v4
53
-
51
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
54
52
- name : Run Trivy in config mode for dockerfiles
55
- uses : aquasecurity/trivy-action@master
53
+ uses : aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2 # 0.21.0
56
54
with :
57
55
scan-type : config
58
56
scan-ref : build/docker/
64
62
name : Scan licenses
65
63
steps :
66
64
- name : Checkout
67
- uses : actions/checkout@v4
68
-
65
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
69
66
- name : Run Trivy in fs mode
70
- uses : aquasecurity/trivy-action@master
67
+ uses : aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2 # 0.21.0
71
68
with :
72
69
scan-type : fs
73
70
scan-ref : .
@@ -78,53 +75,47 @@ jobs:
78
75
trivy-scan-vulns :
79
76
permissions :
80
77
security-events : write
81
-
82
78
runs-on : ubuntu-22.04
83
79
name : Scan vulnerabilities
84
80
steps :
85
81
- name : Checkout
86
- uses : actions/checkout@v4
87
-
82
+ uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
88
83
- name : Run Trivy in fs mode
89
84
continue-on-error : true
90
- uses : aquasecurity/trivy-action@master
85
+ uses : aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2 # 0.21.0
91
86
with :
92
87
scan-type : fs
93
88
scan-ref : .
94
89
exit-code : 1
95
90
list-all-pkgs : true
96
91
format : json
97
92
output : trivy-report.json
98
-
99
93
- name : Show report in human-readable format
100
- uses : aquasecurity/trivy-action@master
94
+ uses : aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2 # 0.21.0
101
95
with :
102
96
scan-type : convert
103
97
vuln-type : ' '
104
98
severity : ' '
105
99
image-ref : trivy-report.json
106
100
format : table
107
-
108
101
- name : Convert report to sarif
109
102
if : ${{ inputs.upload-to-github-security-tab }}
110
- uses : aquasecurity/trivy-action@master
103
+ uses : aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2 # 0.21.0
111
104
with :
112
105
scan-type : convert
113
106
vuln-type : ' '
114
107
severity : ' '
115
108
image-ref : trivy-report.json
116
109
format : sarif
117
110
output : trivy-report.sarif
118
-
119
111
- name : Upload sarif report to GitHub Security tab
120
112
if : ${{ inputs.upload-to-github-security-tab }}
121
- uses : github/codeql-action/upload-sarif@v3
113
+ uses : github/codeql-action/upload-sarif@71ace48453080e924b22589f0c397bedde464d78 # v3
122
114
with :
123
- sarif_file : trivy-report.sarif
124
-
115
+ sarif_file : trivy-report.sarif
125
116
- name : Convert report to csv
126
117
if : ${{ inputs.export-csv }}
127
- uses : aquasecurity/trivy-action@master
118
+ uses : aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2 # 0.21.0
128
119
with :
129
120
scan-type : convert
130
121
vuln-type : ' '
@@ -133,10 +124,9 @@ jobs:
133
124
format : template
134
125
template : " @.github/workflows/template/trivy-csv.tpl"
135
126
output : trivy-report.csv
136
-
137
127
- name : Upload CSV report as an artifact
138
128
if : ${{ inputs.export-csv }}
139
- uses : actions/upload-artifact@v4
129
+ uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
140
130
with :
141
131
name : trivy-report
142
- path : trivy-report.csv
132
+ path : trivy-report.csv
0 commit comments