-
Notifications
You must be signed in to change notification settings - Fork 213
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-operator error download-policy #2309
Comments
I am also unable to deploy trivy-operator.
|
I have the same problem. I was able to solve a part of it with the following settings in values.yaml to use mirrors for querying the images: global:
image:
registry: "public.ecr.aws"
trivy:
registry:
mirror:
"mirror.gcr.io": mirror.gcr.io
"public.ecr.aws": public.ecr.aws
"docker.io": docker.io
"ghcr.io": ghcr.io
dbRegistry: "public.ecr.aws"
dbRepository: "aquasecurity/trivy-db"
javaDbRegistry: "public.ecr.aws"
javaDbRepository: "aquasecurity/trivy-java-db" With that, trivy-operator can be deployed and will create report resources. What remains in the logs are TOOMANYREQUESTS errors for the |
unfortunately, there is no a mirror for trivy-checks now, but Trivy Team is working hard to resolve it. |
That is good to hear. I temporarily deactivated the policiesBundle with |
good decission, I did the same change. but it seems it doesn't work for image scan |
I saw by chance that trivy-check is available at Docker Hub. So I gave it a try, but recognized something weird: trivy:
useBuiltinRegoPolicies: true
policiesBundle:
# -- registry of the policies bundle
registry: docker.io
# -- repository of the policies bundle
repository: aquasecurity/trivy-checks But in the trivy-operator logs it seems that the change in registry is ignored:
|
@pfaelzerchen thanks for the report. repository: aquasec/trivy-checks |
OK, I found a working configuration. When redeploying with helm, What seems to work: policiesBundle:
# -- registry of the policies bundle
registry: docker.io
# -- repository of the policies bundle
repository: aquasec/trivy-checks
# -- tag version of the policies bundle
tag: latest
|
What steps did you take and what happened:
Deploying a aquasecurity/trivy-operator helm chart with version
and using the following values file
We're getting errors in trivy-operator that failed to download policies
{"level":"error","ts":"2024-11-06T10:00:31Z","logger":"policyLoader.Get misconfig bundle policies","msg":"failed to load policies","error":"failed to download policies: failed to download built-in policies: download error: oci download error: f │ │ ailed to fetch the layer: GET https://ghcr.io/v2/aquasecurity/trivy-checks/blobs/sha256:cba49b6781cfcdeb6b063283a711ce0ddb1f36d6e2a5db69ef7d2e3f13998149: TOOMANYREQUESTS: retry-after: 168.77µs, allowed: 44000/minute","stacktrace":"github.com/a │ │ quasecurity/trivy-operator/pkg/policy.(*policyLoader).GetPoliciesAndBundlePath\n\t/home/runner/work/trivy-operator/trivy-operator/pkg/policy/loader.go:63\ngithub.com/aquasecurity/trivy-operator/pkg/policy.(*Policies).loadPolicies\n\t/home/runne │ │ r/work/trivy-operator/trivy-operator/pkg/policy/policy.go:144\ngithub.com/aquasecurity/trivy-operator/pkg/policy.(*Policies).Hash\n\t/home/runner/work/trivy-operator/trivy-operator/pkg/policy/policy.go:114\ngithub.com/aquasecurity/trivy-operato │ │ r/pkg/configauditreport/controller.(*ResourceController).SetupWithManager.(*ResourceController).reconcileResource.func1\n\t/home/runner/work/trivy-operator/trivy-operator/pkg/configauditreport/controller/resource.go:208\nsigs.k8s.io/controller- │ │ runtime/pkg/reconcile.Func.Reconcile\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/reconcile/reconcile.go:113\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/home/runner/go/pkg/mod/sig │ │ s.k8s.io/[email protected]/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/ │ │ controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261\nsigs.k8s.io/cont │ │ roller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222"}
scan-vulnerabilities pods get the following output
What did you expect to happen:
I expect to not get download policies errors and pods scan-vulnerability finish scaning, the last output that we get is "Downloading DB..."
Anything else you would like to add:
We've added the insecure flag to allow the DB to download if not we get error downloading db with TOOMANYREQUESTS
[Miscellaneous information that will assist in solving the issue.]
Environment:
trivy-operator version
): "0.22.0"kubectl version
): v1.30.4-eks-a737599The text was updated successfully, but these errors were encountered: