Skip to content

Commit 6108258

Browse files
committed
ci: add Trivy security scan workflow
- Scan filesystem for HIGH and CRITICAL vulnerabilities on push, PR, and weekly schedule - Upload SARIF results to the GitHub Security tab - Add Trivy Security Scan badge to the README
1 parent 3bf63d2 commit 6108258

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/trivy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Trivy Security Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "0 0 * * 0"
12+
13+
permissions:
14+
contents: read
15+
security-events: write
16+
17+
jobs:
18+
scan:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v6
23+
24+
- name: Run Trivy vulnerability scanner
25+
uses: aquasecurity/trivy-action@0.35.0
26+
with:
27+
scan-type: fs
28+
scan-ref: .
29+
format: sarif
30+
output: trivy-results.sarif
31+
severity: CRITICAL,HIGH
32+
ignore-unfixed: true
33+
34+
- name: Upload Trivy scan results to GitHub Security tab
35+
uses: github/codeql-action/upload-sarif@v3
36+
if: always()
37+
with:
38+
sarif_file: trivy-results.sarif

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# mcp-workshop
22

33
[![build-and-test](https://github.com/go-training/mcp-workshop/actions/workflows/ci.yml/badge.svg)](https://github.com/go-training/mcp-workshop/actions/workflows/ci.yml)
4+
[![Trivy Security Scan](https://github.com/go-training/mcp-workshop/actions/workflows/trivy.yml/badge.svg)](https://github.com/go-training/mcp-workshop/actions/workflows/trivy.yml)
45

56
English | [繁體中文](README.zh-TW.md) | [簡體中文](README.zh-CN.md)
67

0 commit comments

Comments
 (0)