feat: Deprecate active malware analysis in favour of SafeDep threat intelligence query#752
Conversation
…ntelligence query
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #752 +/- ##
==========================================
- Coverage 12.59% 12.57% -0.02%
==========================================
Files 371 370 -1
Lines 49203 48834 -369
==========================================
- Hits 6199 6143 -56
+ Misses 42514 42204 -310
+ Partials 490 487 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KunalSin9h
left a comment
There was a problem hiding this comment.
Deep-dive review of the active-malware-analysis deprecation. Direction is good — this removes ~600 lines of complexity, the exclusion-record handling and GitHub Actions commit-SHA resolution survived intact in the query enricher, dropping the community-mode hard error means --malware now works keyless, and the new reporter copy is more honest than the old text. Branch builds cleanly and go vet passes; the deleted tests only covered the deleted enricher.
That said, two findings are significant and worth addressing before merge (inline comments):
- Silent security downgrade: entitled
--malwareusers lose on-demand/zero-day analysis with no runtime notice — needsMarkDeprecatedand/orui.PrintWarning(scan.go). - Dead quota reporting:
IncrementMalwareAnalysisQuotaErrorhas no callers after deletingenrich_malware.go, so the quota-denied report sections can never render, while real rate-limit errors from the query API surface as generic errors (pkg/reporter/common.go).
Smaller items inline: --malware-analysis-timeout is now a silent no-op, eventScanMalwareAnalysis now fires on every default scan (dashboard discontinuity), and a README nit about vet inspect malware still offering on-demand analysis.
One non-anchorable nit: the doc comment on NewMalysisMalwareAnalysisQueryEnricher ("We are re-using the config from the malware enricher because this enricher is a subset of the malware enricher") is now stale — that enricher no longer exists and the config lives here.
Also: consider linking this PR to a tracking issue for the active-analysis deprecation, since it changes paid-feature behavior.
Generated by Claude Code
The scenario-11 expected CSV drifted from live OSV data: PYSEC-2026-2151 (flask), PYSEC-2024-323, PYSEC-2026-2192 and PYSEC-2026-2555 (langchain) were published, and GHSA-gr75-jv2w-4656 gained the CVE-2026-55443 alias. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDuuXuxJY4kUsEijVwskr7
The e2e scenario asserted the free plan auto-switch warning that this PR removes along with active malware analysis. Assert the new contract instead: --malware acts as a query alias for free plan users, packages are enriched from the known malicious packages database, and the markdown summary reports the database check. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDuuXuxJY4kUsEijVwskr7
On-demand malware analysis is moving to a JWT-authenticated, payment-sensitive workflow and is no longer available through this API-key based command. Mark the command deprecated via cobra (prints a notice on every invocation and hides it from help) and update the README and OSV report docs accordingly. The command still functions for now; it will be removed in a future release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDuuXuxJY4kUsEijVwskr7
Drop internal roadmap detail from the user-facing deprecation notices; just state the command is deprecated and point to vet scan --malware-query. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDuuXuxJY4kUsEijVwskr7
- Mark --malware deprecated via cobra so a warning prints on every use and it is hidden from help; previously entitled users were silently downgraded to a known-malware lookup with no notice. - Handle quota/rate-limit errors in the malware query enricher: detect ErrQuotaExceeded, record it via IncrementMalwareAnalysisQuotaError and continue, so the reporter quota sections reflect real denials instead of being dead code. Reword the quota messages to drop 'on-demand'. - Mark --malware-analysis-timeout deprecated (it no longer affects the single-shot query lookup) and document Timeout as unused. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDuuXuxJY4kUsEijVwskr7
f34e6dd to
66b6568
Compare
Per review feedback, the command no longer attempts on-demand analysis (the backend no longer serves this API-key based flow). executeMalwareAnalysis now fails fast with a useful error pointing users to `vet scan --malware-query`, and the now-dead report/resolver helpers are removed. RunE routes through command.RunCmd so the useful error's human message and help render properly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDuuXuxJY4kUsEijVwskr7



No description provided.