Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ version tag (`v1.2.3`) is pushed.
## [Unreleased]

### Added
- **Direct and transitive dependencies, and through which package.** `SbomFilterExtractor.ps1` names for a transitive
component the direct dependencies it comes in through (`Via`, from the dependency graph), and lockfiles with a graph
give direct / transitive too (`package-lock.json` v2 / v3, `pnpm-lock.yaml`, `packages.lock.json`, `Gemfile.lock`,
`Cargo.lock`, `uv.lock`). `metascraper.ps1` (build 2026-12-04a) writes `DependencyScope` and `Via` per entry. Shown
in the Results tab (column *Dep.*, tooltip, details, CSV, search `is:direct`, `is:transitive`, `via:`), the
Workbench, the attack paths, the Auto Report, the SBOM comparison and the inventory window (column *Via*); the Heavy
mode scan takes it from the inventory. Script test `tests/dependency-graph.ps1`, smoke area `dependency`.
- **Attack paths: components per arrow.** An arrow with more than one finding names, in a second, smaller line,
how many components the findings are in (*5 entries* / *in 3 components*) - in the GUI graph and the report graph.
The *Long list* next to the graph is 25 % wider (475 instead of 380 pixels). The STRIDE categories of a finding are
Expand Down
7 changes: 5 additions & 2 deletions Compare-Sbom.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ foreach ($k in $keys) {
OldComponent = $co; NewComponent = $cn; OldTriage = $(if ($ro) { $to } else { $null }); NewTriage = $(if ($rn) { $tn } else { $null })
OldVersionStatus = $(if ($o) { "$($o.VersionStatus)" } else { '' }); NewVersionStatus = $(if ($n) { "$($n.VersionStatus)" } else { '' })
Why = ($why -join '; ')
# Direct or transitive dependency (metascraper.ps1 2026-12-04a) on the side that counts: the new one, else the old.
Dependency = $(if ("$($e.DependencyScope)" -eq 'transitive') { 'transitive' + $(if ($e.Via) { " via $($e.Via)" }) } else { "$($e.DependencyScope)" })
})
}
$order = @{ new = 0; changed = 1; resolved = 2; unchanged = 3 }
Expand All @@ -226,8 +228,8 @@ $result = [pscustomobject]@{
}
$utf8 = New-Object System.Text.UTF8Encoding($false)
[IO.File]::WriteAllText((Join-Path $OutDir 'sbom_compare.json'), ($result | ConvertTo-Json -Depth 6), $utf8)
$csvRows = @($sorted | Where-Object { $IncludeUnchanged -or $_.Change -ne 'unchanged' } | Select-Object Change, Id, Cve, Severity, Exploited, OldComponent, NewComponent, OldTriage, NewTriage, OldVersionStatus, NewVersionStatus, Why)
$csv = if ($csvRows.Count) { $csvRows | ConvertTo-Csv -NoTypeInformation } else { '"Change","Id","Cve","Severity","Exploited","OldComponent","NewComponent","OldTriage","NewTriage","OldVersionStatus","NewVersionStatus","Why"' }
$csvRows = @($sorted | Where-Object { $IncludeUnchanged -or $_.Change -ne 'unchanged' } | Select-Object Change, Id, Cve, Severity, Exploited, OldComponent, NewComponent, OldTriage, NewTriage, OldVersionStatus, NewVersionStatus, Dependency, Why)
$csv = if ($csvRows.Count) { $csvRows | ConvertTo-Csv -NoTypeInformation } else { '"Change","Id","Cve","Severity","Exploited","OldComponent","NewComponent","OldTriage","NewTriage","OldVersionStatus","NewVersionStatus","Dependency","Why"' }
[IO.File]::WriteAllText((Join-Path $OutDir 'sbom_compare.csv'), (($csv -join "`r`n") + "`r`n"), $utf8)

