Skip to content

test: add fallback registries for Trivy vulnerability database - #642

Merged
andyzhangx merged 1 commit into
kubernetes-sigs:masterfrom
andyzhangx:fix/trivy-db-fallback-20261024
Oct 24, 2026
Merged

andyzhangx merged 1 commit into
kubernetes-sigs:masterfrom
andyzhangx:fix/trivy-db-fallback-20261024

Conversation

@andyzhangx

Copy link
Copy Markdown
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
Apply the same Trivy database repository fallback as kubernetes-csi/csi-driver-smb#1245.

The workflow currently configures ECR Public as its only vulnerability database source. If ECR returns TOOMANYREQUESTS: Data limit exceeded, Trivy cannot initialize its database and the scan fails before inspecting the image.

Configure the following ordered fallback list for every Trivy scan step in this workflow:

  1. mirror.gcr.io/aquasec/trivy-db:2
  2. ghcr.io/aquasecurity/trivy-db:2
  3. public.ecr.aws/aquasecurity/trivy-db:2

Trivy can try another repository on transient errors such as HTTP 429 and 5xx. Preserve all existing image references, build steps, action pins, scan severities, and exit-code: '1'. This does not ignore vulnerability findings or bypass scanner failures.

Reference: https://trivy.dev/docs/latest/configuration/db/#database-locations

Which issue(s) this PR fixes:
Related to kubernetes-csi/csi-driver-smb#1245; prevents the same single-registry database-download failure in this repository.

Special notes for your reviewer:
Local validation:

  • git diff --check passed.
  • Workflow YAML parses successfully.
  • Compared parsed workflow with the base version and verified that the only semantic changes are the ordered TRIVY_DB_REPOSITORY lists in the Trivy steps.
  • Verified that all scan steps retain exit-code: '1'.

Full image builds and Trivy scans were not run locally; CI will exercise them. Multiple repositories reduce single-registry dependency but do not guarantee availability if every source fails.

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: andyzhangx <xiazhang@microsoft.com>
@kubernetes-prow kubernetes-prow Bot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 24, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested review from cofyc and saad-ali October 24, 2026 02:14
@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 24, 2026
@andyzhangx
andyzhangx merged commit 4f84137 into kubernetes-sigs:master Oct 24, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant