Skip to content

Trivy Operator

Runtime vulnerability scanning for every image running in the cluster. Deployed as the trivy-operator Argo CD platform app (k8s/envs/platform/trivy-operator/, chart 0.37.0) in the trivy-system namespace.

It scans whatever is actually running, ours (tomoda-*, pulled through the ghcr-pull secret) and upstream infra alike, on a schedule, so newly disclosed CVEs against long-running pods surface too. Triage, the trivy-issue-reporter that files findings as GitHub issues, and the rest of the pipeline are on Vulnerability scanning.

What it does

The operator watches every workload and creates a VulnerabilityReport CRD per container, plus a ConfigAuditReport for misconfig checks. Query them like any resource:

# Vulnerability reports across the cluster
kubectl get vulnerabilityreports -A

# HIGH/CRITICAL counts for a specific report
kubectl get vulnerabilityreport -n <ns> <name> \
  -o jsonpath='{.report.summary}'

Configuration

Tuned deliberately for this small, memory-tight cluster (application.yaml):

  • severity: HIGH,CRITICAL + ignoreUnfixed: true: only actionable findings.
  • scanJobsConcurrentLimit: 1, scanJobTimeout: 10m: one scan at a time, so scan memory spikes stay small next to prod. Only current ReplicaSet revisions are scanned.
  • Scan-job memory capped (100Mi request, 300Mi limit, no CPU limit) so a scan can't evict a workload.
  • Only vuln + config-audit scanners; RBAC, infra-assessment and cluster-compliance are off.
  • scannerReportTTL: 24h: reports refresh daily, picking up new CVEs against running images.

Metrics

serviceMonitor.enabled: true: the monitoring stack scrapes vulnerability counts automatically. There is no alert rule on them; new findings arrive as GitHub issues instead.