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

trivyOperator.scanJobAnnotations does not get applied to scanJobs #1933

Open
macintoshme opened this issue Mar 21, 2024 · 6 comments
Open

trivyOperator.scanJobAnnotations does not get applied to scanJobs #1933

macintoshme opened this issue Mar 21, 2024 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. target/kubernetes Issues relating to kubernetes cluster scanning

Comments

@macintoshme
Copy link

macintoshme commented Mar 21, 2024

What steps did you take and what happened:

set trivyOperator.scanJobAnnotations, which configured the configmap as below, but does not apply to scanjobs

scanJob.annotations: platform-logging-droplogging=true

What did you expect to happen:
scanjobs have annotation.
Anything else you would like to add:

[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Trivy-Operator version (use trivy-operator version): 0.18.5
@macintoshme macintoshme added the kind/bug Categorizes issue or PR as related to a bug. label Mar 21, 2024
@macintoshme macintoshme changed the title trivyOpaterators.ScanJobAnnotationsddddd trivyOperator.scanJobAnnotations does not get applied to scanJobs Mar 21, 2024
@chen-keinan
Copy link
Contributor

@macintoshme can you please share you configuration (trivy-operator config maps)

@chen-keinan chen-keinan added priority/backlog Higher priority than priority/awaiting-more-evidence. target/kubernetes Issues relating to kubernetes cluster scanning labels Apr 1, 2024
@macintoshme
Copy link
Author

apiVersion: v1 data: compliance.failEntriesLimit: "10" configAuditReports.scanner: Trivy node.collector.imageRef: ghcr.io/aquasecurity/node-collector:0.1.1 node.collector.nodeSelector: "true" nodeCollector.volumeMounts: '[{"mountPath":"/var/lib/etcd","name":"var-lib-etcd","readOnly":true},{"mountPath":"/var/lib/kubelet","name":"var-lib-kubelet","readOnly":true},{"mountPath":"/var/lib/kube-scheduler","name":"var-lib-kube-scheduler","readOnly":true},{"mountPath":"/var/lib/kube-controller-manager","name":"var-lib-kube-controller-manager","readOnly":true},{"mountPath":"/etc/systemd","name":"etc-systemd","readOnly":true},{"mountPath":"/lib/systemd/","name":"lib-systemd","readOnly":true},{"mountPath":"/etc/kubernetes","name":"etc-kubernetes","readOnly":true},{"mountPath":"/etc/cni/net.d/","name":"etc-cni-netd","readOnly":true}]' nodeCollector.volumes: '[{"hostPath":{"path":"/var/lib/etcd"},"name":"var-lib-etcd"},{"hostPath":{"path":"/var/lib/kubelet"},"name":"var-lib-kubelet"},{"hostPath":{"path":"/var/lib/kube-scheduler"},"name":"var-lib-kube-scheduler"},{"hostPath":{"path":"/var/lib/kube-controller-manager"},"name":"var-lib-kube-controller-manager"},{"hostPath":{"path":"/etc/systemd"},"name":"etc-systemd"},{"hostPath":{"path":"/lib/systemd"},"name":"lib-systemd"},{"hostPath":{"path":"/etc/kubernetes"},"name":"etc-kubernetes"},{"hostPath":{"path":"/etc/cni/net.d/"},"name":"etc-cni-netd"}]' report.recordFailedChecksOnly: "true" scanJob.annotations: platform-logging-droplogging=true scanJob.compressLogs: "true" scanJob.podTemplateContainerSecurityContext: '{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true}' scanJob.tolerations: '[{"effect":"NoSchedule","operator":"Exists"}]' trivy.serverURL: http://trivy-service.platform-trivy-operator:4954 vulnerabilityReports.scanner: Trivy kind: ConfigMap metadata: annotations: meta.helm.sh/release-name: platform-trivy-operator meta.helm.sh/release-namespace: platform-trivy-operator creationTimestamp: "2024-01-19T21:18:37Z" labels: app.kubernetes.io/instance: platform-trivy-operator app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: trivy-operator app.kubernetes.io/version: 0.18.5 helm.sh/chart: trivy-operator-0.20.6 name: trivy-operator namespace: platform-trivy-operator resourceVersion: "178146580" uid: bb07d380-7139-4dcb-a718-4d4fdcae57c8

@chen-keinan
Copy link
Contributor

@macintoshme is you issue is similar to this #1735

@macintoshme
Copy link
Author

No, the issue is the configmap gets configured, but the spawned scanjobs do not have the annotation that is indicated in the configmap.

@chen-keinan
Copy link
Contributor

chen-keinan commented Apr 10, 2024

can you please share you values.yaml and one of the scan-job yaml.

kubectl get pods <pod name> -n trivy-system -o yaml

@macintoshme
Copy link
Author

Spotted annotation where it was reported missing. Closing ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. target/kubernetes Issues relating to kubernetes cluster scanning
Projects
None yet
Development

No branches or pull requests

2 participants