-
Notifications
You must be signed in to change notification settings - Fork 223
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
trivy-db fails to download with UNAUTHORIZED: The client does not have permission for manifest aquasecurity/trivy-db/2/manifest.json #695
Comments
@seb-835 you should not set up a permission for it , is this happen intermittently? or happen on every scan job? |
@chen-keinan it happens for every scan job. None Start at all. |
@seb-835 we have not changed anything about it in |
@chen-keinan i install trivy-operator v0.5.0, and got same behaviour. |
thanks for checking , I think it might be env. / config issue. |
i agree @chen-keinan ,
My cluster is deployed with rke2 and cis-compliance enabled, means there is some restriction.
But I have assign to the namespace : trivy-system + serviceaccount trivy-system a rolebinding using an unrestricted PSP :
it have solve and allow the trivy-operator container to run with root user, but it does not solve the trivy-db update UNAUTHORIZE , i don't know what can block it and where to search. Thanks for your help |
if you do not have an access to you can download it and publish it your self to private repo and overwrite the |
ok, i will fix that on the registry to get the image from ghcr.io |
@chen-keinan : is it expected ?
|
you need to use |
Thanks for help @chen-keinan |
Is it the same error or different, can you share the log ? |
Same error
Does the job use the same ServiceAccount as trivy-operator deployment to get the imagePullSecret to pull the trivy-db ? |
Should have , checking and getting back to you |
hum, even if my artifactory registry pull the image from ghcr.io as puvlic , my cluster need to authenticate against the artifactory registry to get the image. anyway, if you do not specify a service account in the job manifest, it may use the "default" one of the trivy-system namespace, |
Download db is done in init container need to check if we can pass TRIVY_USER/TRIVY_PASSWORD then it will work |
@seb-835 I will try to find a away to make it work with current release if I will not succeed I will create PR for it |
@chen-keinan thanks, |
@seb-835 is the images that you want to scan and trivy db are located on the same private registry ? |
Sorry for late, yes, they are.
|
@seb-835 we might need to do a change in |
Any update on this one please ? |
I'll open an issue on trivy to support download db (Server) from private registry |
This is already possible: trivy-operator/deploy/helm/values.yaml Line 339 in 487faa0
|
this is for public repo not private , if it require credential it will now work |
Thanks for the clarification. |
@chen-keinan what is the number of the issue you opened on trivy ? |
thanks for reminder , here is the issue |
@chen-keinan the PR for this issue on trivy has just been merged, and the issue is closed. |
@mfilotto great. once trivy v0.39.0 will be released I'll update |
@chen-keinan: how can I configure authentication in helm chart ? |
|
@chen-keinan I created a secret named trivy-operator-trivy-config with values TRIVY_USERNAME and TRIVY_PASSWORD, but I still have the error UNAUTHORIZED in trivy operator logs. |
yes , what I have specified is for |
Now I have this error in trivy server logs $ kubectl logs -f trivy-server-0 |
@mfilotto Thanks for feedback, I see now that the PR done on trivy support only $ TRIVY_USERNAME=foo TRIVY_PASSWORD=bar trivy image --db-repository ghcr.io/your/private-db --download-db-only I'm Checking it with trivy project and getting back to you , opening this issue for now |
@mfilotto @seb-835 the latest PR in trivy is not supported for server command. |
@mfilotto now adding trivy v0.40.0 which include credential server support for private repo, will be available with trivy-operator v0.13.1 |
What steps did you take and what happened:
trivy-operator pod failed to update db with error :
What did you expect to happen:
I expected the trivy-db to be downloaded fine.
Anything else you would like to add:
What permission do i have to look for and authorized to fix this issue ?
Thanks a lot for advice.
Environment:
The text was updated successfully, but these errors were encountered: