Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Add container security scanning (#19)
Browse files Browse the repository at this point in the history
This adds a workflow that runs Trivy [1] on all Dockerfiles in the repository.

[1] https://aquasecurity.github.io/trivy/
  • Loading branch information
JAORMX authored Jun 6, 2022
1 parent e84e7d7 commit bb32684
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/container-scan-trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
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: '23 20 * * 2'
pull_request:

jobs:
scan-trivy-1:
name: sec-scan-trivy-1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build go binary
run: |
go build -o dhcpserver .
- name: Build
uses: docker/build-push-action@v3
with:
context: .
file: ./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'

0 comments on commit bb32684

Please sign in to comment.