@annexseal/core 1.0.0 → 1.1.0

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.
Files changed (48) hide show
  1. package/dist/cra/classifier.d.ts +8 -0
  2. package/dist/cra/classifier.d.ts.map +1 -0
  3. package/dist/cra/classifier.js +135 -0
  4. package/dist/cra/classifier.js.map +1 -0
  5. package/dist/diff/diff.d.ts +3 -0
  6. package/dist/diff/diff.d.ts.map +1 -0
  7. package/dist/diff/diff.js +151 -0
  8. package/dist/diff/diff.js.map +1 -0
  9. package/dist/index.d.ts +7 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +7 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/merge/merge.d.ts +8 -0
  14. package/dist/merge/merge.d.ts.map +1 -0
  15. package/dist/merge/merge.js +168 -0
  16. package/dist/merge/merge.js.map +1 -0
  17. package/dist/parsers/cyclonedx-xml.d.ts +3 -0
  18. package/dist/parsers/cyclonedx-xml.d.ts.map +1 -0
  19. package/dist/parsers/cyclonedx-xml.js +231 -0
  20. package/dist/parsers/cyclonedx-xml.js.map +1 -0
  21. package/dist/parsers/detect.d.ts.map +1 -1
  22. package/dist/parsers/detect.js +16 -4
  23. package/dist/parsers/detect.js.map +1 -1
  24. package/dist/parsers/lockfiles.d.ts.map +1 -1
  25. package/dist/parsers/lockfiles.js +236 -7
  26. package/dist/parsers/lockfiles.js.map +1 -1
  27. package/dist/parsers/spdx-tv.d.ts +7 -0
  28. package/dist/parsers/spdx-tv.d.ts.map +1 -0
  29. package/dist/parsers/spdx-tv.js +196 -0
  30. package/dist/parsers/spdx-tv.js.map +1 -0
  31. package/dist/types.d.ts +100 -3
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/validator/license-policy.d.ts +5 -0
  34. package/dist/validator/license-policy.d.ts.map +1 -0
  35. package/dist/validator/license-policy.js +95 -0
  36. package/dist/validator/license-policy.js.map +1 -0
  37. package/dist/validator/validate.d.ts.map +1 -1
  38. package/dist/validator/validate.js +78 -23
  39. package/dist/validator/validate.js.map +1 -1
  40. package/dist/vex/cisa-kev-catalog.d.ts +7 -0
  41. package/dist/vex/cisa-kev-catalog.d.ts.map +1 -0
  42. package/dist/vex/cisa-kev-catalog.js +7 -0
  43. package/dist/vex/cisa-kev-catalog.js.map +1 -0
  44. package/dist/vex/vex-engine.d.ts +2 -0
  45. package/dist/vex/vex-engine.d.ts.map +1 -1
  46. package/dist/vex/vex-engine.js +99 -3
  47. package/dist/vex/vex-engine.js.map +1 -1
  48. package/package.json +2 -1
