diff options
Diffstat (limited to '.github/workflows/trivy.yml')
-rw-r--r-- | .github/workflows/trivy.yml | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml new file mode 100644 index 0000000..ce25513 --- /dev/null +++ b/.github/workflows/trivy.yml @@ -0,0 +1,38 @@ +name: Trivy + +on: + workflow_dispatch: + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + - cron: '28 15 * * 3' + +permissions: + contents: read + +jobs: + build: + permissions: + contents: read + security-events: write + runs-on: "ubuntu-18.04" + steps: + - uses: actions/checkout@v2 + + - run: | + docker build -t docker.io/my-organization/my-app:${{ github.sha }} . + + - uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2 + with: + image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}' + format: 'template' + template: '@/contrib/sarif.tpl' + output: 'trivy-results.sarif' + severity: 'CRITICAL,HIGH' + ignore-unfixed: true + + - uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: 'trivy-results.sarif' |