Skip to content

Commit 12f6347

Browse files
committed
test: add trivy Vulnerability scanning test
fix name fix format
1 parent 1636a83 commit 12f6347

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/trivy.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Trivy vulnerability scanner
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Build an image from Dockerfile
16+
run: |
17+
export PUBLISH=true
18+
export REGISTRY=test
19+
export IMAGE_VERSION=latest
20+
export DOCKER_CLI_EXPERIMENTAL=enabled
21+
make container
22+
23+
- name: Run Trivy vulnerability scanner
24+
uses: aquasecurity/trivy-action@master
25+
with:
26+
image-ref: 'test/smb-csi:latest'
27+
format: 'table'
28+
exit-code: '1'
29+
ignore-unfixed: true
30+
vuln-type: 'os,library'
31+
severity: 'CRITICAL,HIGH'
32+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ smb-darwin:
135135

136136
.PHONY: container
137137
container: smb
138-
docker build --no-cache -t $(IMAGE_TAG) -f ./pkg/smbplugin/Dockerfile .
138+
docker build --no-cache -t $(IMAGE_TAG) --output=type=docker -f ./pkg/smbplugin/Dockerfile .
139139

140140
.PHONY: container-linux
141141
container-linux:

0 commit comments

Comments
 (0)