@@ -0,0 +1,8 @@
1
+ import type { CraClassificationResult, CraProductCategoryDef } from '../types.js';
2
+ /**
3
+ * Complete statutory EU Cyber Resilience Act (Regulation (EU) 2024/2847)
4
+ * Annex III (Important Class I & II) & Annex IV (Critical) Product Risk Catalog.
5
+ */
6
+ export declare const CRA_PRODUCT_CATEGORIES: readonly CraProductCategoryDef[];
7
+ export declare function classifyCraProduct(categoryId: string): CraClassificationResult;
8
+ //# sourceMappingURL=classifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classifier.d.ts","sourceRoot":"","sources":["../../src/cra/classifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,qBAAqB,EAyGlE,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,uBAAuB,CA+B9E"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Complete statutory EU Cyber Resilience Act (Regulation (EU) 2024/2847)
3
+ * Annex III (Important Class I & II) & Annex IV (Critical) Product Risk Catalog.
4
+ */
5
+ export const CRA_PRODUCT_CATEGORIES = [
6
+ {
7
+ id: 'default-software-hardware',
8
+ annex: 'default',
9
+ productCategory: 'default',
10
+ title: 'Default Product with Digital Elements (Not Listed in Annex III or IV)',
11
+ examples: 'Standard B2B SaaS clients, mobile apps, consumer smart sensors, desktop utilities, non-security embedded devices (~90% of products)',
12
+ conformityModules: 'Module A (Internal Control — Manufacturer Self-Assessment)',
13
+ notifiedBodyRequired: 'no',
14
+ summary: 'Eligible for self-assessment (Module A) with full Annex I essential cybersecurity requirements, BSI TR-03183-2 SBOM, Annex VII technical documentation, and 24h/72h/14d ENISA SRP vulnerability reporting.',
15
+ },
16
+ {
17
+ id: 'annex-iii-c1-iam',
18
+ annex: 'annex-iii-class-i',
19
+ productCategory: 'important-class-i',
20
+ title: 'Class I — Identity Management Systems & Privileged Access Management (IAM / PAM)',
21
+ examples: 'SSO/OIDC identity providers, PAM vaults, authentication & access control software/hardware, biometric readers',
22
+ conformityModules: 'Module A (if harmonised standards applied in full) OR Module B+C / Module H (Notified Body)',
23
+ notifiedBodyRequired: 'conditional',
24
+ summary: 'Important Product Class I (Annex III). Self-assessment is permitted ONLY when applicable EU harmonised standards or common specifications are fully applied; otherwise a Notified Body assessment is required.',
25
+ },
26
+ {
27
+ id: 'annex-iii-c1-browsers-pw',
28
+ annex: 'annex-iii-class-i',
29
+ productCategory: 'important-class-i',
30
+ title: 'Class I — Standalone & Embedded Browsers, Password Managers',
31
+ examples: 'Web browsers, embedded Chromium/WebKit runtimes, enterprise password managers',
32
+ conformityModules: 'Module A (with harmonised standards) OR Module B+C / Module H',
33
+ notifiedBodyRequired: 'conditional',
34
+ summary: 'Important Product Class I under Annex III requiring harmonised standards for self-assessment.',
35
+ },
36
+ {
37
+ id: 'annex-iii-c1-antivirus-siem',
38
+ annex: 'annex-iii-class-i',
39
+ productCategory: 'important-class-i',
40
+ title: 'Class I — Antivirus / EDR, SIEM, Network Management & VPN Software',
41
+ examples: 'Endpoint detection, malware scanners, SIEM log platforms, VPN clients/gateways, boot managers, PKI / CA software',
42
+ conformityModules: 'Module A (with harmonised standards) OR Module B+C / Module H',
43
+ notifiedBodyRequired: 'conditional',
44
+ summary: 'Security-critical Class I software under Annex III.',
45
+ },
46
+ {
47
+ id: 'annex-iii-c1-routers-os',
48
+ annex: 'annex-iii-class-i',
49
+ productCategory: 'important-class-i',
50
+ title: 'Class I — Operating Systems, Routers, Modems & Network Switches',
51
+ examples: 'Embedded Linux/RTOS distributions, consumer/SOHO routers, switches, cellular/fiber modems, microcontrollers with security features',
52
+ conformityModules: 'Module A (with harmonised standards) OR Module B+C / Module H',
53
+ notifiedBodyRequired: 'conditional',
54
+ summary: 'Core networking & OS infrastructure listed under CRA Annex III Class I.',
55
+ },
56
+ {
57
+ id: 'annex-iii-c1-iot-industrial',
58
+ annex: 'annex-iii-class-i',
59
+ productCategory: 'important-class-i',
60
+ title: 'Class I — Smart Home Security, Wearables & Industrial Automation / PLC Controllers',
61
+ examples: 'Smart locks, security cameras, baby monitors, connected health wearables, industrial controllers not in Class II',
62
+ conformityModules: 'Module A (with harmonised standards) OR Module B+C / Module H',
63
+ notifiedBodyRequired: 'conditional',
64
+ summary: 'Connected physical/industrial controllers classified as Important Class I under Annex III.',
65
+ },
66
+ {
67
+ id: 'annex-iii-c2-hypervisors',
68
+ annex: 'annex-iii-class-ii',
69
+ productCategory: 'important-class-ii',
70
+ title: 'Class II — Hypervisors & Container Runtime Systems',
71
+ examples: 'Type-1/Type-2 hypervisors, containerd/CRI-O runtimes, hardware virtualization engines',
72
+ conformityModules: 'Mandatory Third-Party Assessment: Module B+C (EU-Type Exam) OR Module H (Full QA) OR EUCC Certification',
73
+ notifiedBodyRequired: 'yes',
74
+ summary: 'Important Product Class II (Annex III). Manufacturer self-assessment (Module A) is NOT permitted — mandatory third-party Notified Body conformity assessment or European Cybersecurity Certification Scheme is required.',
75
+ },
76
+ {
77
+ id: 'annex-iii-c2-firewalls-ids',
78
+ annex: 'annex-iii-class-ii',
79
+ productCategory: 'important-class-ii',
80
+ title: 'Class II — Firewalls, Intrusion Detection & Prevention Systems (IDS / IPS)',
81
+ examples: 'Next-gen enterprise firewalls, OT/ICS network intrusion prevention appliances, WAF hardware/software',
82
+ conformityModules: 'Mandatory Third-Party Assessment: Module B+C OR Module H OR EUCC',
83
+ notifiedBodyRequired: 'yes',
84
+ summary: 'Mandatory third-party conformity assessment under CRA Art. 32(3).',
85
+ },
86
+ {
87
+ id: 'annex-iii-c2-tamper-mcu',
88
+ annex: 'annex-iii-class-ii',
89
+ productCategory: 'important-class-ii',
90
+ title: 'Class II — Tamper-Resistant Microprocessors & Microcontrollers',
91
+ examples: 'Secure elements, hardware-isolated cryptographic MCUs, TPM modules',
92
+ conformityModules: 'Mandatory Third-Party Assessment: Module B+C OR Module H OR EUCC',
93
+ notifiedBodyRequired: 'yes',
94
+ summary: 'Tamper-resistant silicon classified as Annex III Class II requiring Notified Body review.',
95
+ },
96
+ {
97
+ id: 'annex-iv-hsm-smartcards',
98
+ annex: 'annex-iv-critical',
99
+ productCategory: 'critical',
100
+ title: 'Critical (Annex IV) — Hardware Security Modules (HSMs), Smartcards & Secure Gateways',
101
+ examples: 'Hardware devices with security boxes (HSMs), smart meter gateways, smartcards / eIDAS secure signature creation devices',
102
+ conformityModules: 'European Cybersecurity Certification Scheme (EUCC / CSA — Substantial or High Assurance Level)',
103
+ notifiedBodyRequired: 'yes',
104
+ summary: 'Critical Product with Digital Elements (Annex IV). Subject to mandatory European Cybersecurity Certification under the EU Cybersecurity Act (or Class II third-party conformity where delegated act is pending).',
105
+ },
106
+ ];
107
+ export function classifyCraProduct(categoryId) {
108
+ const selected = CRA_PRODUCT_CATEGORIES.find((c) => c.id === categoryId) ?? CRA_PRODUCT_CATEGORIES[0];
109
+ const notifiedBodyGuidance = selected.notifiedBodyRequired === 'no'
110
+ ? 'Not required — Manufacturer Self-Assessment (Module A) is sufficient.'
111
+ : selected.notifiedBodyRequired === 'conditional'
112
+ ? 'Avoidable if you apply EU harmonised standards in full; otherwise Notified Body (Module B+C or H) is required.'
113
+ : 'MANDATORY — Third-party Notified Body conformity assessment (Module B+C / H) or EUCC certification is legally required before CE marking.';
114
+ return {
115
+ selected,
116
+ productCategory: selected.productCategory,
117
+ notifiedBodyGuidance,
118
+ minimumSupportMonths: 60,
119
+ mandatoryDeadlines: {
120
+ enisaArt14Reporting: 'September 11, 2026 (ALREADY IN FORCE — 24h / 72h / 14d ENISA SRP)',
121
+ fullCeMarkAndAnnexVii: 'December 11, 2027 (Full CE Mark, SBOM & 10-Year Annex VII Archive)',
122
+ },
123
+ requiredArtifacts: [
124
+ 'Machine-readable SBOM (CycloneDX 1.6+ or SPDX 3.0.1+ per BSI TR-03183-2 v2.1.0)',
125
+ 'Vulnerability Handling & Coordinated Vulnerability Disclosure (CVD) Policy',
126
+ 'Cybersecurity Risk Assessment mapped to CRA Annex I Part I',
127
+ 'Minimum 5-Year (60-Month) Support Period Rationale (Art. 13(8))',
128
+ 'EU Declaration of Conformity (Annex V) + 10-Year Ed25519-Signed Annex VII Technical File',
129
+ ...(selected.notifiedBodyRequired !== 'no'
130
+ ? ['Harmonised Standards Compliance Matrix or Notified Body EU-Type Examination Certificate']
131
+ : []),
132
+ ],
133
+ };
134
+ }
135
+ //# sourceMappingURL=classifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classifier.js","sourceRoot":"","sources":["../../src/cra/classifier.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACtE;QACE,EAAE,EAAE,2BAA2B;QAC/B,KAAK,EAAE,SAAS;QAChB,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,uEAAuE;QAC9E,QAAQ,EAAE,qIAAqI;QAC/I,iBAAiB,EAAE,4DAA4D;QAC/E,oBAAoB,EAAE,IAAI;QAC1B,OAAO,EACL,4MAA4M;KAC/M;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,mBAAmB;QAC1B,eAAe,EAAE,mBAAmB;QACpC,KAAK,EAAE,kFAAkF;QACzF,QAAQ,EAAE,+GAA+G;QACzH,iBAAiB,EAAE,6FAA6F;QAChH,oBAAoB,EAAE,aAAa;QACnC,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EAAE;YACjB,iFAAiF;YACjF,4EAA4E;YAC5E,4DAA4D;YAC5D,iEAAiE;YACjE,0FAA0F;YAC1F,GAAG,CAAC,QAAQ,CAAC,oBAAoB,KAAK,IAAI;gBACxC,CAAC,CAAC,CAAC,yFAAyF,CAAC;gBAC7F,CAAC,CAAC,EAAE,CAAC;SACR;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CanonicalSbom, SbomDiffResult } from '../types.js';
2
+ export declare function diffSboms(before: CanonicalSbom, after: CanonicalSbom, beforeLabel?: string, afterLabel?: string): SbomDiffResult;
3
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/diff/diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEb,cAAc,EAEf,MAAM,aAAa,CAAC;AAmBrB,wBAAgB,SAAS,CACvB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,aAAa,EACpB,WAAW,SAAqG,EAChH,UAAU,SAAmG,GAC5G,cAAc,CAyJhB"}
@@ -0,0 +1,151 @@
1
+ import { classifyLicenseExpression, isCopyleftEscalation } from '../validator/license-policy.js';
2
+ import { validateSbom } from '../validator/validate.js';
3
+ import { compareVersions } from '../vex/kev-index.js';
4
+ function componentIdentityKey(comp) {
5
+ if (comp.purl) {
6
+ // Strip @version and qualifiers so version bumps match the same package
7
+ return comp.purl.split('@')[0].split('?')[0].toLowerCase();
8
+ }
9
+ const groupPrefix = comp.group ? `${comp.group.toLowerCase()}/` : '';
10
+ return `${groupPrefix}${comp.name.toLowerCase()}`;
11
+ }
12
+ function componentNameKey(comp) {
13
+ const groupPrefix = comp.group ? `${comp.group.toLowerCase()}/` : '';
14
+ return `${groupPrefix}${comp.name.toLowerCase()}`;
15
+ }
16
+ export function diffSboms(before, after, beforeLabel = before.rootComponent ? `${before.rootComponent.name}@${before.rootComponent.version}` : 'baseline', afterLabel = after.rootComponent ? `${after.rootComponent.name}@${after.rootComponent.version}` : 'candidate') {
17
+ const beforeReport = validateSbom(before);
18
+ const afterReport = validateSbom(after);
19
+ const beforeMap = new Map();
20
+ const beforeByName = new Map();
21
+ for (const c of before.components) {
22
+ const k = componentIdentityKey(c);
23
+ beforeMap.set(k, c);
24
+ beforeByName.set(componentNameKey(c), { key: k, comp: c });
25
+ }
26
+ const matchedBeforeKeys = new Set();
27
+ const added = [];
28
+ const removed = [];
29
+ const versionChanges = [];
30
+ const licenseChanges = [];
31
+ let unchangedCount = 0;
32
+ const afterEntries = new Map();
33
+ for (const c of after.components)
34
+ afterEntries.set(componentIdentityKey(c), c);
35
+ for (const [key, afterComp] of afterEntries.entries()) {
36
+ let beforeComp = beforeMap.get(key);
37
+ let matchedKey = key;
38
+ if (!beforeComp) {
39
+ const byName = beforeByName.get(componentNameKey(afterComp));
40
+ if (byName && !matchedBeforeKeys.has(byName.key)) {
41
+ beforeComp = byName.comp;
42
+ matchedKey = byName.key;
43
+ }
44
+ }
45
+ if (!beforeComp) {
46
+ added.push(afterComp);
47
+ continue;
48
+ }
49
+ matchedBeforeKeys.add(matchedKey);
50
+ if (beforeComp.version !== afterComp.version) {
51
+ const cmp = compareVersions(beforeComp.version, afterComp.version);
52
+ versionChanges.push({
53
+ name: afterComp.name || key,
54
+ key,
55
+ beforeVersion: beforeComp.version || 'unknown',
56
+ afterVersion: afterComp.version || 'unknown',
57
+ direction: cmp < 0 ? 'upgraded' : cmp > 0 ? 'downgraded' : 'changed',
58
+ });
59
+ }
60
+ else {
61
+ unchangedCount++;
62
+ }
63
+ const beforeLicKey = [...beforeComp.licenses].sort().join(' | ');
64
+ const afterLicKey = [...afterComp.licenses].sort().join(' | ');
65
+ if (beforeLicKey !== afterLicKey) {
66
+ const beforeRisk = classifyLicenseExpression(beforeComp.licenses);
67
+ const afterRisk = classifyLicenseExpression(afterComp.licenses);
68
+ licenseChanges.push({
69
+ name: afterComp.name || key,
70
+ key,
71
+ beforeLicenses: beforeComp.licenses.length > 0 ? beforeComp.licenses : ['NOASSERTION'],
72
+ afterLicenses: afterComp.licenses.length > 0 ? afterComp.licenses : ['NOASSERTION'],
73
+ beforeRisk,
74
+ afterRisk,
75
+ copyleftEscalation: isCopyleftEscalation(beforeRisk, afterRisk),
76
+ });
77
+ }
78
+ }
79
+ for (const [key, beforeComp] of beforeMap.entries()) {
80
+ if (!matchedBeforeKeys.has(key)) {
81
+ removed.push(beforeComp);
82
+ }
83
+ }
84
+ const beforeKevSet = new Set(beforeReport.kevMatches.map((m) => `${m.entry.cveId}::${m.componentName.toLowerCase()}`));
85
+ const afterKevSet = new Set(afterReport.kevMatches.map((m) => `${m.entry.cveId}::${m.componentName.toLowerCase()}`));
86
+ const newKevs = afterReport.kevMatches.filter((m) => !beforeKevSet.has(`${m.entry.cveId}::${m.componentName.toLowerCase()}`));
87
+ const resolvedKevs = beforeReport.kevMatches.filter((m) => !afterKevSet.has(`${m.entry.cveId}::${m.componentName.toLowerCase()}`));
88
+ const copyleftEscalations = licenseChanges.filter((l) => l.copyleftEscalation);
89
+ const scoreDelta = afterReport.score - beforeReport.score;
90
+ const mdLines = [
91
+ `## AnnexSeal SBOM Release Diff: \`${beforeLabel}\` → \`${afterLabel}\``,
92
+ '',
93
+ `- **BSI v2.1.0 Score:** ${beforeReport.score}/100 → **${afterReport.score}/100** (${scoreDelta >= 0 ? '+' : ''}${scoreDelta} pts)`,
94
+ `- **Components:** +${added.length} added • -${removed.length} removed • ${versionChanges.length} version change(s) • ${unchangedCount} unchanged`,
95
+ `- **Vulnerability Drift:** ${newKevs.length} new KEV/CVE(s) • ${resolvedKevs.length} resolved KEV/CVE(s)`,
96
+ `- **License Drift:** ${licenseChanges.length} change(s) • **${copyleftEscalations.length} copyleft escalation(s)**`,
97
+ '',
98
+ ];
99
+ if (newKevs.length > 0) {
100
+ mdLines.push('### New Vulnerabilities Introduced', '');
101
+ for (const k of newKevs) {
102
+ mdLines.push(`- **${k.entry.cveId}** (CVSS ${k.entry.cvss}) on \`${k.componentName}@${k.componentVersion}\` — ${k.entry.recommendedAction}`);
103
+ }
104
+ mdLines.push('');
105
+ }
106
+ if (copyleftEscalations.length > 0) {
107
+ mdLines.push('### Copyleft License Escalations', '');
108
+ for (const l of copyleftEscalations) {
109
+ mdLines.push(`- **${l.name}**: \`${l.beforeLicenses.join(', ')}\` (${l.beforeRisk}) → \`${l.afterLicenses.join(', ')}\` (**${l.afterRisk}**)`);
110
+ }
111
+ mdLines.push('');
112
+ }
113
+ if (added.length > 0) {
114
+ mdLines.push('### Added Components', '');
115
+ for (const c of added.slice(0, 50)) {
116
+ mdLines.push(`- \`${c.name}@${c.version || 'unknown'}\` (${c.licenses.join(', ') || 'NOASSERTION'})`);
117
+ }
118
+ mdLines.push('');
119
+ }
120
+ if (versionChanges.length > 0) {
121
+ mdLines.push('### Version Changes', '');
122
+ for (const v of versionChanges.slice(0, 50)) {
123
+ mdLines.push(`- **${v.name}**: \`${v.beforeVersion}\` → \`${v.afterVersion}\` (${v.direction})`);
124
+ }
125
+ mdLines.push('');
126
+ }
127
+ if (removed.length > 0) {
128
+ mdLines.push('### Removed Components', '');
129
+ for (const c of removed.slice(0, 50)) {
130
+ mdLines.push(`- \`${c.name}@${c.version || 'unknown'}\``);
131
+ }
132
+ mdLines.push('');
133
+ }
134
+ return {
135
+ beforeLabel,
136
+ afterLabel,
137
+ beforeScore: beforeReport.score,
138
+ afterScore: afterReport.score,
139
+ scoreDelta,
140
+ added,
141
+ removed,
142
+ versionChanges,
143
+ unchangedCount,
144
+ licenseChanges,
145
+ copyleftEscalations,
146
+ newKevs,
147
+ resolvedKevs,
148
+ markdown: mdLines.join('\n'),
149
+ };
150
+ }
151
+ //# sourceMappingURL=diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/diff/diff.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;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from './rules/bsi-tr03183-2.js';
3
3
  export { parseSbomObject, parseSbomString } from './parsers/detect.js';
