forked from ahess99/catenax-at-home
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (72 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
# Depending on the location of your Docker container
# you need to change the path to the specific Docker registry.
#
name: "Trivy"
on:
push:
branches: [ main ]
# 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/trivy-action@master
with:
scan-type: "config"
# ignore-unfixed: true
exit-code: "1"
hide-progress: false
format: "sarif"
output: "trivy-results1.sarif"
severity: "CRITICAL,HIGH"
- 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-api-wrapper:
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/trivy-action@master
with:
# Path to Docker image
image-ref: "ghcr.io/catenax-ng/catenax-at-home/api-wrapper:0.0.1"
format: "sarif"
output: "trivy-results2.sarif"
exit-code: "1"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results2.sarif"