2323 name=${NAME// /-}
2424 echo "tag=${tag}" >> $GITHUB_OUTPUT
2525 echo "name=${name}" >> $GITHUB_OUTPUT
26-
26+
2727 - name : Install ORAS
2828 id : oras
2929 uses : oras-project/setup-oras@v1
@@ -39,28 +39,34 @@ runs:
3939 id : pull
4040 shell : bash
4141 run : |
42+ mkdir -p $GITHUB_WORKSPACE/.cache/trivy/db
4243 oras pull ghcr.io/temporalio/trivy-db:2
44+ tar -xzf db.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/db
45+ rm db.tar.gz
46+
47+ mkdir -p $GITHUB_WORKSPACE/.cache/trivy/java-db
4348 oras pull ghcr.io/temporalio/trivy-java-db:1
49+ tar -xzf javadb.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/java-db
50+ rm javadb.tar.gz
51+
52+ - name : Install Trivy
53+ uses : aquasecurity/setup-trivy@v0.2.5
54+ with :
55+ version : v0.69.3
4456
4557 - name : Scan Container Image
4658 id : scan
47- uses : aquasecurity/trivy-action@0.28.0
59+ shell : bash
4860 env :
49- TRIVY_DB_REPOSITORY : ghcr.io/temporalio/private-actions/trivy-db,public.ecr.aws/aquasecurity/trivy-db,ghcr.io/aquasecurity/trivy-db
50- TRIVY_JAVA_DB_REPOSITORY : ghcr.io/temporalio/private-actions/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db,ghcr.io/aquasecurity/trivy-java-db
51- # Not 100% sure if these are required, but so far no issues.
52- TRIVY_USERNAME : ${{ github.actor }}
53- TRIVY_PASSWORD : ${{ github.token }}
54- with :
55- cache : true
56- exit-code : 0
57- image-ref : ${{ steps.vars.outputs.tag }}
58- format : ' sarif'
59- output : ' trivy-${{ steps.vars.outputs.name }}-results.sarif'
61+ TRIVY_SKIP_DB_UPDATE : true
62+ TRIVY_SKIP_JAVA_DB_UPDATE : true
63+ TRIVY_CACHE_DIR : ${{ github.workspace }}/.cache/trivy
64+ run : |
65+ trivy image --severity HIGH,CRITICAL --no-progress ${{ steps.vars.outputs.tag }} --format sarif --output trivy-${{ steps.vars.outputs.name }}-results.sarif
6066
61- - name : Upload ${{ inputs.image-name }} image Trivy scan results to GitHub Security tab
67+ - name : Upload Trivy scan results
6268 uses : github/codeql-action/upload-sarif@v3
63- # if: always()
69+ if : always()
6470 with :
65- sarif_file : ' trivy-${{ steps.vars.outputs.name }}-results.sarif'
71+ sarif_file : trivy-${{ steps.vars.outputs.name }}-results.sarif
6672 category : trivy-${{ steps.vars.outputs.name }}-results
0 commit comments