supply-chain-guard 5.2.25 → 5.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/cli.js +1 -1
- package/dist/reporter.js +4 -4
- package/dist/slsa-verifier.d.ts.map +1 -1
- package/dist/slsa-verifier.js +39 -2
- package/dist/slsa-verifier.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -342,6 +342,23 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. The most impactful contri
|
|
|
342
342
|
|
|
343
343
|
## Changelog
|
|
344
344
|
|
|
345
|
+
### v5.2.26 (2026-05-25)
|
|
346
|
+
**SLSA verifier recognises `npm publish --provenance` + OIDC as Level 3**
|
|
347
|
+
|
|
348
|
+
The SLSA verifier's L3 patterns required the literal string `slsa-framework/slsa-github-generator` in a workflow. That predated npm's `--provenance` flag (added in npm 9.5, mandatory under Trusted Publishing since npm 11.5), which produces Sigstore-signed, Rekor-logged provenance bound to the GitHub Actions OIDC identity - cryptographically the same L3 guarantees the slsa-github-generator reusable workflow produces, just specialised for npm artifacts.
|
|
349
|
+
|
|
350
|
+
New L3 detection path in `slsa-verifier.ts`: a workflow corpus containing both
|
|
351
|
+
- `npm publish ... --provenance`, AND
|
|
352
|
+
- `id-token: write` permission
|
|
353
|
+
|
|
354
|
+
is recognised as Level 3. Without `id-token: write` the publish would fail at runtime, so the OIDC permission is required defence-in-depth to ensure the workflow can actually mint provenance, not just that someone typed the flag into a non-functional config.
|
|
355
|
+
|
|
356
|
+
The `SLSA_UNSIGNED_ARTIFACTS` recommendation now describes both L3 paths (npm-native vs. slsa-github-generator) so projects pick the one that fits their ecosystem.
|
|
357
|
+
|
|
358
|
+
4 new tests in `slsa-verifier.test.ts` cover: combined `--provenance` + OIDC returns L3, `--provenance` alone stays at L2, OIDC alone stays at L1, and the two signals split across separate workflow files in the same `.github/workflows/` directory still register as L3.
|
|
359
|
+
|
|
360
|
+
Expected impact on the self-scan: the `SLSA_UNSIGNED_ARTIFACTS` INFO finding drops because our own `ci.yml` already has the L3 npm-native combination since v5.2.20.
|
|
361
|
+
|
|
345
362
|
### v5.2.25 (2026-05-25)
|
|
346
363
|
**Threat-intel update: TrapDoor, Polymarket typosquats, durabletask, Megalodon throwaways**
|
|
347
364
|
|
package/dist/cli.js
CHANGED
|
@@ -20,7 +20,7 @@ const program = new commander_1.Command();
|
|
|
20
20
|
program
|
|
21
21
|
.name("supply-chain-guard")
|
|
22
22
|
.description("Open-source supply-chain security scanner. Detects GlassWorm and similar malware campaigns in npm packages, PyPI packages, code repos, VS Code extensions, and project dependencies.")
|
|
23
|
-
.version("5.2.
|
|
23
|
+
.version("5.2.26");
|
|
24
24
|
// ── scan command ────────────────────────────────────────────────────
|
|
25
25
|
program
|
|
26
26
|
.command("scan")
|
package/dist/reporter.js
CHANGED
|
@@ -55,7 +55,7 @@ function formatJson(report) {
|
|
|
55
55
|
function formatText(report) {
|
|
56
56
|
const lines = [];
|
|
57
57
|
// ── layout constants ───────────────────────────────────────────────────────
|
|
58
|
-
const VERSION = "5.2.
|
|
58
|
+
const VERSION = "5.2.26";
|
|
59
59
|
const W = 76; // visible chars between "│ " and " │" (total line = 80)
|
|
60
60
|
// ── ANSI helpers ───────────────────────────────────────────────────────────
|
|
61
61
|
const stripAnsi = (s) => s.replace(/\x1b\[[0-9;]*m/g, "");
|
|
@@ -462,7 +462,7 @@ function formatSarif(report) {
|
|
|
462
462
|
tool: {
|
|
463
463
|
driver: {
|
|
464
464
|
name: "supply-chain-guard",
|
|
465
|
-
version: "5.2.
|
|
465
|
+
version: "5.2.26",
|
|
466
466
|
informationUri: "https://github.com/homeofe/supply-chain-guard",
|
|
467
467
|
rules,
|
|
468
468
|
},
|
|
@@ -524,7 +524,7 @@ function formatSbom(report) {
|
|
|
524
524
|
timestamp: report.timestamp,
|
|
525
525
|
tools: {
|
|
526
526
|
components: [
|
|
527
|
-
{ type: "application", name: "supply-chain-guard", version: "5.2.
|
|
527
|
+
{ type: "application", name: "supply-chain-guard", version: "5.2.26" },
|
|
528
528
|
],
|
|
529
529
|
},
|
|
530
530
|
component: {
|
|
@@ -676,7 +676,7 @@ footer{text-align:center;padding:24px;color:#94a3b8;font-size:13px}
|
|
|
676
676
|
` : ""}
|
|
677
677
|
|
|
678
678
|
<footer>
|
|
679
|
-
Generated by <a href="https://github.com/homeofe/supply-chain-guard">supply-chain-guard</a> v5.2.
|
|
679
|
+
Generated by <a href="https://github.com/homeofe/supply-chain-guard">supply-chain-guard</a> v5.2.26
|
|
680
680
|
</footer>
|
|
681
681
|
</div>
|
|
682
682
|
<script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slsa-verifier.d.ts","sourceRoot":"","sources":["../src/slsa-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"slsa-verifier.d.ts","sourceRoot":"","sources":["../src/slsa-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA6H1C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAwChD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CA4CjD"}
|
package/dist/slsa-verifier.js
CHANGED
|
@@ -67,6 +67,31 @@ const SLSA_LEVEL3_PATTERNS = [
|
|
|
67
67
|
/slsa-framework\/slsa-github-generator.*@[0-9a-f]{40}/i,
|
|
68
68
|
/uses:\s+slsa-framework\/slsa-github-generator/i,
|
|
69
69
|
];
|
|
70
|
+
/**
|
|
71
|
+
* Modern canonical SLSA Level 3 path for npm packages.
|
|
72
|
+
*
|
|
73
|
+
* `npm publish --provenance` (npm >= 9.5, mandatory under npm Trusted Publishing
|
|
74
|
+
* since 11.5) generates a Sigstore-signed provenance statement using the GitHub
|
|
75
|
+
* Actions OIDC identity, publishes it to the npm registry, and records it in
|
|
76
|
+
* the public Rekor transparency log. The result is cryptographically
|
|
77
|
+
* non-falsifiable provenance bound to the workflow identity and a specific
|
|
78
|
+
* source commit - the same L3 guarantees the slsa-github-generator reusable
|
|
79
|
+
* workflow produces, just specialised for the npm ecosystem.
|
|
80
|
+
*
|
|
81
|
+
* Requires both signals in the same workflow corpus:
|
|
82
|
+
* - `npm publish ... --provenance` flag (the publish step itself)
|
|
83
|
+
* - `id-token: write` permission (OIDC required for Sigstore signing)
|
|
84
|
+
*
|
|
85
|
+
* Without `id-token: write` the publish would fail at runtime, so the check is
|
|
86
|
+
* defence-in-depth: it ensures the workflow could actually mint provenance, not
|
|
87
|
+
* just that someone typed the flag into a non-functional config.
|
|
88
|
+
*
|
|
89
|
+
* v5.2.26: added so projects following the npm-native path (e.g. our own ci.yml)
|
|
90
|
+
* are recognised at the level they actually achieve, instead of being parked at
|
|
91
|
+
* L2 because they don't import the slsa-github-generator reusable workflow.
|
|
92
|
+
*/
|
|
93
|
+
const NPM_PROVENANCE_PATTERN = /npm\s+publish[^\n]*--provenance/i;
|
|
94
|
+
const OIDC_TOKEN_WRITE_PATTERN = /id-token:\s*write/i;
|
|
70
95
|
/** Attestation file names that indicate provenance is present */
|
|
71
96
|
const ATTESTATION_FILES = [
|
|
72
97
|
"provenance.json",
|
|
@@ -166,6 +191,14 @@ function getSLSALevel(dir) {
|
|
|
166
191
|
const attestation = hasAttestationFile(dir);
|
|
167
192
|
if (hasHermeticPattern && (hasHermeticBuild || attestation))
|
|
168
193
|
return 3;
|
|
194
|
+
// Level 3 (npm-native path): `npm publish --provenance` + OIDC permission.
|
|
195
|
+
// Sigstore-signed, Rekor-logged provenance bound to the workflow identity
|
|
196
|
+
// is non-falsifiable and service-generated - the same security substance
|
|
197
|
+
// as the slsa-github-generator path, just specialised for npm artifacts.
|
|
198
|
+
const hasNpmProvenance = NPM_PROVENANCE_PATTERN.test(allWorkflowContent);
|
|
199
|
+
const hasOidcTokenWrite = OIDC_TOKEN_WRITE_PATTERN.test(allWorkflowContent);
|
|
200
|
+
if (hasNpmProvenance && hasOidcTokenWrite)
|
|
201
|
+
return 3;
|
|
169
202
|
// Level 2: signed provenance action or cosign
|
|
170
203
|
const hasLevel2 = SLSA_LEVEL2_PATTERNS.some((p) => p.test(allWorkflowContent));
|
|
171
204
|
if (hasLevel2)
|
|
@@ -204,8 +237,12 @@ function verifySLSA(dir) {
|
|
|
204
237
|
description: "Signed provenance action detected but no hermetic build or attestation file found (SLSA Level 2). " +
|
|
205
238
|
"Build inputs are not fully verified.",
|
|
206
239
|
severity: "info",
|
|
207
|
-
recommendation: "
|
|
208
|
-
"
|
|
240
|
+
recommendation: "Pick the L3 path that fits your ecosystem. " +
|
|
241
|
+
"For npm packages: add `--provenance` to `npm publish` and grant `id-token: write` " +
|
|
242
|
+
"permission in the publish job - npm 9.5+ then produces Sigstore-signed, Rekor-logged " +
|
|
243
|
+
"provenance bound to the workflow identity. " +
|
|
244
|
+
"For other ecosystems: call `slsa-framework/slsa-github-generator` from a reusable " +
|
|
245
|
+
"workflow (`workflow_call`) and attach the `provenance.intoto.jsonl` to each release.",
|
|
209
246
|
});
|
|
210
247
|
}
|
|
211
248
|
// Level 3: no findings — fully compliant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slsa-verifier.js","sourceRoot":"","sources":["../src/slsa-verifier.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"slsa-verifier.js","sourceRoot":"","sources":["../src/slsa-verifier.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsIH,oCAwCC;AAKD,gCA4CC;AA7ND,4CAA8B;AAC9B,gDAAk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+BAA+B;IAC/B,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,MAAM,QAAQ,GAAc,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAEhC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,cAAc;YACpB,WAAW,EACT,+FAA+F;YACjG,QAAQ,EAAE,MAAM;YAChB,cAAc,EACZ,iFAAiF;gBACjF,qEAAqE;SACxE,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EACT,wFAAwF;gBACxF,iDAAiD;YACnD,QAAQ,EAAE,KAAK;YACf,cAAc,EACZ,qFAAqF;gBACrF,qFAAqF;SACxF,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QACvB,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,yBAAyB;YAC/B,WAAW,EACT,oGAAoG;gBACpG,sCAAsC;YACxC,QAAQ,EAAE,MAAM;YAChB,cAAc,EACZ,6CAA6C;gBAC7C,oFAAoF;gBACpF,uFAAuF;gBACvF,6CAA6C;gBAC7C,oFAAoF;gBACpF,sFAAsF;SACzF,CAAC,CAAC;IACL,CAAC;IACD,yCAAyC;IAEzC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supply-chain-guard",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.26",
|
|
4
4
|
"description": "Open-source supply-chain security scanner for npm, PyPI, Cargo, Go, Docker, VS Code extensions, GitHub Actions, IaC and Solana C2. Detects GlassWorm, Shai-Hulud, PPE attacks, dependency confusion and 120+ malware indicators. Generates CycloneDX 1.6 SBOMs and verifies SLSA provenance.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|