-
Notifications
You must be signed in to change notification settings - Fork 20
61 lines (53 loc) · 1.45 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
name: Code Scanning by Trivy
on:
push:
branches:
- "main"
pull_request:
schedule:
- cron: '0 0 * * 1'
watch:
types: [started]
jobs:
use-build:
uses: ./.github/workflows/build.yml
scan-config:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in config mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'config'
scan-ref: '.'
trivyignores: .trivyignore
trivy-config: trivy.yaml
scan-fs:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
trivyignores: .trivyignore
trivy-config: trivy.yaml
scan-image:
runs-on: self-hosted
needs: [use-build]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in image mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'image'
image-ref: 'ghcr.io/${{ github.repository }}:${{ github.sha }}'
trivyignores: .trivyignore
trivy-config: trivy.yaml
env:
TRIVY_USERNAME: ${{ github.repository_owner }}
TRIVY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}