Skip to content

feat: Deprecate active malware analysis in favour of SafeDep threat intelligence query#752

Merged
KunalSin9h merged 7 commits into
mainfrom
feat/deprecate-activate-malware-analysis
Jul 22, 2026
Merged

feat: Deprecate active malware analysis in favour of SafeDep threat intelligence query#752
KunalSin9h merged 7 commits into
mainfrom
feat/deprecate-activate-malware-analysis

Conversation

@abhisek

@abhisek abhisek commented Jul 21, 2026

Copy link
Copy Markdown
Member

No description provided.

@safedep

safedep Bot commented Jul 21, 2026

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

View complete scan results →

This report is generated by SafeDep Github App

@abhisek
abhisek requested review from KunalSin9h and Copilot and removed request for KunalSin9h July 21, 2026 05:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.44444% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.57%. Comparing base (7517804) to head (3a98231).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
cmd/inspect/malware.go 0.00% 13 Missing ⚠️
scan.go 0.00% 12 Missing ⚠️
pkg/scanner/enrich_malware_query.go 0.00% 10 Missing and 1 partial ⚠️
pkg/reporter/markdown_summary.go 0.00% 4 Missing ⚠️
pkg/reporter/common.go 50.00% 2 Missing ⚠️
pkg/reporter/summary.go 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KunalSin9h KunalSin9h left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

  1. Silent security downgrade: entitled --malware users lose on-demand/zero-day analysis with no runtime notice — needs MarkDeprecated and/or ui.PrintWarning (scan.go).
  2. Dead quota reporting: IncrementMalwareAnalysisQuotaError has no callers after deleting enrich_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

Comment thread scan.go Outdated
Comment thread pkg/reporter/common.go
Comment thread pkg/scanner/enrich_malware_query.go
Comment thread scan.go
Comment thread README.md
KunalSin9h and others added 5 commits July 21, 2026 10:11
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
@KunalSin9h
KunalSin9h force-pushed the feat/deprecate-activate-malware-analysis branch from f34e6dd to 66b6568 Compare July 22, 2026 12:48
KunalSin9h
KunalSin9h previously approved these changes Jul 22, 2026
Comment thread cmd/inspect/malware.go Outdated
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
@KunalSin9h
KunalSin9h merged commit b4d728f into main Jul 22, 2026
14 checks passed
@KunalSin9h
KunalSin9h deleted the feat/deprecate-activate-malware-analysis branch July 22, 2026 16:40
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.

4 participants