Skip to content

Commit e08cea1

Browse files
authored
Merge pull request #5673 from zhzhuang-zju/trivy
image-scanning: fix ratelimiting error when downloading vulnerability db from ghcr.io
2 parents 6f138cf + d2c29f0 commit e08cea1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/ci-image-scanning-on-schedule.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
make image-${{ matrix.target }}
4949
- name: Run Trivy vulnerability scanner
5050
uses: aquasecurity/[email protected]
51+
env:
52+
ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
5154
with:
5255
image-ref: 'docker.io/karmada/${{ matrix.target }}:${{ matrix.karmada-version }}'
5356
format: 'sarif'
@@ -56,6 +59,8 @@ jobs:
5659
output: '${{ matrix.target }}:${{ matrix.karmada-version }}.trivy-results.sarif'
5760
- name: display scan results
5861
uses: aquasecurity/[email protected]
62+
env:
63+
TRIVY_SKIP_DB_UPDATE: true # Avoid updating the vulnerability db as it was cached in the previous step.
5964
with:
6065
image-ref: 'docker.io/karmada/${{ matrix.target }}:${{ matrix.karmada-version }}'
6166
format: 'table'

.github/workflows/ci-image-scanning.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
make image-${{ matrix.target }}
4444
- name: Run Trivy vulnerability scanner
4545
uses: aquasecurity/[email protected]
46+
env:
47+
ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
4649
with:
4750
image-ref: 'docker.io/karmada/${{ matrix.target }}:latest'
4851
format: 'sarif'
@@ -51,6 +54,8 @@ jobs:
5154
output: 'trivy-results.sarif'
5255
- name: display scan results
5356
uses: aquasecurity/[email protected]
57+
env:
58+
TRIVY_SKIP_DB_UPDATE: true # Avoid updating the vulnerability db as it was cached in the previous step.
5459
with:
5560
image-ref: 'docker.io/karmada/${{ matrix.target }}:latest'
5661
format: 'table'

0 commit comments

Comments
 (0)