-
Notifications
You must be signed in to change notification settings - Fork 18
44 lines (39 loc) · 1.24 KB
/
security.yaml
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
name: Security Scan
on:
push:
branches:
- master
- main
pull_request:
schedule:
- cron: "0 3 * * *"
jobs:
trivy:
name: Trivy security scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
if: ${{ ! github.event.schedule }} # Do not run inline checks when running periodically
with:
scan-type: fs
ignore-unfixed: true
exit-code: 1
severity: 'HIGH,CRITICAL'
- name: Run Trivy vulnerability scanner sarif output
uses: aquasecurity/[email protected]
if: ${{ github.event.schedule }} # Generate sarif when running periodically
with:
scan-type: fs
ignore-unfixed: true
severity: 'HIGH,CRITICAL'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: ${{ github.event.schedule }} # Upload sarif when running periodically
with:
sarif_file: 'trivy-results.sarif'