forked from openshift/compliance-operator
-
Notifications
You must be signed in to change notification settings - Fork 24
83 lines (74 loc) · 2.07 KB
/
container-scan-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
---
name: trivy-container-scan
# Run for all pushes to main and pull requests when Go or YAML files change
on:
push:
branches:
- main
schedule:
- cron: '15 15 * * 2'
pull_request:
jobs:
scan-trivy-openscap:
name: Security Scan for OpenSCAP image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: docker/build-push-action@v6
with:
context: .
file: ./images/openscap/Dockerfile
push: false
load: true
tags: localbuild/sec-scan-trivy:latest
- name: Scan image
uses: aquasecurity/trivy-action@master
with:
image-ref: localbuild/sec-scan-trivy:latest
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
scan-trivy-operator:
name: Security scan for Compliance Operator image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: docker/build-push-action@v6
with:
context: .
file: ./build/Dockerfile
push: false
load: true
tags: localbuild/sec-scan-trivy:latest
- name: Scan image
uses: aquasecurity/trivy-action@master
with:
image-ref: localbuild/sec-scan-trivy:latest
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
scan-trivy-repo:
name: Security scan for git repo
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Scan repo
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
skip-files: 'vendor/github.com/securego/gosec/v2/rules/hardcoded_credentials.go'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'