4
4
  export { parseCycloneDxJson, detectCycloneDxFormat } from './parsers/cyclonedx.js';
5
+ export { parseCycloneDxXml } from './parsers/cyclonedx-xml.js';
5
6
  export { parseSpdx23Json, parseSpdx301JsonLd } from './parsers/spdx.js';
7
+ export { parseSpdxTagValue } from './parsers/spdx-tv.js';
6
8
  export { parseLockfile, detectLockfileType, encodeNpmPurl } from './parsers/lockfiles.js';
7
9
  export { validateSbom, reportToSarif, COMMON_SPDX_LICENSES } from './validator/validate.js';
10
+ export { analyzeLicensePolicy, classifyLicenseExpression, isCopyleftEscalation, } from './validator/license-policy.js';
8
11
  export { healSbom, computeSha512Hex } from './healer/heal.js';
9
12
  export { serializeCycloneDx16, serializeSpdx301, deterministicUuid } from './healer/convert.js';
13
+ export { diffSboms } from './diff/diff.js';
14
+ export { mergeSboms } from './merge/merge.js';
15
+ export { CRA_PRODUCT_CATEGORIES, classifyCraProduct } from './cra/classifier.js';
10
16
  export { BUILTIN_KEV_FEED_VERSION, BUILTIN_KEV_INDEX, compareVersions, satisfiesRange, } from './vex/kev-index.js';
