-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (67 loc) · 1.99 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
name: build-and-scan
on:
push:
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: docker.io/anaisurlichs/cns-website:${{ github.sha }}
-
name: Run Trivy vulnerability scanner 2nd
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/anaisurlichs/cns-website:${{ github.sha }}'
format: 'table'
output: 'trivy-results.txt'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM'
-
name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: update vulnerability list
title: Update vulnerability list
body: Update the vulnerability list
branch: update-vulnerabilities
-
name: Run Trivy vulnerability scanner 1st
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/anaisurlichs/cns-website:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
-
name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'