Repository navigation
Conversation
Scan jobs used the registry password as the GOOGLE_APPLICATION_CREDENTIALS key file for any GCR or Artifact Registry image, but it is a JSON key only when the user is _json_key. Other users, such as _json_key_base64, now get TRIVY_USERNAME and TRIVY_PASSWORD. Assisted-by: Claude:Opus-5.5
This branch has not been deployed
This file contains hidden or 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
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.
Description
Scan jobs now use the GCR key file (
GOOGLE_APPLICATION_CREDENTIALS) only when the registry username is_json_key, as ClientServer mode did before #2595, and other GCR and Artifact Registry credentials, such as_json_key_base64, getTRIVY_USERNAMEandTRIVY_PASSWORDlike any other registry.The new
TestStandalone_GCRJSONKeyBase64fails without the change inimage.goand passes with it, as doesgo test ./pkg/plugins/trivy/.... With Trivy 0.76.1, a real_json_key_base64key scans a private Artifact Registry image asTRIVY_USERNAMEandTRIVY_PASSWORD, and fails withDENIED: Unauthenticated requestas a key file. This PR is independent of #3133.Related issues
_json_key_base64GCR credentials fail because scan jobs use them as a key file #3134Checklist
This PR was written with help from Claude (Opus 5.5) and reviewed by me.