@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
|
@@ -27,6 +27,8 @@ import {
|
|
|
27
27
|
setCycloneDxFormat,
|
|
28
28
|
toCycloneDxSpecVersionString,
|
|
29
29
|
} from "../../inventory/bomUtils.js";
|
|
30
|
+
import { CDX20_INTERNAL_SECTIONS_KEY } from "../../inventory/cyclonedx20.js";
|
|
31
|
+
import { markInternalModel } from "../../inventory/cyclonedx20ReadContext.js";
|
|
30
32
|
|
|
31
33
|
const COMPONENT_1_6_ONLY_FIELDS = new Set([
|
|
32
34
|
"authors",
|
|
@@ -115,9 +117,17 @@ function normalizeMetadataForSpecVersion(subject, specVersion) {
|
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
function normalizeBomForSpecVersion(subject, specVersion) {
|
|
120
|
+
if (!subject) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
118
123
|
if (specVersion < 1.7) {
|
|
119
124
|
deleteFields(subject, BOM_1_7_ONLY_FIELDS);
|
|
120
125
|
}
|
|
126
|
+
if (specVersion < 2) {
|
|
127
|
+
// 2.0-only sections ride through the internal model under this key
|
|
128
|
+
// (see lib/inventory/cyclonedx20.js); a 1.x document never serializes it.
|
|
129
|
+
delete subject[CDX20_INTERNAL_SECTIONS_KEY];
|
|
130
|
+
}
|
|
121
131
|
}
|
|
122
132
|
|
|
123
133
|
function normalizeDependencyForSpecVersion(subject, specVersion) {
|
|
@@ -713,6 +723,9 @@ export function applySpecVersionCompatibility(bomJson, options) {
|
|
|
713
723
|
downgradeSubjectForSpecVersion(bomJson, specVersion);
|
|
714
724
|
} else if (isCycloneDx20SpecVersion(specVersion)) {
|
|
715
725
|
upgradeSubjectForSpecVersion(bomJson, specVersion);
|
|
726
|
+
// The result is the 1.x-shaped model labelled 2.0, not a 2.0 document;
|
|
727
|
+
// the mark tells loadBomForAnalysis not to read it as one.
|
|
728
|
+
markInternalModel(bomJson);
|
|
716
729
|
}
|
|
717
730
|
return setCycloneDxFormat(bomJson, normalizedSpecVersion);
|
|
718
731
|
}
|
|
@@ -763,3 +776,66 @@ export function diffRemovedFieldPaths(sourceBomJson, normalizedBomJson) {
|
|
|
763
776
|
.filter((path) => !retainedPaths.has(path))
|
|
764
777
|
.sort();
|
|
765
778
|
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Count the leaf values of a JSON document as `path=value` strings, using
|
|
782
|
+
* the dotted, index-free paths of collectFieldPaths. Array order is ignored,
|
|
783
|
+
* so two documents that differ only in member order give the same counts,
|
|
784
|
+
* but a repeated entry counts once per occurrence. Empty arrays and objects
|
|
785
|
+
* count as leaves.
|
|
786
|
+
*
|
|
787
|
+
* @param {*} subject JSON value
|
|
788
|
+
* @param {string} [prefix] Path so far
|
|
789
|
+
* @param {Map<string, number>} [leaves] Accumulator
|
|
790
|
+
* @returns {Map<string, number>} Occurrences of each `path=value` string
|
|
791
|
+
*/
|
|
792
|
+
export function collectLeafValues(subject, prefix = "", leaves = new Map()) {
|
|
793
|
+
const add = (leaf) => {
|
|
794
|
+
leaves.set(leaf, (leaves.get(leaf) || 0) + 1);
|
|
795
|
+
};
|
|
796
|
+
if (Array.isArray(subject)) {
|
|
797
|
+
if (!subject.length) {
|
|
798
|
+
add(`${prefix}=[]`);
|
|
799
|
+
}
|
|
800
|
+
for (const entry of subject) {
|
|
801
|
+
collectLeafValues(entry, prefix, leaves);
|
|
802
|
+
}
|
|
803
|
+
return leaves;
|
|
804
|
+
}
|
|
805
|
+
if (isObjectRecord(subject)) {
|
|
806
|
+
const entries = Object.entries(subject);
|
|
807
|
+
if (!entries.length) {
|
|
808
|
+
add(`${prefix}={}`);
|
|
809
|
+
}
|
|
810
|
+
for (const [key, value] of entries) {
|
|
811
|
+
collectLeafValues(value, prefix ? `${prefix}.${key}` : key, leaves);
|
|
812
|
+
}
|
|
813
|
+
return leaves;
|
|
814
|
+
}
|
|
815
|
+
if (subject !== undefined) {
|
|
816
|
+
add(`${prefix}=${JSON.stringify(subject)}`);
|
|
817
|
+
}
|
|
818
|
+
return leaves;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Report the leaf values of `sourceBomJson` that `convertedBomJson` lacks,
|
|
823
|
+
* ignoring member order (see collectLeafValues). A value the source holds
|
|
824
|
+
* more often than the output is reported once for every missing occurrence,
|
|
825
|
+
* so dropping one of two identical entries counts.
|
|
826
|
+
*
|
|
827
|
+
* @param {Object} sourceBomJson BOM before conversion
|
|
828
|
+
* @param {Object} convertedBomJson BOM after conversion
|
|
829
|
+
* @returns {string[]} Sorted `path=value` strings missing from the output,
|
|
830
|
+
* repeated per missing occurrence
|
|
831
|
+
*/
|
|
832
|
+
export function diffMissingLeafValues(sourceBomJson, convertedBomJson) {
|
|
833
|
+
const retained = collectLeafValues(convertedBomJson);
|
|
834
|
+
const missing = [];
|
|
835
|
+
for (const [leaf, count] of collectLeafValues(sourceBomJson)) {
|
|
836
|
+
for (let i = retained.get(leaf) || 0; i < count; i++) {
|
|
837
|
+
missing.push(leaf);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return missing.sort();
|
|
841
|
+
}
|
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
} from "../../core/fs.js";
|
|
30
30
|
import { isMac, isWin } from "../../core/paths.js";
|
|
31
31
|
import { isProjectToolingAllowed } from "../../core/projectTooling.js";
|
|
32
|
+
import { recordToolVersion } from "../../core/toolRegistry.js";
|
|
33
|
+
import { collectProjectRubyDeclarations } from "../../ecosystems/rubyutils.js";
|
|
32
34
|
import {
|
|
33
35
|
dosaiDotnetRequirement,
|
|
34
36
|
dosaiDotnetRequirementAdvice,
|
|
@@ -45,6 +47,7 @@ import {
|
|
|
45
47
|
installSdkmanTool,
|
|
46
48
|
isNvmAvailable,
|
|
47
49
|
isRbenvAvailable,
|
|
50
|
+
isRubyVersionActive,
|
|
48
51
|
isSdkmanAvailable,
|
|
49
52
|
isSdkmanToolAvailable,
|
|
50
53
|
performBundleInstall,
|
|
@@ -65,6 +68,7 @@ import {
|
|
|
65
68
|
readSbtBuildPropertiesVersion,
|
|
66
69
|
readToolVersionEnvHint,
|
|
67
70
|
readToolVersionOverride,
|
|
71
|
+
resolveGradleVersionForJava,
|
|
68
72
|
resolvePartialVersion,
|
|
69
73
|
} from "../../inventory/jvmToolEnv.js";
|
|
70
74
|
import { resolvePluginBinary } from "../../inventory/plugins.js";
|
|
@@ -316,6 +320,27 @@ const JVM_TOOL_DEFAULT_PREFIXES = {
|
|
|
316
320
|
maven: "3.9",
|
|
317
321
|
};
|
|
318
322
|
|
|
323
|
+
/**
|
|
324
|
+
* JDK major a versioned java project type names, such as 27 for `java27`.
|
|
325
|
+
*
|
|
326
|
+
* @param {string} projectType Project type
|
|
327
|
+
* @returns {number|undefined} The major, or undefined for any other type
|
|
328
|
+
*/
|
|
329
|
+
export function javaMajorFromProjectType(projectType) {
|
|
330
|
+
if (typeof projectType !== "string" || !projectType.startsWith("java")) {
|
|
331
|
+
return undefined;
|
|
332
|
+
}
|
|
333
|
+
const major = Number.parseInt(projectType.slice(4), 10);
|
|
334
|
+
return Number.isInteger(major) && `java${major}` === projectType
|
|
335
|
+
? major
|
|
336
|
+
: undefined;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/** Command each provisioned sdkman candidate is invoked as. */
|
|
340
|
+
const JVM_TOOL_COMMANDS = {
|
|
341
|
+
maven: "mvn",
|
|
342
|
+
};
|
|
343
|
+
|
|
319
344
|
/** sdkman candidates cdxgen can provision for JVM builds. */
|
|
320
345
|
const JVM_BUILD_TOOLS = ["maven", "gradle", "sbt", "scala"];
|
|
321
346
|
|
|
@@ -400,10 +425,26 @@ export function prepareJvmBuildEnv(filePath, options) {
|
|
|
400
425
|
return;
|
|
401
426
|
}
|
|
402
427
|
// Resolve partial versions (e.g. maven3.9 -> 3.9.16) before touching the JDK
|
|
403
|
-
// so the compatibility matrix sees the real versions.
|
|
428
|
+
// so the compatibility matrix sees the real versions. The Gradle default
|
|
429
|
+
// install is constrained by the JDK the project declared or asked for, so a
|
|
430
|
+
// Java 27 project never gets a Gradle that cannot run on it.
|
|
431
|
+
// A versioned java type counts even without an sdkman alias: java27 has
|
|
432
|
+
// none until the broker serves a Java 27 build, but the project still asked
|
|
433
|
+
// for that JDK.
|
|
434
|
+
const explicitJavaMajor = Math.max(
|
|
435
|
+
0,
|
|
436
|
+
...(options.projectType || []).map((pt) =>
|
|
437
|
+
SDKMAN_JAVA_TOOL_ALIASES[pt]
|
|
438
|
+
? extractJavaMajor(SDKMAN_JAVA_TOOL_ALIASES[pt]) || 0
|
|
439
|
+
: javaMajorFromProjectType(pt) || 0,
|
|
440
|
+
),
|
|
441
|
+
);
|
|
442
|
+
const gradleJavaMajor =
|
|
443
|
+
Math.max(detected.javaVersionHint || 0, explicitJavaMajor || 0) ||
|
|
444
|
+
undefined;
|
|
404
445
|
const resolvedPins = [];
|
|
405
446
|
for (const pin of installPins) {
|
|
406
|
-
const resolved = resolveJvmToolPinVersion(pin);
|
|
447
|
+
const resolved = resolveJvmToolPinVersion(pin, gradleJavaMajor);
|
|
407
448
|
if (resolved) {
|
|
408
449
|
resolvedPins.push(resolved);
|
|
409
450
|
}
|
|
@@ -422,6 +463,11 @@ export function prepareJvmBuildEnv(filePath, options) {
|
|
|
422
463
|
const installed = provisionJvmTool(pin, options);
|
|
423
464
|
if (installed) {
|
|
424
465
|
setJvmToolCommandEnv(pin);
|
|
466
|
+
if (pin.version) {
|
|
467
|
+
// The resolved version is already known, so metadata.tools can carry
|
|
468
|
+
// it without spawning another probe, once the tool runs (issue #598).
|
|
469
|
+
recordToolVersion(JVM_TOOL_COMMANDS[pin.tool] || pin.tool, pin.version);
|
|
470
|
+
}
|
|
425
471
|
if (pin.source === "cli") {
|
|
426
472
|
pinnedToolSelected = true;
|
|
427
473
|
}
|
|
@@ -731,11 +777,14 @@ function recordDetectedJvmPins(installPins, wrapperVersions) {
|
|
|
731
777
|
* and to pick defaults.
|
|
732
778
|
*
|
|
733
779
|
* @param {Object} pin `{ tool, version?, source }`
|
|
780
|
+
* @param {Number|undefined} javaMajor JDK major the project declared or
|
|
781
|
+
* configured, when known. Constrains the default Gradle install so a
|
|
782
|
+
* project on a new JDK never resolves a Gradle that cannot run on it.
|
|
734
783
|
*
|
|
735
784
|
* @returns {Object|undefined} Pin with an exact version, or undefined when no
|
|
736
785
|
* version could be determined.
|
|
737
786
|
*/
|
|
738
|
-
export function resolveJvmToolPinVersion(pin) {
|
|
787
|
+
export function resolveJvmToolPinVersion(pin, javaMajor) {
|
|
739
788
|
if (pin.version && isSdkmanToolAvailable(pin.tool, pin.version)) {
|
|
740
789
|
recordLedgerEvent(LEDGER_EVENT_KINDS.TOOL_RESOLVED, {
|
|
741
790
|
ecosystem: "java",
|
|
@@ -766,20 +815,30 @@ export function resolveJvmToolPinVersion(pin) {
|
|
|
766
815
|
return undefined;
|
|
767
816
|
}
|
|
768
817
|
const prefix = pin.version || JVM_TOOL_DEFAULT_PREFIXES[pin.tool] || "";
|
|
769
|
-
const resolved =
|
|
818
|
+
const resolved =
|
|
819
|
+
pin.tool === "gradle" && !pin.version
|
|
820
|
+
? resolveGradleVersionForJava(versionList, javaMajor)
|
|
821
|
+
: resolvePartialVersion(versionList, prefix);
|
|
770
822
|
if (!resolved) {
|
|
771
823
|
if (pin.version) {
|
|
772
824
|
return pin;
|
|
773
825
|
}
|
|
826
|
+
const gradleMinimum =
|
|
827
|
+
pin.tool === "gradle"
|
|
828
|
+
? minimumGradleVersionForJava(javaMajor)
|
|
829
|
+
: undefined;
|
|
830
|
+
const missingDetail = gradleMinimum
|
|
831
|
+
? `No stable gradle version at or above ${gradleMinimum}, the first that runs on Java ${javaMajor}, is listed by sdkman.`
|
|
832
|
+
: `No stable ${pin.tool} version matched the default prefix '${prefix}'.`;
|
|
774
833
|
recordLedgerEvent(LEDGER_EVENT_KINDS.TOOL_MISSING, {
|
|
775
834
|
ecosystem: "java",
|
|
776
835
|
tool: pin.tool,
|
|
777
|
-
wanted: prefix,
|
|
836
|
+
wanted: gradleMinimum ? `>=${gradleMinimum}` : prefix,
|
|
778
837
|
source: "sdkman",
|
|
779
|
-
detail:
|
|
838
|
+
detail: missingDetail,
|
|
780
839
|
});
|
|
781
840
|
console.log(
|
|
782
|
-
|
|
841
|
+
`${missingDetail} Pass an exact version identifier via -t ${pin.tool}<version>.`,
|
|
783
842
|
);
|
|
784
843
|
return undefined;
|
|
785
844
|
}
|
|
@@ -1582,6 +1641,17 @@ export function prepareSwiftEnv(filePath, options) {
|
|
|
1582
1641
|
* @param {String} filePath Path
|
|
1583
1642
|
* @param {Object} options CLI Options
|
|
1584
1643
|
*/
|
|
1644
|
+
// The order pregen reads the Ruby to install in.
|
|
1645
|
+
const PREGEN_RUBY_SOURCE_ORDER = [
|
|
1646
|
+
".ruby-version",
|
|
1647
|
+
".tool-versions",
|
|
1648
|
+
"mise.toml",
|
|
1649
|
+
".mise.toml",
|
|
1650
|
+
".config/mise.toml",
|
|
1651
|
+
"Gemfile.lock",
|
|
1652
|
+
"Gemfile",
|
|
1653
|
+
];
|
|
1654
|
+
|
|
1585
1655
|
export function prepareRubyEnv(filePath, options) {
|
|
1586
1656
|
// Skip preparation early
|
|
1587
1657
|
if (
|
|
@@ -1627,53 +1697,39 @@ export function prepareRubyEnv(filePath, options) {
|
|
|
1627
1697
|
readEnvironmentVariable("GEM_HOME") ||
|
|
1628
1698
|
safeMkdtempSync(join(getTmpDir(), "cdxgen-gem-home-"));
|
|
1629
1699
|
process.env.CDXGEN_GEM_HOME = cdxgenGemHome;
|
|
1630
|
-
//
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1700
|
+
// The Ruby to install is the one developers select: .ruby-version, then the
|
|
1701
|
+
// asdf and mise pins, then the Ruby the lockfile was resolved with, then the
|
|
1702
|
+
// Gemfile directive. Only an exact MRI version can be installed with rbenv.
|
|
1703
|
+
const declarations = collectProjectRubyDeclarations(filePath);
|
|
1704
|
+
for (const declaration of declarations) {
|
|
1705
|
+
recordLedgerEvent(LEDGER_EVENT_KINDS.TOOL_EXPECTED, {
|
|
1706
|
+
ecosystem: "ruby",
|
|
1707
|
+
tool: declaration.engine === "ruby" ? "ruby" : declaration.engine,
|
|
1708
|
+
wanted: declaration.version || declaration.requirement,
|
|
1709
|
+
source: declaration.source,
|
|
1710
|
+
path: declaration.path,
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
const installable = PREGEN_RUBY_SOURCE_ORDER.map((source) =>
|
|
1714
|
+
declarations.find(
|
|
1715
|
+
(declaration) => declaration.source === source && declaration.version,
|
|
1716
|
+
),
|
|
1717
|
+
).find(Boolean);
|
|
1718
|
+
if (installable && installable.engine !== "ruby") {
|
|
1719
|
+
console.log(
|
|
1720
|
+
`This project selects ${installable.engine} ${installable.version} (${installable.source}). cdxgen installs only MRI Ruby with rbenv; build the project with ${installable.engine} first and then invoke cdxgen with the arguments "--lifecycle pre-build".`,
|
|
1721
|
+
);
|
|
1722
|
+
} else if (installable?.prerelease) {
|
|
1723
|
+
console.log(
|
|
1724
|
+
`This project was locked with a pre-release of Ruby ${installable.version}, whose tag the lockfile does not record. Install it before invoking cdxgen.`,
|
|
1725
|
+
);
|
|
1726
|
+
} else if (installable) {
|
|
1727
|
+
rubyVersionNeeded = installable.version;
|
|
1728
|
+
}
|
|
1729
|
+
if (safeExistsSync(join(filePath, "Gemfile.lock"))) {
|
|
1648
1730
|
const gemlockData = readFileSync(join(filePath, "Gemfile.lock"), {
|
|
1649
1731
|
encoding: "utf-8",
|
|
1650
1732
|
});
|
|
1651
|
-
let rubyVersionMarker = false;
|
|
1652
|
-
for (let l of gemlockData.split("\n")) {
|
|
1653
|
-
l = l.replaceAll("\r", "").trim();
|
|
1654
|
-
if (l.includes("RUBY VERSION")) {
|
|
1655
|
-
rubyVersionMarker = true;
|
|
1656
|
-
}
|
|
1657
|
-
if (rubyVersionMarker && l.includes("ruby ")) {
|
|
1658
|
-
const possibleVersion = l
|
|
1659
|
-
.split("ruby ")
|
|
1660
|
-
.pop()
|
|
1661
|
-
.split("p")[0]
|
|
1662
|
-
.split("d")[0];
|
|
1663
|
-
if (/^\d+/.test(possibleVersion)) {
|
|
1664
|
-
rubyVersionNeeded = possibleVersion;
|
|
1665
|
-
break;
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
if (rubyVersionNeeded) {
|
|
1670
|
-
recordLedgerEvent(LEDGER_EVENT_KINDS.TOOL_EXPECTED, {
|
|
1671
|
-
ecosystem: "ruby",
|
|
1672
|
-
tool: "ruby",
|
|
1673
|
-
wanted: rubyVersionNeeded,
|
|
1674
|
-
source: "Gemfile.lock",
|
|
1675
|
-
});
|
|
1676
|
-
}
|
|
1677
1733
|
const bundlerVersion = parseGemfileLockBundlerVersion(gemlockData);
|
|
1678
1734
|
if (bundlerVersion) {
|
|
1679
1735
|
recordLedgerEvent(LEDGER_EVENT_KINDS.TOOL_EXPECTED, {
|
|
@@ -1683,7 +1739,8 @@ export function prepareRubyEnv(filePath, options) {
|
|
|
1683
1739
|
source: "Gemfile.lock",
|
|
1684
1740
|
});
|
|
1685
1741
|
}
|
|
1686
|
-
}
|
|
1742
|
+
}
|
|
1743
|
+
if (!installable) {
|
|
1687
1744
|
// Is the user invoking with a ruby with custom version type. Eg: -t ruby2.5.4
|
|
1688
1745
|
let projectTypes = options.projectType;
|
|
1689
1746
|
if (
|
|
@@ -1716,13 +1773,13 @@ export function prepareRubyEnv(filePath, options) {
|
|
|
1716
1773
|
const existingRuby = collectRubyInfo(filePath);
|
|
1717
1774
|
if (
|
|
1718
1775
|
rubyVersionNeeded &&
|
|
1719
|
-
existingRuby
|
|
1776
|
+
isRubyVersionActive(existingRuby, rubyVersionNeeded)
|
|
1720
1777
|
) {
|
|
1721
1778
|
recordLedgerEvent(LEDGER_EVENT_KINDS.TOOL_RESOLVED, {
|
|
1722
1779
|
ecosystem: "ruby",
|
|
1723
1780
|
tool: "ruby",
|
|
1724
1781
|
wanted: rubyVersionNeeded,
|
|
1725
|
-
found: existingRuby.version,
|
|
1782
|
+
found: existingRuby.description || existingRuby.version,
|
|
1726
1783
|
source: "env",
|
|
1727
1784
|
detail: `The active interpreter is the required Ruby ${rubyVersionNeeded}.`,
|
|
1728
1785
|
});
|
|
@@ -1754,15 +1811,15 @@ export function prepareRubyEnv(filePath, options) {
|
|
|
1754
1811
|
});
|
|
1755
1812
|
} else if (
|
|
1756
1813
|
rubyVersionNeeded &&
|
|
1757
|
-
!existingRuby
|
|
1814
|
+
!isRubyVersionActive(existingRuby, rubyVersionNeeded)
|
|
1758
1815
|
) {
|
|
1759
1816
|
recordLedgerEvent(LEDGER_EVENT_KINDS.TOOL_MISMATCH, {
|
|
1760
1817
|
ecosystem: "ruby",
|
|
1761
1818
|
tool: "ruby",
|
|
1762
1819
|
wanted: rubyVersionNeeded,
|
|
1763
|
-
found: existingRuby.version,
|
|
1820
|
+
found: existingRuby.description || existingRuby.version,
|
|
1764
1821
|
source: "env",
|
|
1765
|
-
detail: `Ruby ${rubyVersionNeeded} is required and the active interpreter reports ${existingRuby.version}.`,
|
|
1822
|
+
detail: `Ruby ${rubyVersionNeeded} is required and the active interpreter reports ${existingRuby.description || existingRuby.version}.`,
|
|
1766
1823
|
});
|
|
1767
1824
|
}
|
|
1768
1825
|
if (rubyVersionNeeded && !rbenvPresent) {
|
|
@@ -55,11 +55,18 @@ const compileSchemaValidator = (specVersion) => {
|
|
|
55
55
|
const ajv = new Ajv2020(AJV_OPTIONS);
|
|
56
56
|
useLinearUniqueItems(ajv);
|
|
57
57
|
addCycloneDxFormats(ajv);
|
|
58
|
+
// The 2.0 draft pins its own cryptography definitions; the 1.7 schema
|
|
59
|
+
// keeps reading data/cryptography-defs.schema.json below.
|
|
58
60
|
addDraft2020BundledSchema(
|
|
59
61
|
ajv,
|
|
60
|
-
readJsonSchema("cryptography-defs.schema.json"),
|
|
62
|
+
readJsonSchema("cyclonedx-2.0-cryptography-defs.schema.json"),
|
|
61
63
|
"https://cyclonedx.org/schema/cryptography-defs.schema.json",
|
|
62
64
|
);
|
|
65
|
+
addDraft2020BundledSchema(
|
|
66
|
+
ajv,
|
|
67
|
+
readJsonSchema("behavior-taxonomy.schema.json"),
|
|
68
|
+
"https://cyclonedx.org/schema/behavior-taxonomy.schema.json",
|
|
69
|
+
);
|
|
63
70
|
addDraft2020BundledSchema(
|
|
64
71
|
ajv,
|
|
65
72
|
readJsonSchema("jsf-0.82.schema.json"),
|
|
@@ -263,10 +270,12 @@ const getSpdxExportSchemaValidator = () => {
|
|
|
263
270
|
* Validate the generated bom using jsonschema
|
|
264
271
|
*
|
|
265
272
|
* @param {object} bomJson content
|
|
273
|
+
* @param {object} [options] Validation options
|
|
274
|
+
* @param {boolean} [options.deep] Run the deep validators after the schema check. Defaults to true.
|
|
266
275
|
*
|
|
267
276
|
* @returns {Promise<Boolean>} true if the BOM is valid. false otherwise.
|
|
268
277
|
*/
|
|
269
|
-
export const validateBom = async (bomJson) => {
|
|
278
|
+
export const validateBom = async (bomJson, options = {}) => {
|
|
270
279
|
if (!bomJson) {
|
|
271
280
|
return true;
|
|
272
281
|
}
|
|
@@ -292,6 +301,9 @@ export const validateBom = async (bomJson) => {
|
|
|
292
301
|
console.log(validate.errors);
|
|
293
302
|
return false;
|
|
294
303
|
}
|
|
304
|
+
if (options.deep === false) {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
295
307
|
// Deep validation tests
|
|
296
308
|
return (
|
|
297
309
|
validateMetadata(bomJson) &&
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Orchestrates evaluation of internal compliance rule packs (SCVS + CRA)
|
|
3
|
-
* aggregates results into per-benchmark scorecards.
|
|
2
|
+
* Orchestrates evaluation of internal compliance rule packs (SCVS + CRA + CISA)
|
|
3
|
+
* and aggregates results into per-benchmark scorecards.
|
|
4
4
|
*
|
|
5
5
|
* This module is deliberately independent of the CycloneDX BOM audit engine
|
|
6
6
|
* (lib/stages/postgen/auditBom.js). The two engines share similar *Finding*
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
getAllComplianceRules,
|
|
12
|
+
getCisaAiRules,
|
|
13
|
+
getCisaRules,
|
|
12
14
|
getCraRules,
|
|
13
15
|
getScvsRules,
|
|
14
16
|
} from "./complianceRules.js";
|
|
@@ -63,6 +65,25 @@ const BENCHMARKS = {
|
|
|
63
65
|
filter: (rules) => rules.filter((r) => r.standard === "CRA"),
|
|
64
66
|
levelPredicate: () => true,
|
|
65
67
|
},
|
|
68
|
+
cisa: {
|
|
69
|
+
id: "cisa",
|
|
70
|
+
name: "CISA 2026 minimum elements for an SBOM",
|
|
71
|
+
standard: "CISA",
|
|
72
|
+
// The AI element rules share the CISA standard key but form their own
|
|
73
|
+
// benchmark, so both filters select by category.
|
|
74
|
+
filter: (rules) =>
|
|
75
|
+
rules.filter(
|
|
76
|
+
(r) => r.standard === "CISA" && r.category === "compliance-cisa",
|
|
77
|
+
),
|
|
78
|
+
levelPredicate: () => true,
|
|
79
|
+
},
|
|
80
|
+
"cisa-ai": {
|
|
81
|
+
id: "cisa-ai",
|
|
82
|
+
name: "CISA and G7 minimum elements for an AI SBOM",
|
|
83
|
+
standard: "CISA",
|
|
84
|
+
filter: (rules) => rules.filter((r) => r.category === "compliance-cisa-ai"),
|
|
85
|
+
levelPredicate: () => true,
|
|
86
|
+
},
|
|
66
87
|
};
|
|
67
88
|
|
|
68
89
|
/**
|
|
@@ -238,4 +259,10 @@ export function buildBenchmarkReports(findings, requestedAliases) {
|
|
|
238
259
|
return aliases.map((b) => scoreBenchmark(b, findings));
|
|
239
260
|
}
|
|
240
261
|
|
|
241
|
-
export {
|
|
262
|
+
export {
|
|
263
|
+
getAllComplianceRules,
|
|
264
|
+
getCisaAiRules,
|
|
265
|
+
getCisaRules,
|
|
266
|
+
getCraRules,
|
|
267
|
+
getScvsRules,
|
|
268
|
+
};
|