-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat(security-actions/scan-docker-image): support trivy_db_cache
as alternate
#184
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input which allows caching the Trivy DB to get around rate limiting issues
saisatishkarra
force-pushed
the
feat/use_custom_registry
branch
3 times, most recently
from
November 26, 2024 20:45
7bc7818
to
7936c06
Compare
…dated mirror for `trivy-db` and `trivy-java-db` feat(security-actions/scan-docker-image): use existing token input with default
saisatishkarra
force-pushed
the
feat/use_custom_registry
branch
from
November 26, 2024 21:13
7936c06
to
b91cc81
Compare
Based on the below discussions for the mentioned Issue,
|
saisatishkarra
changed the title
feat(security-actions/scan-docker-image): support
feat(security-actions/scan-docker-image): support Nov 26, 2024
trivy_db_cache
astrivy_db_cache
as alternate
saisatishkarra
previously approved these changes
Nov 26, 2024
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.
LGTM
…clone db mirror repo" This reverts commit 52a79f0.
saisatishkarra
force-pushed
the
feat/use_custom_registry
branch
from
November 28, 2024 17:40
a1a7cab
to
00dbcb8
Compare
saisatishkarra
force-pushed
the
feat/use_custom_registry
branch
from
November 28, 2024 17:43
00dbcb8
to
c0bb00e
Compare
pankajmouriyakong
approved these changes
Nov 28, 2024
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.
LGTM
vsofronievk
approved these changes
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
input which allows caching the Trivy DB to get around rate limiting issues
Trivy (ab)uses GHCR OCI as it's config update mechanism, and this is being heavily (targeted) rate limited by GitHub.
Inspired by aquasecurity/trivy#7591, this PR adds two optional arguments to the
security-actions/scan-docker-image
image that allows us to skip fetching fro GHCR completely:When provided, we will checkout the specific repo's branch using the PAT, look for a
db.tar.gz
file from it and untar it to the filesystem. We then instruct Trivy to not update it's database and instead use the local database only.This ensures the action will always succeed because a database will always be available. https://github.com/Kong/trivy-db-mirror contains a workflow that automatically updates it's database every 6 hours, but update can also be manually triggered via Run workflow button on this page.
This PR also removed running Trivy inside the Docker container, as it appears that GitHub Actions does not support volume mounting with the
docker://
method. Instead we simply download thetrivy
executable from the official release link and throw it into/usr/local/bin
.According to my tests, the scan image workflow now always succeeds.
Sister PR on Kong-ee: https://github.com/Kong/kong-ee/pull/10626