-
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.72 KB
/
trivy-scan.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
name: Daily Vulnerability Scan
on:
schedule:
- cron: '0 15 * * *'
workflow_dispatch:
inputs:
tag:
description: 'Image tag'
required: true
default: 'master'
jobs:
scan-image:
runs-on: ubuntu-latest
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/sksat/kuso-subdomain-adder:${{ github.event.inputs.tag || 'master' }}"
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/[email protected]
with:
sarif_file: 'trivy-results.sarif'
scan-image2:
runs-on: ubuntu-latest
steps:
- name: Scan for vulnerabilities
id: scan
uses: crazy-max/[email protected]
with:
image: ghcr.io/sksat/kuso-subdomain-adder:${{ github.event.inputs.tag || 'master' }}
dockerfile: ./Dockerfile
- name: Upload SARIF file
if: ${{ steps.scan.outputs.sarif != '' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
scan-repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/[email protected]
with:
sarif_file: 'trivy-results.sarif'