@cdxgen/cdxgen 13.5.0 → 13.7.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.
- package/README.md +17 -10
- package/bin/audit.js +7 -4
- package/bin/cdxgen.js +260 -37
- package/bin/convert.js +146 -22
- package/bin/evinse.js +28 -3
- package/bin/repl.js +47 -3
- package/bin/sign.js +211 -34
- package/bin/tracebom.js +18 -6
- package/bin/validate.js +24 -3
- package/bin/verify.js +113 -5
- package/data/behavior-taxonomy.schema.json +1491 -0
- package/data/cyclonedx-2.0-bundled.schema.json +18606 -5528
- package/data/cyclonedx-2.0-cryptography-defs.schema.json +857 -0
- package/data/license-aliases.json +24 -2
- package/data/pqc-migration.json +239 -0
- package/data/remediations.json +176 -0
- package/data/rules/ai-bom.yaml +1 -1
- package/data/rules/brotli-decoder.yaml +107 -0
- package/data/rules/cbom-security.yaml +4 -3
- package/data/rules/package-integrity.yaml +28 -0
- package/data/rules/vscode-extensions.yaml +75 -0
- package/data/spdx-license-list.json +121 -7
- package/data/spdx-licenses.json +69 -0
- package/data/spdx.schema.json +845 -2
- package/lib/audit/index.js +25 -3
- package/lib/cli/bomAssembly.js +172 -4
- package/lib/cli/cliOptions.js +121 -17
- package/lib/cli/index.js +720 -902
- package/lib/cli/jsBom.js +156 -64
- package/lib/cli/jvmBom.js +602 -86
- package/lib/cli/managedBom.js +161 -19
- package/lib/cli/nativeBom.js +52 -5
- package/lib/core/boundedFile.js +344 -0
- package/lib/core/brotliProbe.js +182 -0
- package/lib/core/env.js +34 -0
- package/lib/core/fs.js +138 -3
- package/lib/core/globPatterns.js +218 -0
- package/lib/core/httpClient.js +98 -1
- package/lib/core/lockPaths.js +38 -0
- package/lib/core/paths.js +24 -1
- package/lib/core/processTree.js +100 -8
- package/lib/core/projectConfig.js +332 -25
- package/lib/core/toolRegistry.js +184 -0
- package/lib/ecosystems/cppEvidence.js +263 -106
- package/lib/ecosystems/cppIncludeResolver.js +16 -5
- package/lib/ecosystems/denoutils.js +2 -2
- package/lib/ecosystems/ecosystems.js +25 -10
- package/lib/ecosystems/gemHostProbe.js +301 -0
- package/lib/ecosystems/golem.js +3 -8
- package/lib/ecosystems/gradleutils.js +1909 -229
- package/lib/ecosystems/jsEvidence.js +90 -38
- package/lib/ecosystems/kosi.js +3 -5
- package/lib/ecosystems/npmVersionResolution.js +376 -0
- package/lib/ecosystems/parsers-bazel.js +107 -6
- package/lib/ecosystems/parsers-js.js +505 -22
- package/lib/ecosystems/parsers-misc.js +209 -20
- package/lib/ecosystems/parsers-python.js +178 -30
- package/lib/ecosystems/parsers-rust.js +117 -15
- package/lib/ecosystems/pythonutils.js +128 -2
- package/lib/ecosystems/remote/huggingface.js +22 -0
- package/lib/ecosystems/rubyutils.js +538 -31
- package/lib/ecosystems/rusi.js +2 -4
- package/lib/ecosystems/scalacliutils.js +2 -0
- package/lib/ecosystems/scalasem.js +798 -152
- package/lib/ecosystems/vendoredCode.js +237 -3
- package/lib/ecosystems/venvProbe.js +360 -0
- package/lib/evinser/evinser.js +536 -71
- package/lib/evinser/scalasem.js +5 -1
- package/lib/helpers/agenticToolutils.js +525 -94
- package/lib/helpers/bomSigner.js +43 -9
- package/lib/helpers/jssSigner.js +1276 -0
- package/lib/helpers/vsixutils.js +1574 -315
- package/lib/inventory/agentBlueprint.js +193 -0
- package/lib/inventory/agentToolNames.js +145 -0
- package/lib/inventory/aiCollector.js +153 -7
- package/lib/inventory/aiInventory.js +44 -8
- package/lib/inventory/aiProviders.js +324 -0
- package/lib/inventory/atomUtils.js +77 -0
- package/lib/inventory/bomUtils.js +8 -1
- package/lib/inventory/brotliDecoder.js +142 -0
- package/lib/inventory/buildToolRateLimit.js +1 -1
- package/lib/inventory/cbomutils.js +56 -7
- package/lib/inventory/ciParsers/githubActionsLock.js +821 -0
- package/lib/inventory/citations.js +31 -2
- package/lib/inventory/communityAiConfigParser.js +978 -80
- package/lib/inventory/cyclonedx20.js +152 -0
- package/lib/inventory/cyclonedx20Common.js +286 -0
- package/lib/inventory/cyclonedx20Derived.js +159 -0
- package/lib/inventory/cyclonedx20Parties.js +552 -0
- package/lib/inventory/cyclonedx20Read.js +768 -0
- package/lib/inventory/cyclonedx20ReadCommon.js +374 -0
- package/lib/inventory/cyclonedx20ReadComponents.js +692 -0
- package/lib/inventory/cyclonedx20ReadContext.js +380 -0
- package/lib/inventory/cyclonedx20ReadEvidence.js +466 -0
- package/lib/inventory/cyclonedx20ReadSections.js +599 -0
- package/lib/inventory/cyclonedx20Render.js +766 -0
- package/lib/inventory/cyclonedx20RenderComponents.js +716 -0
- package/lib/inventory/cyclonedx20RenderDefinitions.js +405 -0
- package/lib/inventory/cyclonedx20RenderEvidence.js +726 -0
- package/lib/inventory/cyclonedx20RenderHardware.js +203 -0
- package/lib/inventory/cyclonedx20RenderPatents.js +174 -0
- package/lib/inventory/cyclonedx20RenderRefIds.js +314 -0
- package/lib/inventory/cyclonedx20RenderSections.js +499 -0
- package/lib/inventory/cyclonedx20Tables.js +594 -0
- package/lib/inventory/deps.js +141 -13
- package/lib/inventory/dosai.js +375 -6
- package/lib/inventory/dosaiParsers.js +3 -6
- package/lib/inventory/dotnetRuntime.js +367 -0
- package/lib/inventory/ecosystemFormulationParsers.js +979 -0
- package/lib/inventory/envcontext.js +436 -48
- package/lib/inventory/evidenceUtils.js +13 -1
- package/lib/inventory/fetchBatch.js +1 -1
- package/lib/inventory/formulationParsers.js +124 -14
- package/lib/inventory/gtfobins.js +13 -0
- package/lib/inventory/hbom.js +45 -6
- package/lib/inventory/hbomLoader.js +166 -0
- package/lib/inventory/hostRuntimeProbe.js +686 -0
- package/lib/inventory/jvmLocalRepos.js +9 -2
- package/lib/inventory/jvmToolEnv.js +29 -0
- package/lib/inventory/licenseEnhancer.js +12 -0
- package/lib/inventory/mavenCentralMirror.js +534 -0
- package/lib/inventory/mcpConfigParser.js +5 -0
- package/lib/inventory/nodeBuildInfo.js +218 -0
- package/lib/inventory/nodeHostProbe.js +202 -0
- package/lib/inventory/occurrenceKey.js +90 -0
- package/lib/inventory/osPackageResolver.js +182 -0
- package/lib/inventory/phpBuildInfo.js +10 -59
- package/lib/inventory/phpHostProbe.js +32 -488
- package/lib/inventory/pqcMigration.js +426 -0
- package/lib/inventory/rubyBuildInfo.js +972 -0
- package/lib/inventory/rubyHostProbe.js +218 -0
- package/lib/inventory/rustFormulationParser.js +21 -10
- package/lib/inventory/scalaCoords.js +4 -3
- package/lib/inventory/scalaDedupe.js +440 -0
- package/lib/inventory/source.js +114 -8
- package/lib/managers/binary.js +337 -3
- package/lib/managers/docker.js +79 -0
- package/lib/parsers/huggingfaceManifest.js +9 -1
- package/lib/parsers/huggingfaceUtils.js +18 -0
- package/lib/parsers/kiroPermissions.js +166 -0
- package/lib/parsers/largeJson.js +28 -11
- package/lib/parsers/vscodeExtensionId.js +183 -0
- package/lib/server/server.js +48 -35
- package/lib/stages/postgen/postgen.js +41 -1
- package/lib/stages/postgen/ruleEngine.js +13 -5
- package/lib/stages/postgen/specVersionCompat.js +76 -0
- package/lib/stages/pregen/envAudit.js +1 -0
- package/lib/stages/pregen/pregen.js +114 -57
- package/lib/validator/bomValidator.js +14 -2
- package/lib/validator/complianceEngine.js +30 -3
- package/lib/validator/complianceRules.js +1416 -4
- package/lib/validator/generated/validate-1.6.mjs +1 -1
- package/lib/validator/generated/validate-1.7.mjs +1 -1
- package/lib/validator/generated/validate-2.0.mjs +57554 -13851
- package/lib/validator/index.js +49 -8
- package/lib/validator/reporters/json.js +6 -0
- package/package.json +11 -10
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts +6 -2
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +29 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +6 -0
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts +3 -18
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +15 -0
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/boundedFile.d.ts +100 -0
- package/types/lib/core/boundedFile.d.ts.map +1 -0
- package/types/lib/core/brotliProbe.d.ts +37 -0
- package/types/lib/core/brotliProbe.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +14 -0
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +4 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/globPatterns.d.ts +70 -0
- package/types/lib/core/globPatterns.d.ts.map +1 -0
- package/types/lib/core/httpClient.d.ts +24 -0
- package/types/lib/core/httpClient.d.ts.map +1 -1
- package/types/lib/core/lockPaths.d.ts +19 -0
- package/types/lib/core/lockPaths.d.ts.map +1 -0
- package/types/lib/core/paths.d.ts +9 -0
- package/types/lib/core/paths.d.ts.map +1 -1
- package/types/lib/core/processTree.d.ts +17 -4
- package/types/lib/core/processTree.d.ts.map +1 -1
- package/types/lib/core/projectConfig.d.ts +47 -8
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/toolRegistry.d.ts +36 -0
- package/types/lib/core/toolRegistry.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +40 -13
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts +2 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gemHostProbe.d.ts +28 -0
- package/types/lib/ecosystems/gemHostProbe.d.ts.map +1 -0
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +294 -20
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +14 -1
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts.map +1 -1
- package/types/lib/ecosystems/npmVersionResolution.d.ts +119 -0
- package/types/lib/ecosystems/npmVersionResolution.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +17 -20
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +19 -0
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts +10 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +19 -1
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts +144 -12
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
- package/types/lib/ecosystems/scalasem.d.ts +58 -16
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
- package/types/lib/ecosystems/vendoredCode.d.ts +26 -0
- package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -1
- package/types/lib/ecosystems/venvProbe.d.ts +40 -0
- package/types/lib/ecosystems/venvProbe.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +120 -13
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/scalasem.d.ts.map +1 -1
- package/types/lib/helpers/agenticToolutils.d.ts +53 -19
- package/types/lib/helpers/agenticToolutils.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +20 -3
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/helpers/jssSigner.d.ts +288 -0
- package/types/lib/helpers/jssSigner.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +303 -19
- package/types/lib/helpers/vsixutils.d.ts.map +1 -1
- package/types/lib/inventory/agentBlueprint.d.ts +70 -0
- package/types/lib/inventory/agentBlueprint.d.ts.map +1 -0
- package/types/lib/inventory/agentToolNames.d.ts +51 -0
- package/types/lib/inventory/agentToolNames.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/aiInventory.d.ts.map +1 -1
- package/types/lib/inventory/aiProviders.d.ts +85 -0
- package/types/lib/inventory/aiProviders.d.ts.map +1 -0
- package/types/lib/inventory/atomUtils.d.ts +19 -0
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/bomUtils.d.ts.map +1 -1
- package/types/lib/inventory/brotliDecoder.d.ts +58 -0
- package/types/lib/inventory/brotliDecoder.d.ts.map +1 -0
- package/types/lib/inventory/cbomutils.d.ts +17 -0
- package/types/lib/inventory/cbomutils.d.ts.map +1 -1
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts +101 -0
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts.map +1 -0
- package/types/lib/inventory/citations.d.ts +5 -0
- package/types/lib/inventory/citations.d.ts.map +1 -1
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/cyclonedx20.d.ts +99 -0
- package/types/lib/inventory/cyclonedx20.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts +102 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts +74 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts +91 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts +51 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts +69 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts +77 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts +118 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts +40 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts +53 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts +73 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts +29 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts +110 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts +42 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts +26 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts +55 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts +134 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts.map +1 -0
- package/types/lib/inventory/deps.d.ts +35 -2
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +36 -1
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dotnetRuntime.d.ts +91 -0
- package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts +73 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts.map +1 -0
- package/types/lib/inventory/envcontext.d.ts +74 -12
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
- package/types/lib/inventory/gtfobins.d.ts.map +1 -1
- package/types/lib/inventory/hbom.d.ts +11 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -1
- package/types/lib/inventory/hbomLoader.d.ts +54 -0
- package/types/lib/inventory/hbomLoader.d.ts.map +1 -1
- package/types/lib/inventory/hostRuntimeProbe.d.ts +44 -0
- package/types/lib/inventory/hostRuntimeProbe.d.ts.map +1 -0
- package/types/lib/inventory/jvmLocalRepos.d.ts +5 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +12 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
- package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -1
- package/types/lib/inventory/mavenCentralMirror.d.ts +170 -0
- package/types/lib/inventory/mavenCentralMirror.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/nodeBuildInfo.d.ts +95 -0
- package/types/lib/inventory/nodeBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/nodeHostProbe.d.ts +15 -0
- package/types/lib/inventory/nodeHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/occurrenceKey.d.ts +52 -0
- package/types/lib/inventory/occurrenceKey.d.ts.map +1 -0
- package/types/lib/inventory/osPackageResolver.d.ts +38 -0
- package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
- package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -1
- package/types/lib/inventory/phpHostProbe.d.ts.map +1 -1
- package/types/lib/inventory/pqcMigration.d.ts +84 -0
- package/types/lib/inventory/pqcMigration.d.ts.map +1 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts +271 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/rubyHostProbe.d.ts +47 -0
- package/types/lib/inventory/rubyHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts +7 -2
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -1
- package/types/lib/inventory/scalaDedupe.d.ts +43 -0
- package/types/lib/inventory/scalaDedupe.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +25 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +12 -0
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts +10 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts +12 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
- package/types/lib/parsers/kiroPermissions.d.ts +62 -0
- package/types/lib/parsers/kiroPermissions.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +4 -3
- package/types/lib/parsers/largeJson.d.ts.map +1 -1
- package/types/lib/parsers/vscodeExtensionId.d.ts +48 -0
- package/types/lib/parsers/vscodeExtensionId.d.ts.map +1 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +7 -0
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts +25 -0
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +12 -8
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts +5 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/complianceEngine.d.ts +4 -4
- package/types/lib/validator/complianceEngine.d.ts.map +1 -1
- package/types/lib/validator/complianceRules.d.ts +14 -2
- package/types/lib/validator/complianceRules.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +10 -0
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-quantum migration risk for cryptographic assets (cdxgen/cdxgen#4592).
|
|
3
|
+
*
|
|
4
|
+
* The facts come from data/pqc-migration.json: the classes of NIST IR 8547
|
|
5
|
+
* (final, October 2026) Tables 2, 4 and 8 and section 4.1.3, plus FIPS 186-5
|
|
6
|
+
* for DSA, each with its members (algorithm families, OIDs and normalised
|
|
7
|
+
* names), the transition the source states and the rationale text. This
|
|
8
|
+
* module classifies a component and builds the risk entry; it adds no fact of
|
|
9
|
+
* its own.
|
|
10
|
+
*
|
|
11
|
+
* Classification of an algorithm asset (cryptoProperties.assetType
|
|
12
|
+
* `algorithm`), first match wins. A hybrid combiner (primitive `combiner`) is
|
|
13
|
+
* not classified: IR 8547 section 3.2.1 approves a composite scheme with one
|
|
14
|
+
* approved input, so the OID of one input does not decide it.
|
|
15
|
+
*
|
|
16
|
+
* 1. `algorithmProperties.algorithmFamily`. A quantum-safe family (SHA-2,
|
|
17
|
+
* SHA-3, AES, ML-KEM, …) is safe, except its 112-bit members (SHA-224,
|
|
18
|
+
* SHA-512/224, SHA3-224), which are recognised by OID or name.
|
|
19
|
+
* 2. `cryptoProperties.oid` (rsaEncryption, id-ecPublicKey, the RSA, ECDSA,
|
|
20
|
+
* EdDSA and DSA signature OIDs, X25519/X448, DH, …).
|
|
21
|
+
* 3. The component name, lower case with only letters and digits kept
|
|
22
|
+
* ("SHA-512/224" is `sha512224`), then resolveAlgorithmFamily(name). A
|
|
23
|
+
* name that resolves to a hash family but names a DSA, RSA or ECDSA
|
|
24
|
+
* signature ("SHA256withDSA", "dsa-with-sha256", "RSA-SHA-512") is that
|
|
25
|
+
* signature algorithm, not its digest.
|
|
26
|
+
*
|
|
27
|
+
* A class whose members have a key family (rsa, ff, ec) is checked against
|
|
28
|
+
* the minimum key size of IR 8547 Tables 2 and 4 (112 bits of classical
|
|
29
|
+
* strength: RSA and finite-field 2048, elliptic curve 224). An algorithm with
|
|
30
|
+
* a known smaller key, and a public or private key asset
|
|
31
|
+
* (`related-crypto-material`) whose size is smaller, is classed
|
|
32
|
+
* `below-minimum-strength` instead. The key size of an algorithm comes from
|
|
33
|
+
* the first of these that gives a plausible key size (at least 512 for rsa
|
|
34
|
+
* and ff, 160 to 571 for ec): a trailing number in its name ("RSA-1024")
|
|
35
|
+
* unless it follows a hash token ("RSASSA-PSS-SHA-512",
|
|
36
|
+
* "sha512WithRSAEncryption-512"), an RFC 7919 group name ("ffdhe2048"), its
|
|
37
|
+
* `parameterSetIdentifier` (a digest size such as "256" on an RSA signature
|
|
38
|
+
* is not a key size) or the bit size in its curve name. A key asset is
|
|
39
|
+
* checked with its own size against the base class of its algorithm, so a
|
|
40
|
+
* 4096-bit key of an algorithm named "RSA-1024" is not reported again.
|
|
41
|
+
*
|
|
42
|
+
* The likelihood and impact levels are the fixed per-class rating the data
|
|
43
|
+
* file records. No confidence is emitted (the rating is not a measurement)
|
|
44
|
+
* and no organisational fact is invented: no owner, status or responses.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
import { readFileSync } from "node:fs";
|
|
48
|
+
import { join } from "node:path";
|
|
49
|
+
|
|
50
|
+
import { dirNameStr } from "../core/paths.js";
|
|
51
|
+
import { resolveAlgorithmFamily } from "./cryptoAlgorithmFamily.js";
|
|
52
|
+
|
|
53
|
+
/** Prefix of every risk refId this module derives. */
|
|
54
|
+
export const PQC_RISK_REF_ID_PREFIX = "risk-pqc-";
|
|
55
|
+
|
|
56
|
+
const pqcData = JSON.parse(
|
|
57
|
+
readFileSync(join(dirNameStr, "data", "pqc-migration.json"), "utf-8"),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const QUANTUM_SAFE_FAMILIES = new Set(pqcData.quantumSafeFamilies);
|
|
61
|
+
const HASH_FAMILIES = new Set(["SHA-1", "SHA-2", "SHA-3"]);
|
|
62
|
+
const NAMED_GROUP_KEY_SIZES = new Map(
|
|
63
|
+
Object.entries(pqcData.namedGroupKeySizes).filter(
|
|
64
|
+
([name]) => !name.startsWith("$"),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
const UNCLASSIFIED_PRIMITIVES = new Set(pqcData.unclassifiedPrimitives);
|
|
68
|
+
const BELOW_MINIMUM_CLASS = "below-minimum-strength";
|
|
69
|
+
const SYMMETRIC_112_CLASS = "symmetric-112-bit";
|
|
70
|
+
const KEY_MATERIAL_TYPES = new Set(["public-key", "private-key", "key"]);
|
|
71
|
+
const PLAUSIBLE_KEY_SIZES = Object.freeze({
|
|
72
|
+
rsa: [512, 65536],
|
|
73
|
+
ff: [512, 65536],
|
|
74
|
+
ec: [160, 571],
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
function buildLookup(member) {
|
|
78
|
+
const lookup = new Map();
|
|
79
|
+
for (const [className, definition] of Object.entries(pqcData.classes)) {
|
|
80
|
+
for (const [key, keyFamily] of Object.entries(definition[member] || {})) {
|
|
81
|
+
lookup.set(key, keyFamily ? { className, keyFamily } : { className });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return lookup;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const BY_FAMILY = buildLookup("families");
|
|
88
|
+
const BY_OID = buildLookup("oids");
|
|
89
|
+
const BY_NAME = buildLookup("names");
|
|
90
|
+
|
|
91
|
+
const isDigits = (text) =>
|
|
92
|
+
typeof text === "string" &&
|
|
93
|
+
text.length > 0 &&
|
|
94
|
+
[...text].every((ch) => ch >= "0" && ch <= "9");
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A name in lower case with only ASCII letters and digits kept, the form the
|
|
98
|
+
* `names` tables of data/pqc-migration.json use.
|
|
99
|
+
*
|
|
100
|
+
* @param {string} name Algorithm or key name
|
|
101
|
+
* @returns {string} The compact name, empty for no name
|
|
102
|
+
*/
|
|
103
|
+
export function compactAlgorithmName(name) {
|
|
104
|
+
let compact = "";
|
|
105
|
+
for (const ch of `${name ?? ""}`.toLowerCase()) {
|
|
106
|
+
if ((ch >= "a" && ch <= "z") || (ch >= "0" && ch <= "9")) {
|
|
107
|
+
compact += ch;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return compact;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Is this name segment a digest name ("SHA", "sha512WithRSAEncryption")? */
|
|
114
|
+
function isHashToken(segment) {
|
|
115
|
+
const compact = compactAlgorithmName(segment);
|
|
116
|
+
return compact.startsWith("sha") || compact === "hash";
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* "RSA-2048" is `{base: "RSA", size: 2048}`; other names have no size. A
|
|
121
|
+
* trailing number after a hash token is a digest size, so
|
|
122
|
+
* "RSASSA-PSS-SHA-512" has no size.
|
|
123
|
+
*/
|
|
124
|
+
function splitNamedKeySize(name) {
|
|
125
|
+
const text = `${name ?? ""}`;
|
|
126
|
+
const index = Math.max(text.lastIndexOf("-"), text.lastIndexOf("_"));
|
|
127
|
+
const tail = index > 0 ? text.slice(index + 1) : "";
|
|
128
|
+
if (!isDigits(tail) || tail.length > 5) {
|
|
129
|
+
return { base: text };
|
|
130
|
+
}
|
|
131
|
+
const head = text.slice(0, index);
|
|
132
|
+
const previous = head.slice(
|
|
133
|
+
Math.max(
|
|
134
|
+
head.lastIndexOf("-"),
|
|
135
|
+
head.lastIndexOf("_"),
|
|
136
|
+
head.lastIndexOf("/"),
|
|
137
|
+
) + 1,
|
|
138
|
+
);
|
|
139
|
+
if (isHashToken(previous)) {
|
|
140
|
+
return { base: text };
|
|
141
|
+
}
|
|
142
|
+
return { base: head, size: Number(tail) };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const SIGNATURE_FAMILY_BY_TOKEN = Object.freeze([
|
|
146
|
+
["ecdsa", "ECDSA"],
|
|
147
|
+
["dsa", "DSA"],
|
|
148
|
+
["rsa", "RSASSA-PKCS1"],
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The signature family of a name that pairs a hash with DSA, RSA or ECDSA:
|
|
153
|
+
* "SHA256withDSA", "dsa-with-sha256", "RSA-SHA-512". ECDSA is checked before
|
|
154
|
+
* DSA, which it contains.
|
|
155
|
+
*/
|
|
156
|
+
function signatureFamilyOfHashName(name) {
|
|
157
|
+
const compact = compactAlgorithmName(name);
|
|
158
|
+
const tokens = `${name ?? ""}`
|
|
159
|
+
.toLowerCase()
|
|
160
|
+
.split(/[-_/ ]/u)
|
|
161
|
+
.filter(Boolean);
|
|
162
|
+
const hasHashToken = tokens.some(isHashToken);
|
|
163
|
+
for (const [token, family] of SIGNATURE_FAMILY_BY_TOKEN) {
|
|
164
|
+
if (
|
|
165
|
+
compact.includes(`with${token}`) ||
|
|
166
|
+
compact.startsWith(`${token}with`) ||
|
|
167
|
+
(hasHashToken && tokens.includes(token))
|
|
168
|
+
) {
|
|
169
|
+
return family;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function lookupCompactName(name) {
|
|
176
|
+
const compact = compactAlgorithmName(name);
|
|
177
|
+
return compact ? BY_NAME.get(compact) : undefined;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function lookupName(name) {
|
|
181
|
+
const { base } = splitNamedKeySize(name);
|
|
182
|
+
const byName = lookupCompactName(name) ?? lookupCompactName(base);
|
|
183
|
+
if (byName) {
|
|
184
|
+
return byName;
|
|
185
|
+
}
|
|
186
|
+
let family = resolveAlgorithmFamily(name) ?? resolveAlgorithmFamily(base);
|
|
187
|
+
if (!family || HASH_FAMILIES.has(family)) {
|
|
188
|
+
family = signatureFamilyOfHashName(name) ?? family;
|
|
189
|
+
}
|
|
190
|
+
return family ? BY_FAMILY.get(family) : undefined;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** The first run of digits in a curve name ("secg/secp192r1" is 192). */
|
|
194
|
+
function curveBits(curve) {
|
|
195
|
+
const text = `${curve ?? ""}`;
|
|
196
|
+
let digits = "";
|
|
197
|
+
for (const ch of text.slice(text.lastIndexOf("/") + 1)) {
|
|
198
|
+
if (ch >= "0" && ch <= "9") {
|
|
199
|
+
digits += ch;
|
|
200
|
+
} else if (digits) {
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return digits && digits.length <= 4 ? Number(digits) : undefined;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function plausibleKeySize(size, keyFamily) {
|
|
208
|
+
const range = PLAUSIBLE_KEY_SIZES[keyFamily];
|
|
209
|
+
return range && size >= range[0] && size <= range[1] ? size : undefined;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** The key size a name states: a trailing number or an RFC 7919 group. */
|
|
213
|
+
function namedKeySize(name) {
|
|
214
|
+
return (
|
|
215
|
+
splitNamedKeySize(name).size ??
|
|
216
|
+
NAMED_GROUP_KEY_SIZES.get(compactAlgorithmName(name))
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function algorithmKeySize(component, keyFamily) {
|
|
221
|
+
const algorithm = component.cryptoProperties?.algorithmProperties || {};
|
|
222
|
+
const parameterSet = `${algorithm.parameterSetIdentifier ?? ""}`;
|
|
223
|
+
const candidates = [
|
|
224
|
+
namedKeySize(component.name),
|
|
225
|
+
isDigits(parameterSet) ? Number(parameterSet) : undefined,
|
|
226
|
+
keyFamily === "ec"
|
|
227
|
+
? curveBits(algorithm.ellipticCurve ?? algorithm.curve)
|
|
228
|
+
: undefined,
|
|
229
|
+
];
|
|
230
|
+
for (const candidate of candidates) {
|
|
231
|
+
const size =
|
|
232
|
+
candidate === undefined
|
|
233
|
+
? undefined
|
|
234
|
+
: plausibleKeySize(candidate, keyFamily);
|
|
235
|
+
if (size !== undefined) {
|
|
236
|
+
return size;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return undefined;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Apply the IR 8547 minimum key size to a key-family classification. */
|
|
243
|
+
function withStrengthCheck(match, keySize) {
|
|
244
|
+
const minimumKeySize = pqcData.minimumKeySizes[match.keyFamily];
|
|
245
|
+
if (keySize !== undefined && minimumKeySize && keySize < minimumKeySize) {
|
|
246
|
+
return {
|
|
247
|
+
className: BELOW_MINIMUM_CLASS,
|
|
248
|
+
keyFamily: match.keyFamily,
|
|
249
|
+
keySize,
|
|
250
|
+
minimumKeySize,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
return { ...match };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The class of an algorithm asset before the minimum key size is applied, or
|
|
258
|
+
* undefined when it is quantum-safe or unclassified.
|
|
259
|
+
*/
|
|
260
|
+
function baseAlgorithmClass(component) {
|
|
261
|
+
const cryptoProperties = component.cryptoProperties;
|
|
262
|
+
const family = cryptoProperties.algorithmProperties?.algorithmFamily;
|
|
263
|
+
if (
|
|
264
|
+
UNCLASSIFIED_PRIMITIVES.has(cryptoProperties.algorithmProperties?.primitive)
|
|
265
|
+
) {
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
if (family && QUANTUM_SAFE_FAMILIES.has(family)) {
|
|
269
|
+
const refined =
|
|
270
|
+
BY_OID.get(cryptoProperties.oid) ?? lookupCompactName(component.name);
|
|
271
|
+
return refined?.className === SYMMETRIC_112_CLASS
|
|
272
|
+
? { ...refined }
|
|
273
|
+
: undefined;
|
|
274
|
+
}
|
|
275
|
+
const match =
|
|
276
|
+
(family && BY_FAMILY.get(family)) ||
|
|
277
|
+
BY_OID.get(cryptoProperties.oid) ||
|
|
278
|
+
lookupName(component.name);
|
|
279
|
+
return match ? { ...match } : undefined;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function classifyAlgorithm(component) {
|
|
283
|
+
const match = baseAlgorithmClass(component);
|
|
284
|
+
if (!match?.keyFamily) {
|
|
285
|
+
return match;
|
|
286
|
+
}
|
|
287
|
+
return withStrengthCheck(match, algorithmKeySize(component, match.keyFamily));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function classifyKey(component, algorithmsByRef) {
|
|
291
|
+
const material = component.cryptoProperties.relatedCryptoMaterialProperties;
|
|
292
|
+
if (!KEY_MATERIAL_TYPES.has(material?.type)) {
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
const algorithm = algorithmsByRef.get(material.algorithmRef);
|
|
296
|
+
const match = algorithm?.cryptoProperties
|
|
297
|
+
? baseAlgorithmClass(algorithm)
|
|
298
|
+
: lookupName(component.name);
|
|
299
|
+
const keySize =
|
|
300
|
+
typeof material.size === "number"
|
|
301
|
+
? material.size
|
|
302
|
+
: namedKeySize(component.name);
|
|
303
|
+
if (!match?.keyFamily || keySize === undefined) {
|
|
304
|
+
return undefined;
|
|
305
|
+
}
|
|
306
|
+
const checked = withStrengthCheck(match, keySize);
|
|
307
|
+
return checked.className === BELOW_MINIMUM_CLASS ? checked : undefined;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Classify one cryptographic-asset component. Algorithm assets get their
|
|
312
|
+
* IR 8547 class; key assets are classified only when their size is below the
|
|
313
|
+
* IR 8547 minimum (the algorithm asset carries the quantum risk).
|
|
314
|
+
*
|
|
315
|
+
* @param {object} component A component with cryptoProperties
|
|
316
|
+
* @param {Map<string, object>} [algorithmsByRef] Components by bom-ref, to
|
|
317
|
+
* resolve a key's `algorithmRef`
|
|
318
|
+
* @returns {{className: string, keyFamily?: string, keySize?: number, minimumKeySize?: number}|undefined}
|
|
319
|
+
* The class, or undefined when the asset is quantum-safe or unclassified
|
|
320
|
+
*/
|
|
321
|
+
export function classifyPqcCryptoAsset(component, algorithmsByRef = new Map()) {
|
|
322
|
+
const assetType = component?.cryptoProperties?.assetType;
|
|
323
|
+
if (assetType === "algorithm") {
|
|
324
|
+
return classifyAlgorithm(component);
|
|
325
|
+
}
|
|
326
|
+
if (assetType === "related-crypto-material") {
|
|
327
|
+
return classifyKey(component, algorithmsByRef);
|
|
328
|
+
}
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function flattenComponents(components, into = []) {
|
|
333
|
+
for (const component of Array.isArray(components) ? components : []) {
|
|
334
|
+
if (component && typeof component === "object") {
|
|
335
|
+
into.push(component);
|
|
336
|
+
flattenComponents(component.components, into);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return into;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Build the risks.risks[] entries for the quantum-vulnerable and weak
|
|
344
|
+
* cryptographic assets of a 1.x-shaped internal BOM: one per asset with a
|
|
345
|
+
* bom-ref (an asset without one could not be referenced from `affects`), in
|
|
346
|
+
* component order, unique by refId.
|
|
347
|
+
*
|
|
348
|
+
* @param {object} internalBom The internal model
|
|
349
|
+
* @returns {object[]} Risk entries shaped for the draft's
|
|
350
|
+
* #/$defs/cyclonedx-risk-2.0/$defs/risk; empty when nothing is at risk
|
|
351
|
+
*/
|
|
352
|
+
export function collectPqcRisks(internalBom) {
|
|
353
|
+
const components = flattenComponents(internalBom?.components);
|
|
354
|
+
const byRef = new Map();
|
|
355
|
+
for (const component of components) {
|
|
356
|
+
if (typeof component["bom-ref"] === "string") {
|
|
357
|
+
byRef.set(component["bom-ref"], component);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
const risks = [];
|
|
361
|
+
const seen = new Set();
|
|
362
|
+
for (const component of components) {
|
|
363
|
+
const bomRef = component["bom-ref"];
|
|
364
|
+
if (typeof bomRef !== "string" || !bomRef.length) {
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
const classification = classifyPqcCryptoAsset(component, byRef);
|
|
368
|
+
const refId = `${PQC_RISK_REF_ID_PREFIX}${bomRef}`;
|
|
369
|
+
if (classification && !seen.has(refId)) {
|
|
370
|
+
seen.add(refId);
|
|
371
|
+
risks.push(buildRiskEntry(component, classification, refId));
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return risks;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const fillTemplate = (template, values) =>
|
|
378
|
+
Object.entries(values).reduce(
|
|
379
|
+
(text, [key, value]) => text.split(`{${key}}`).join(`${value}`),
|
|
380
|
+
template,
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
const PROPERTY_FIELDS = Object.freeze([
|
|
384
|
+
["deprecatedAfter", "cdx:crypto:pqc:deprecatedAfter"],
|
|
385
|
+
["disallowedAfter", "cdx:crypto:pqc:disallowedAfter"],
|
|
386
|
+
["disallowedIn", "cdx:crypto:pqc:disallowedIn"],
|
|
387
|
+
["transition", "cdx:crypto:pqc:transition"],
|
|
388
|
+
["source", "cdx:crypto:pqc:source"],
|
|
389
|
+
]);
|
|
390
|
+
|
|
391
|
+
function buildRiskEntry(component, classification, refId) {
|
|
392
|
+
const definition = pqcData.classes[classification.className];
|
|
393
|
+
const label =
|
|
394
|
+
typeof component.name === "string" && component.name.length
|
|
395
|
+
? component.name
|
|
396
|
+
: component.cryptoProperties?.algorithmProperties?.algorithmFamily ||
|
|
397
|
+
"algorithm";
|
|
398
|
+
const properties = [
|
|
399
|
+
{ name: "cdx:crypto:pqc:class", value: classification.className },
|
|
400
|
+
];
|
|
401
|
+
for (const [field, name] of PROPERTY_FIELDS) {
|
|
402
|
+
if (definition[field]) {
|
|
403
|
+
properties.push({ name, value: definition[field] });
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return {
|
|
407
|
+
refId,
|
|
408
|
+
name: `${definition.riskName}: ${label}`,
|
|
409
|
+
statement: definition.statement,
|
|
410
|
+
domains: [{ type: "security" }],
|
|
411
|
+
affects: [component["bom-ref"]],
|
|
412
|
+
inherentRisk: {
|
|
413
|
+
likelihood: { level: definition.likelihood },
|
|
414
|
+
impacts: [{ level: definition.impact }],
|
|
415
|
+
rationale: fillTemplate(definition.rationale, {
|
|
416
|
+
algorithm: label,
|
|
417
|
+
size: classification.keySize,
|
|
418
|
+
minimum: classification.minimumKeySize,
|
|
419
|
+
}),
|
|
420
|
+
},
|
|
421
|
+
properties,
|
|
422
|
+
externalReferences: [
|
|
423
|
+
{ type: "documentation", url: definition.url || pqcData.source.url },
|
|
424
|
+
],
|
|
425
|
+
};
|
|
426
|
+
}
|