@cdxgen/cdxgen 13.5.0 → 13.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/bin/audit.js +7 -4
- package/bin/cdxgen.js +260 -37
- package/bin/convert.js +146 -22
- package/bin/evinse.js +28 -3
- package/bin/repl.js +47 -3
- package/bin/sign.js +211 -34
- package/bin/tracebom.js +18 -6
- package/bin/validate.js +24 -3
- package/bin/verify.js +113 -5
- package/data/behavior-taxonomy.schema.json +1491 -0
- package/data/cyclonedx-2.0-bundled.schema.json +18606 -5528
- package/data/cyclonedx-2.0-cryptography-defs.schema.json +857 -0
- package/data/license-aliases.json +24 -2
- package/data/pqc-migration.json +239 -0
- package/data/remediations.json +176 -0
- package/data/rules/ai-bom.yaml +1 -1
- package/data/rules/brotli-decoder.yaml +107 -0
- package/data/rules/cbom-security.yaml +4 -3
- package/data/rules/package-integrity.yaml +28 -0
- package/data/rules/vscode-extensions.yaml +75 -0
- package/data/spdx-license-list.json +121 -7
- package/data/spdx-licenses.json +69 -0
- package/data/spdx.schema.json +845 -2
- package/lib/audit/index.js +25 -3
- package/lib/cli/bomAssembly.js +172 -4
- package/lib/cli/cliOptions.js +121 -17
- package/lib/cli/index.js +720 -902
- package/lib/cli/jsBom.js +156 -64
- package/lib/cli/jvmBom.js +602 -86
- package/lib/cli/managedBom.js +161 -19
- package/lib/cli/nativeBom.js +52 -5
- package/lib/core/boundedFile.js +344 -0
- package/lib/core/brotliProbe.js +182 -0
- package/lib/core/env.js +34 -0
- package/lib/core/fs.js +138 -3
- package/lib/core/globPatterns.js +218 -0
- package/lib/core/httpClient.js +98 -1
- package/lib/core/lockPaths.js +38 -0
- package/lib/core/paths.js +24 -1
- package/lib/core/processTree.js +100 -8
- package/lib/core/projectConfig.js +332 -25
- package/lib/core/toolRegistry.js +184 -0
- package/lib/ecosystems/cppEvidence.js +263 -106
- package/lib/ecosystems/cppIncludeResolver.js +16 -5
- package/lib/ecosystems/denoutils.js +2 -2
- package/lib/ecosystems/ecosystems.js +25 -10
- package/lib/ecosystems/gemHostProbe.js +301 -0
- package/lib/ecosystems/golem.js +3 -8
- package/lib/ecosystems/gradleutils.js +1909 -229
- package/lib/ecosystems/jsEvidence.js +90 -38
- package/lib/ecosystems/kosi.js +3 -5
- package/lib/ecosystems/npmVersionResolution.js +376 -0
- package/lib/ecosystems/parsers-bazel.js +107 -6
- package/lib/ecosystems/parsers-js.js +505 -22
- package/lib/ecosystems/parsers-misc.js +209 -20
- package/lib/ecosystems/parsers-python.js +178 -30
- package/lib/ecosystems/parsers-rust.js +117 -15
- package/lib/ecosystems/pythonutils.js +128 -2
- package/lib/ecosystems/remote/huggingface.js +22 -0
- package/lib/ecosystems/rubyutils.js +538 -31
- package/lib/ecosystems/rusi.js +2 -4
- package/lib/ecosystems/scalacliutils.js +2 -0
- package/lib/ecosystems/scalasem.js +798 -152
- package/lib/ecosystems/vendoredCode.js +237 -3
- package/lib/ecosystems/venvProbe.js +360 -0
- package/lib/evinser/evinser.js +536 -71
- package/lib/evinser/scalasem.js +5 -1
- package/lib/helpers/agenticToolutils.js +525 -94
- package/lib/helpers/bomSigner.js +43 -9
- package/lib/helpers/jssSigner.js +1276 -0
- package/lib/helpers/vsixutils.js +1574 -315
- package/lib/inventory/agentBlueprint.js +193 -0
- package/lib/inventory/agentToolNames.js +145 -0
- package/lib/inventory/aiCollector.js +153 -7
- package/lib/inventory/aiInventory.js +44 -8
- package/lib/inventory/aiProviders.js +324 -0
- package/lib/inventory/atomUtils.js +77 -0
- package/lib/inventory/bomUtils.js +8 -1
- package/lib/inventory/brotliDecoder.js +142 -0
- package/lib/inventory/buildToolRateLimit.js +1 -1
- package/lib/inventory/cbomutils.js +56 -7
- package/lib/inventory/ciParsers/githubActionsLock.js +821 -0
- package/lib/inventory/citations.js +31 -2
- package/lib/inventory/communityAiConfigParser.js +978 -80
- package/lib/inventory/cyclonedx20.js +152 -0
- package/lib/inventory/cyclonedx20Common.js +286 -0
- package/lib/inventory/cyclonedx20Derived.js +159 -0
- package/lib/inventory/cyclonedx20Parties.js +552 -0
- package/lib/inventory/cyclonedx20Read.js +768 -0
- package/lib/inventory/cyclonedx20ReadCommon.js +374 -0
- package/lib/inventory/cyclonedx20ReadComponents.js +692 -0
- package/lib/inventory/cyclonedx20ReadContext.js +380 -0
- package/lib/inventory/cyclonedx20ReadEvidence.js +466 -0
- package/lib/inventory/cyclonedx20ReadSections.js +599 -0
- package/lib/inventory/cyclonedx20Render.js +766 -0
- package/lib/inventory/cyclonedx20RenderComponents.js +716 -0
- package/lib/inventory/cyclonedx20RenderDefinitions.js +405 -0
- package/lib/inventory/cyclonedx20RenderEvidence.js +726 -0
- package/lib/inventory/cyclonedx20RenderHardware.js +203 -0
- package/lib/inventory/cyclonedx20RenderPatents.js +174 -0
- package/lib/inventory/cyclonedx20RenderRefIds.js +314 -0
- package/lib/inventory/cyclonedx20RenderSections.js +499 -0
- package/lib/inventory/cyclonedx20Tables.js +594 -0
- package/lib/inventory/deps.js +141 -13
- package/lib/inventory/dosai.js +375 -6
- package/lib/inventory/dosaiParsers.js +3 -6
- package/lib/inventory/dotnetRuntime.js +367 -0
- package/lib/inventory/ecosystemFormulationParsers.js +979 -0
- package/lib/inventory/envcontext.js +436 -48
- package/lib/inventory/evidenceUtils.js +13 -1
- package/lib/inventory/fetchBatch.js +1 -1
- package/lib/inventory/formulationParsers.js +124 -14
- package/lib/inventory/gtfobins.js +13 -0
- package/lib/inventory/hbom.js +45 -6
- package/lib/inventory/hbomLoader.js +166 -0
- package/lib/inventory/hostRuntimeProbe.js +686 -0
- package/lib/inventory/jvmLocalRepos.js +9 -2
- package/lib/inventory/jvmToolEnv.js +29 -0
- package/lib/inventory/licenseEnhancer.js +12 -0
- package/lib/inventory/mavenCentralMirror.js +534 -0
- package/lib/inventory/mcpConfigParser.js +5 -0
- package/lib/inventory/nodeBuildInfo.js +218 -0
- package/lib/inventory/nodeHostProbe.js +202 -0
- package/lib/inventory/occurrenceKey.js +90 -0
- package/lib/inventory/osPackageResolver.js +182 -0
- package/lib/inventory/phpBuildInfo.js +10 -59
- package/lib/inventory/phpHostProbe.js +32 -488
- package/lib/inventory/pqcMigration.js +426 -0
- package/lib/inventory/rubyBuildInfo.js +972 -0
- package/lib/inventory/rubyHostProbe.js +218 -0
- package/lib/inventory/rustFormulationParser.js +21 -10
- package/lib/inventory/scalaCoords.js +4 -3
- package/lib/inventory/scalaDedupe.js +440 -0
- package/lib/inventory/source.js +114 -8
- package/lib/managers/binary.js +337 -3
- package/lib/managers/docker.js +79 -0
- package/lib/parsers/huggingfaceManifest.js +9 -1
- package/lib/parsers/huggingfaceUtils.js +18 -0
- package/lib/parsers/kiroPermissions.js +166 -0
- package/lib/parsers/largeJson.js +28 -11
- package/lib/parsers/vscodeExtensionId.js +183 -0
- package/lib/server/server.js +48 -35
- package/lib/stages/postgen/postgen.js +41 -1
- package/lib/stages/postgen/ruleEngine.js +13 -5
- package/lib/stages/postgen/specVersionCompat.js +76 -0
- package/lib/stages/pregen/envAudit.js +1 -0
- package/lib/stages/pregen/pregen.js +114 -57
- package/lib/validator/bomValidator.js +14 -2
- package/lib/validator/complianceEngine.js +30 -3
- package/lib/validator/complianceRules.js +1416 -4
- package/lib/validator/generated/validate-1.6.mjs +1 -1
- package/lib/validator/generated/validate-1.7.mjs +1 -1
- package/lib/validator/generated/validate-2.0.mjs +57554 -13851
- package/lib/validator/index.js +49 -8
- package/lib/validator/reporters/json.js +6 -0
- package/package.json +11 -10
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts +6 -2
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +29 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +6 -0
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts +3 -18
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +15 -0
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/boundedFile.d.ts +100 -0
- package/types/lib/core/boundedFile.d.ts.map +1 -0
- package/types/lib/core/brotliProbe.d.ts +37 -0
- package/types/lib/core/brotliProbe.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +14 -0
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +4 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/globPatterns.d.ts +70 -0
- package/types/lib/core/globPatterns.d.ts.map +1 -0
- package/types/lib/core/httpClient.d.ts +24 -0
- package/types/lib/core/httpClient.d.ts.map +1 -1
- package/types/lib/core/lockPaths.d.ts +19 -0
- package/types/lib/core/lockPaths.d.ts.map +1 -0
- package/types/lib/core/paths.d.ts +9 -0
- package/types/lib/core/paths.d.ts.map +1 -1
- package/types/lib/core/processTree.d.ts +17 -4
- package/types/lib/core/processTree.d.ts.map +1 -1
- package/types/lib/core/projectConfig.d.ts +47 -8
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/toolRegistry.d.ts +36 -0
- package/types/lib/core/toolRegistry.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +40 -13
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts +2 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gemHostProbe.d.ts +28 -0
- package/types/lib/ecosystems/gemHostProbe.d.ts.map +1 -0
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +294 -20
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +14 -1
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts.map +1 -1
- package/types/lib/ecosystems/npmVersionResolution.d.ts +119 -0
- package/types/lib/ecosystems/npmVersionResolution.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +17 -20
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +19 -0
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts +10 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +19 -1
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts +144 -12
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
- package/types/lib/ecosystems/scalasem.d.ts +58 -16
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
- package/types/lib/ecosystems/vendoredCode.d.ts +26 -0
- package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -1
- package/types/lib/ecosystems/venvProbe.d.ts +40 -0
- package/types/lib/ecosystems/venvProbe.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +120 -13
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/scalasem.d.ts.map +1 -1
- package/types/lib/helpers/agenticToolutils.d.ts +53 -19
- package/types/lib/helpers/agenticToolutils.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +20 -3
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/helpers/jssSigner.d.ts +288 -0
- package/types/lib/helpers/jssSigner.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +303 -19
- package/types/lib/helpers/vsixutils.d.ts.map +1 -1
- package/types/lib/inventory/agentBlueprint.d.ts +70 -0
- package/types/lib/inventory/agentBlueprint.d.ts.map +1 -0
- package/types/lib/inventory/agentToolNames.d.ts +51 -0
- package/types/lib/inventory/agentToolNames.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/aiInventory.d.ts.map +1 -1
- package/types/lib/inventory/aiProviders.d.ts +85 -0
- package/types/lib/inventory/aiProviders.d.ts.map +1 -0
- package/types/lib/inventory/atomUtils.d.ts +19 -0
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/bomUtils.d.ts.map +1 -1
- package/types/lib/inventory/brotliDecoder.d.ts +58 -0
- package/types/lib/inventory/brotliDecoder.d.ts.map +1 -0
- package/types/lib/inventory/cbomutils.d.ts +17 -0
- package/types/lib/inventory/cbomutils.d.ts.map +1 -1
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts +101 -0
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts.map +1 -0
- package/types/lib/inventory/citations.d.ts +5 -0
- package/types/lib/inventory/citations.d.ts.map +1 -1
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/cyclonedx20.d.ts +99 -0
- package/types/lib/inventory/cyclonedx20.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts +102 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts +74 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts +91 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts +51 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts +69 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts +77 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts +118 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts +40 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts +53 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts +73 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts +29 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts +110 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts +42 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts +26 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts +55 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts +134 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts.map +1 -0
- package/types/lib/inventory/deps.d.ts +35 -2
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +36 -1
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dotnetRuntime.d.ts +91 -0
- package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts +73 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts.map +1 -0
- package/types/lib/inventory/envcontext.d.ts +74 -12
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
- package/types/lib/inventory/gtfobins.d.ts.map +1 -1
- package/types/lib/inventory/hbom.d.ts +11 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -1
- package/types/lib/inventory/hbomLoader.d.ts +54 -0
- package/types/lib/inventory/hbomLoader.d.ts.map +1 -1
- package/types/lib/inventory/hostRuntimeProbe.d.ts +44 -0
- package/types/lib/inventory/hostRuntimeProbe.d.ts.map +1 -0
- package/types/lib/inventory/jvmLocalRepos.d.ts +5 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +12 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
- package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -1
- package/types/lib/inventory/mavenCentralMirror.d.ts +170 -0
- package/types/lib/inventory/mavenCentralMirror.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/nodeBuildInfo.d.ts +95 -0
- package/types/lib/inventory/nodeBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/nodeHostProbe.d.ts +15 -0
- package/types/lib/inventory/nodeHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/occurrenceKey.d.ts +52 -0
- package/types/lib/inventory/occurrenceKey.d.ts.map +1 -0
- package/types/lib/inventory/osPackageResolver.d.ts +38 -0
- package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
- package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -1
- package/types/lib/inventory/phpHostProbe.d.ts.map +1 -1
- package/types/lib/inventory/pqcMigration.d.ts +84 -0
- package/types/lib/inventory/pqcMigration.d.ts.map +1 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts +271 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/rubyHostProbe.d.ts +47 -0
- package/types/lib/inventory/rubyHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts +7 -2
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -1
- package/types/lib/inventory/scalaDedupe.d.ts +43 -0
- package/types/lib/inventory/scalaDedupe.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +25 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +12 -0
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts +10 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts +12 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
- package/types/lib/parsers/kiroPermissions.d.ts +62 -0
- package/types/lib/parsers/kiroPermissions.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +4 -3
- package/types/lib/parsers/largeJson.d.ts.map +1 -1
- package/types/lib/parsers/vscodeExtensionId.d.ts +48 -0
- package/types/lib/parsers/vscodeExtensionId.d.ts.map +1 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +7 -0
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts +25 -0
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +12 -8
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts +5 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/complianceEngine.d.ts +4 -4
- package/types/lib/validator/complianceEngine.d.ts.map +1 -1
- package/types/lib/validator/complianceRules.d.ts +14 -2
- package/types/lib/validator/complianceRules.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +10 -0
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// Bounded, read-only probe for the Ruby no package manager owns on a live host,
|
|
2
|
+
// for `-t os` / obom. osquery's package tables list what dpkg, rpm and the like
|
|
3
|
+
// installed, so a Ruby built by ruby-build, rbenv, rvm, asdf, mise, chruby or
|
|
4
|
+
// frum, unpacked from a toolcache tarball, or installed under /usr/local or
|
|
5
|
+
// /opt is invisible to them, and with it the version an advisory in the
|
|
6
|
+
// interpreter core is read against.
|
|
7
|
+
//
|
|
8
|
+
// Candidates come from fixed directories and from each version manager's tree
|
|
9
|
+
// under the home directories, one wildcard level at a time, never from a walk
|
|
10
|
+
// of the file system. The ownership rules, caps and degradations are the
|
|
11
|
+
// shared host-runtime probe's. Only rbconfig.rb and the interpreter's own
|
|
12
|
+
// files are read; nothing is executed.
|
|
13
|
+
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
isDryRun,
|
|
18
|
+
readEnvironmentVariable,
|
|
19
|
+
recordActivity,
|
|
20
|
+
} from "../core/activity.js";
|
|
21
|
+
import { recordDegradation } from "../core/buildLedger.js";
|
|
22
|
+
import {
|
|
23
|
+
isDirectory,
|
|
24
|
+
listDirectory,
|
|
25
|
+
probeHostRuntime,
|
|
26
|
+
} from "./hostRuntimeProbe.js";
|
|
27
|
+
import {
|
|
28
|
+
attachRubyBuild,
|
|
29
|
+
createRubyRuntimeInventory,
|
|
30
|
+
isRubyBinaryName,
|
|
31
|
+
MAX_RUBY_PROBES,
|
|
32
|
+
readRubyBuildVersion,
|
|
33
|
+
} from "./rubyBuildInfo.js";
|
|
34
|
+
|
|
35
|
+
// The most directories one wildcard pattern may expand to.
|
|
36
|
+
const MAX_EXPANDED_DIRECTORIES = 256;
|
|
37
|
+
|
|
38
|
+
// Relative to the root.
|
|
39
|
+
const POSIX_DIRECTORIES = {
|
|
40
|
+
linux: [
|
|
41
|
+
"usr/local/bin",
|
|
42
|
+
"opt/*/bin",
|
|
43
|
+
"opt/rubies/*/bin",
|
|
44
|
+
"opt/hostedtoolcache/Ruby/*/*/bin",
|
|
45
|
+
"usr/local/rbenv/versions/*/bin",
|
|
46
|
+
"usr/local/rvm/rubies/*/bin",
|
|
47
|
+
],
|
|
48
|
+
darwin: [
|
|
49
|
+
"usr/local/bin",
|
|
50
|
+
"opt/*/bin",
|
|
51
|
+
"opt/rubies/*/bin",
|
|
52
|
+
"Users/runner/hostedtoolcache/Ruby/*/*/bin",
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Relative to a home directory.
|
|
57
|
+
export const RUBY_VERSION_MANAGER_DIRECTORIES = [
|
|
58
|
+
".rbenv/versions/*/bin",
|
|
59
|
+
".rvm/rubies/*/bin",
|
|
60
|
+
".asdf/installs/ruby/*/bin",
|
|
61
|
+
".local/share/mise/installs/ruby/*/bin",
|
|
62
|
+
".rubies/*/bin",
|
|
63
|
+
".frum/versions/*/bin",
|
|
64
|
+
".local/share/rv/rubies/*/bin",
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
export const HOME_PARENTS = {
|
|
68
|
+
linux: ["home"],
|
|
69
|
+
darwin: ["Users"],
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Expand a relative directory pattern whose `*` segments match one directory
|
|
74
|
+
* name each.
|
|
75
|
+
*
|
|
76
|
+
* @param {string} base absolute directory the pattern hangs off
|
|
77
|
+
* @param {string} pattern `/`-separated relative pattern
|
|
78
|
+
* @returns {string[]} existing directories, at most MAX_EXPANDED_DIRECTORIES
|
|
79
|
+
*/
|
|
80
|
+
export function expandDirectories(base, pattern) {
|
|
81
|
+
let current = [base];
|
|
82
|
+
for (const segment of pattern.split("/")) {
|
|
83
|
+
const next = [];
|
|
84
|
+
for (const directory of current) {
|
|
85
|
+
if (segment !== "*") {
|
|
86
|
+
next.push(join(directory, segment));
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
for (const name of listDirectory(directory)) {
|
|
90
|
+
const child = join(directory, name);
|
|
91
|
+
if (isDirectory(child)) {
|
|
92
|
+
next.push(child);
|
|
93
|
+
}
|
|
94
|
+
if (next.length >= MAX_EXPANDED_DIRECTORIES) {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
current = next.slice(0, MAX_EXPANDED_DIRECTORIES);
|
|
100
|
+
}
|
|
101
|
+
return current.filter(isDirectory);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The home directories of a host: /root and /home/* on Linux, /Users/* on
|
|
106
|
+
* macOS.
|
|
107
|
+
*
|
|
108
|
+
* @param {{rootPath: string, platform: string}} context probe context
|
|
109
|
+
* @returns {string[]}
|
|
110
|
+
*/
|
|
111
|
+
export function homeDirectories(context) {
|
|
112
|
+
const { rootPath, platform } = context;
|
|
113
|
+
const homes = [];
|
|
114
|
+
if (platform === "linux") {
|
|
115
|
+
homes.push(join(rootPath, "root"));
|
|
116
|
+
}
|
|
117
|
+
for (const parent of HOME_PARENTS[platform] || []) {
|
|
118
|
+
for (const name of listDirectory(join(rootPath, parent))) {
|
|
119
|
+
const home = join(rootPath, parent, name);
|
|
120
|
+
if (isDirectory(home)) {
|
|
121
|
+
homes.push(home);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return homes.slice(0, MAX_EXPANDED_DIRECTORIES);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The directories a Windows Ruby lives in: the RubyInstaller's C:\Ruby34-x64,
|
|
130
|
+
* Chocolatey's C:\tools\ruby34, and the hosted toolcache.
|
|
131
|
+
*
|
|
132
|
+
* @param {Object} context probe context
|
|
133
|
+
* @returns {string[]} install roots, each with a `bin` directory
|
|
134
|
+
*/
|
|
135
|
+
export function windowsRubyRoots(context) {
|
|
136
|
+
const { rootPath } = context;
|
|
137
|
+
const roots = [];
|
|
138
|
+
for (const parent of [rootPath, join(rootPath, "tools")]) {
|
|
139
|
+
for (const name of listDirectory(parent)) {
|
|
140
|
+
const directory = join(parent, name);
|
|
141
|
+
if (name.toLowerCase().startsWith("ruby") && isDirectory(directory)) {
|
|
142
|
+
roots.push(directory);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
roots.push(
|
|
147
|
+
...expandDirectories(rootPath, "hostedtoolcache/windows/Ruby/*/*"),
|
|
148
|
+
);
|
|
149
|
+
return roots.slice(0, MAX_EXPANDED_DIRECTORIES);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function candidateDirectories(context) {
|
|
153
|
+
const { rootPath, platform } = context;
|
|
154
|
+
const directories = [];
|
|
155
|
+
if (platform === "win32") {
|
|
156
|
+
for (const root of windowsRubyRoots(context)) {
|
|
157
|
+
directories.push({ directory: join(root, "bin") });
|
|
158
|
+
}
|
|
159
|
+
return directories;
|
|
160
|
+
}
|
|
161
|
+
for (const pattern of POSIX_DIRECTORIES[platform] || []) {
|
|
162
|
+
for (const directory of expandDirectories(rootPath, pattern)) {
|
|
163
|
+
directories.push({ directory });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
for (const home of homeDirectories(context)) {
|
|
167
|
+
for (const pattern of RUBY_VERSION_MANAGER_DIRECTORIES) {
|
|
168
|
+
for (const directory of expandDirectories(home, pattern)) {
|
|
169
|
+
directories.push({ directory });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return directories;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Look for Ruby no package manager owns on the host. Components come back
|
|
178
|
+
* only for the files nothing owns: a `file` component for each `ruby` binary
|
|
179
|
+
* with the cdx:ruby properties, and one `platform` component per Ruby version
|
|
180
|
+
* with its CPE.
|
|
181
|
+
*
|
|
182
|
+
* @param {Object} [options] probe options, as probeHostPhp takes them
|
|
183
|
+
* @returns {{components: Object[], dependencies: Object[]}}
|
|
184
|
+
*/
|
|
185
|
+
export function probeHostRuby(options = {}) {
|
|
186
|
+
return probeHostRuntime(options, {
|
|
187
|
+
label: "Ruby",
|
|
188
|
+
ecosystem: "ruby",
|
|
189
|
+
capability: "ruby-host-probe",
|
|
190
|
+
remediationId: "ruby.host-probe.package-db-unreadable",
|
|
191
|
+
maxProbes: MAX_RUBY_PROBES,
|
|
192
|
+
chocolateyPackages: ["ruby"],
|
|
193
|
+
// Chocolatey's ruby package runs the RubyInstaller into C:\tools.
|
|
194
|
+
chocolateyDirectories: (context) => [join(context.rootPath, "tools")],
|
|
195
|
+
directories: candidateDirectories,
|
|
196
|
+
classify: (name, platform) => {
|
|
197
|
+
if (platform === "win32") {
|
|
198
|
+
return name.toLowerCase() === "ruby.exe" ? "ruby" : undefined;
|
|
199
|
+
}
|
|
200
|
+
return isRubyBinaryName(name) ? "ruby" : undefined;
|
|
201
|
+
},
|
|
202
|
+
readBuild: (context, candidate) =>
|
|
203
|
+
readRubyBuildVersion(candidate.real, context.realRoot),
|
|
204
|
+
createInventory: createRubyRuntimeInventory,
|
|
205
|
+
attach: (inventory, component, build) =>
|
|
206
|
+
attachRubyBuild(inventory, component, build),
|
|
207
|
+
finish: (inventory) => ({
|
|
208
|
+
components: inventory.runtimeComponents,
|
|
209
|
+
dependencies: inventory.dependencies,
|
|
210
|
+
}),
|
|
211
|
+
hooks: {
|
|
212
|
+
isDryRun,
|
|
213
|
+
readEnvironmentVariable,
|
|
214
|
+
recordActivity,
|
|
215
|
+
recordDegradation,
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
}
|
|
@@ -3,6 +3,7 @@ import { basename, dirname, join } from "node:path";
|
|
|
3
3
|
|
|
4
4
|
import { safeExistsSync } from "../core/fs.js";
|
|
5
5
|
import { parseToml } from "../core/toml.js";
|
|
6
|
+
import { formulationSourcePath } from "./ecosystemFormulationParsers.js";
|
|
6
7
|
|
|
7
8
|
// Keep this list conservative and high-signal: it is meant to surface common
|
|
8
9
|
// Rust native build helpers for audit triage, not to exhaustively model every
|
|
@@ -53,17 +54,18 @@ function appendProperty(properties, name, value) {
|
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
function createFormulationComponent(name, filePath, toolName) {
|
|
57
|
+
function createFormulationComponent(name, filePath, toolName, rootDir) {
|
|
58
|
+
const sourcePath = formulationSourcePath(filePath, rootDir);
|
|
57
59
|
return {
|
|
58
60
|
type: "application",
|
|
59
61
|
name,
|
|
60
62
|
version: "config",
|
|
61
|
-
"bom-ref": `urn:cdxgen:formulation:${toolName}:${
|
|
62
|
-
properties: [{ name: "internal:SrcFile", value:
|
|
63
|
+
"bom-ref": `urn:cdxgen:formulation:${toolName}:${sourcePath}`,
|
|
64
|
+
properties: [{ name: "internal:SrcFile", value: sourcePath }],
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
function parseCargoManifest(filePath) {
|
|
68
|
+
function parseCargoManifest(filePath, rootDir) {
|
|
67
69
|
let cargoData;
|
|
68
70
|
try {
|
|
69
71
|
cargoData = parseToml(readFileSync(filePath, { encoding: "utf-8" }));
|
|
@@ -75,7 +77,12 @@ function parseCargoManifest(filePath) {
|
|
|
75
77
|
}
|
|
76
78
|
const packageName =
|
|
77
79
|
cargoData?.package?.name || basename(dirname(filePath)) || "cargo-project";
|
|
78
|
-
const component = createFormulationComponent(
|
|
80
|
+
const component = createFormulationComponent(
|
|
81
|
+
packageName,
|
|
82
|
+
filePath,
|
|
83
|
+
"cargo",
|
|
84
|
+
rootDir,
|
|
85
|
+
);
|
|
79
86
|
const properties = component.properties;
|
|
80
87
|
const buildDependencies = cargoData?.["build-dependencies"];
|
|
81
88
|
const devDependencies = cargoData?.["dev-dependencies"];
|
|
@@ -248,7 +255,7 @@ function parseCargoManifest(filePath) {
|
|
|
248
255
|
return component;
|
|
249
256
|
}
|
|
250
257
|
|
|
251
|
-
function parsePyProject(filePath) {
|
|
258
|
+
function parsePyProject(filePath, rootDir) {
|
|
252
259
|
let pyprojectData;
|
|
253
260
|
try {
|
|
254
261
|
pyprojectData = parseToml(readFileSync(filePath, { encoding: "utf-8" }));
|
|
@@ -269,6 +276,7 @@ function parsePyProject(filePath) {
|
|
|
269
276
|
"maturin-project",
|
|
270
277
|
filePath,
|
|
271
278
|
"maturin",
|
|
279
|
+
rootDir,
|
|
272
280
|
);
|
|
273
281
|
const properties = component.properties;
|
|
274
282
|
appendProperty(properties, "cdx:rust:buildTool", "maturin");
|
|
@@ -311,23 +319,26 @@ function parsePyProject(filePath) {
|
|
|
311
319
|
* formulation components carrying build-tool, build-script capability, native
|
|
312
320
|
* build dependency, and maturin metadata properties.
|
|
313
321
|
*
|
|
314
|
-
*
|
|
322
|
+
* Components record the manifest path relative to context.rootDir, the
|
|
323
|
+
* scanned project root.
|
|
324
|
+
*
|
|
325
|
+
* @type {{id: string, patterns: string[], parse(files: string[], options?: Object, context?: {rootDir?: string}): {components: Object[]}}}
|
|
315
326
|
*/
|
|
316
327
|
export const rustFormulationParser = {
|
|
317
328
|
id: "rust-build",
|
|
318
329
|
patterns: ["**/Cargo.toml", "**/pyproject.toml"],
|
|
319
|
-
parse(files) {
|
|
330
|
+
parse(files, _options, context = {}) {
|
|
320
331
|
const components = [];
|
|
321
332
|
for (const filePath of files || []) {
|
|
322
333
|
if (filePath.endsWith("Cargo.toml")) {
|
|
323
|
-
const cargoComponent = parseCargoManifest(filePath);
|
|
334
|
+
const cargoComponent = parseCargoManifest(filePath, context.rootDir);
|
|
324
335
|
if (cargoComponent) {
|
|
325
336
|
components.push(cargoComponent);
|
|
326
337
|
}
|
|
327
338
|
continue;
|
|
328
339
|
}
|
|
329
340
|
if (filePath.endsWith("pyproject.toml")) {
|
|
330
|
-
const pyprojectComponent = parsePyProject(filePath);
|
|
341
|
+
const pyprojectComponent = parsePyProject(filePath, context.rootDir);
|
|
331
342
|
if (pyprojectComponent) {
|
|
332
343
|
components.push(pyprojectComponent);
|
|
333
344
|
}
|
|
@@ -7,7 +7,7 @@ import { Purl } from "@cdxgen/cdx-purl";
|
|
|
7
7
|
// platform suffix (`jwt-core`, `upickle_sjs1`), so the same library is named
|
|
8
8
|
// differently depending on the build tool that reported it.
|
|
9
9
|
const SCALA_BINARY_SUFFIX_REGEX = /_(2\.\d+|3)$/;
|
|
10
|
-
const SCALA_PLATFORM_SUFFIX_REGEX = /_(
|
|
10
|
+
const SCALA_PLATFORM_SUFFIX_REGEX = /_(sjs\d+(?:\.\d+)?|native\d+(?:\.\d+)?)$/;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Parse a Scala-published Maven artifact name into its coordinate parts.
|
|
@@ -123,10 +123,11 @@ export function scalaCoordinateOfPurl(purlString) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
// An artifact name that already ends in a full Scala version, as scala-cli
|
|
126
|
-
// `:::` and sbt `CrossVersion.full` artifacts do (`_3.3.7`, `_2.13.16
|
|
126
|
+
// `:::` and sbt `CrossVersion.full` artifacts do (`_3.3.7`, `_2.13.16`,
|
|
127
|
+
// `_3.4.0-RC1-bin-20231010-abc1234-NIGHTLY`). A
|
|
127
128
|
// binary suffix such as `_3` left on a name is part of the name: the
|
|
128
129
|
// component producers strip exactly one, into the compiler version.
|
|
129
|
-
const SCALA_FULL_VERSION_SUFFIX_REGEX = /_\d+\.\d+\.\d+(?:-[A-Za-z0-9
|
|
130
|
+
const SCALA_FULL_VERSION_SUFFIX_REGEX = /_\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/;
|
|
130
131
|
|
|
131
132
|
/**
|
|
132
133
|
* The artifactId the library is published under, for cache and repository
|