Skip to content

add trivy cache #63

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

add trivy cache #63

wants to merge 3 commits into from

Conversation

sam-trace
Copy link
Contributor

Description

trivy scans are failing because of db download. this is a fix to the below issue

aquasecurity/trivy#7668

shell: sh
id: date
run: |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're putting the date into the cache, what's the point? It's just going to accumulate cache entries. I would suggest we make caching optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed caching . since vulnerabilities are updated daily, we cannot cache it after a day.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does pulling this manually via oras help? the rate limit is on ghcr. In the linked thread, they suggest you can just use their public ECR instead which can be passed as a flag.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRIVY_DB_REPOSITORY=ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db

Seems like this should fallback to the public ECR (should be a similar one for the java db). There's also rate limiting there but we can either set up a user or just hope that having two options should be good enough.

rm javadb.tar.gz

- name: Cache DBs
uses: actions/cache/save@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no cache restore in this flow. It's atypical to use cache save directly, but if if we're going to we should be doing a restore on cache hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants