This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (75 loc) · 2.23 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Trivy"
on:
push:
branches:
- main
- dev
paths:
- 'src/**'
- 'pom.xml'
- 'Dockerfile'
# pull_request:
# The branches below must be a subset of the branches above
# branches: [ main ]
# paths-ignore:
# - "**/*.md"
# - "**/*.txt"
schedule:
# Once a day
- cron: "0 0 * * *"
workflow_dispatch:
# Trigger manually
jobs:
analyze-config:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
scan-type: "config"
hide-progress: false
format: "sarif"
output: "trivy-results1.sarif"
vuln-type: "os,library"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: "trivy-results1.sarif"
analyze-product-value-added-service:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# It's also possible to scan your private registry with Trivy's built-in image scan.
# All you have to do is set ENV vars.
# Docker Hub needs TRIVY_USERNAME and TRIVY_PASSWORD.
# You don't need to set ENV vars when downloading from a public repository.
# For public images, no ENV vars must be set.
- name: Run Trivy vulnerability scanner
if: always()
uses: aquasecurity/[email protected]
with:
# Path to Docker image
image-ref: "tractusx/vas-country-risk-backend:latest"
format: "sarif"
output: "trivy-results3.sarif"
# exit-code: "1"
# severity: "CRITICAL,HIGH"
# timeout: "60m"
vuln-type: "os,library"
- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results3.sarif"