Skip to content

Commit 1494a15

Browse files
committed
fix(trivy-operator): stop asserting fixability the alert cannot verify
The backlog alert described every counted finding as having a published fix. Nothing in the expression establishes that. trivy_image_vulnerabilities counts by severity and carries no fixed_version label, so the claim rested entirely on trivy.ignoreUnfixed being true, which drops unfixed CVEs at scan time so they never reach a report. That coupling was invisible. Setting ignoreUnfixed to false left the alert firing on CVEs nobody can act on while still calling the backlog actionable. The annotations now derive their wording from that value instead of asserting it, so turning it off changes what the alert says about itself. Same correction applied to the values.yaml comments, which still described the alert as a ticket rather than a page.
1 parent 6c0d08c commit 1494a15

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

argocd-helm-charts/trivy-operator/templates/prometheusrule.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ spec:
4949
# filter this count is never zero on a real cluster, so marking it
5050
# critical would get it muted within a week — and a muted receiver
5151
# takes the health alert above down with it.
52+
#
53+
# Fixability is NOT in this expression. trivy_image_vulnerabilities
54+
# counts by severity and carries no fixed_version label, so nothing
55+
# here can filter on whether a fix exists. Every counted finding is
56+
# fixable only because trivy.ignoreUnfixed makes Trivy drop unfixed
57+
# CVEs at scan time, so they never reach a report to be counted.
58+
#
59+
# The wording below is derived from that value rather than asserting
60+
# it. Setting ignoreUnfixed to false would otherwise leave this alert
61+
# working but quietly claiming something untrue — counting CVEs nobody
62+
# can act on while still calling them actionable.
63+
{{- $fixableOnly := index .Values "trivy-operator" "trivy" "ignoreUnfixed" }}
5264
- alert: ClusterVulnerabilityBacklog
5365
expr: |
5466
sum(trivy_image_vulnerabilities{severity=~"Critical|High"})
@@ -57,6 +69,6 @@ spec:
5769
labels:
5870
severity: warning
5971
annotations:
60-
summary: "Cluster has {{ "{{ $value }}" }} fixable Critical/High CVEs"
61-
description: "Fixable Critical/High findings exceed the threshold of {{ .Values.kubeaid.prometheusRule.backlogThreshold }}. Every finding counted here has a published fix, so the backlog is actionable. Per-image detail: kubectl get vulnerabilityreports -A."
72+
summary: "Cluster has {{ "{{ $value }}" }} {{ if $fixableOnly }}fixable {{ end }}Critical/High CVEs"
73+
description: "Critical/High findings exceed the threshold of {{ .Values.kubeaid.prometheusRule.backlogThreshold }}. {{ if $fixableOnly }}Every finding counted has a published fix, so the backlog is actionable.{{ else }}This count includes CVEs with no published fix, because trivy.ignoreUnfixed is false — some of it may not be actionable.{{ end }} Per-image detail: kubectl get vulnerabilityreports -A."
6274
{{- end }}

argocd-helm-charts/trivy-operator/values.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ kubeaid:
4141
enabled: true
4242

4343
# TrivyOperatorMetricsMissing — the scanner is producing nothing, so the
44-
# cluster is unscanned rather than clean. Pages. Long enough to ride out an
45-
# operator restart or a missed scrape, short enough that a genuinely dead
46-
# scanner does not go unnoticed for a working day.
44+
# cluster is unscanned rather than clean. Severity critical. Long enough to
45+
# ride out an operator restart or a missed scrape, short enough that a
46+
# genuinely dead scanner does not go unnoticed for a working day.
4747
blindFor: "1h"
4848

49-
# ClusterVulnerabilityBacklog — fixable Critical/High findings above this
50-
# count. Ticket, never a page: with ignoreUnfixed the count is still never
51-
# zero on a real cluster, so paging would be muted within a week.
49+
# ClusterVulnerabilityBacklog — Critical/High findings above this count.
50+
# Severity warning: with ignoreUnfixed the count is still never zero on a
51+
# real cluster, so marking it critical would get the receiver muted.
52+
#
53+
# Whether these are all fixable depends on trivy.ignoreUnfixed above, not
54+
# on the alert — the metric it counts carries no fixed_version label.
5255
#
5356
# Tune per cluster. The default is deliberately high: an alert that fires
5457
# on day one everywhere teaches operators to ignore it.

0 commit comments

Comments
 (0)