Skip to content

fix(daily-scan): scan published artifacts instead of repo source - #749

Merged
thpierce merged 1 commit into
masterfrom
scan-published-artifacts
Mar 20, 2026
Merged

thpierce merged 1 commit into
masterfrom
scan-published-artifacts

Conversation

@thpierce

Copy link
Copy Markdown
Contributor

Problem

DependencyCheck (DC) scans -s "." which includes DC's own bundled jars in ./dependency-check/lib/, producing false positive CVEs (commons-beanutils, h2, logback, gson, httpclient5, etc.).

Additionally, scanning source code means if a vulnerability exists in the published artifact but has already been fixed on main, the scan gives a false negative — customers are still exposed.

Fix

Instead of scanning the repo source tree, download/install the published artifact from its package registry into a dedicated scan-target/ directory, then scan only that.

This pattern is already proven by ADOT Java and ADOT Python repos.

Changes

  • Replace the pre-scan build/install step with one that fetches the published artifact into scan-target/
  • Change the DC scan target from -s "." to -s "scan-target/"
  • All other steps (checkout, DC download/GPG/unzip, Trivy, metrics) are unchanged
  • All DC flags (--failOnCVSS 0, --enableExperimental, --nvdApiKey, etc.) are unchanged

Testing

Tested locally with DC v12.1.0 against NVD database. Verified:

  • All reported dependencies come from the published artifact
  • Zero DC tool jars in the report (no false positives)
  • Dependency count matches expected published artifact contents

@thpierce
thpierce requested a review from a team as a code owner March 19, 2026 23:58
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.31%. Comparing base (0aec538) to head (55376c7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #749   +/-   ##
=======================================
  Coverage   84.31%   84.31%           
=======================================
  Files          36       36           
  Lines        1817     1817           
=======================================
  Hits         1532     1532           
  Misses        285      285           

☔ View full report in Codecov by Sentry.
📢 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.

@thpierce
thpierce merged commit 68405ff into master Mar 20, 2026
15 of 16 checks passed
@thpierce
thpierce deleted the scan-published-artifacts branch March 20, 2026 03:07
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.

2 participants