11
- export { scanOfflineKev, generateOpenVex, generateCsaf20Vex, type OpenVexDocument, } from './vex/vex-engine.js';
17
+ export { CISA_KEV_CATALOG_VERSION, CISA_KEV_CATALOG_DATE, CISA_KEV_TOTAL_COUNT, scanOfflineKev, generateOpenVex, generateCsaf20Vex, type OpenVexDocument, } from './vex/vex-engine.js';
12
18
  export { createZipArchive, readZipArchive, crc32 } from './packager/zip.js';
13
19
  export { createAnnexViiBundle, verifyAnnexViiBundle } from './packager/annex-vii.js';
14
20
  export { generateEnisaSrpDossier, ENISA_SRP_PORTAL_URL } from './packager/enisa-srp.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,UAAU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AAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EACL,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -2,13 +2,19 @@ export * from './types.js';
2
2
  export { BSI_CRA_RULES, RULE_BY_ID } from './rules/bsi-tr03183-2.js';
3
3
  export { parseSbomObject, parseSbomString } from './parsers/detect.js';
4
4
  export { parseCycloneDxJson, detectCycloneDxFormat } from './parsers/cyclonedx.js';
5
+ export { parseCycloneDxXml } from './parsers/cyclonedx-xml.js';
5
6
  export { parseSpdx23Json, parseSpdx301JsonLd } from './parsers/spdx.js';
