Skip to content

Commit

Permalink
add trivy scanning (#15)
Browse files Browse the repository at this point in the history
Signed-off-by: David van der Spek <[email protected]>
  • Loading branch information
davidspek authored Jun 2, 2023
1 parent e56cf6f commit f1452b8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: trivy

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
jobs:
trivy-scan:
name: Trivy IaC scan
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in IaC mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
hide-progress: false
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
scanners: 'vuln,secret,config'
ignore-unfixed: true
#severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
continue-on-error: true # TODO: remove once https://github.com/aquasecurity/tfsec/issues/1955 is resolved
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'

0 comments on commit f1452b8

Please sign in to comment.