Cannot authenticate trivy operator to private docker registry #1260
Replies: 2 comments
-
And also we have a gitlab registry for our images. And we've been following this format for registry authentication. |
Beta Was this translation helpful? Give feedback.
-
I created the docker config with kubectl like described here https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
creted In the trivy namespace and defined the secret in the PullSecret block in the Values.yaml trivy-operator/deploy/helm/values.yaml Line 126 in 1b69d4a It works for me with Azure ACR |
Beta Was this translation helpful? Give feedback.
-
I followed the docs(https://aquasecurity.github.io/trivy-operator/v0.5.0/tutorials/private-registries/) for authenticating our private registry to scan images. Only the first option seems to work.But we are not comfortable running Trivy as root. The second,third and fourth options seem to get ACCESS DENIED error. I could see that error in the logs.
Logs:
"Error","status.message":"time\t\u001b[31mFATAL\u001b[0m\timage scan error: scan error: unable to initialize a scanner: unable to initialize a docker scanner: 4 errors occurred:\n\t* unable to inspect the image (registry.private.com/project:4**7): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\n\t* unable to initialize Podman client: no podman socket found: stat podman/podman.sock: no such file or directory\n\t* containerd socket not found: /run/containerd/containerd.sock\n\t* GET https://gitlab.private.com/jwt/auth?scope=repository%3Arepo%2Fproject%3Apull&service=container_registry: DENIED: access forbidden\n\n\n"
Note: I did try above options with the recommended token format.
Beta Was this translation helpful? Give feedback.
All reactions