Skip to content

Commit

Permalink
feat(CI): Added codeql report upload step in Trivy docker image scan
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptarshiSarkar12 committed Feb 20, 2024
1 parent 0313277 commit ce72e36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,4 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
file: Docker/prod/${{ matrix.filename }}
platforms: linux/amd64,linux/arm64,linux/arm/v7

- name: Run Trivy security scan
uses: aquasecurity/trivy-action@0.17.0
with:
image-ref: ${{ steps.meta.outputs.tags }}
format: ${{ github.event_name == 'pull_request' && 'table' || 'sarif' }}
exit-code: 1
vuln-type: os,library
ignore-unfixed: true
output: ${{ github.event_name != 'pull_request' && 'trivy-report.sarif' || '' }}
hide-progress: false
scanners: vuln,secret,config

- name: Upload Trivy security scan results
if: github.event_name != 'pull_request'
uses: github/codeql-action/upload-sarif@main
with:
sarif_file: trivy-report.sarif
platforms: linux/amd64,linux/arm64,linux/arm/v7
7 changes: 6 additions & 1 deletion .github/workflows/docker-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ jobs:
ignore-unfixed: true
output: 'trivy-report.sarif'
hide-progress: false
scanners: vuln,secret,config
scanners: vuln,secret,config

- name: Upload Trivy report
uses: github/codeql-action/upload-sarif@main
with:
sarif_file: trivy-report.sarif

0 comments on commit ce72e36

Please sign in to comment.