-
Notifications
You must be signed in to change notification settings - Fork 16
64 lines (60 loc) · 1.96 KB
/
trivy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Trivy
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Trivy component analysis
runs-on: ubuntu-latest
permissions:
security-events: write
strategy:
matrix:
include:
- component: api_server
build_path: components
docker_file: api_server/Dockerfile
- component: collector
build_path: components
docker_file: collector/Dockerfile
- component: database
build_path: components/database
docker_file: Dockerfile
- component: frontend
build_path: components/frontend
docker_file: Dockerfile
- component: notifier
build_path: components
docker_file: notifier/Dockerfile
- component: proxy
build_path: components/proxy
docker_file: Dockerfile
- component: renderer
build_path: components/renderer
docker_file: Dockerfile
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Build image from Dockerfile
run: |
cd ${{ matrix.build_path }}
docker build -f ${{ matrix.docker_file }} -t docker.io/ictu/quality-time_${{ matrix.component }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/ictu/quality-time_${{ matrix.component }}'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-${{ matrix.component }}.sarif'
- name: Upload Trivy scan results to GitHub Security tab
if: ${{ github.ref == 'refs/heads/master' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-${{ matrix.component }}.sarif'
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: 'trivy-${{ matrix.component }}.sarif'
path: '*.sarif'