Skip to content

Commit 97a7d54

Browse files
authored
Add trivy action (#8)
* Add trivy.yml * Setup trivy jobs for workflows * Update Alpine to 3.12.0 Signed-off-by: Prakhar Gurunani <[email protected]>
1 parent ef4802a commit 97a7d54

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,18 @@ jobs:
4848
run: |
4949
make buildx.image
5050
make buildx.push
51-
51+
52+
trivy:
53+
runs-on: ubuntu-18.04
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v2
57+
58+
- name: Run Trivy vulnerability scanner
59+
uses: aquasecurity/trivy-action@master
60+
with:
61+
image-ref: 'openebs/linux-utils:ci'
62+
format: 'table'
63+
exit-code: '1'
64+
ignore-unfixed: true
65+
severity: 'CRITICAL,HIGH'

.github/workflows/pull_request.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,14 @@ jobs:
3636

3737
- name: Build Image
3838
env:
39-
IMG_RESULT: cache
39+
IMG_RESULT: load
4040
run: make buildx.image
41+
42+
- name: Run Trivy vulnerability scanner
43+
uses: aquasecurity/trivy-action@master
44+
with:
45+
image-ref: 'openebs/linux-utils:ci'
46+
format: 'table'
47+
exit-code: '1'
48+
ignore-unfixed: true
49+
severity: 'CRITICAL,HIGH'

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,23 @@ jobs:
4646
run: |
4747
make buildx.image
4848
make buildx.push
49+
50+
trivy:
51+
runs-on: ubuntu-18.04
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v2
55+
56+
- name: Set Tag
57+
run: |
58+
echo "::set-env name=TAG::${GITHUB_REF#refs/*/v}"
59+
echo "::set-env name=RELEASE_TAG::${TAG}"
60+
61+
- name: Run Trivy vulnerability scanner
62+
uses: aquasecurity/trivy-action@master
63+
with:
64+
image-ref: openebs/linux-utils:${{ env.RELEASE_TAG }}
65+
format: 'table'
66+
exit-code: '1'
67+
ignore-unfixed: true
68+
severity: 'CRITICAL,HIGH'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.10.3
1+
FROM alpine:3.12.0
22
RUN apk add --no-cache util-linux
33

44
ARG DBUILD_DATE

0 commit comments

Comments
 (0)