7
+ export { parseSpdxTagValue } from './parsers/spdx-tv.js';
6
8
  export { parseLockfile, detectLockfileType, encodeNpmPurl } from './parsers/lockfiles.js';
7
9
  export { validateSbom, reportToSarif, COMMON_SPDX_LICENSES } from './validator/validate.js';
10
+ export { analyzeLicensePolicy, classifyLicenseExpression, isCopyleftEscalation, } from './validator/license-policy.js';
8
11
  export { healSbom, computeSha512Hex } from './healer/heal.js';
9
12
  export { serializeCycloneDx16, serializeSpdx301, deterministicUuid } from './healer/convert.js';
13
+ export { diffSboms } from './diff/diff.js';
14
+ export { mergeSboms } from './merge/merge.js';
15
+ export { CRA_PRODUCT_CATEGORIES, classifyCraProduct } from './cra/classifier.js';
10
16
  export { BUILTIN_KEV_FEED_VERSION, BUILTIN_KEV_INDEX, compareVersions, satisfiesRange, } from './vex/kev-index.js';
11
- export { scanOfflineKev, generateOpenVex, generateCsaf20Vex, } from './vex/vex-engine.js';
17
+ export { CISA_KEV_CATALOG_VERSION, CISA_KEV_CATALOG_DATE, CISA_KEV_TOTAL_COUNT, scanOfflineKev, generateOpenVex, generateCsaf20Vex, } from './vex/vex-engine.js';
12
18
  export { createZipArchive, readZipArchive, crc32 } from './packager/zip.js';
