@cdxgen/cdxgen 13.3.0 → 13.5.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 +12 -9
- package/bin/cdxgen-secure.js +15 -0
- package/bin/cdxgen.js +115 -31
- package/bin/evinse.js +23 -1
- package/bin/hbom.js +15 -7
- package/bin/repl.js +115 -0
- package/bin/sign.js +45 -15
- package/bin/tracebom.js +5 -1
- package/bin/validate.js +84 -18
- package/bin/verify.js +155 -86
- package/data/cbomosdb-queries.json +13 -1
- package/data/component-tags.json +8 -0
- package/data/helpers/init.gradle +46 -21
- package/data/queries-darwin.json +25 -1
- package/data/queries-win.json +19 -1
- package/data/queries.json +41 -0
- package/data/remediations.json +344 -1
- package/data/rules/cbom-security.yaml +235 -4
- package/data/rules/dependency-sources.yaml +67 -0
- package/data/rules/go-binaries.yaml +46 -0
- package/data/rules/golem-go.yaml +80 -0
- package/data/rules/hbom-compliance.yaml +40 -22
- package/data/rules/hbom-performance.yaml +7 -1
- package/data/rules/host-topology.yaml +1 -1
- package/data/rules/obom-runtime.yaml +31 -2
- package/data/rules/php-runtime.yaml +143 -0
- package/data/rules/scala-evidence.yaml +115 -0
- package/lib/audit/index.js +52 -6
- package/lib/cli/bomAssembly.js +28 -3
- package/lib/cli/cliOptions.js +110 -3
- package/lib/cli/index.js +186 -58
- package/lib/cli/jsBom.js +50 -29
- package/lib/cli/jvmBom.js +779 -146
- package/lib/cli/managedBom.js +1021 -261
- package/lib/cli/nativeBom.js +364 -58
- package/lib/core/activity.js +12 -0
- package/lib/core/env.js +47 -17
- package/lib/core/fs.js +31 -21
- package/lib/core/httpClient.js +233 -69
- package/lib/core/pluginRun.js +184 -0
- package/lib/core/processTree.js +100 -0
- package/lib/core/projectConfig.js +1 -0
- package/lib/core/projectTooling.js +97 -0
- package/lib/core/propertySanitizer.js +72 -0
- package/lib/core/runState.js +39 -0
- package/lib/core/toml.js +72 -0
- package/lib/ecosystems/asarutils.js +4 -2
- package/lib/ecosystems/bunutils.js +5 -7
- package/lib/ecosystems/cargoCache.js +231 -8
- package/lib/ecosystems/cmakeResolver.js +10 -21
- package/lib/ecosystems/cppBuildContext.js +631 -0
- package/lib/ecosystems/cppEvidence.js +337 -22
- package/lib/ecosystems/cppIncludeResolver.js +294 -0
- package/lib/ecosystems/denoutils.js +93 -66
- package/lib/ecosystems/ecosystems.js +1967 -788
- package/lib/ecosystems/golem.js +578 -18
- package/lib/ecosystems/gradleutils.js +340 -46
- package/lib/ecosystems/jsEvidence.js +85 -24
- package/lib/ecosystems/kosi.js +21 -4
- package/lib/ecosystems/npmutils.js +64 -0
- package/lib/ecosystems/parsers-dotnet.js +668 -153
- package/lib/ecosystems/parsers-elm.js +46 -28
- package/lib/ecosystems/parsers-gleam.js +3 -4
- package/lib/ecosystems/parsers-go.js +1283 -297
- package/lib/ecosystems/parsers-js.js +92 -26
- package/lib/ecosystems/parsers-julia.js +2 -3
- package/lib/ecosystems/parsers-jvm.js +463 -29
- package/lib/ecosystems/parsers-misc.js +405 -93
- package/lib/ecosystems/parsers-python.js +152 -20
- package/lib/ecosystems/parsers-rust.js +4 -4
- package/lib/ecosystems/parsers-terraform.js +1573 -19
- package/lib/ecosystems/pythonutils.js +102 -6
- package/lib/ecosystems/remote/huggingface.js +3 -0
- package/lib/ecosystems/rubyutils.js +73 -20
- package/lib/ecosystems/rusi.js +32 -9
- package/lib/ecosystems/sbtutils.js +243 -187
- package/lib/ecosystems/scalacliutils.js +343 -0
- package/lib/ecosystems/scalasem.js +2620 -0
- package/lib/ecosystems/terraformRegistry.js +288 -0
- package/lib/ecosystems/utils.js +2 -0
- package/lib/ecosystems/vendoredCode.js +156 -0
- package/lib/evinser/evinser.js +695 -78
- package/lib/evinser/swiftsem.js +68 -5
- package/lib/helpers/agenticToolutils.js +2 -2
- package/lib/helpers/bomSigner.js +576 -128
- package/lib/inventory/agentSkillSpec.js +17 -0
- package/lib/inventory/aiCollector.js +4 -1
- package/lib/inventory/analyzer.js +110 -127
- package/lib/inventory/apkInstalledDb.js +243 -0
- package/lib/inventory/atomUtils.js +204 -48
- package/lib/inventory/auditCategories.js +10 -3
- package/lib/inventory/buildToolRateLimit.js +144 -0
- package/lib/inventory/cacheCommands.js +2 -1
- package/lib/inventory/cacheDir.js +52 -9
- package/lib/inventory/certificates.js +2371 -0
- package/lib/inventory/cmakeBuildDirs.js +254 -0
- package/lib/inventory/communityAiConfigParser.js +4 -9
- package/lib/inventory/deps.js +507 -128
- package/lib/inventory/display.js +200 -3
- package/lib/inventory/dosai.js +747 -101
- package/lib/inventory/dosaiParsers.js +310 -15
- package/lib/inventory/dynamic.js +96 -8
- package/lib/inventory/envcontext.js +168 -5
- package/lib/inventory/evidenceUtils.js +590 -132
- package/lib/inventory/fetchBatch.js +574 -38
- package/lib/inventory/fetchDiskCache.js +597 -0
- package/lib/inventory/forgeEnricher.js +14 -5
- package/lib/inventory/formulationParsers.js +3 -2
- package/lib/inventory/goBuildInfo.js +140 -0
- package/lib/inventory/hbom.js +67 -7
- package/lib/inventory/hbomAnalysis.js +16 -0
- package/lib/inventory/hostTopology.js +21 -0
- package/lib/inventory/jvmLocalRepos.js +917 -0
- package/lib/inventory/mcpConfigParser.js +2 -3
- package/lib/inventory/osPackagePurl.js +244 -0
- package/lib/inventory/osPackageResolver.js +89 -87
- package/lib/inventory/osinfo.js +79 -31
- package/lib/inventory/osqueryTransform.js +114 -5
- package/lib/inventory/parentSelection.js +146 -0
- package/lib/inventory/phpBuildInfo.js +487 -0
- package/lib/inventory/phpHostProbe.js +641 -0
- package/lib/inventory/rootfsCerts.js +426 -0
- package/lib/inventory/rustFormulationParser.js +3 -4
- package/lib/inventory/scalaCoords.js +153 -0
- package/lib/inventory/source.js +215 -11
- package/lib/inventory/spdx.js +245 -0
- package/lib/inventory/traceRunner.js +93 -8
- package/lib/inventory/tracedCrypto.js +423 -0
- package/lib/managers/binary.js +529 -183
- package/lib/managers/docker.js +199 -44
- package/lib/managers/oci.js +24 -2
- package/lib/parsers/cmakeCache.js +69 -0
- package/lib/parsers/cmakeLists.js +16 -2
- package/lib/parsers/cmakePresets.js +400 -0
- package/lib/parsers/compileCommands.js +557 -0
- package/lib/parsers/email.js +277 -0
- package/lib/parsers/largeJson.js +34 -2
- package/lib/parsers/strictJson.js +322 -0
- package/lib/parsers/terraformConfig.js +1073 -0
- package/lib/parsers/terraformSource.js +652 -0
- package/lib/server/server.js +209 -1
- package/lib/stages/postgen/annotator.js +17 -1
- package/lib/stages/postgen/introspection/markers.js +1 -1
- package/lib/stages/postgen/introspection/reflect.js +4 -1
- package/lib/stages/postgen/postgen.js +20 -6
- package/lib/stages/postgen/ruleEngine.js +58 -1
- package/lib/stages/postgen/specVersionCompat.js +62 -0
- package/lib/stages/pregen/pregen.js +117 -5
- package/lib/validator/bomValidator.js +26 -5
- package/lib/validator/generated/runtime.mjs +13 -0
- package/lib/validator/generated/validate-1.6.mjs +26 -7
- package/lib/validator/generated/validate-1.7.mjs +31 -12
- package/lib/validator/generated/validate-2.0.mjs +30 -11
- package/lib/validator/index.js +25 -10
- package/lib/validator/reporters/json.js +1 -0
- package/package.json +23 -23
- package/types/bin/cdxgen-secure.d.ts +3 -0
- package/types/bin/cdxgen-secure.d.ts.map +1 -0
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +9 -2
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +43 -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.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +44 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts +7 -4
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts +3 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/activity.d.ts.map +1 -1
- package/types/lib/core/env.d.ts +27 -2
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/httpClient.d.ts +13 -8
- package/types/lib/core/httpClient.d.ts.map +1 -1
- package/types/lib/core/pluginRun.d.ts +97 -0
- package/types/lib/core/pluginRun.d.ts.map +1 -0
- package/types/lib/core/processTree.d.ts +36 -0
- package/types/lib/core/processTree.d.ts.map +1 -0
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/projectTooling.d.ts +41 -0
- package/types/lib/core/projectTooling.d.ts.map +1 -0
- package/types/lib/core/propertySanitizer.d.ts +26 -0
- package/types/lib/core/propertySanitizer.d.ts.map +1 -1
- package/types/lib/core/runState.d.ts +29 -0
- package/types/lib/core/runState.d.ts.map +1 -0
- package/types/lib/core/toml.d.ts +20 -0
- package/types/lib/core/toml.d.ts.map +1 -0
- package/types/lib/ecosystems/asarutils.d.ts.map +1 -1
- package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
- package/types/lib/ecosystems/cargoCache.d.ts +12 -0
- package/types/lib/ecosystems/cargoCache.d.ts.map +1 -1
- package/types/lib/ecosystems/cmakeResolver.d.ts +5 -3
- package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/cppBuildContext.d.ts +55 -0
- package/types/lib/ecosystems/cppBuildContext.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +19 -3
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts +92 -0
- package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -0
- package/types/lib/ecosystems/denoutils.d.ts +9 -3
- package/types/lib/ecosystems/denoutils.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts +62 -13
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/golem.d.ts +81 -1
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +59 -7
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -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/npmutils.d.ts +15 -0
- package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-dotnet.d.ts +155 -5
- package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-go.d.ts +119 -5
- package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +6 -1
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-jvm.d.ts +74 -3
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +21 -59
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts +57 -6
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-terraform.d.ts +38 -21
- package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +26 -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 +21 -1
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/sbtutils.d.ts +88 -2
- package/types/lib/ecosystems/sbtutils.d.ts.map +1 -1
- package/types/lib/ecosystems/scalacliutils.d.ts +56 -0
- package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -0
- package/types/lib/ecosystems/scalasem.d.ts +311 -0
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -0
- package/types/lib/ecosystems/terraformRegistry.d.ts +9 -0
- package/types/lib/ecosystems/terraformRegistry.d.ts.map +1 -0
- package/types/lib/ecosystems/utils.d.ts +2 -2
- package/types/lib/ecosystems/utils.d.ts.map +1 -1
- package/types/lib/ecosystems/vendoredCode.d.ts +32 -0
- package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +100 -8
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/swiftsem.d.ts +10 -0
- package/types/lib/evinser/swiftsem.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +80 -4
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/inventory/agentSkillSpec.d.ts +13 -0
- package/types/lib/inventory/agentSkillSpec.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/analyzer.d.ts.map +1 -1
- package/types/lib/inventory/apkInstalledDb.d.ts +42 -0
- package/types/lib/inventory/apkInstalledDb.d.ts.map +1 -0
- package/types/lib/inventory/atomUtils.d.ts +96 -10
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/auditCategories.d.ts +3 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/buildToolRateLimit.d.ts +38 -0
- package/types/lib/inventory/buildToolRateLimit.d.ts.map +1 -0
- package/types/lib/inventory/cacheCommands.d.ts +2 -1
- package/types/lib/inventory/cacheCommands.d.ts.map +1 -1
- package/types/lib/inventory/cacheDir.d.ts +12 -4
- package/types/lib/inventory/cacheDir.d.ts.map +1 -1
- package/types/lib/inventory/certificates.d.ts +205 -0
- package/types/lib/inventory/certificates.d.ts.map +1 -0
- package/types/lib/inventory/cmakeBuildDirs.d.ts +58 -0
- package/types/lib/inventory/cmakeBuildDirs.d.ts.map +1 -0
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/deps.d.ts +61 -2
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/display.d.ts +18 -0
- package/types/lib/inventory/display.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +202 -14
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts +53 -7
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dynamic.d.ts +16 -1
- package/types/lib/inventory/dynamic.d.ts.map +1 -1
- package/types/lib/inventory/envcontext.d.ts +40 -2
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts +48 -14
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts +83 -14
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/fetchDiskCache.d.ts +169 -0
- package/types/lib/inventory/fetchDiskCache.d.ts.map +1 -0
- package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
- package/types/lib/inventory/goBuildInfo.d.ts +10 -0
- package/types/lib/inventory/goBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -1
- package/types/lib/inventory/hbomAnalysis.d.ts +10 -0
- package/types/lib/inventory/hbomAnalysis.d.ts.map +1 -1
- package/types/lib/inventory/hostTopology.d.ts.map +1 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts +178 -0
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/osPackagePurl.d.ts +99 -0
- package/types/lib/inventory/osPackagePurl.d.ts.map +1 -0
- package/types/lib/inventory/osPackageResolver.d.ts +6 -2
- package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
- package/types/lib/inventory/osinfo.d.ts +31 -6
- package/types/lib/inventory/osinfo.d.ts.map +1 -1
- package/types/lib/inventory/osqueryTransform.d.ts +51 -0
- package/types/lib/inventory/osqueryTransform.d.ts.map +1 -1
- package/types/lib/inventory/parentSelection.d.ts +34 -0
- package/types/lib/inventory/parentSelection.d.ts.map +1 -0
- package/types/lib/inventory/phpBuildInfo.d.ts +142 -0
- package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/phpHostProbe.d.ts +35 -0
- package/types/lib/inventory/phpHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/rootfsCerts.d.ts +27 -0
- package/types/lib/inventory/rootfsCerts.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts +80 -0
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +28 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/inventory/spdx.d.ts +24 -0
- package/types/lib/inventory/spdx.d.ts.map +1 -1
- package/types/lib/inventory/traceRunner.d.ts +16 -1
- package/types/lib/inventory/traceRunner.d.ts.map +1 -1
- package/types/lib/inventory/tracedCrypto.d.ts +64 -0
- package/types/lib/inventory/tracedCrypto.d.ts.map +1 -0
- package/types/lib/managers/binary.d.ts +10 -0
- 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/managers/oci.d.ts +3 -1
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/parsers/cmakeCache.d.ts +16 -0
- package/types/lib/parsers/cmakeCache.d.ts.map +1 -1
- package/types/lib/parsers/cmakeLists.d.ts +2 -1
- package/types/lib/parsers/cmakeLists.d.ts.map +1 -1
- package/types/lib/parsers/cmakePresets.d.ts +78 -0
- package/types/lib/parsers/cmakePresets.d.ts.map +1 -0
- package/types/lib/parsers/compileCommands.d.ts +115 -0
- package/types/lib/parsers/compileCommands.d.ts.map +1 -0
- package/types/lib/parsers/email.d.ts +19 -0
- package/types/lib/parsers/email.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +13 -0
- package/types/lib/parsers/largeJson.d.ts.map +1 -1
- package/types/lib/parsers/strictJson.d.ts +46 -0
- package/types/lib/parsers/strictJson.d.ts.map +1 -0
- package/types/lib/parsers/terraformConfig.d.ts +70 -0
- package/types/lib/parsers/terraformConfig.d.ts.map +1 -0
- package/types/lib/parsers/terraformSource.d.ts +66 -0
- package/types/lib/parsers/terraformSource.d.ts.map +1 -0
- package/types/lib/server/server.d.ts +8 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
- package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts +7 -4
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +14 -1
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +8 -0
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
- package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +0 -462
|
@@ -28,6 +28,13 @@ import {
|
|
|
28
28
|
TIMEOUT_MS,
|
|
29
29
|
} from "../../core/fs.js";
|
|
30
30
|
import { isMac, isWin } from "../../core/paths.js";
|
|
31
|
+
import { isProjectToolingAllowed } from "../../core/projectTooling.js";
|
|
32
|
+
import {
|
|
33
|
+
dosaiDotnetRequirement,
|
|
34
|
+
dosaiDotnetRequirementAdvice,
|
|
35
|
+
dosaiDotnetRequirementDetail,
|
|
36
|
+
markDosaiLaunchFailureReported,
|
|
37
|
+
} from "../../inventory/dosai.js";
|
|
31
38
|
import {
|
|
32
39
|
bundleInstallWithDocker,
|
|
33
40
|
collectJavaInfo,
|
|
@@ -60,6 +67,7 @@ import {
|
|
|
60
67
|
readToolVersionOverride,
|
|
61
68
|
resolvePartialVersion,
|
|
62
69
|
} from "../../inventory/jvmToolEnv.js";
|
|
70
|
+
import { resolvePluginBinary } from "../../inventory/plugins.js";
|
|
63
71
|
import {
|
|
64
72
|
classifyProbeResult,
|
|
65
73
|
describeSpawnRestriction,
|
|
@@ -74,12 +82,20 @@ import {
|
|
|
74
82
|
* @param {Object} options CLI options
|
|
75
83
|
*/
|
|
76
84
|
export function prepareEnv(filePath, options) {
|
|
77
|
-
if (
|
|
85
|
+
if (isSecureMode) {
|
|
78
86
|
return;
|
|
79
87
|
}
|
|
80
88
|
if (filePath) {
|
|
81
89
|
filePath = resolve(filePath);
|
|
82
90
|
}
|
|
91
|
+
// Runs before the project type check: a .NET tree is also found when cdxgen
|
|
92
|
+
// detects the project types itself.
|
|
93
|
+
if (!isDryRun) {
|
|
94
|
+
prepareDotnetEnv(filePath, options);
|
|
95
|
+
}
|
|
96
|
+
if (!options.projectType) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
83
99
|
// The JVM preparation provisions the JDK ahead of the build tools, so an
|
|
84
100
|
// alias it already installed must not be installed a second time here.
|
|
85
101
|
// It runs under dry-run too, where it reports the toolchain it would set up
|
|
@@ -104,6 +120,91 @@ export function prepareEnv(filePath, options) {
|
|
|
104
120
|
prepareRubyEnv(filePath, options);
|
|
105
121
|
}
|
|
106
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Check that dosai, which deep runs use for .NET evidence, can start. The
|
|
125
|
+
* dosai bundled with cdxgen-plugins-bin is framework-dependent, so it needs a
|
|
126
|
+
* .NET runtime at least as new as the one it targets (.NET 11 from dosai
|
|
127
|
+
* 5.0.0). Running it lets the .NET host apply its own version rules. Skipped
|
|
128
|
+
* in the container images, which ship a dosai that works with their SDK, and
|
|
129
|
+
* when DOSAI_CMD names another build, such as the self-contained -full one.
|
|
130
|
+
*
|
|
131
|
+
* @param {String} filePath Project path
|
|
132
|
+
* @param {Object} options CLI options
|
|
133
|
+
*/
|
|
134
|
+
export function prepareDotnetEnv(filePath, options) {
|
|
135
|
+
if (
|
|
136
|
+
!options.deep ||
|
|
137
|
+
!filePath ||
|
|
138
|
+
readEnvironmentVariable("CDXGEN_IN_CONTAINER") === "true" ||
|
|
139
|
+
readEnvironmentVariable("DOSAI_CMD") ||
|
|
140
|
+
!isDotnetInScope(filePath, options)
|
|
141
|
+
) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const dosaiBin = resolvePluginBinary("dosai");
|
|
145
|
+
if (!dosaiBin) {
|
|
146
|
+
// A missing plugin is reported where dosai runs
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const result = safeSpawnSync(dosaiBin, ["--version"], {
|
|
150
|
+
encoding: "utf-8",
|
|
151
|
+
timeout: TIMEOUT_MS,
|
|
152
|
+
});
|
|
153
|
+
if (result?.status === 0 && !result.error) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const output = commandOutputText(result) || "";
|
|
157
|
+
const requirement = dosaiDotnetRequirement(output);
|
|
158
|
+
const detail = requirement
|
|
159
|
+
? dosaiDotnetRequirementDetail(requirement)
|
|
160
|
+
: "dosai could not start";
|
|
161
|
+
console.log(
|
|
162
|
+
`WARNING: ${detail}, so this deep run has no dosai evidence for .NET (call graph, reachability, crypto). ${dosaiDotnetRequirementAdvice(requirement)}`,
|
|
163
|
+
);
|
|
164
|
+
if (requirement) {
|
|
165
|
+
markDosaiLaunchFailureReported(dosaiBin);
|
|
166
|
+
}
|
|
167
|
+
recordLedgerEvent(LEDGER_EVENT_KINDS.EVIDENCE_DEGRADED, {
|
|
168
|
+
ecosystem: "csharp",
|
|
169
|
+
tool: "dosai",
|
|
170
|
+
detail: `${detail}; .NET evidence from dosai is unavailable.`,
|
|
171
|
+
impact: LEDGER_EVENT_IMPACTS.COMPONENTS,
|
|
172
|
+
});
|
|
173
|
+
deferFailOnError(options, {
|
|
174
|
+
ecosystem: "csharp",
|
|
175
|
+
tool: "dosai",
|
|
176
|
+
detail,
|
|
177
|
+
exitCode: typeof result?.status === "number" ? result.status : undefined,
|
|
178
|
+
command: `${dosaiBin} --version`,
|
|
179
|
+
outputExcerpt: output.trim() || undefined,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Whether the run covers .NET: a .NET project type, or, when cdxgen detects
|
|
185
|
+
* the types itself, a .NET project or solution file in the tree.
|
|
186
|
+
*
|
|
187
|
+
* @param {String} filePath Project path
|
|
188
|
+
* @param {Object} options CLI options
|
|
189
|
+
*
|
|
190
|
+
* @returns {Boolean}
|
|
191
|
+
*/
|
|
192
|
+
function isDotnetInScope(filePath, options) {
|
|
193
|
+
if (options.projectType?.length) {
|
|
194
|
+
return hasAnyProjectType(["csharp"], options, false);
|
|
195
|
+
}
|
|
196
|
+
if (!hasAnyProjectType(["csharp"], options, true)) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
return (
|
|
200
|
+
getAllFiles(
|
|
201
|
+
filePath,
|
|
202
|
+
`${options.multiProject ? "**/" : ""}*.{csproj,vbproj,fsproj,sln,slnx}`,
|
|
203
|
+
options,
|
|
204
|
+
).length > 0
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
107
208
|
/**
|
|
108
209
|
* Record the tool requirements the project declares through its well-known
|
|
109
210
|
* tool pin files (`.tool-versions`, `.nvmrc`, `package.json`, `go.mod`, …),
|
|
@@ -1205,7 +1306,7 @@ export function prepareNodeEnv(filePath, options) {
|
|
|
1205
1306
|
}
|
|
1206
1307
|
}
|
|
1207
1308
|
if (nvmNodePath) {
|
|
1208
|
-
doNpmInstall(filePath, nvmNodePath);
|
|
1309
|
+
doNpmInstall(filePath, nvmNodePath, options);
|
|
1209
1310
|
npmInstallAttempted = true;
|
|
1210
1311
|
} else {
|
|
1211
1312
|
console.log(
|
|
@@ -1228,7 +1329,7 @@ export function prepareNodeEnv(filePath, options) {
|
|
|
1228
1329
|
);
|
|
1229
1330
|
continue;
|
|
1230
1331
|
}
|
|
1231
|
-
doNpmInstall(filePath, nvmNodePath);
|
|
1332
|
+
doNpmInstall(filePath, nvmNodePath, options);
|
|
1232
1333
|
npmInstallAttempted = true;
|
|
1233
1334
|
}
|
|
1234
1335
|
}
|
|
@@ -1302,12 +1403,18 @@ export function tryLoadNvmAndInstallTool(nodeVersion) {
|
|
|
1302
1403
|
*
|
|
1303
1404
|
* @param {String} filePath Path
|
|
1304
1405
|
* @param {String} nvmNodePath Path to node version in nvm
|
|
1406
|
+
* @param {Object} [options] CLI options
|
|
1305
1407
|
*/
|
|
1306
|
-
export function doNpmInstall(filePath, nvmNodePath) {
|
|
1408
|
+
export function doNpmInstall(filePath, nvmNodePath, options = {}) {
|
|
1307
1409
|
// we do not install if INSTALL_ARGS set false
|
|
1308
1410
|
if (["0", "false"].includes(readEnvironmentVariable("NODE_INSTALL_ARGS"))) {
|
|
1309
1411
|
return;
|
|
1310
1412
|
}
|
|
1413
|
+
// npm install runs the project's own lifecycle scripts, such as preinstall,
|
|
1414
|
+
// even with --package-lock-only.
|
|
1415
|
+
if (options.installDeps === false) {
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1311
1418
|
const newPath = `${nvmNodePath}${delimiter}${readEnvironmentVariable("PATH")}`;
|
|
1312
1419
|
let installArgs =
|
|
1313
1420
|
readEnvironmentVariable("NPM_INSTALL_ARGS") || "--package-lock-only";
|
|
@@ -1386,7 +1493,12 @@ export function prepareSwiftEnv(filePath, options) {
|
|
|
1386
1493
|
"INFO: Swift for Linux has known issues on non x64 machines. Run the cdxgen container image with --platform=linux/amd64 for best experience.",
|
|
1387
1494
|
);
|
|
1388
1495
|
}
|
|
1389
|
-
|
|
1496
|
+
// `swift package resolve` runs the project's Package.swift, so it waits for
|
|
1497
|
+
// the same permission as the scan's other project tooling.
|
|
1498
|
+
if (
|
|
1499
|
+
(options.deep || options?.lifecycle?.includes("post-build")) &&
|
|
1500
|
+
isProjectToolingAllowed(options)
|
|
1501
|
+
) {
|
|
1390
1502
|
const swiftFiles = getAllFiles(
|
|
1391
1503
|
filePath,
|
|
1392
1504
|
`${options.multiProject ? "**/" : ""}Package*.swift`,
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from "../inventory/bomUtils.js";
|
|
17
17
|
import { isPartialTree } from "../inventory/depsUtils.js";
|
|
18
18
|
import { isValidPurl, parsePurlLoose } from "../inventory/purl.js";
|
|
19
|
+
import { isValidIdnEmail } from "../parsers/email.js";
|
|
19
20
|
|
|
20
21
|
const dirName = dirNameStr;
|
|
21
22
|
// The v13 floor is spec 1.6. 1.4 and 1.5 were dropped here so that the JS and
|
|
@@ -53,7 +54,7 @@ const compileSchemaValidator = (specVersion) => {
|
|
|
53
54
|
if (isCycloneDxSpecVersionAtLeast(specVersion, "2.0")) {
|
|
54
55
|
const ajv = new Ajv2020(AJV_OPTIONS);
|
|
55
56
|
useLinearUniqueItems(ajv);
|
|
56
|
-
|
|
57
|
+
addCycloneDxFormats(ajv);
|
|
57
58
|
addDraft2020BundledSchema(
|
|
58
59
|
ajv,
|
|
59
60
|
readJsonSchema("cryptography-defs.schema.json"),
|
|
@@ -84,7 +85,7 @@ const compileSchemaValidator = (specVersion) => {
|
|
|
84
85
|
schemas,
|
|
85
86
|
});
|
|
86
87
|
useLinearUniqueItems(ajv);
|
|
87
|
-
|
|
88
|
+
addCycloneDxFormats(ajv);
|
|
88
89
|
validate = ajv.getSchema(
|
|
89
90
|
`http://cyclonedx.org/schema/bom-${specVersion}.schema.json`,
|
|
90
91
|
);
|
|
@@ -204,6 +205,21 @@ const useLinearUniqueItems = (ajv) => {
|
|
|
204
205
|
});
|
|
205
206
|
};
|
|
206
207
|
|
|
208
|
+
/**
|
|
209
|
+
* Register the formats the CycloneDX schemas assert: ajv-formats' set, plus
|
|
210
|
+
* `idn-email`, which ajv-formats lacks and `strict: false` would otherwise
|
|
211
|
+
* accept for any string. `cdxrs validate` checks it, so without it a
|
|
212
|
+
* malformed contact address passed here and failed there.
|
|
213
|
+
* `contrib/gen-validators.mjs` registers the same set for the pre-compiled
|
|
214
|
+
* validators.
|
|
215
|
+
*
|
|
216
|
+
* @param {object} ajv Ajv instance whose validators are about to be compiled
|
|
217
|
+
*/
|
|
218
|
+
const addCycloneDxFormats = (ajv) => {
|
|
219
|
+
addFormats(ajv);
|
|
220
|
+
ajv.addFormat("idn-email", isValidIdnEmail);
|
|
221
|
+
};
|
|
222
|
+
|
|
207
223
|
const readJsonSchema = (fileName) =>
|
|
208
224
|
JSON.parse(readFileSync(join(dirName, "data", fileName), "utf-8"));
|
|
209
225
|
|
|
@@ -780,10 +796,15 @@ export const validateRefs = (bomJson) => {
|
|
|
780
796
|
);
|
|
781
797
|
}
|
|
782
798
|
for (const dep of bomJson.dependencies) {
|
|
799
|
+
// A ref made from a purl is its decoded form. The ref of a cryptographic
|
|
800
|
+
// asset encodes the path or name it is keyed by on purpose, such as a
|
|
801
|
+
// keystore's `crypto/related-crypto-material/keystore/%2Fetc%2F...`, and
|
|
802
|
+
// is a dependency when it holds certificates.
|
|
783
803
|
if (
|
|
784
|
-
dep.ref.
|
|
785
|
-
dep.ref.includes("%
|
|
786
|
-
|
|
804
|
+
!dep.ref.startsWith("crypto/") &&
|
|
805
|
+
(dep.ref.includes("%40") ||
|
|
806
|
+
dep.ref.includes("%3A") ||
|
|
807
|
+
dep.ref.includes("%2F"))
|
|
787
808
|
) {
|
|
788
809
|
errorList.push(`Invalid encoded ref in dependencies ${dep.ref}`);
|
|
789
810
|
}
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
// The linear-time uniqueItems keyword calls this instead of ajv's pairwise
|
|
4
4
|
// deep-equal, so the generated validators retain O(n) uniqueness checking.
|
|
5
5
|
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
|
|
8
|
+
import { isValidIdnEmail } from "../../parsers/email.js";
|
|
9
|
+
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
// Every format the generated validators check: ajv-formats' full set plus
|
|
13
|
+
// idn-email, which ajv-formats lacks (see contrib/gen-validators.mjs).
|
|
14
|
+
export const cdxgenFormats = {
|
|
15
|
+
...require("ajv-formats/dist/formats").fullFormats,
|
|
16
|
+
"idn-email": isValidIdnEmail,
|
|
17
|
+
};
|
|
18
|
+
|
|
6
19
|
export function canonicalize(value) {
|
|
7
20
|
if (value === null || typeof value !== "object") {
|
|
8
21
|
return typeof value === "string"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// CycloneDX 1.6 schema validator (pre-compiled with ajv/standalone).
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
const require = createRequire(import.meta.url);
|
|
5
|
-
import { canonicalize } from "./runtime.mjs";
|
|
5
|
+
import { canonicalize, cdxgenFormats } from "./runtime.mjs";
|
|
6
6
|
"use strict";
|
|
7
7
|
export const validate = validate10;
|
|
8
8
|
export default validate10;
|
|
@@ -16,7 +16,7 @@ const func13 = canonicalize;
|
|
|
16
16
|
const func5 = require("ajv/dist/runtime/ucs2length").default;
|
|
17
17
|
const pattern0 = new RegExp("^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "u");
|
|
18
18
|
const schema12 = {"type":"object","title":"BOM Metadata","additionalProperties":false,"properties":{"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"The date and time (timestamp) when the BOM was created."},"lifecycles":{"type":"array","title":"Lifecycles","description":"Lifecycles communicate the stage(s) in which data in the BOM was captured. Different types of data may be available at various phases of a lifecycle, such as the Software Development Lifecycle (SDLC), IT Asset Management (ITAM), and Software Asset Management (SAM). Thus, a BOM may include data specific to or only obtainable in a given lifecycle.","items":{"type":"object","title":"Lifecycle","description":"The product lifecycle(s) that this BOM represents.","oneOf":[{"title":"Pre-Defined Phase","required":["phase"],"additionalProperties":false,"properties":{"phase":{"type":"string","title":"Phase","description":"A pre-defined phase in the product lifecycle.","enum":["design","pre-build","build","post-build","operations","discovery","decommission"],"meta:enum":{"design":"BOM produced early in the development lifecycle containing an inventory of components and services that are proposed or planned to be used. The inventory may need to be procured, retrieved, or resourced prior to use.","pre-build":"BOM consisting of information obtained prior to a build process and may contain source files and development artifacts and manifests. The inventory may need to be resolved and retrieved prior to use.","build":"BOM consisting of information obtained during a build process where component inventory is available for use. The precise versions of resolved components are usually available at this time as well as the provenance of where the components were retrieved from.","post-build":"BOM consisting of information obtained after a build process has completed and the resulting components(s) are available for further analysis. Built components may exist as the result of a CI/CD process, may have been installed or deployed to a system or device, and may need to be retrieved or extracted from the system or device.","operations":"BOM produced that represents inventory that is running and operational. This may include staging or production environments and will generally encompass multiple SBOMs describing the applications and operating system, along with HBOMs describing the hardware that makes up the system. Operations Bill of Materials (OBOM) can provide full-stack inventory of runtime environments, configurations, and additional dependencies.","discovery":"BOM consisting of information observed through network discovery providing point-in-time enumeration of embedded, on-premise, and cloud-native services such as server applications, connected devices, microservices, and serverless functions.","decommission":"BOM containing inventory that will be, or has been retired from operations."}}}},{"title":"Custom Phase","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","title":"Name","description":"The name of the lifecycle phase"},"description":{"type":"string","title":"Description","description":"The description of the lifecycle phase"}}}]}},"tools":{"title":"Tools","description":"The tool(s) used in the creation, enrichment, and validation of the BOM.","oneOf":[{"type":"object","title":"Tools","description":"The tool(s) used in the creation, enrichment, and validation of the BOM.","additionalProperties":false,"properties":{"components":{"type":"array","items":{"$ref":"#/definitions/component"},"uniqueItems":true,"title":"Components","description":"A list of software and hardware components used as tools."},"services":{"type":"array","items":{"$ref":"#/definitions/service"},"uniqueItems":true,"title":"Services","description":"A list of services used as tools. This may include microservices, function-as-a-service, and other types of network or intra-process services."}}},{"type":"array","title":"Tools (legacy)","description":"[Deprecated] The tool(s) used in the creation, enrichment, and validation of the BOM.","items":{"$ref":"#/definitions/tool"}}]},"manufacturer":{"title":"BOM Manufacturer","description":"The organization that created the BOM.\nManufacturer is common in BOMs created through automated processes. BOMs created through manual means may have `@.authors` instead.","$ref":"#/definitions/organizationalEntity"},"authors":{"type":"array","title":"BOM Authors","description":"The person(s) who created the BOM.\nAuthors are common in BOMs created through manual processes. BOMs created through automated means may have `@.manufacturer` instead.","items":{"$ref":"#/definitions/organizationalContact"}},"component":{"title":"Component","description":"The component that the BOM describes.","$ref":"#/definitions/component"},"manufacture":{"deprecated":true,"title":"Component Manufacture (legacy)","description":"[Deprecated] This will be removed in a future version. Use the `@.component.manufacturer` instead.\nThe organization that manufactured the component that the BOM describes.","$ref":"#/definitions/organizationalEntity"},"supplier":{"title":"Supplier","description":" The organization that supplied the component that the BOM describes. The supplier may often be the manufacturer, but may also be a distributor or repackager.","$ref":"#/definitions/organizationalEntity"},"licenses":{"title":"BOM License(s)","description":"The license information for the BOM document.\nThis may be different from the license(s) of the component(s) that the BOM describes.","$ref":"#/definitions/licenseChoice"},"properties":{"type":"array","title":"Properties","description":"Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.","items":{"$ref":"#/definitions/property"}}}};
|
|
19
|
-
const formats0 =
|
|
19
|
+
const formats0 = cdxgenFormats["date-time"];
|
|
20
20
|
const schema13 = {"type":"object","title":"Component","required":["type","name"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["application","framework","library","container","platform","operating-system","device","device-driver","firmware","file","machine-learning-model","data","cryptographic-asset"],"meta:enum":{"application":"A software application. Refer to [https://en.wikipedia.org/wiki/Application_software](https://en.wikipedia.org/wiki/Application_software) for information about applications.","framework":"A software framework. Refer to [https://en.wikipedia.org/wiki/Software_framework](https://en.wikipedia.org/wiki/Software_framework) for information on how frameworks vary slightly from libraries.","library":"A software library. Refer to [https://en.wikipedia.org/wiki/Library_(computing)](https://en.wikipedia.org/wiki/Library_(computing)) for information about libraries. All third-party and open source reusable components will likely be a library. If the library also has key features of a framework, then it should be classified as a framework. If not, or is unknown, then specifying library is recommended.","container":"A packaging and/or runtime format, not specific to any particular technology, which isolates software inside the container from software outside of a container through virtualization technology. Refer to [https://en.wikipedia.org/wiki/OS-level_virtualization](https://en.wikipedia.org/wiki/OS-level_virtualization).","platform":"A runtime environment which interprets or executes software. This may include runtimes such as those that execute bytecode or low-code/no-code application platforms.","operating-system":"A software operating system without regard to deployment model (i.e. installed on physical hardware, virtual machine, image, etc) Refer to [https://en.wikipedia.org/wiki/Operating_system](https://en.wikipedia.org/wiki/Operating_system).","device":"A hardware device such as a processor or chip-set. A hardware device containing firmware SHOULD include a component for the physical hardware itself and another component of type 'firmware' or 'operating-system' (whichever is relevant), describing information about the software running on the device. See also the list of [known device properties](https://github.com/CycloneDX/cyclonedx-property-taxonomy/blob/main/cdx/device.md).","device-driver":"A special type of software that operates or controls a particular type of device. Refer to [https://en.wikipedia.org/wiki/Device_driver](https://en.wikipedia.org/wiki/Device_driver).","firmware":"A special type of software that provides low-level control over a device's hardware. Refer to [https://en.wikipedia.org/wiki/Firmware](https://en.wikipedia.org/wiki/Firmware).","file":"A computer file. Refer to [https://en.wikipedia.org/wiki/Computer_file](https://en.wikipedia.org/wiki/Computer_file) for information about files.","machine-learning-model":"A model based on training data that can make predictions or decisions without being explicitly programmed to do so.","data":"A collection of discrete values that convey information.","cryptographic-asset":"A cryptographic asset including algorithms, protocols, certificates, keys, tokens, and secrets."},"title":"Component Type","description":"Specifies the type of component. For software components, classify as application if no more specific appropriate classification is available or cannot be determined for the component.","examples":["library"]},"mime-type":{"type":"string","title":"Mime-Type","description":"The optional mime-type of the component. When used on file components, the mime-type can provide additional context about the kind of file being represented, such as an image, font, or executable. Some library or framework components may also have an associated mime-type.","examples":["image/jpeg"],"pattern":"^[-+a-z0-9.]+/[-+a-z0-9.]+$"},"bom-ref":{"$ref":"#/definitions/refType","title":"BOM Reference","description":"An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref must be unique within the BOM.\nValue SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links."},"supplier":{"title":"Component Supplier","description":" The organization that supplied the component. The supplier may often be the manufacturer, but may also be a distributor or repackager.","$ref":"#/definitions/organizationalEntity"},"manufacturer":{"title":"Component Manufacturer","description":"The organization that created the component.\nManufacturer is common in components created through automated processes. Components created through manual means may have `@.authors` instead.","$ref":"#/definitions/organizationalEntity"},"authors":{"type":"array","title":"Component Authors","description":"The person(s) who created the component.\nAuthors are common in components created through manual processes. Components created through automated means may have `@.manufacturer` instead.","items":{"$ref":"#/definitions/organizationalContact"}},"author":{"deprecated":true,"type":"string","title":"Component Author (legacy)","description":"[Deprecated] This will be removed in a future version. Use `@.authors` or `@.manufacturer` instead.\nThe person(s) or organization(s) that authored the component","examples":["Acme Inc"]},"publisher":{"type":"string","title":"Component Publisher","description":"The person(s) or organization(s) that published the component","examples":["Acme Inc"]},"group":{"type":"string","title":"Component Group","description":"The grouping name or identifier. This will often be a shortened, single name of the company or project that produced the component, or the source package or domain name. Whitespace and special characters should be avoided. Examples include: apache, org.apache.commons, and apache.org.","examples":["com.acme"]},"name":{"type":"string","title":"Component Name","description":"The name of the component. This will often be a shortened, single name of the component. Examples: commons-lang3 and jquery","examples":["tomcat-catalina"]},"version":{"$ref":"#/definitions/version","title":"Component Version","description":"The component version. The version should ideally comply with semantic versioning but is not enforced."},"description":{"type":"string","title":"Component Description","description":"Specifies a description for the component"},"scope":{"type":"string","enum":["required","optional","excluded"],"meta:enum":{"required":"The component is required for runtime","optional":"The component is optional at runtime. Optional components are components that are not capable of being called due to them not being installed or otherwise accessible by any means. Components that are installed but due to configuration or other restrictions are prohibited from being called must be scoped as 'required'.","excluded":"Components that are excluded provide the ability to document component usage for test and other non-runtime purposes. Excluded components are not reachable within a call graph at runtime."},"title":"Component Scope","description":"Specifies the scope of the component. If scope is not specified, 'required' scope SHOULD be assumed by the consumer of the BOM.","default":"required"},"hashes":{"type":"array","title":"Component Hashes","description":"The hashes of the component.","items":{"$ref":"#/definitions/hash"}},"licenses":{"$ref":"#/definitions/licenseChoice","title":"Component License(s)"},"copyright":{"type":"string","title":"Component Copyright","description":"A copyright notice informing users of the underlying claims to copyright ownership in a published work.","examples":["Acme Inc"]},"cpe":{"type":"string","title":"Common Platform Enumeration (CPE)","description":"Asserts the identity of the component using CPE. The CPE must conform to the CPE 2.2 or 2.3 specification. See [https://nvd.nist.gov/products/cpe](https://nvd.nist.gov/products/cpe). Refer to `@.evidence.identity` to optionally provide evidence that substantiates the assertion of the component's identity.","examples":["cpe:2.3:a:acme:component_framework:-:*:*:*:*:*:*:*"]},"purl":{"type":"string","title":"Package URL (purl)","description":"Asserts the identity of the component using package-url (purl). The purl, if specified, must be valid and conform to the specification defined at: [https://github.com/package-url/purl-spec](https://github.com/package-url/purl-spec). Refer to `@.evidence.identity` to optionally provide evidence that substantiates the assertion of the component's identity.","examples":["pkg:maven/com.acme/tomcat-catalina@9.0.14?packaging=jar"]},"omniborId":{"type":"array","title":"OmniBOR Artifact Identifier (gitoid)","description":"Asserts the identity of the component using the OmniBOR Artifact ID. The OmniBOR, if specified, must be valid and conform to the specification defined at: [https://www.iana.org/assignments/uri-schemes/prov/gitoid](https://www.iana.org/assignments/uri-schemes/prov/gitoid). Refer to `@.evidence.identity` to optionally provide evidence that substantiates the assertion of the component's identity.","items":{"type":"string"},"examples":["gitoid:blob:sha1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3","gitoid:blob:sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"]},"swhid":{"type":"array","title":"Software Heritage Identifier","description":"Asserts the identity of the component using the Software Heritage persistent identifier (SWHID). The SWHID, if specified, must be valid and conform to the specification defined at: [https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html](https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html). Refer to `@.evidence.identity` to optionally provide evidence that substantiates the assertion of the component's identity.","items":{"type":"string"},"examples":["swh:1:cnt:94a9ed024d3859793618152ea559a168bbcbb5e2"]},"swid":{"$ref":"#/definitions/swid","title":"SWID Tag","description":"Asserts the identity of the component using [ISO-IEC 19770-2 Software Identification (SWID) Tags](https://www.iso.org/standard/65666.html). Refer to `@.evidence.identity` to optionally provide evidence that substantiates the assertion of the component's identity."},"modified":{"type":"boolean","title":"Component Modified From Original","description":"[Deprecated] This will be removed in a future version. Use the pedigree element instead to supply information on exactly how the component was modified. A boolean value indicating if the component has been modified from the original. A value of true indicates the component is a derivative of the original. A value of false indicates the component has not been modified from the original."},"pedigree":{"type":"object","title":"Component Pedigree","description":"Component pedigree is a way to document complex supply chain scenarios where components are created, distributed, modified, redistributed, combined with other components, etc. Pedigree supports viewing this complex chain from the beginning, the end, or anywhere in the middle. It also provides a way to document variants where the exact relation may not be known.","additionalProperties":false,"properties":{"ancestors":{"type":"array","title":"Ancestors","description":"Describes zero or more components in which a component is derived from. This is commonly used to describe forks from existing projects where the forked version contains a ancestor node containing the original component it was forked from. For example, Component A is the original component. Component B is the component being used and documented in the BOM. However, Component B contains a pedigree node with a single ancestor documenting Component A - the original component from which Component B is derived from.","items":{"$ref":"#/definitions/component"}},"descendants":{"type":"array","title":"Descendants","description":"Descendants are the exact opposite of ancestors. This provides a way to document all forks (and their forks) of an original or root component.","items":{"$ref":"#/definitions/component"}},"variants":{"type":"array","title":"Variants","description":"Variants describe relations where the relationship between the components is not known. For example, if Component A contains nearly identical code to Component B. They are both related, but it is unclear if one is derived from the other, or if they share a common ancestor.","items":{"$ref":"#/definitions/component"}},"commits":{"type":"array","title":"Commits","description":"A list of zero or more commits which provide a trail describing how the component deviates from an ancestor, descendant, or variant.","items":{"$ref":"#/definitions/commit"}},"patches":{"type":"array","title":"Patches","description":">A list of zero or more patches describing how the component deviates from an ancestor, descendant, or variant. Patches may be complementary to commits or may be used in place of commits.","items":{"$ref":"#/definitions/patch"}},"notes":{"type":"string","title":"Notes","description":"Notes, observations, and other non-structured commentary describing the components pedigree."}}},"externalReferences":{"type":"array","items":{"$ref":"#/definitions/externalReference"},"title":"External References","description":"External references provide a way to document systems, sites, and information that may be relevant but are not included with the BOM. They may also establish specific relationships within or external to the BOM."},"components":{"type":"array","items":{"$ref":"#/definitions/component"},"uniqueItems":true,"title":"Components","description":"A list of software and hardware components included in the parent component. This is not a dependency tree. It provides a way to specify a hierarchical representation of component assemblies, similar to system → subsystem → parts assembly in physical supply chains."},"evidence":{"$ref":"#/definitions/componentEvidence","title":"Evidence","description":"Provides the ability to document evidence collected through various forms of extraction or analysis."},"releaseNotes":{"$ref":"#/definitions/releaseNotes","title":"Release notes","description":"Specifies optional release notes."},"modelCard":{"$ref":"#/definitions/modelCard","title":"AI/ML Model Card"},"data":{"type":"array","items":{"$ref":"#/definitions/componentData"},"title":"Data","description":"This object SHOULD be specified for any component of type `data` and must not be specified for other component types."},"cryptoProperties":{"$ref":"#/definitions/cryptoProperties","title":"Cryptographic Properties"},"properties":{"type":"array","title":"Properties","description":"Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.","items":{"$ref":"#/definitions/property"}},"tags":{"$ref":"#/definitions/tags","title":"Tags"},"signature":{"$ref":"#/definitions/signature","title":"Signature","description":"Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html)."}}};
|
|
21
21
|
const schema21 = {"description":"A single disjunctive version identifier, for a component or service.","type":"string","maxLength":1024,"examples":["9.0.14","v1.33.7","7.0.0-M1","2.0pre1","1.0.0-beta1","0.8.15"]};
|
|
22
22
|
const schema55 = {"type":"array","items":{"type":"string"},"title":"Tags","description":"Textual strings that aid in discovery, search, and retrieval of the associated object. Tags often serve as a way to group or categorize similar or related objects by various attributes.","examples":["json-parser","object-persistence","text-to-image","translation","object-detection"]};
|
|
@@ -155,6 +155,7 @@ return errors === 0;
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
const schema19 = {"type":"object","title":"Organizational Contact","additionalProperties":false,"properties":{"bom-ref":{"$ref":"#/definitions/refType","title":"BOM Reference","description":"An optional identifier which can be used to reference the object elsewhere in the BOM. Every bom-ref must be unique within the BOM.\nValue SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links."},"name":{"type":"string","title":"Name","description":"The name of a contact","examples":["Contact name"]},"email":{"type":"string","format":"idn-email","title":"Email Address","description":"The email address of the contact.","examples":["firstname.lastname@example.com"]},"phone":{"type":"string","title":"Phone","description":"The phone number of the contact.","examples":["800-555-1212"]}}};
|
|
158
|
+
const formats2 = cdxgenFormats["idn-email"];
|
|
158
159
|
|
|
159
160
|
function validate16(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
|
|
160
161
|
let vErrors = null;
|
|
@@ -210,7 +211,13 @@ let data2 = data.email;
|
|
|
210
211
|
const _errs8 = errors;
|
|
211
212
|
if(errors === _errs8){
|
|
212
213
|
if(errors === _errs8){
|
|
213
|
-
if(
|
|
214
|
+
if(typeof data2 === "string"){
|
|
215
|
+
if(!(formats2(data2))){
|
|
216
|
+
validate16.errors = [{instancePath:instancePath+"/email",schemaPath:"#/properties/email/format",keyword:"format",params:{format: "idn-email"},message:"must match format \""+"idn-email"+"\"",schema:"idn-email",parentSchema:schema19.properties.email,data:data2}];
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
214
221
|
validate16.errors = [{instancePath:instancePath+"/email",schemaPath:"#/properties/email/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema19.properties.email.type,parentSchema:schema19.properties.email,data:data2}];
|
|
215
222
|
return false;
|
|
216
223
|
}
|
|
@@ -1959,7 +1966,13 @@ let data5 = data2.email;
|
|
|
1959
1966
|
const _errs14 = errors;
|
|
1960
1967
|
if(errors === _errs14){
|
|
1961
1968
|
if(errors === _errs14){
|
|
1962
|
-
if(
|
|
1969
|
+
if(typeof data5 === "string"){
|
|
1970
|
+
if(!(formats2(data5))){
|
|
1971
|
+
validate35.errors = [{instancePath:instancePath+"/author/email",schemaPath:"#/definitions/identifiableAction/properties/email/format",keyword:"format",params:{format: "idn-email"},message:"must match format \""+"idn-email"+"\"",schema:"idn-email",parentSchema:schema37.properties.email,data:data5}];
|
|
1972
|
+
return false;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
else {
|
|
1963
1976
|
validate35.errors = [{instancePath:instancePath+"/author/email",schemaPath:"#/definitions/identifiableAction/properties/email/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema37.properties.email.type,parentSchema:schema37.properties.email,data:data5}];
|
|
1964
1977
|
return false;
|
|
1965
1978
|
}
|
|
@@ -2041,7 +2054,13 @@ let data9 = data6.email;
|
|
|
2041
2054
|
const _errs24 = errors;
|
|
2042
2055
|
if(errors === _errs24){
|
|
2043
2056
|
if(errors === _errs24){
|
|
2044
|
-
if(
|
|
2057
|
+
if(typeof data9 === "string"){
|
|
2058
|
+
if(!(formats2(data9))){
|
|
2059
|
+
validate35.errors = [{instancePath:instancePath+"/committer/email",schemaPath:"#/definitions/identifiableAction/properties/email/format",keyword:"format",params:{format: "idn-email"},message:"must match format \""+"idn-email"+"\"",schema:"idn-email",parentSchema:schema37.properties.email,data:data9}];
|
|
2060
|
+
return false;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
else {
|
|
2045
2064
|
validate35.errors = [{instancePath:instancePath+"/committer/email",schemaPath:"#/definitions/identifiableAction/properties/email/type",keyword:"type",params:{type: "string"},message:"must be string",schema:schema37.properties.email.type,parentSchema:schema37.properties.email,data:data9}];
|
|
2046
2065
|
return false;
|
|
2047
2066
|
}
|
|
@@ -8015,7 +8034,7 @@ return errors === 0;
|
|
|
8015
8034
|
|
|
8016
8035
|
const schema104 = {"type":"object","title":"Signature","oneOf":[{"additionalProperties":false,"properties":{"signers":{"type":"array","title":"Signature","description":"Unique top level property for Multiple Signatures. (multisignature)","items":{"$ref":"#/definitions/signer"}}}},{"additionalProperties":false,"properties":{"chain":{"type":"array","title":"Signature","description":"Unique top level property for Signature Chains. (signaturechain)","items":{"$ref":"#/definitions/signer"}}}},{"title":"Signature","description":"Unique top level property for simple signatures. (signaturecore)","$ref":"#/definitions/signer"}]};
|
|
8017
8036
|
const schema105 = {"type":"object","title":"Signature","required":["algorithm","value"],"additionalProperties":false,"properties":{"algorithm":{"oneOf":[{"type":"string","title":"Algorithm","description":"Signature algorithm. The currently recognized JWA [RFC7518] and RFC8037 [RFC8037] asymmetric key algorithms. Note: Unlike RFC8037 [RFC8037] JSF requires explicit Ed* algorithm names instead of \"EdDSA\".","enum":["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512","Ed25519","Ed448","HS256","HS384","HS512"]},{"type":"string","title":"Algorithm","description":"Signature algorithm. Note: If proprietary signature algorithms are added, they must be expressed as URIs.","format":"uri"}]},"keyId":{"type":"string","title":"Key ID","description":"Optional. Application specific string identifying the signature key."},"publicKey":{"title":"Public key","description":"Optional. Public key object.","$ref":"#/definitions/publicKey"},"certificatePath":{"type":"array","title":"Certificate path","description":"Optional. Sorted array of X.509 [RFC5280] certificates, where the first element must contain the signature certificate. The certificate path must be contiguous but is not required to be complete.","items":{"type":"string"}},"excludes":{"type":"array","title":"Excludes","description":"Optional. Array holding the names of one or more application level properties that must be excluded from the signature process. Note that the \"excludes\" property itself, must also be excluded from the signature process. Since both the \"excludes\" property and the associated data it points to are unsigned, a conforming JSF implementation must provide options for specifying which properties to accept.","items":{"type":"string"}},"value":{"type":"string","title":"Signature","description":"The signature data. Note that the binary representation must follow the JWA [RFC7518] specifications."}}};
|
|
8018
|
-
const
|
|
8037
|
+
const formats30 = cdxgenFormats.uri;
|
|
8019
8038
|
const schema106 = {"title":"Public key","description":"Optional. Public key object.","type":"object","required":["kty"],"additionalProperties":true,"properties":{"kty":{"$ref":"#/definitions/keyType"}},"allOf":[{"if":{"properties":{"kty":{"const":"EC"}}},"then":{"required":["kty","crv","x","y"],"additionalProperties":false,"properties":{"kty":{"$ref":"#/definitions/keyType"},"crv":{"type":"string","title":"Curve name","description":"EC curve name.","enum":["P-256","P-384","P-521"]},"x":{"type":"string","title":"Coordinate","description":"EC curve point X. The length of this field must be the full size of a coordinate for the curve specified in the \"crv\" parameter. For example, if the value of \"crv\" is \"P-521\", the decoded argument must be 66 bytes."},"y":{"type":"string","title":"Coordinate","description":"EC curve point Y. The length of this field must be the full size of a coordinate for the curve specified in the \"crv\" parameter. For example, if the value of \"crv\" is \"P-256\", the decoded argument must be 32 bytes."}}}},{"if":{"properties":{"kty":{"const":"OKP"}}},"then":{"required":["kty","crv","x"],"additionalProperties":false,"properties":{"kty":{"$ref":"#/definitions/keyType"},"crv":{"type":"string","title":"Curve name","description":"EdDSA curve name.","enum":["Ed25519","Ed448"]},"x":{"type":"string","title":"Coordinate","description":"EdDSA curve point X. The length of this field must be the full size of a coordinate for the curve specified in the \"crv\" parameter. For example, if the value of \"crv\" is \"Ed25519\", the decoded argument must be 32 bytes."}}}},{"if":{"properties":{"kty":{"const":"RSA"}}},"then":{"required":["kty","n","e"],"additionalProperties":false,"properties":{"kty":{"$ref":"#/definitions/keyType"},"n":{"type":"string","title":"Modulus","description":"RSA modulus."},"e":{"type":"string","title":"Exponent","description":"RSA exponent."}}}}]};
|
|
8020
8039
|
const schema107 = {"type":"string","title":"Key type","description":"Key type indicator.","enum":["EC","OKP","RSA"]};
|
|
8021
8040
|
|
|
@@ -8462,7 +8481,7 @@ const _errs6 = errors;
|
|
|
8462
8481
|
if(errors === _errs6){
|
|
8463
8482
|
if(errors === _errs6){
|
|
8464
8483
|
if(typeof data0 === "string"){
|
|
8465
|
-
if(!(
|
|
8484
|
+
if(!(formats30(data0))){
|
|
8466
8485
|
const err2 = {instancePath:instancePath+"/algorithm",schemaPath:"#/properties/algorithm/oneOf/1/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\"",schema:"uri",parentSchema:schema105.properties.algorithm.oneOf[1],data:data0};
|
|
8467
8486
|
if(vErrors === null){
|
|
8468
8487
|
vErrors = [err2];
|