File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,3 +122,20 @@ jobs:
122122 cosign sign --yes "$_@$digest"
123123 }
124124 exit 0
125+ m365-scan :
126+ name : M365 Image Scan
127+ if : github.ref == 'refs/heads/scanning'
128+ runs-on : ubuntu-20.04
129+ steps :
130+ - name : Run Trivy vulnerability scanner
131+ uses : aquasecurity/trivy-action@0.28.0
132+ with :
133+ image-ref : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
134+ format : ' sarif'
135+ output : ' trivy-results.sarif'
136+
137+ - name : Upload Trivy scan results to GitHub Security tab
138+ uses : github/codeql-action/upload-sarif@v3
139+ with :
140+ sarif_file : ' trivy-results.sarif'
141+ category : M365Image
Original file line number Diff line number Diff line change 1+ name : Trivy Scans
2+ on :
3+ push :
4+ branches : [ "*" ]
5+ pull_request :
6+ branches : [ "main" ]
7+ jobs :
8+ code-scan :
9+ name : Scan Code
10+ runs-on : ubuntu-20.04
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+
15+ - name : Run Trivy vulnerability scanner in IaC mode
16+ uses : aquasecurity/trivy-action@0.28.0
17+ with :
18+ scan-type : ' config'
19+ hide-progress : true
20+ format : ' sarif'
21+ output : ' trivy-results.sarif'
22+ exit-code : ' 1'
23+ severity : ' CRITICAL,HIGH,MEDIUM'
24+
25+ - name : Upload Trivy scan results to GitHub Security tab
26+ if : github.ref == 'refs/heads/scanning'
27+ uses : github/codeql-action/upload-sarif@v3
28+ with :
29+ sarif_file : ' trivy-results.sarif'
30+ category : Terraform
You can’t perform that action at this time.
0 commit comments