@@ -12,16 +12,72 @@ jobs:
12
12
- name : Checkout code
13
13
uses : actions/checkout@v4
14
14
15
+ - name : Build Docker Image 1 (Vulnerable - Ubuntu)
16
+ run : |
17
+ docker build -t vulnerable-image-ubuntu -f Dockerfile1 .
15
18
16
- - name : Run Trivy vulnerability scanner in fs mode
19
+ - name : Build Docker Image 3 (Non-vulnerable)
20
+ run : |
21
+ docker build -t non-vulnerable-image -f Dockerfile3 .
22
+
23
+ - name : " Run Trivy vulnerability scanner: image"
24
+ uses :
aquasecurity/[email protected]
25
+ with :
26
+ image-ref : ' vulnerable-image-ubuntu'
27
+ scan-type : ' image'
28
+ vuln-type : ' os'
29
+ format : ' sarif'
30
+ output : ' trivy-results-image1.sarif'
31
+
32
+ - name : Upload Trivy scan results to GitHub Security tab
33
+ uses : github/codeql-action/upload-sarif@v3
34
+ with :
35
+ sarif_file : ' trivy-results-image1.sarif'
36
+ category : ' image'
37
+
38
+ - name : " Run Trivy vulnerability scanner: image"
39
+ uses :
aquasecurity/[email protected]
40
+ with :
41
+ image-ref : ' non-vulnerable-image'
42
+ scan-type : ' image'
43
+ vuln-type : ' os'
44
+ format : ' sarif'
45
+ output : ' trivy-results-image2.sarif'
46
+
47
+ - name : Upload Trivy scan results to GitHub Security tab
48
+ uses : github/codeql-action/upload-sarif@v3
49
+ with :
50
+ sarif_file : ' trivy-results-image2.sarif'
51
+ category : ' image'
52
+
53
+ - name : " Run Trivy vulnerability scanner: image"
54
+ uses :
aquasecurity/[email protected]
55
+ with :
56
+ image-ref : ' vulnerable-image-ubuntu'
57
+ scan-type : ' image'
58
+ scanners : ' vuln,secret'
59
+ vuln-type : ' os'
60
+ format : ' sarif'
61
+ output : ' trivy-results-image1.sarif'
62
+
63
+ - name : Upload Trivy scan results to GitHub Security tab
64
+ uses : github/codeql-action/upload-sarif@v3
65
+ with :
66
+ sarif_file : ' trivy-results-image1.sarif'
67
+ category : ' image'
68
+
69
+ - name : " Run Trivy vulnerability scanner: image"
17
70
uses :
aquasecurity/[email protected]
18
71
with :
19
- scan-type : ' fs'
20
- scan-ref : ' .'
72
+ image-ref : ' non-vulnerable-image'
73
+ scan-type : ' image'
74
+ scanners : ' vuln,secret'
75
+ vuln-type : ' os'
21
76
format : ' sarif'
22
- output : ' trivy-results.sarif'
77
+ output : ' trivy-results-image2 .sarif'
23
78
24
79
- name : Upload Trivy scan results to GitHub Security tab
25
80
uses : github/codeql-action/upload-sarif@v3
26
81
with :
27
- sarif_file : ' trivy-results.sarif'
82
+ sarif_file : ' trivy-results-image2.sarif'
83
+ category : ' image'
0 commit comments