# ---------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -267,6 +269,7 @@ foreach ($g in $groups) {
$id = if ($r.Url) { "<a href=""$(HtmlText $r.Url)"">$(HtmlText $r.Id)</a>" } else { HtmlText $r.Id }
$oldC = if ($r.OldComponent) { HtmlText $r.OldComponent } else { '<span class="dim">&mdash;</span>' }
$newC = if ($r.NewComponent) { HtmlText $r.NewComponent } else { '<span class="dim">removed</span>' }
if ($r.Dependency -like 'transitive*') { $newC += "<br><span class=""dim"">$(HtmlText $r.Dependency)</span>" }
[void]$sb.Append("<tr><td><span class=""tag t-$($r.Change)"">$($r.Change)</span></td><td><b>$id</b>$(if ($r.Exploited) { ' <span class="kev">KEV</span>' })</td><td>$(HtmlText $r.Severity)</td><td>$oldC<span class=""arrow"">&rarr;</span>$newC</td><td>$(Format-Triage $r.OldTriage)<span class=""arrow"">&rarr;</span>$(Format-Triage $r.NewTriage)</td><td>$(HtmlText $r.Why)</td></tr>")
}
[void]$sb.Append('</tbody></table></div>')
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,24 @@ from the dependency graph) get **-5**, `scope: optional` components **-10** on t
the reason says *"(transitive dependency -5)"*. OSV confirmations (100) and VEX are not changed. Without a
dependency graph nothing is deducted.

**Direct or transitive - and through which package** (script build 2026-12-04a): each entry carries
`DependencyScope` - *direct* when one matched component is a direct dependency of the main component, *transitive*
when every matched component with a known scope is transitive - and, for a transitive one, `Via`: the direct
dependencies it comes in through (`express@4.17.1; lodash@4.17.20`). The fix is mostly an update of that direct
dependency. Where it shows:

| Where | What |
|---|---|
| Results | column **Dep.** (*direct* / *transitive*, the tooltip names the way in), the line *Dependency* in the details, CSV columns `DependencyScope` and `Via`; search `is:direct`, `is:transitive`, `via:express`, `dep:transitive` |
| Workbench | *Dependency* in the details and the CSV; a change is noted like other changes |
| Attack paths | a transitive finding shows *transitive via ...* in the lists (GUI and report) |
| Auto Report | *transitive via ...* in the column Fix |
| SBOM comparison | column *Dependency* (window, CSV, HTML) |
| Inventory window | column *Via* (read-only) next to *Direct* |

The graph comes from the SBOM (CycloneDX `dependencies`, SPDX `DEPENDS_ON` / `DEPENDENCY_OF`) or from a lockfile that
has one (see the lockfiles in 2.3). Without a graph the column stays empty.

**Shadow comparison ("what do the stricter rules suppress?"):** for every entry the script also computes the
applicability it would get without the suppressing rules (ignored generic keywords, generic product names,
umbrella vendors, dependency scope, structured "not affected", VEX). If that is higher, the entry carries
Expand Down Expand Up @@ -1670,7 +1688,10 @@ a project (direct and indirect): `package-lock.json` / `npm-shrinkwrap.json`, `y
`poetry.lock`, `uv.lock`, `Pipfile.lock`, `requirements*.txt` (pinned `==` only), `composer.lock`, `go.sum`,
`Cargo.lock`, `Gemfile.lock`, `packages.lock.json` (.NET), `gradle.lockfile`. Each package becomes a component with
a purl (exact OSV / GHSA matching); development-only packages count as scope *excluded* (`-IncludeExcluded` keeps
them). A lockfile covers the libraries of one project only - operating system and server software (PostgreSQL,
them). Direct or transitive, and the way in (`Via`), come from the lockfiles that record the dependency graph:
`package-lock.json` v2 / v3, `pnpm-lock.yaml`, `packages.lock.json`, `Gemfile.lock`, `Cargo.lock`, `uv.lock`. The
others (`yarn.lock`, `poetry.lock`, `Pipfile.lock`, `requirements*.txt`, `composer.lock`, `go.sum`, `gradle.lockfile`)
do not say which packages the project uses itself: there it stays unknown. A lockfile covers the libraries of one project only - operating system and server software (PostgreSQL,
OpenSSL ...) still need an SBOM or Dependency-Track.

```powershell
Expand Down
Loading
Loading