Skip to content

Commit 0129333

Browse files
KornevNikitasarnex
andauthored
[CI] Add Trivy workflow (#16840)
This patch adds a workflow to perform trivy check as required by our public release policy. --------- Co-authored-by: Nick Sarnie <[email protected]>
1 parent 70f7543 commit 0129333

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/trivy.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow performs a trivy check of docker config files.
2+
3+
name: Trivy
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- 'devops/containers/**'
9+
- 'devops/.trivyignore.yaml'
10+
- '.github/workflows/trivy.yml'
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
name: Trivy
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
sparse-checkout: devops
22+
23+
# There is a github action, but for some reason it ignores ignore-file.
24+
- name: Install Trivy
25+
run: |
26+
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh
27+
./bin/trivy --version
28+
29+
- name: Run Trivy vulnerability scanner
30+
run: ./bin/trivy config --format json --output trivy-report.json --ignorefile=devops/.trivyignore.yaml devops/containers --exit-code 1
31+
32+
- name: Upload report artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: trivy-report
36+
path: trivy-report.json
37+
retention-days: 3

devops/.trivyignore.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
misconfigurations:
2+
- id: AVD-DS-0001
3+
statement: "We use our own containers, no uncontrolled behavior is expected when the image is updated"
4+
- id: AVD-DS-0026
5+
statement: "Our containers do not provide running services, but only preinstalled tools, there is not much value in adding HEALTHCHECK directives"

0 commit comments

Comments
 (0)