Skip to content

Commit

Permalink
Merge pull request #5673 from zhzhuang-zju/trivy
Browse files Browse the repository at this point in the history
image-scanning: fix ratelimiting error when downloading vulnerability db from ghcr.io
  • Loading branch information
karmada-bot authored Nov 14, 2024
2 parents 6f138cf + d2c29f0 commit e08cea1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-image-scanning-on-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
make image-${{ matrix.target }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
env:
ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
with:
image-ref: 'docker.io/karmada/${{ matrix.target }}:${{ matrix.karmada-version }}'
format: 'sarif'
Expand All @@ -56,6 +59,8 @@ jobs:
output: '${{ matrix.target }}:${{ matrix.karmada-version }}.trivy-results.sarif'
- name: display scan results
uses: aquasecurity/[email protected]
env:
TRIVY_SKIP_DB_UPDATE: true # Avoid updating the vulnerability db as it was cached in the previous step.
with:
image-ref: 'docker.io/karmada/${{ matrix.target }}:${{ matrix.karmada-version }}'
format: 'table'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci-image-scanning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
make image-${{ matrix.target }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
env:
ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
with:
image-ref: 'docker.io/karmada/${{ matrix.target }}:latest'
format: 'sarif'
Expand All @@ -51,6 +54,8 @@ jobs:
output: 'trivy-results.sarif'
- name: display scan results
uses: aquasecurity/[email protected]
env:
TRIVY_SKIP_DB_UPDATE: true # Avoid updating the vulnerability db as it was cached in the previous step.
with:
image-ref: 'docker.io/karmada/${{ matrix.target }}:latest'
format: 'table'
Expand Down

0 comments on commit e08cea1

Please sign in to comment.