Skip to content

Commit 87f756a

Browse files
author
Vianpyro
committed
Add GitHub Actions workflow to scan Docker images for vulnerabilities
1 parent 4f1db93 commit 87f756a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Scan Docker Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: null
8+
9+
jobs:
10+
scan-images:
11+
name: Scan Docker Images for Vulnerabilities
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Build an image from Dockerfile
19+
run: docker build -t docker.io/my-organization/my-app:${{ github.sha }} .
20+
21+
- name: Run Trivy vulnerability scanner
22+
uses: aquasecurity/[email protected]
23+
with:
24+
image-ref: "docker.io/my-organization/my-app:${{ github.sha }}"
25+
format: "table"
26+
exit-code: "1"
27+
ignore-unfixed: true
28+
vuln-type: "os,library"
29+
severity: "CRITICAL,HIGH"

0 commit comments

Comments
 (0)