Skip to content

Commit 1122895

Browse files
committed
Add trivy scan IaC
1 parent 2d23d7d commit 1122895

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/scan.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Scan
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
trivy-iac-scan:
13+
permissions:
14+
contents: read
15+
security-events: write
16+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
17+
name: Trivy IaC Scan
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Run Trivy vulnerability scanner in IaC mode
24+
uses: aquasecurity/trivy-action@0.33.1
25+
with:
26+
scan-type: 'config'
27+
hide-progress: true
28+
format: 'sarif'
29+
output: 'trivy-results.sarif'
30+
31+
- name: Upload Trivy scan results to GitHub Security tab
32+
if: always()
33+
uses: github/codeql-action/upload-sarif@v4
34+
with:
35+
sarif_file: 'trivy-results.sarif'

.trivyignore.yaml

Whitespace-only changes.

trivy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignorefile: .trivyignore.yaml # experimental so the doc say we must specify it explicitly

0 commit comments

Comments
 (0)