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

Commit

Permalink
ci: Update Trivy configuration in security scan workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Rupeekshan authored Nov 14, 2024
1 parent 484ea2b commit c1960ea
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/component-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,44 @@ jobs:
uses: aquasecurity/[email protected]
with:
image-ref: image:latest
format: 'json'
vuln-type: 'os,library'
output: 'trivy-results.json'
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
TRIVY_FORMAT: json
TRIVY_OUTPUT: 'trivy-results.json'

- name: Save vulnerabilities report in tabular format
if: always()
uses: aquasecurity/[email protected]
with:
image-ref: trivy-results.json
scan-ref: trivy-results.json
scan-type: convert
vuln-type: ''
format: 'table'
output: 'trivy-results.txt'
env:
TRIVY_FORMAT: table
TRIVY_OUTPUT: 'trivy-results.txt'

- name: Display vulnerabilities report
if: always()
uses: aquasecurity/[email protected]
with:
image-ref: trivy-results.json
scan-ref: trivy-results.json
scan-type: convert
vuln-type: ''
env:
TRIVY_FORMAT: table
TRIVY_OUTPUT: ''

- name: Fail on high and critical vulnerabilities
if: always()
uses: aquasecurity/[email protected]
with:
image-ref: trivy-results.json
scan-ref: trivy-results.json
scan-type: convert
exit-code: '1'
vuln-type: ''
severity: 'HIGH,CRITICAL'
env:
TRIVY_FORMAT: table
TRIVY_OUTPUT: ''

- name: Publish scan report
if: always()
Expand Down

0 comments on commit c1960ea

Please sign in to comment.