Skip to content
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: trivy db repository credential set #2064

Merged

Conversation

kimtaehong
Copy link
Contributor

@kimtaehong kimtaehong commented May 13, 2024

Description

Regarding the issue in #2063, I checked the code and realized that environment value (TRIVY_USER/TRIVY_PASSWORD) is not set at initContainer step.

So I looked at the related code, and it seemed to be caused by the DB Registry User/Password information set in k8s secret being set to refer to ConfigMap data.

func (c Config) TrivyDBRepositoryCredentialsSet() bool {
	_, userOk := c.Data[keyTrivyDBRepositoryUsername]
	_, passOk := c.Data[keyTrivyDBRepositoryPassword]
	return userOk && passOk
}

I tried putting the trivy db private registry credentials in the configmap and it worked fine, but I think it should be referencing secret as originally intended, please confirm

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@kimtaehong kimtaehong requested a review from chen-keinan as a code owner May 13, 2024 13:26
@github-actions github-actions bot added the bug label May 13, 2024
Copy link
Contributor

@chen-keinan chen-keinan left a comment

Choose a reason for hiding this comment

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

@kimtaehong lgtm 🚀 thanks for the contributions

@chen-keinan chen-keinan merged commit fcfad91 into aquasecurity:main May 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

private db registry authentication error
2 participants