You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+87-19Lines changed: 87 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,12 @@
3
3
> SBOM diff with supply-chain risk signals — flags **new CVEs**, **typosquats**, **multi-major version jumps**, and **young maintainers** on added or upgraded dependencies, surfaced as a GitHub PR comment.
The most actionable supply-chain question on a pull request is:
@@ -46,23 +50,29 @@ jobs:
46
50
with:
47
51
before-sbom: before.json
48
52
after-sbom: after.json
53
+
fail-on: critical-cve # optional: exit 2 on HIGH/CRITICAL advisories
49
54
```
50
55
56
+
The `@v1` mutable tag tracks the latest v0.x release; pin to a specific version (`@v0.3.0`) if you prefer reproducible builds. See the [Action reference](https://metbcy.github.io/bomdrift/github-action.html) for every input.
57
+
51
58
### As a binary (local / CI)
52
59
53
-
Download a signed release archive for your platform from the [Releases page](https://github.com/Metbcy/bomdrift/releases/latest) and verify it with cosign — see [Release signing](#release-signing) below.
60
+
Download a signed release archive for your platform from the [Releases page](https://github.com/Metbcy/bomdrift/releases/latest) and verify it with cosign — see [Release signing](#release-signing) below. Pre-built binaries cover **Linux x86_64 + aarch64**, **macOS aarch64**, and **Windows x86_64**.
# Refresh the bundled popular-package lists (used by the typosquat enricher)
98
+
bomdrift refresh-typosquat # all ecosystems
99
+
bomdrift refresh-typosquat --ecosystem pypi # one specific list
82
100
```
83
101
84
-
`bomdrift diff` exits 0 on success regardless of findings. It emits Markdown by default when stdout is piped/redirected (the PR-comment path), and ANSI-colored terminal output when stdout is a TTY. `--output markdown|json|terminal` overrides detection.
102
+
`bomdrift diff`exits 0 on success regardless of findings unless `--fail-on` is set — then it exits 2 when the threshold trips. Stdout is Markdown by default when piped/redirected (the PR-comment path) and ANSI-colored when stdout is a TTY. `--output markdown|json|terminal|sarif` overrides detection.
103
+
104
+
See the [`examples/`](./examples/) directory for end-to-end scenarios (axios incident, multi-ecosystem typosquats, version jumps, baseline suppression).
105
+
106
+
## Example output
107
+
108
+
Running `bomdrift diff` against the bundled axios-incident fixture pair (`tests/fixtures/cdx-minimal.json` → `tests/fixtures/cdx-after.json`) produces:
109
+
110
+
```markdown
111
+
## SBOM diff
112
+
113
+
| Change | Count |
114
+
|---|---:|
115
+
| Added | 1 |
116
+
| Removed | 1 |
117
+
| Version changed | 1 |
118
+
| License changed | 0 |
119
+
| Possible typosquats | 1 |
120
+
121
+
### Added
122
+
| Ecosystem | Name | Version |
123
+
|---|---|---|
124
+
| npm | plain-crypto-js | 4.2.1 |
125
+
126
+
### Version changed
127
+
| Ecosystem | Name | Before | After |
128
+
|---|---|---|---|
129
+
| npm | axios | 1.14.0 | 1.14.1 |
130
+
131
+
### Possible typosquats
132
+
| Ecosystem | Name | Version | Similar to | Similarity |
With network access, the **Vulnerabilities** section additionally lists each advisory ID (CVE / GHSA / MAL) per affected component, alongside its OSV.dev-sourced severity.
85
138
86
139
## Features
87
140
88
141
- Diff **CycloneDX 1.5/1.6**, **SPDX 2.3**, and **Syft** JSON SBOMs against each other (any combination), via a unified component model.
89
-
- For added & upgraded packages, enrich with **OSV.dev CVE data** through the `/v1/querybatch` endpoint.
90
-
- Flag possible **typosquats** via Jaro-Winkler similarity to top-1000 npm packages, with a suffix-containment boost rule that catches the `plain-crypto-js` → `crypto-js` pattern that pure JW alone misses.
142
+
- For added & upgraded packages, enrich with **OSV.dev CVE data** through `/v1/querybatch`, then a per-advisory `/v1/vulns/{id}` follow-up to populate **severity** (Critical / High / Medium / Low).
143
+
- 24h on-disk **OSV severity cache** (`<XDG_CACHE_HOME>/bomdrift/osv/`) so reruns within a working day don't re-fetch — opt out with `--no-osv-cache`.
144
+
- Flag possible **typosquats** across **npm**, **PyPI**, **Cargo**, and **Maven** via Jaro-Winkler similarity (Levenshtein for Maven artifactIds), with a suffix-containment boost rule that catches the `plain-crypto-js` → `crypto-js` pattern that pure JW alone misses. Refreshable from each ecosystem's canonical upstream via `bomdrift refresh-typosquat`.
91
145
- Flag deps whose **top GitHub maintainer joined the project recently** (the xz-style takeover signal). Honors `GITHUB_TOKEN`, rate-limit-aware, skipped when the repo has > 50 contributors.
92
146
- Flag **multi-major version jumps** (≥ 2 majors) in a single diff — often correlates with takeover swaps and namespace reuse.
- Ships as a single Rust binary **and** a composite GitHub Action — no Docker.
95
-
- Releases are signed with [cosign keyless](https://docs.sigstore.dev/) — eat-your-own-supply-chain-dogfood.
147
+
- **Output formats**: terminal (colored, TTY-aware), Markdown (PR comment), **JSON**, and **SARIF v2.1.0** for GitHub Code Scanning ingestion.
148
+
- **`--fail-on`** thresholds (`cve` / `critical-cve` / `typosquat` / `any`) exit code 2 on trip while still emitting the comment body, so the PR comment posts even when the workflow step fails.
149
+
- **`--baseline <path.json>`** suppresses findings already captured in a previously stored `bomdrift diff --output json` snapshot — adopt bomdrift on a project with pre-existing findings without drowning the first PR.
150
+
- **`--summary-only`** + automatic comment-size fallback (default 60 KB) keeps big SBOM diffs under GitHub's 65,536-char comment-body cap.
151
+
- Ships as a **single Rust binary** (~3.4 MB, stripped + LTO) **and** a composite GitHub Action — no Docker.
152
+
- Releases are **cosign-signed** keyless via Sigstore + GitHub OIDC — eat-your-own-supply-chain-dogfood.
96
153
97
154
## Release signing
98
155
99
156
Every release archive is signed with cosign keyless via Sigstore (GitHub OIDC).
100
157
101
158
```bash
159
+
# Replace VERSION + TARGET with your downloaded archive's pair
The Action verifies signatures automatically when cosign is available on the runner.
172
+
The Action verifies signatures automatically by default. Set `verify-signatures: false` on trusted mirrors to skip the cosign install step (~15s saved per run).
173
+
174
+
## Documentation
175
+
176
+
- **[Docs site (mdBook)](https://metbcy.github.io/bomdrift/)** — full reference: CLI flags, every action input, output-format anatomy, per-enricher deep dives, architecture notes, roadmap.
177
+
- **[`examples/`](./examples/)** — runnable scenarios with synthetic SBOM pairs.
178
+
- **[CHANGELOG](./CHANGELOG.md)** — release notes per version, including breaking-change migration notes.
0 commit comments