13
19
  export { createAnnexViiBundle, verifyAnnexViiBundle } from './packager/annex-vii.js';
14
20
  export { generateEnisaSrpDossier, ENISA_SRP_PORTAL_URL } from './packager/enisa-srp.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mB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AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EACL,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { CanonicalSbom, SbomMergeOptions, SbomMergeResult } from '../types.js';
2
+ /**
3
+ * Deterministically merges 2..N heterogeneous SBOMs (e.g., firmware + backend + mobile)
4
+ * into a single commercial-product CycloneDX 1.6 or SPDX 3.0.1 SBOM with full
5
+ * PURL deduplication, hash preservation, and rewritten dependency graphs.
6
+ */
7
+ export declare function mergeSboms(inputs: readonly CanonicalSbom[], options: SbomMergeOptions): SbomMergeResult;
8
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/merge/merge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,aAAa,EACb,gBAAgB,EAChB,eAAe,EAChB,MAAM,aAAa,CAAC;AA4CrB;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,OAAO,EAAE,gBAAgB,GACxB,eAAe,CAkIjB"}
@@ -0,0 +1,168 @@
1
+ import { deterministicUuid, serializeCycloneDx16, serializeSpdx301 } from '../healer/convert.js';
2
+ import { validateSbom } from '../validator/validate.js';
3
+ function dedupeKey(comp) {
4
+ if (comp.purl)
5
+ return comp.purl.toLowerCase();
6
+ return `${(comp.group ?? '').toLowerCase()}|${comp.name.toLowerCase()}|${comp.version.toLowerCase()}`;
7
+ }
8
+ function mergeTwoComponents(base, incoming) {
9
+ const hashes = [...base.hashes];
10
+ for (const h of incoming.hashes) {
11
+ if (!hashes.some((x) => x.alg.toUpperCase() === h.alg.toUpperCase() && x.content === h.content)) {
12
+ hashes.push(h);
13
+ }
14
+ }
15
+ const licenses = [...new Set([...base.licenses, ...incoming.licenses].filter((l) => l !== 'NOASSERTION'))];
16
+ if (licenses.length === 0 && (base.licenses.includes('NOASSERTION') || incoming.licenses.includes('NOASSERTION'))) {
17
+ licenses.push('NOASSERTION');
18
+ }
19
+ const externalReferences = [...base.externalReferences];
20
+ for (const r of incoming.externalReferences) {
21
+ if (!externalReferences.some((x) => x.type === r.type && x.url === r.url)) {
22
+ externalReferences.push(r);
23
+ }
24
+ }
25
+ const properties = [...base.properties];
26
+ for (const p of incoming.properties) {
27
+ if (!properties.some((x) => x.name === p.name)) {
28
+ properties.push(p);
29
+ }
30
+ }
31
+ return {
32
+ ...base,
33
+ ...(base.purl || incoming.purl ? { purl: base.purl ?? incoming.purl } : {}),
34
+ ...(base.cpe || incoming.cpe ? { cpe: base.cpe ?? incoming.cpe } : {}),
35
+ ...(base.supplier || incoming.supplier ? { supplier: base.supplier ?? incoming.supplier } : {}),
36
+ hashes,
37
+ licenses,
38
+ externalReferences,
39
+ properties,
40
+ };
41
+ }
42
+ /**
43
+ * Deterministically merges 2..N heterogeneous SBOMs (e.g., firmware + backend + mobile)
44
+ * into a single commercial-product CycloneDX 1.6 or SPDX 3.0.1 SBOM with full
45
+ * PURL deduplication, hash preservation, and rewritten dependency graphs.
46
+ */
47
+ export function mergeSboms(inputs, options) {
48
+ if (inputs.length === 0) {
49
+ throw new Error('At least one SBOM is required for merging.');
50
+ }
51
+ const targetFormat = options.targetFormat ?? 'cyclonedx-1.6';
52
+ const nowIso = new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
53
+ const rootRef = `pkg:generic/${encodeURIComponent(options.productName)}@${encodeURIComponent(options.productVersion)}`;
54
+ const creator = {
55
+ name: options.supplierName ?? inputs.find((s) => s.creator?.name)?.creator?.name ?? 'Manufacturer',
56
+ email: options.supplierEmail ?? inputs.find((s) => s.creator?.email)?.creator?.email ?? 'security@example.eu',
57
+ url: options.supplierUrl ?? inputs.find((s) => s.creator?.url)?.creator?.url ?? 'https://example.eu',
58
+ };
59
+ const rootComponent = {
60
+ bomRef: rootRef,
61
+ type: 'application',
62
+ name: options.productName,
63
+ version: options.productVersion,
64
+ purl: rootRef,
65
+ supplier: creator,
66
+ licenses: ['NOASSERTION'],
67
+ hashes: [],
68
+ externalReferences: [{ type: 'security-contact', url: `mailto:${creator.email}` }],
69
+ properties: [],
70
+ };
71
+ const mergedByKey = new Map();
72
+ const depEdges = new Map();
73
+ const rootDirectDeps = new Set();
74
+ let totalInputComponents = 0;
75
+ let duplicatesMerged = 0;
76
+ inputs.forEach((sbom, sbomIdx) => {
77
+ const localRefRemap = new Map();
78
+ // Include each sub-SBOM's root component as a sub-component of the unified product
79
+ if (sbom.rootComponent && sbom.rootComponent.name) {
80
+ const subRoot = {
81
+ ...structuredClone(sbom.rootComponent),
82
+ bomRef: `sub-${sbomIdx + 1}-${sbom.rootComponent.bomRef}`,
83
+ };
84
+ const k = dedupeKey(subRoot);
85
+ const existing = mergedByKey.get(k);
86
+ if (existing) {
87
+ mergedByKey.set(k, mergeTwoComponents(existing, subRoot));
88
+ localRefRemap.set(sbom.rootComponent.bomRef, existing.bomRef);
89
+ rootDirectDeps.add(existing.bomRef);
90
+ duplicatesMerged++;
91
+ }
92
+ else {
93
+ mergedByKey.set(k, subRoot);
94
+ localRefRemap.set(sbom.rootComponent.bomRef, subRoot.bomRef);
95
+ rootDirectDeps.add(subRoot.bomRef);
96
+ }
97
+ totalInputComponents++;
98
+ }
99
+ for (const rawComp of sbom.components) {
100
+ totalInputComponents++;
101
+ const comp = structuredClone(rawComp);
102
+ const k = dedupeKey(comp);
103
+ const existing = mergedByKey.get(k);
104
+ if (existing) {
105
+ mergedByKey.set(k, mergeTwoComponents(existing, comp));
106
+ localRefRemap.set(rawComp.bomRef, existing.bomRef);
107
+ duplicatesMerged++;
108
+ }
109
+ else {
110
+ // Guarantee globally unique bom-ref across inputs
111
+ const existingRefs = new Set([...mergedByKey.values()].map((c) => c.bomRef));
112
+ if (existingRefs.has(comp.bomRef) || comp.bomRef === rootRef) {
113
+ comp.bomRef = `sbom${sbomIdx + 1}-${comp.bomRef}`;
114
+ }
115
+ mergedByKey.set(k, comp);
116
+ localRefRemap.set(rawComp.bomRef, comp.bomRef);
117
+ if (!sbom.rootComponent) {
118
+ rootDirectDeps.add(comp.bomRef);
119
+ }
120
+ }
121
+ }
122
+ for (const dep of sbom.dependencies) {
123
+ const mappedFrom = localRefRemap.get(dep.ref);
124
+ if (!mappedFrom)
125
+ continue;
126
+ const set = depEdges.get(mappedFrom) ?? new Set();
127
+ for (const t of dep.dependsOn) {
128
+ const mappedTo = localRefRemap.get(t);
129
+ if (mappedTo && mappedTo !== mappedFrom)
130
+ set.add(mappedTo);
131
+ }
132
+ depEdges.set(mappedFrom, set);
133
+ }
134
+ });
135
+ const mergedComponents = [...mergedByKey.values()];
136
+ const dependencies = [
137
+ { ref: rootRef, dependsOn: [...rootDirectDeps] },
138
+ ...[...depEdges.entries()].map(([ref, set]) => ({ ref, dependsOn: [...set] })),
139
+ ];
140
+ const mergedCanonical = {
141
+ sourceFormat: targetFormat,
142
+ specVersion: targetFormat === 'cyclonedx-1.6' ? '1.6' : '3.0.1',
143
+ serialNumber: `urn:uuid:${deterministicUuid(`merge:${options.productName}:${options.productVersion}:${mergedComponents.length}`)}`,
144
+ version: 1,
145
+ timestamp: nowIso,
146
+ creator,
147
+ tools: [{ vendor: 'AnnexSeal', name: 'AnnexSeal Merger', version: '1.1.0' }],
148
+ rootComponent,
149
+ components: mergedComponents,
150
+ dependencies,
151
+ securityContact: `mailto:${creator.email}`,
152
+ supportPeriodEnd: `${new Date().getUTCFullYear() + 5}-${nowIso.slice(5, 10)}`,
153
+ };
154
+ const serialized = targetFormat === 'cyclonedx-1.6'
155
+ ? serializeCycloneDx16(mergedCanonical)
156
+ : serializeSpdx301(mergedCanonical);
157
+ return {
158
+ mergedCanonical,
159
+ mergedJson: JSON.stringify(serialized, null, 2),
160
+ targetFormat,
161
+ inputCount: inputs.length,
162
+ totalInputComponents,
163
+ deduplicatedComponents: mergedComponents.length,
164
+ duplicatesMerged,
165
+ report: validateSbom(mergedCanonical),
166
+ };
167
+ }
168
+ //# sourceMappingURL=merge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/merge/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQjG,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,SAAS,SAAS,CAAC,IAAwB;IACzC,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,OAAO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Y,KAAK,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;QAC/D,YAAY,EAAE,YAAY,iBAAiB,CAAC,SAAS,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,cAAc,IAAI,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE;QAClI,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,MAAM;QACjB,OAAO;QACP,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAC5E,aAAa;QACb,UAAU,EAAE,gBAAgB;QAC5B,YAAY;QACZ,eAAe,EAAE,UAAU,OAAO,CAAC,KAAK,EAAE;QAC1C,gBAAgB,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;KAC9E,CAAC;IAEF,MAAM,UAAU,GACd,YAAY,KAAK,eAAe;QAC9B,CAAC,CAAC,oBAAoB,CAAC,eAAe,CAAC;QACvC,CAAC,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAExC,OAAO;QACL,eAAe;QACf,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,YAAY;QACZ,UAAU,EAAE,MAAM,CAAC,MAAM;QACzB,oBAAoB;QACpB,sBAAsB,EAAE,gBAAgB,CAAC,MAAM;QAC/C,gBAAgB;QAChB,MAAM,EAAE,YAAY,CAAC,eAAe,CAAC;KACtC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CanonicalSbom } from '../types.js';
2
+ export declare function parseCycloneDxXml(xml: string): CanonicalSbom;
3
+ //# sourceMappingURL=cyclonedx-xml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx-xml.d.ts","sourceRoot":"","sources":["../../src/parsers/cyclonedx-xml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,aAAa,EAMd,MAAM,aAAa,CAAC;AA6JrB,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CA4F5D"}