@@ -738,36 +738,36 @@ jobs:
738
738
:cosmotech-api:jibDockerBuild
739
739
-Djib.to.image=com.cosmotech/cosmotech-api:${{ github.sha }}
740
740
741
- - name : Scan Container Image
741
+ - name : Run Trivy vulnerability scanner
742
+ uses :
aquasecurity/[email protected]
742
743
id : scan
743
- # TODO For now, do not block if the container scan action returns issues
744
- continue-on-error : true
745
-
746
- with :
747
- image-name : com.cosmotech/cosmotech-api:${{ github.sha }}
744
+ # Add TRIVY_DB_REPOSITORY due to ratelimit issue
745
+ # https://github.com/aquasecurity/trivy-action/issues/389
748
746
env :
749
747
DOCKLE_HOST : " unix:///var/run/docker.sock"
748
+ TRIVY_DB_REPOSITORY : public.ecr.aws/aquasecurity/trivy-db:2
749
+ TRIVY_JAVA_DB_REPOSITORY : public.ecr.aws/aquasecurity/trivy-java-db:1
750
+
751
+ # TODO For now, do not block if the container scan action returns issues
752
+ continue-on-error : true
750
753
751
- - name : Convert Container Scan Report to SARIF
752
- id : scan-to-sarif
753
-
754
- if : ${{ always() }}
755
754
with :
756
- input-file : ${{ steps.scan.outputs.scan-report-path }}
755
+ image-ref : com.cosmotech/cosmotech-api:${{ github.sha }}
756
+ format : " sarif"
757
+ severity : " CRITICAL,HIGH"
758
+ output : " trivy-results.sarif"
757
759
758
- - name : Upload SARIF reports to GitHub Security tab
759
- uses : github/codeql-action/upload-sarif@v2
760
- if : ${{ always() }}
760
+ - name : Upload Trivy scan results to GitHub Security tab
761
+ uses : github/codeql-action/upload-sarif@v3
761
762
with :
762
- sarif_file : ${{ steps.scan-to-sarif.outputs. sarif-report-path }}
763
+ sarif_file : " trivy-results. sarif"
763
764
764
765
- name : Archive container image scan report
765
766
if : ${{ always() }}
766
- continue-on-error : true
767
- uses : actions/upload-artifact@v3
767
+ uses : actions/upload-artifact@v4
768
768
with :
769
769
name : container-image-scan-report
770
- path : ${{ steps.scan.outputs.scan-report-path }}
770
+ path : " trivy-results.sarif "
771
771
retention-days : 3
772
772
773
773
- name : Login to GitHub Container Registry
0 commit comments