Skip to content

Validate ClassifierReport identity before acting on it - #552

Merged
gianlucam76 merged 1 commit into
projectsveltos:release-1.18from
gianlucam76:fix/classifierreport-identity-validation-release-1.18
Nov 26, 2026
Merged

gianlucam76 merged 1 commit into
projectsveltos:release-1.18from
gianlucam76:fix/classifierreport-identity-validation-release-1.18

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

Backport to release-1.18.

In pull mode a ClassifierReport is written by the managed cluster, so its Spec cannot be trusted. The report was used as is: a cluster could name a cluster in another namespace (tenant) with Match true and get the Classifier labels applied to it, and a report with an unknown cluster type made getClusterRefFromClassifierReport panic, which in the stale report sweep (a goroutine without recover) crashes the manager.

A ClassifierReport is now ignored unless it lives in the namespace of the cluster it names and its cluster type is Capi or Sveltos. The check is applied where reports are listed (listClassifierReportsForClassifier, syncAndGetMatchingClusters and the stale report sweep), and getClusterRefFromClassifierReport returns an error instead of panicking.

Tested: go build, go vet and the controllers Ginkgo suite pass on this branch.

🤖 Generated with Claude Code

In pull mode a ClassifierReport is written by the managed cluster, so its
Spec cannot be trusted. The report was used as is: a cluster could name a
cluster in another namespace (tenant) with Match true and get the
Classifier labels applied to it, and a report with an unknown cluster type
made getClusterRefFromClassifierReport panic, which in the stale report
sweep (a goroutine without recover) crashes the manager.

A ClassifierReport is now ignored unless it lives in the namespace of the
cluster it names and its cluster type is Capi or Sveltos. The check is
applied where reports are listed (listClassifierReportsForClassifier,
syncAndGetMatchingClusters and the stale report sweep), and
getClusterRefFromClassifierReport returns an error instead of panicking.
@gianlucam76
gianlucam76 merged commit c5c2091 into projectsveltos:release-1.18 Nov 26, 2026
8 checks passed
@gianlucam76
gianlucam76 deleted the fix/classifierreport-identity-validation-release-1.18 branch November 26, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant