Your Vulnerability History Is a ReplicaSet Side Effect
Trivy-operator's VulnerabilityReports are owned by the ReplicaSet they describe and named deterministically. Delete the Deployment and the history goes with it; rescan and the old numbers are overwritten. What you have is a snapshot, not a trend.
There were 24 VulnerabilityReports in the namespace. Five Deployments were deleted — poc-nginx-old, poc-debian, poc-alpine, poc-python, poc-nginx-old2 — and the reports for those five workloads were gone. Not archived, not orphaned: none, garbage-collected with their ReplicaSet ownerReference, in the time it takes the Kubernetes GC to notice.
That is the whole finding, and it reframes what trivy-operator is. It is not a vulnerability database that happens to live in etcd. It is a projection of the current workload set, and projections do not have history.
The name is the problem
Look at a single report's identity:
replicaset-poc-nginx-old-5c9cf8fc5d-app
generation=1
ownerRef=ReplicaSet/poc-nginx-old-5c9cf8fc5d
blockOwnerDeletion=falseTwo things follow from that one line. First, the owner is the ReplicaSet, so the report's lifetime is bounded by the ReplicaSet's — delete the Deployment, the ReplicaSet goes, the report goes. Second, the name is deterministic: ReplicaSet name plus container name. It carries no timestamp, no scan ID, no sequence number. A second scan of the same workload produces an object with the same name, so it overwrites rather than appends. generation=1 after a rescan is the tell — there is no history row because there is no row, only a cell being rewritten.
Ownership flows down and deletion flows with it; the deterministic name means the rescan lands on top of the previous result rather than beside it.
And the rescan is on a timer
The mechanism that triggers the overwrite is visible on the report itself:
{"trivy-operator.aquasecurity.github.io/report-ttl":"24h0m0s"}OPERATOR_SCANNER_REPORT_TTL=24h. The report is deleted at creation plus TTL, and the controller immediately re-creates it by running a new scan job whose init container does trivy image --download-db-only — so the rescan is against a fresh database, which is exactly what you want. It also means that every 24 hours, for every workload, yesterday's numbers stop existing.
This is a good design for the question the operator is built to answer: what is running right now, and how bad is it right now? It is the wrong design for the question people ask it second: are we getting better?
What this rules out
The CRD list makes the boundary explicit. Every kind — vulnerabilityreports, configauditreports, exposedsecretreports, sbomreports, and their cluster-scoped siblings — is keyed to a Kubernetes workload. There is no registry or repository CRD. Nothing in the operator holds a record of an image that is not currently deployed, and nothing holds a record of what an image looked like last week.
So if the roadmap has "show the CVE burndown over the quarter" on it, that data does not exist in the cluster and cannot be recovered from it later. It has to be exported — scraped to a time series, or shipped to something that keeps rows — at the moment the report exists, because the report is the only copy and it has a 24-hour expiry and a name that guarantees the next one will land on top of it.
Treat the CRDs as a live view. Treat anything you want to trend as something you are responsible for persisting yourself.
Next: the CVE trend that is 20 days long — what happens when you do export to Prometheus, and how much trend you actually get.