Skip to content

Trigger internal analysis on internal vulnerability create/update - #7104

Open
heyiamwahab236 wants to merge 1 commit into
DependencyTrack:4.14.xfrom
tecan:feature/internal-vuln-autolinking
Open

heyiamwahab236 wants to merge 1 commit into
DependencyTrack:4.14.xfrom
tecan:feature/internal-vuln-autolinking

Conversation

@heyiamwahab236

Copy link
Copy Markdown

Description

Findings for INTERNAL vulnerabilities are currently only produced when components are
re-analyzed — on BOM upload or during the scheduled portfolio analysis. Creating or
updating an internal vulnerability has no immediate effect: findings appear silently
up to a day later, with no feedback if the affected-component identifiers match
nothing in the portfolio.

Creating or updating an INTERNAL vulnerability now resolves candidate components via
targeted queries and dispatches an InternalAnalysisEvent for just those candidates.
The existing internal analyzer performs the precise identity and version-range
matching, so results are identical to those of the scheduled analysis — they just
appear immediately.

Addressed Issue

fixes #7030

Additional Details

  • ComponentQueryManager.getCandidateComponentsForVulnerableSoftware narrows
    candidates at the DB level (PURL type/namespace/name; CPE vendor:product substring,
    matching both escaped and unescaped stored forms) and deduplicates across entries.
  • InternalAnalysisTask is subscribed to InternalAnalysisEvent in
    EventSubsystemInitializer to make the dispatch effective — analyzers were
    previously only invoked inline by VulnerabilityAnalysisTask. Aware of the TODO
    about moving away from Subscriber#inform; happy to switch to direct invocation
    if preferred.
  • Companion frontend PR: will follow shortly and be linked here.
  • Note: touches the same methods as open PR Add opt-in template-based vulnerability ID generation #6639 (non-overlapping lines).

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly
  • This PR is a substantial change (per the ADR criteria), and I have added an ADR under docs/adr/

Findings for INTERNAL vulnerabilities are currently only produced when
components are re-analyzed - on BOM upload or during the scheduled
portfolio analysis. Creating or updating an internal vulnerability has
no immediate effect: findings appear silently up to a day later, and
there is no feedback if the affected-component identifiers match
nothing in the portfolio.

Creating or updating an INTERNAL vulnerability now resolves candidate
components via targeted queries (PURL type/namespace/name, or CPE
vendor:product substring with escaped-form support) and dispatches an
InternalAnalysisEvent for just those candidates. The existing internal
analyzer performs the precise identity and version-range matching, so
results are identical to those of the scheduled analysis - they just
appear immediately.

InternalAnalysisTask is subscribed to InternalAnalysisEvent to make the
dispatch effective; analyzers were previously only invoked inline by
VulnerabilityAnalysisTask.

Signed-off-by: Abdul wahab Shah <abdulwahab.shah236@gmail.com>
@owasp-dt-bot

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 561 complexity

Metric Results
Complexity 561

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@heyiamwahab236

Copy link
Copy Markdown
Author

Companion frontend PR: DependencyTrack/frontend#1773

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.

3 participants