-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rate limiting issue in Trivy workflow scan #23634
Conversation
env: | ||
AWS_REGION: us-east-2 | ||
AWS_IAM_ROLE: arn:aws:iam::160035666661:role/github-actions-role | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added for use in aws-actions/configure-aws-credentials
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db | ||
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See aquasecurity/trivy-db#440. Pulling from these may become the default in future Trivy versions, at which point we could back this out and let them drive again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💖 This is great, thank you!
Exactly same fix as #23634. PS: Thanks @sgress454!
This PR updates the way that the Trivy scan workflow downloads the vulnerability database. Previously, it would download the database from the Github container registry (ghcr.io) by default. This caused issues where the request for the file would get a "too many requests" error response, seemingly due to ever user of Trivy being lumped together for the purpose of rate limiting. Now, we're instructing Trivy to download the dbs from their own public ECR. We're also authenticating with AWS first, so that we get our own quota.
This PR also updates the version of the Github checkout action to avoid a warning about it not being designed for Node 20:
I tested this by pushing the branch up and triggering the workflow manually. Only time will tell if it really solves the rate limit issue, since we run this pretty infrequently.