kirograph 0.16.1 → 0.19.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/LICENSE +1 -1
- package/README.md +103 -1605
- package/dist/architecture/layers/dart.js +112 -0
- package/dist/architecture/layers/dart.js.map +7 -0
- package/dist/architecture/layers/index.js +3 -1
- package/dist/architecture/layers/index.js.map +2 -2
- package/dist/bin/banner.js +74 -6
- package/dist/bin/banner.js.map +2 -2
- package/dist/bin/commands/affected.js +40 -5
- package/dist/bin/commands/affected.js.map +2 -2
- package/dist/bin/commands/attack-surface.js +157 -0
- package/dist/bin/commands/attack-surface.js.map +7 -0
- package/dist/bin/commands/benchmark.js +206 -0
- package/dist/bin/commands/benchmark.js.map +7 -0
- package/dist/bin/commands/budget.js +70 -0
- package/dist/bin/commands/budget.js.map +7 -0
- package/dist/bin/commands/communities.js +77 -0
- package/dist/bin/commands/communities.js.map +7 -0
- package/dist/bin/commands/data.js +665 -0
- package/dist/bin/commands/data.js.map +7 -0
- package/dist/bin/commands/dep-confusion.js +119 -0
- package/dist/bin/commands/dep-confusion.js.map +7 -0
- package/dist/bin/commands/export.js +304 -10
- package/dist/bin/commands/export.js.map +2 -2
- package/dist/bin/commands/flows.js +97 -0
- package/dist/bin/commands/flows.js.map +7 -0
- package/dist/bin/commands/help.js +386 -100
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/install.js +90 -8
- package/dist/bin/commands/install.js.map +2 -2
- package/dist/bin/commands/licenses.js +201 -0
- package/dist/bin/commands/licenses.js.map +7 -0
- package/dist/bin/commands/reachability.js +160 -0
- package/dist/bin/commands/reachability.js.map +7 -0
- package/dist/bin/commands/read.js +100 -0
- package/dist/bin/commands/read.js.map +7 -0
- package/dist/bin/commands/refactor.js +116 -0
- package/dist/bin/commands/refactor.js.map +7 -0
- package/dist/bin/commands/remediation.js +133 -0
- package/dist/bin/commands/remediation.js.map +7 -0
- package/dist/bin/commands/sbom.js +76 -0
- package/dist/bin/commands/sbom.js.map +7 -0
- package/dist/bin/commands/security-ci-report.js +267 -0
- package/dist/bin/commands/security-ci-report.js.map +7 -0
- package/dist/bin/commands/security-export.js +1349 -0
- package/dist/bin/commands/security-export.js.map +7 -0
- package/dist/bin/commands/security-flows.js +126 -0
- package/dist/bin/commands/security-flows.js.map +7 -0
- package/dist/bin/commands/security-secrets.js +170 -0
- package/dist/bin/commands/security-secrets.js.map +7 -0
- package/dist/bin/commands/security.js +193 -0
- package/dist/bin/commands/security.js.map +7 -0
- package/dist/bin/commands/staleness.js +144 -0
- package/dist/bin/commands/staleness.js.map +7 -0
- package/dist/bin/commands/status.js +102 -2
- package/dist/bin/commands/status.js.map +2 -2
- package/dist/bin/commands/supply-chain.js +138 -0
- package/dist/bin/commands/supply-chain.js.map +7 -0
- package/dist/bin/commands/uninit.js +109 -60
- package/dist/bin/commands/uninit.js.map +2 -2
- package/dist/bin/commands/vex.js +76 -0
- package/dist/bin/commands/vex.js.map +7 -0
- package/dist/bin/commands/vuln-suppress.js +95 -0
- package/dist/bin/commands/vuln-suppress.js.map +7 -0
- package/dist/bin/commands/vulns.js +382 -0
- package/dist/bin/commands/vulns.js.map +7 -0
- package/dist/bin/installer/auto-detect.js +125 -0
- package/dist/bin/installer/auto-detect.js.map +7 -0
- package/dist/bin/installer/cli-agent.js +28 -5
- package/dist/bin/installer/cli-agent.js.map +2 -2
- package/dist/bin/installer/common.js +47 -0
- package/dist/bin/installer/common.js.map +2 -2
- package/dist/bin/installer/config-prompt.js +39 -1
- package/dist/bin/installer/config-prompt.js.map +2 -2
- package/dist/bin/installer/detect.js +309 -0
- package/dist/bin/installer/detect.js.map +7 -0
- package/dist/bin/installer/index.js +36 -1
- package/dist/bin/installer/index.js.map +2 -2
- package/dist/bin/installer/instructions.js +195 -3
- package/dist/bin/installer/instructions.js.map +2 -2
- package/dist/bin/installer/steering.js +440 -0
- package/dist/bin/installer/steering.js.map +2 -2
- package/dist/bin/installer/targets/aider.js +3 -3
- package/dist/bin/installer/targets/aider.js.map +2 -2
- package/dist/bin/installer/targets/amp.js +3 -3
- package/dist/bin/installer/targets/amp.js.map +2 -2
- package/dist/bin/installer/targets/antigravity.js +35 -6
- package/dist/bin/installer/targets/antigravity.js.map +2 -2
- package/dist/bin/installer/targets/augment.js +3 -3
- package/dist/bin/installer/targets/augment.js.map +2 -2
- package/dist/bin/installer/targets/claude.js +49 -5
- package/dist/bin/installer/targets/claude.js.map +2 -2
- package/dist/bin/installer/targets/cline.js +32 -6
- package/dist/bin/installer/targets/cline.js.map +2 -2
- package/dist/bin/installer/targets/codex.js +64 -12
- package/dist/bin/installer/targets/codex.js.map +2 -2
- package/dist/bin/installer/targets/continue.js +2 -2
- package/dist/bin/installer/targets/continue.js.map +2 -2
- package/dist/bin/installer/targets/copilot-cli.js +101 -0
- package/dist/bin/installer/targets/copilot-cli.js.map +7 -0
- package/dist/bin/installer/targets/copilot.js +31 -5
- package/dist/bin/installer/targets/copilot.js.map +2 -2
- package/dist/bin/installer/targets/cursor.js +4 -4
- package/dist/bin/installer/targets/cursor.js.map +2 -2
- package/dist/bin/installer/targets/devin.js +2 -2
- package/dist/bin/installer/targets/devin.js.map +2 -2
- package/dist/bin/installer/targets/gemini-cli.js +2 -2
- package/dist/bin/installer/targets/gemini-cli.js.map +2 -2
- package/dist/bin/installer/targets/generic.js +2 -14
- package/dist/bin/installer/targets/generic.js.map +2 -2
- package/dist/bin/installer/targets/goose.js +3 -3
- package/dist/bin/installer/targets/goose.js.map +2 -2
- package/dist/bin/installer/targets/index.js +250 -0
- package/dist/bin/installer/targets/index.js.map +2 -2
- package/dist/bin/installer/targets/junie.js +2 -2
- package/dist/bin/installer/targets/junie.js.map +2 -2
- package/dist/bin/installer/targets/kilo.js +2 -2
- package/dist/bin/installer/targets/kilo.js.map +2 -2
- package/dist/bin/installer/targets/kiro.js +3 -3
- package/dist/bin/installer/targets/kiro.js.map +2 -2
- package/dist/bin/installer/targets/opencode.js +2 -2
- package/dist/bin/installer/targets/opencode.js.map +2 -2
- package/dist/bin/installer/targets/openhands.js +3 -3
- package/dist/bin/installer/targets/openhands.js.map +2 -2
- package/dist/bin/installer/targets/qoder.js +91 -0
- package/dist/bin/installer/targets/qoder.js.map +7 -0
- package/dist/bin/installer/targets/qwen.js +96 -0
- package/dist/bin/installer/targets/qwen.js.map +7 -0
- package/dist/bin/installer/targets/replit.js +3 -3
- package/dist/bin/installer/targets/replit.js.map +2 -2
- package/dist/bin/installer/targets/roo.js +2 -2
- package/dist/bin/installer/targets/roo.js.map +2 -2
- package/dist/bin/installer/targets/tabnine.js +3 -3
- package/dist/bin/installer/targets/tabnine.js.map +2 -2
- package/dist/bin/installer/targets/trae.js +5 -5
- package/dist/bin/installer/targets/trae.js.map +2 -2
- package/dist/bin/installer/targets/warp.js +2 -2
- package/dist/bin/installer/targets/warp.js.map +2 -2
- package/dist/bin/installer/targets/windsurf.js +35 -6
- package/dist/bin/installer/targets/windsurf.js.map +2 -2
- package/dist/bin/kirograph.js +74 -6
- package/dist/bin/kirograph.js.map +3 -3
- package/dist/bin/progress.js +30 -0
- package/dist/bin/progress.js.map +2 -2
- package/dist/compression/naive-cost.js +25 -0
- package/dist/compression/naive-cost.js.map +2 -2
- package/dist/compression/tracker.js +91 -2
- package/dist/compression/tracker.js.map +2 -2
- package/dist/compression/types.js.map +1 -1
- package/dist/config.js +126 -3
- package/dist/config.js.map +2 -2
- package/dist/core/pipeline.js +92 -4
- package/dist/core/pipeline.js.map +2 -2
- package/dist/data/filters.js +105 -0
- package/dist/data/filters.js.map +7 -0
- package/dist/data/indexer.js +225 -0
- package/dist/data/indexer.js.map +7 -0
- package/dist/data/linker.js +150 -0
- package/dist/data/linker.js.map +7 -0
- package/dist/data/lint.js +109 -0
- package/dist/data/lint.js.map +7 -0
- package/dist/data/parsers/csv.js +132 -0
- package/dist/data/parsers/csv.js.map +7 -0
- package/dist/data/parsers/excel.js +88 -0
- package/dist/data/parsers/excel.js.map +7 -0
- package/dist/data/parsers/index.js +79 -0
- package/dist/data/parsers/index.js.map +7 -0
- package/dist/data/parsers/json-array.js +89 -0
- package/dist/data/parsers/json-array.js.map +7 -0
- package/dist/data/parsers/jsonl.js +84 -0
- package/dist/data/parsers/jsonl.js.map +7 -0
- package/dist/data/parsers/parquet.js +95 -0
- package/dist/data/parsers/parquet.js.map +7 -0
- package/dist/data/profiler.js +182 -0
- package/dist/data/profiler.js.map +7 -0
- package/dist/data/queries.js +512 -0
- package/dist/data/queries.js.map +7 -0
- package/dist/data/types.js +17 -0
- package/dist/data/types.js.map +7 -0
- package/dist/db/data-schema.sql +61 -0
- package/dist/db/database.js +67 -5
- package/dist/db/database.js.map +2 -2
- package/dist/db/memory-schema.sql +5 -1
- package/dist/db/schema.sql +3 -1
- package/dist/db/security-schema.sql +72 -0
- package/dist/extraction/extractor.js +81 -0
- package/dist/extraction/extractor.js.map +2 -2
- package/dist/extraction/grammars.js +32 -8
- package/dist/extraction/grammars.js.map +2 -2
- package/dist/extraction/languages.js +43 -1
- package/dist/extraction/languages.js.map +2 -2
- package/dist/extraction/notebook.js +300 -0
- package/dist/extraction/notebook.js.map +7 -0
- package/dist/extraction/wasm/tree-sitter-astro.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-gdscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-julia.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-perl.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-powershell.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-sql.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-verilog.wasm +0 -0
- package/dist/frameworks/flutter.js +130 -0
- package/dist/frameworks/flutter.js.map +7 -0
- package/dist/frameworks/index.js +7 -1
- package/dist/frameworks/index.js.map +3 -3
- package/dist/graph/communities.js +317 -0
- package/dist/graph/communities.js.map +7 -0
- package/dist/graph/flows.js +138 -0
- package/dist/graph/flows.js.map +7 -0
- package/dist/graph/refactor.js +155 -0
- package/dist/graph/refactor.js.map +7 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/mcp/cache.js +172 -0
- package/dist/mcp/cache.js.map +7 -0
- package/dist/mcp/read-modes.js +295 -0
- package/dist/mcp/read-modes.js.map +7 -0
- package/dist/mcp/server.js +2 -1
- package/dist/mcp/server.js.map +2 -2
- package/dist/mcp/tool-names.js +29 -1
- package/dist/mcp/tool-names.js.map +2 -2
- package/dist/mcp/tools.js +1588 -6
- package/dist/mcp/tools.js.map +3 -3
- package/dist/memory/database.js +32 -2
- package/dist/memory/database.js.map +2 -2
- package/dist/memory/types.js.map +1 -1
- package/dist/resolution/bridges/android-rn.js +298 -0
- package/dist/resolution/bridges/android-rn.js.map +7 -0
- package/dist/resolution/bridges/expo-modules.js +155 -0
- package/dist/resolution/bridges/expo-modules.js.map +7 -0
- package/dist/resolution/bridges/flutter-channel.js +385 -0
- package/dist/resolution/bridges/flutter-channel.js.map +7 -0
- package/dist/resolution/bridges/index.js +80 -0
- package/dist/resolution/bridges/index.js.map +7 -0
- package/dist/resolution/bridges/native-events.js +188 -0
- package/dist/resolution/bridges/native-events.js.map +7 -0
- package/dist/resolution/bridges/native-views.js +244 -0
- package/dist/resolution/bridges/native-views.js.map +7 -0
- package/dist/resolution/bridges/react-native.js +161 -0
- package/dist/resolution/bridges/react-native.js.map +7 -0
- package/dist/resolution/bridges/swift-objc.js +227 -0
- package/dist/resolution/bridges/swift-objc.js.map +7 -0
- package/dist/resolution/bridges/turbomodules.js +216 -0
- package/dist/resolution/bridges/turbomodules.js.map +7 -0
- package/dist/resolution/index.js +61 -2
- package/dist/resolution/index.js.map +2 -2
- package/dist/security/attack-surface.js +164 -0
- package/dist/security/attack-surface.js.map +7 -0
- package/dist/security/context-warnings.js +123 -0
- package/dist/security/context-warnings.js.map +7 -0
- package/dist/security/context-warnings.test.js +300 -0
- package/dist/security/context-warnings.test.js.map +7 -0
- package/dist/security/data-flows.js +228 -0
- package/dist/security/data-flows.js.map +7 -0
- package/dist/security/dep-confusion.js +255 -0
- package/dist/security/dep-confusion.js.map +7 -0
- package/dist/security/errors.js +51 -0
- package/dist/security/errors.js.map +7 -0
- package/dist/security/export/fix-suggestions.js +58 -0
- package/dist/security/export/fix-suggestions.js.map +7 -0
- package/dist/security/export/fix-suggestions.test.js +74 -0
- package/dist/security/export/fix-suggestions.test.js.map +7 -0
- package/dist/security/export/sbom.js +230 -0
- package/dist/security/export/sbom.js.map +7 -0
- package/dist/security/export/sbom.test.js +288 -0
- package/dist/security/export/sbom.test.js.map +7 -0
- package/dist/security/export/serialization.js +142 -0
- package/dist/security/export/serialization.js.map +7 -0
- package/dist/security/export/serialization.test.js +310 -0
- package/dist/security/export/serialization.test.js.map +7 -0
- package/dist/security/export/vex.js +220 -0
- package/dist/security/export/vex.js.map +7 -0
- package/dist/security/export/vex.test.js +278 -0
- package/dist/security/export/vex.test.js.map +7 -0
- package/dist/security/index.js +67 -0
- package/dist/security/index.js.map +7 -0
- package/dist/security/integrator-transitives.test.js +359 -0
- package/dist/security/integrator-transitives.test.js.map +7 -0
- package/dist/security/integrator.js +491 -0
- package/dist/security/integrator.js.map +7 -0
- package/dist/security/integrator.test.js +237 -0
- package/dist/security/integrator.test.js.map +7 -0
- package/dist/security/license.js +70 -0
- package/dist/security/license.js.map +7 -0
- package/dist/security/manifest/adapter.js +243 -0
- package/dist/security/manifest/adapter.js.map +7 -0
- package/dist/security/manifest/adapter.test.js +272 -0
- package/dist/security/manifest/adapter.test.js.map +7 -0
- package/dist/security/manifest/parser.js +376 -0
- package/dist/security/manifest/parser.js.map +7 -0
- package/dist/security/manifest/parser.test.js +110 -0
- package/dist/security/manifest/parser.test.js.map +7 -0
- package/dist/security/manifest/plugins/cargo.js +233 -0
- package/dist/security/manifest/plugins/cargo.js.map +7 -0
- package/dist/security/manifest/plugins/cargo.test.js +304 -0
- package/dist/security/manifest/plugins/cargo.test.js.map +7 -0
- package/dist/security/manifest/plugins/composer.js +152 -0
- package/dist/security/manifest/plugins/composer.js.map +7 -0
- package/dist/security/manifest/plugins/go.js +146 -0
- package/dist/security/manifest/plugins/go.js.map +7 -0
- package/dist/security/manifest/plugins/go.test.js +341 -0
- package/dist/security/manifest/plugins/go.test.js.map +7 -0
- package/dist/security/manifest/plugins/gradle.js +159 -0
- package/dist/security/manifest/plugins/gradle.js.map +7 -0
- package/dist/security/manifest/plugins/hex.js +159 -0
- package/dist/security/manifest/plugins/hex.js.map +7 -0
- package/dist/security/manifest/plugins/maven.js +128 -0
- package/dist/security/manifest/plugins/maven.js.map +7 -0
- package/dist/security/manifest/plugins/maven.test.js +389 -0
- package/dist/security/manifest/plugins/maven.test.js.map +7 -0
- package/dist/security/manifest/plugins/npm.js +284 -0
- package/dist/security/manifest/plugins/npm.js.map +7 -0
- package/dist/security/manifest/plugins/npm.test.js +298 -0
- package/dist/security/manifest/plugins/npm.test.js.map +7 -0
- package/dist/security/manifest/plugins/nuget.js +186 -0
- package/dist/security/manifest/plugins/nuget.js.map +7 -0
- package/dist/security/manifest/plugins/pip.js +123 -0
- package/dist/security/manifest/plugins/pip.js.map +7 -0
- package/dist/security/manifest/plugins/pip.test.js +208 -0
- package/dist/security/manifest/plugins/pip.test.js.map +7 -0
- package/dist/security/manifest/plugins/pubspec.js +212 -0
- package/dist/security/manifest/plugins/pubspec.js.map +7 -0
- package/dist/security/manifest/plugins/pyproject.js +261 -0
- package/dist/security/manifest/plugins/pyproject.js.map +7 -0
- package/dist/security/manifest/plugins/rubygems.js +185 -0
- package/dist/security/manifest/plugins/rubygems.js.map +7 -0
- package/dist/security/manifest/plugins/swift.js +200 -0
- package/dist/security/manifest/plugins/swift.js.map +7 -0
- package/dist/security/owasp.js +104 -0
- package/dist/security/owasp.js.map +7 -0
- package/dist/security/pipeline.js +125 -0
- package/dist/security/pipeline.js.map +7 -0
- package/dist/security/reachability.js +276 -0
- package/dist/security/reachability.js.map +7 -0
- package/dist/security/reachability.test.js +394 -0
- package/dist/security/reachability.test.js.map +7 -0
- package/dist/security/remediation.js +126 -0
- package/dist/security/remediation.js.map +7 -0
- package/dist/security/secrets.js +176 -0
- package/dist/security/secrets.js.map +7 -0
- package/dist/security/staleness.js +231 -0
- package/dist/security/staleness.js.map +7 -0
- package/dist/security/supply-chain.js +301 -0
- package/dist/security/supply-chain.js.map +7 -0
- package/dist/security/suppressions.js +106 -0
- package/dist/security/suppressions.js.map +7 -0
- package/dist/security/types.js +17 -0
- package/dist/security/types.js.map +7 -0
- package/dist/security/vuln/client.js +355 -0
- package/dist/security/vuln/client.js.map +7 -0
- package/dist/security/vuln/client.test.js +288 -0
- package/dist/security/vuln/client.test.js.map +7 -0
- package/dist/security/vuln/epss-client.js +95 -0
- package/dist/security/vuln/epss-client.js.map +7 -0
- package/dist/security/vuln/index.js +29 -0
- package/dist/security/vuln/index.js.map +7 -0
- package/dist/security/vuln/osv-adapter.js +321 -0
- package/dist/security/vuln/osv-adapter.js.map +7 -0
- package/dist/security/vuln/osv-adapter.test.js +391 -0
- package/dist/security/vuln/osv-adapter.test.js.map +7 -0
- package/dist/security/vuln/types.js +17 -0
- package/dist/security/vuln/types.js.map +7 -0
- package/dist/types.js.map +2 -2
- package/package.json +5 -2
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var vex_exports = {};
|
|
30
|
+
__export(vex_exports, {
|
|
31
|
+
VEXExporter: () => VEXExporter
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(vex_exports);
|
|
34
|
+
var path = __toESM(require("path"));
|
|
35
|
+
const TOOL_NAME = "kirograph-sec";
|
|
36
|
+
const TOOL_VERSION = "0.1.0";
|
|
37
|
+
class VEXExporter {
|
|
38
|
+
constructor(db, projectRoot) {
|
|
39
|
+
this.db = db;
|
|
40
|
+
this.projectRoot = projectRoot;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Generate CycloneDX 1.5 VEX JSON object.
|
|
44
|
+
*
|
|
45
|
+
* Queries all Vulnerability_Nodes and their reachability verdicts,
|
|
46
|
+
* producing one VEX entry per vulnerability.
|
|
47
|
+
*/
|
|
48
|
+
export() {
|
|
49
|
+
const rawDb = this.db.getRawDb();
|
|
50
|
+
const projectName = path.basename(this.projectRoot);
|
|
51
|
+
const metadata = {
|
|
52
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
53
|
+
tools: {
|
|
54
|
+
components: [
|
|
55
|
+
{
|
|
56
|
+
type: "application",
|
|
57
|
+
name: TOOL_NAME,
|
|
58
|
+
version: TOOL_VERSION
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
component: {
|
|
63
|
+
type: "application",
|
|
64
|
+
name: projectName
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const vulnRows = rawDb.all(
|
|
68
|
+
`SELECT node_id, cve_id, severity_score, source_database FROM sec_vulnerabilities`
|
|
69
|
+
);
|
|
70
|
+
const vulnerabilities = [];
|
|
71
|
+
for (const vuln of vulnRows) {
|
|
72
|
+
const entry = this.buildVulnerabilityEntry(rawDb, vuln);
|
|
73
|
+
vulnerabilities.push(entry);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
bomFormat: "CycloneDX",
|
|
77
|
+
specVersion: "1.5",
|
|
78
|
+
version: 1,
|
|
79
|
+
metadata,
|
|
80
|
+
vulnerabilities
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Export to pretty-printed JSON string.
|
|
85
|
+
*/
|
|
86
|
+
exportJSON() {
|
|
87
|
+
return JSON.stringify(this.export(), null, 2);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Build a single CycloneDX vulnerability entry from a Vulnerability_Node.
|
|
91
|
+
*
|
|
92
|
+
* Maps reachability verdicts to CycloneDX analysis states:
|
|
93
|
+
* - affected → "affected" with path summary detail
|
|
94
|
+
* - not_affected → "not_affected" with justification "code_not_reachable"
|
|
95
|
+
* - under_investigation → "under_investigation" with unresolved symbols detail
|
|
96
|
+
* - no reachability data → "under_investigation" with pending analysis detail
|
|
97
|
+
*/
|
|
98
|
+
buildVulnerabilityEntry(rawDb, vuln) {
|
|
99
|
+
const entry = {
|
|
100
|
+
id: vuln.cve_id,
|
|
101
|
+
source: {
|
|
102
|
+
name: vuln.source_database
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
if (vuln.severity_score != null) {
|
|
106
|
+
entry.ratings = [
|
|
107
|
+
{
|
|
108
|
+
score: vuln.severity_score,
|
|
109
|
+
method: "CVSSv31"
|
|
110
|
+
}
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
const depEdge = rawDb.get(
|
|
114
|
+
`SELECT source FROM edges WHERE target = ? AND kind = 'has_vulnerability'`,
|
|
115
|
+
[vuln.node_id]
|
|
116
|
+
);
|
|
117
|
+
if (depEdge) {
|
|
118
|
+
const depRow = rawDb.get(
|
|
119
|
+
`SELECT ecosystem, package_name, resolved_version, declared_constraint
|
|
120
|
+
FROM sec_dependencies WHERE node_id = ?`,
|
|
121
|
+
[depEdge.source]
|
|
122
|
+
);
|
|
123
|
+
if (depRow) {
|
|
124
|
+
const version = depRow.resolved_version || depRow.declared_constraint;
|
|
125
|
+
const purl = `pkg:${depRow.ecosystem}/${depRow.package_name}@${version}`;
|
|
126
|
+
entry.affects = [{ ref: purl }];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const reachRow = rawDb.get(
|
|
130
|
+
`SELECT verdict, paths, unresolved_symbols, reaching_entry_point_count
|
|
131
|
+
FROM sec_reachability WHERE vulnerability_node_id = ?`,
|
|
132
|
+
[vuln.node_id]
|
|
133
|
+
);
|
|
134
|
+
if (!reachRow) {
|
|
135
|
+
entry.analysis = {
|
|
136
|
+
state: "under_investigation",
|
|
137
|
+
detail: "Reachability analysis has not yet been executed for this vulnerability."
|
|
138
|
+
};
|
|
139
|
+
} else {
|
|
140
|
+
entry.analysis = this.buildAnalysis(rawDb, vuln.node_id, reachRow);
|
|
141
|
+
}
|
|
142
|
+
return entry;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Build the analysis section based on the reachability verdict.
|
|
146
|
+
*/
|
|
147
|
+
buildAnalysis(rawDb, vulnerabilityNodeId, reachRow) {
|
|
148
|
+
switch (reachRow.verdict) {
|
|
149
|
+
case "affected":
|
|
150
|
+
return this.buildAffectedAnalysis(rawDb, vulnerabilityNodeId, reachRow);
|
|
151
|
+
case "not_affected":
|
|
152
|
+
return {
|
|
153
|
+
state: "not_affected",
|
|
154
|
+
justification: "code_not_reachable",
|
|
155
|
+
detail: "No reachable path found from any application entry point to this dependency."
|
|
156
|
+
};
|
|
157
|
+
case "under_investigation":
|
|
158
|
+
return this.buildUnderInvestigationAnalysis(reachRow);
|
|
159
|
+
default:
|
|
160
|
+
return {
|
|
161
|
+
state: "under_investigation",
|
|
162
|
+
detail: "Reachability analysis pending."
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Build analysis detail for "affected" verdict.
|
|
168
|
+
*
|
|
169
|
+
* Includes: entry point count, layer count, shortest path length.
|
|
170
|
+
*/
|
|
171
|
+
buildAffectedAnalysis(rawDb, vulnerabilityNodeId, reachRow) {
|
|
172
|
+
const entryPointCount = reachRow.reaching_entry_point_count;
|
|
173
|
+
const impactRow = rawDb.get(
|
|
174
|
+
`SELECT affected_layers, distinct_path_count FROM sec_impact WHERE vulnerability_node_id = ?`,
|
|
175
|
+
[vulnerabilityNodeId]
|
|
176
|
+
);
|
|
177
|
+
let layerCount = 0;
|
|
178
|
+
if (impactRow && impactRow.affected_layers) {
|
|
179
|
+
const layers = JSON.parse(impactRow.affected_layers);
|
|
180
|
+
layerCount = layers.length;
|
|
181
|
+
}
|
|
182
|
+
let shortestPathLength = 0;
|
|
183
|
+
if (reachRow.paths) {
|
|
184
|
+
const paths = JSON.parse(reachRow.paths);
|
|
185
|
+
if (paths.length > 0) {
|
|
186
|
+
shortestPathLength = Math.min(...paths.map((p) => p.path.length));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const detail = `Reachable from ${entryPointCount} entry point${entryPointCount !== 1 ? "s" : ""} via ${layerCount} layer${layerCount !== 1 ? "s" : ""}. Shortest path length: ${shortestPathLength} nodes.`;
|
|
190
|
+
return {
|
|
191
|
+
state: "affected",
|
|
192
|
+
detail
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Build analysis detail for "under_investigation" verdict.
|
|
197
|
+
*
|
|
198
|
+
* Lists unresolved symbols or states pending analysis reason.
|
|
199
|
+
*/
|
|
200
|
+
buildUnderInvestigationAnalysis(reachRow) {
|
|
201
|
+
if (reachRow.unresolved_symbols) {
|
|
202
|
+
const symbols = JSON.parse(reachRow.unresolved_symbols);
|
|
203
|
+
if (symbols.length > 0) {
|
|
204
|
+
return {
|
|
205
|
+
state: "under_investigation",
|
|
206
|
+
detail: `${symbols.length} unresolved symbol${symbols.length !== 1 ? "s" : ""} blocked complete analysis: ${symbols.join(", ")}`
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
state: "under_investigation",
|
|
212
|
+
detail: "Reachability analysis pending."
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
217
|
+
0 && (module.exports = {
|
|
218
|
+
VEXExporter
|
|
219
|
+
});
|
|
220
|
+
//# sourceMappingURL=vex.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/security/export/vex.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph-Sec VEX Exporter\n *\n * Generates CycloneDX 1.5 VEX (Vulnerability Exploitability eXchange) documents\n * with reachability-informed vulnerability status. Each Vulnerability_Node is\n * mapped to a VEX entry with an analysis state derived from the reachability verdict.\n *\n * Requirements: 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8\n */\n\nimport * as path from 'path';\nimport type { GraphDatabase } from '../../db/database';\nimport type { CycloneDXVEX, CycloneDXVulnerability, ReachabilityPath } from '../types';\n\n/** Tool metadata for VEX document */\nconst TOOL_NAME = 'kirograph-sec';\nconst TOOL_VERSION = '0.1.0';\n\n/**\n * VEXExporter serializes vulnerability assessments with reachability verdicts\n * into CycloneDX 1.5 VEX format.\n */\nexport class VEXExporter {\n private readonly db: GraphDatabase;\n private readonly projectRoot: string;\n\n constructor(db: GraphDatabase, projectRoot: string) {\n this.db = db;\n this.projectRoot = projectRoot;\n }\n\n /**\n * Generate CycloneDX 1.5 VEX JSON object.\n *\n * Queries all Vulnerability_Nodes and their reachability verdicts,\n * producing one VEX entry per vulnerability.\n */\n export(): CycloneDXVEX {\n const rawDb = this.db.getRawDb();\n const projectName = path.basename(this.projectRoot);\n\n // Build metadata\n const metadata: Record<string, unknown> = {\n timestamp: new Date().toISOString(),\n tools: {\n components: [\n {\n type: 'application',\n name: TOOL_NAME,\n version: TOOL_VERSION,\n },\n ],\n },\n component: {\n type: 'application',\n name: projectName,\n },\n };\n\n // Query all vulnerability nodes\n const vulnRows: Array<{\n node_id: string;\n cve_id: string;\n severity_score: number | null;\n source_database: string;\n }> = rawDb.all(\n `SELECT node_id, cve_id, severity_score, source_database FROM sec_vulnerabilities`,\n );\n\n // Build vulnerability entries\n const vulnerabilities: CycloneDXVulnerability[] = [];\n\n for (const vuln of vulnRows) {\n const entry = this.buildVulnerabilityEntry(rawDb, vuln);\n vulnerabilities.push(entry);\n }\n\n return {\n bomFormat: 'CycloneDX',\n specVersion: '1.5',\n version: 1,\n metadata,\n vulnerabilities,\n };\n }\n\n /**\n * Export to pretty-printed JSON string.\n */\n exportJSON(): string {\n return JSON.stringify(this.export(), null, 2);\n }\n\n /**\n * Build a single CycloneDX vulnerability entry from a Vulnerability_Node.\n *\n * Maps reachability verdicts to CycloneDX analysis states:\n * - affected \u2192 \"affected\" with path summary detail\n * - not_affected \u2192 \"not_affected\" with justification \"code_not_reachable\"\n * - under_investigation \u2192 \"under_investigation\" with unresolved symbols detail\n * - no reachability data \u2192 \"under_investigation\" with pending analysis detail\n */\n private buildVulnerabilityEntry(\n rawDb: any,\n vuln: { node_id: string; cve_id: string; severity_score: number | null; source_database: string },\n ): CycloneDXVulnerability {\n const entry: CycloneDXVulnerability = {\n id: vuln.cve_id,\n source: {\n name: vuln.source_database,\n },\n };\n\n // Add severity rating if available\n if (vuln.severity_score != null) {\n entry.ratings = [\n {\n score: vuln.severity_score,\n method: 'CVSSv31',\n },\n ];\n }\n\n // Find the affected component purl via has_vulnerability edge\n const depEdge = rawDb.get(\n `SELECT source FROM edges WHERE target = ? AND kind = 'has_vulnerability'`,\n [vuln.node_id],\n );\n\n if (depEdge) {\n const depRow = rawDb.get(\n `SELECT ecosystem, package_name, resolved_version, declared_constraint\n FROM sec_dependencies WHERE node_id = ?`,\n [depEdge.source],\n );\n\n if (depRow) {\n const version = depRow.resolved_version || depRow.declared_constraint;\n const purl = `pkg:${depRow.ecosystem}/${depRow.package_name}@${version}`;\n entry.affects = [{ ref: purl }];\n }\n }\n\n // Query reachability verdict\n const reachRow = rawDb.get(\n `SELECT verdict, paths, unresolved_symbols, reaching_entry_point_count\n FROM sec_reachability WHERE vulnerability_node_id = ?`,\n [vuln.node_id],\n );\n\n if (!reachRow) {\n // No reachability analysis performed (Requirement 7.5)\n entry.analysis = {\n state: 'under_investigation',\n detail: 'Reachability analysis has not yet been executed for this vulnerability.',\n };\n } else {\n entry.analysis = this.buildAnalysis(rawDb, vuln.node_id, reachRow);\n }\n\n return entry;\n }\n\n /**\n * Build the analysis section based on the reachability verdict.\n */\n private buildAnalysis(\n rawDb: any,\n vulnerabilityNodeId: string,\n reachRow: {\n verdict: string;\n paths: string | null;\n unresolved_symbols: string | null;\n reaching_entry_point_count: number;\n },\n ): CycloneDXVulnerability['analysis'] {\n switch (reachRow.verdict) {\n case 'affected':\n return this.buildAffectedAnalysis(rawDb, vulnerabilityNodeId, reachRow);\n\n case 'not_affected':\n return {\n state: 'not_affected',\n justification: 'code_not_reachable',\n detail: 'No reachable path found from any application entry point to this dependency.',\n };\n\n case 'under_investigation':\n return this.buildUnderInvestigationAnalysis(reachRow);\n\n default:\n return {\n state: 'under_investigation',\n detail: 'Reachability analysis pending.',\n };\n }\n }\n\n /**\n * Build analysis detail for \"affected\" verdict.\n *\n * Includes: entry point count, layer count, shortest path length.\n */\n private buildAffectedAnalysis(\n rawDb: any,\n vulnerabilityNodeId: string,\n reachRow: {\n paths: string | null;\n reaching_entry_point_count: number;\n },\n ): CycloneDXVulnerability['analysis'] {\n const entryPointCount = reachRow.reaching_entry_point_count;\n\n // Get impact summary for layer information\n const impactRow = rawDb.get(\n `SELECT affected_layers, distinct_path_count FROM sec_impact WHERE vulnerability_node_id = ?`,\n [vulnerabilityNodeId],\n );\n\n let layerCount = 0;\n if (impactRow && impactRow.affected_layers) {\n const layers: string[] = JSON.parse(impactRow.affected_layers);\n layerCount = layers.length;\n }\n\n // Calculate shortest path length from stored paths\n let shortestPathLength = 0;\n if (reachRow.paths) {\n const paths: ReachabilityPath[] = JSON.parse(reachRow.paths);\n if (paths.length > 0) {\n shortestPathLength = Math.min(...paths.map(p => p.path.length));\n }\n }\n\n const detail = `Reachable from ${entryPointCount} entry point${entryPointCount !== 1 ? 's' : ''} via ${layerCount} layer${layerCount !== 1 ? 's' : ''}. Shortest path length: ${shortestPathLength} nodes.`;\n\n return {\n state: 'affected',\n detail,\n };\n }\n\n /**\n * Build analysis detail for \"under_investigation\" verdict.\n *\n * Lists unresolved symbols or states pending analysis reason.\n */\n private buildUnderInvestigationAnalysis(\n reachRow: {\n unresolved_symbols: string | null;\n },\n ): CycloneDXVulnerability['analysis'] {\n if (reachRow.unresolved_symbols) {\n const symbols: string[] = JSON.parse(reachRow.unresolved_symbols);\n if (symbols.length > 0) {\n return {\n state: 'under_investigation',\n detail: `${symbols.length} unresolved symbol${symbols.length !== 1 ? 's' : ''} blocked complete analysis: ${symbols.join(', ')}`,\n };\n }\n }\n\n return {\n state: 'under_investigation',\n detail: 'Reachability analysis pending.',\n };\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;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AAY,MAAM;AAAA,MACtB;AAAA,MACA,CAAC,mBAAmB;AAAA,IACtB;AAEA,QAAI,aAAa;AACjB,QAAI,aAAa,UAAU,iBAAiB;AAC1C,YAAM,SAAmB,KAAK,MAAM,UAAU,eAAe;AAC7D,mBAAa,OAAO;AAAA,IACtB;AAGA,QAAI,qBAAqB;AACzB,QAAI,SAAS,OAAO;AAClB,YAAM,QAA4B,KAAK,MAAM,SAAS,KAAK;AAC3D,UAAI,MAAM,SAAS,GAAG;AACpB,6BAAqB,KAAK,IAAI,GAAG,MAAM,IAAI,OAAK,EAAE,KAAK,MAAM,CAAC;AAAA,MAChE;AAAA,IACF;AAEA,UAAM,SAAS,kBAAkB,eAAe,eAAe,oBAAoB,IAAI,MAAM,EAAE,QAAQ,UAAU,SAAS,eAAe,IAAI,MAAM,EAAE,2BAA2B,kBAAkB;AAElM,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ,gCACN,UAGoC;AACpC,QAAI,SAAS,oBAAoB;AAC/B,YAAM,UAAoB,KAAK,MAAM,SAAS,kBAAkB;AAChE,UAAI,QAAQ,SAAS,GAAG;AACtB,eAAO;AAAA,UACL,OAAO;AAAA,UACP,QAAQ,GAAG,QAAQ,MAAM,qBAAqB,QAAQ,WAAW,IAAI,MAAM,EAAE,+BAA+B,QAAQ,KAAK,IAAI,CAAC;AAAA,QAChI;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_vitest = require("vitest");
|
|
25
|
+
var import_vex = require("./vex");
|
|
26
|
+
var import_database = require("../../db/database");
|
|
27
|
+
var fs = __toESM(require("fs"));
|
|
28
|
+
var path = __toESM(require("path"));
|
|
29
|
+
var os = __toESM(require("os"));
|
|
30
|
+
(0, import_vitest.describe)("VEXExporter", () => {
|
|
31
|
+
let db;
|
|
32
|
+
let tmpDir;
|
|
33
|
+
(0, import_vitest.beforeEach)(() => {
|
|
34
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "vex-test-"));
|
|
35
|
+
db = new import_database.GraphDatabase(tmpDir);
|
|
36
|
+
db.applySecuritySchema();
|
|
37
|
+
});
|
|
38
|
+
(0, import_vitest.afterEach)(() => {
|
|
39
|
+
db.close();
|
|
40
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
41
|
+
});
|
|
42
|
+
function insertDependency(nodeId, ecosystem, packageName, version) {
|
|
43
|
+
const rawDb = db.getRawDb();
|
|
44
|
+
db.upsertNode({
|
|
45
|
+
id: nodeId,
|
|
46
|
+
kind: "dependency",
|
|
47
|
+
name: packageName,
|
|
48
|
+
qualifiedName: `${ecosystem}/${packageName}`,
|
|
49
|
+
filePath: "package.json",
|
|
50
|
+
language: "unknown",
|
|
51
|
+
startLine: 0,
|
|
52
|
+
endLine: 0,
|
|
53
|
+
startColumn: 0,
|
|
54
|
+
endColumn: 0,
|
|
55
|
+
updatedAt: Date.now()
|
|
56
|
+
});
|
|
57
|
+
rawDb.run(
|
|
58
|
+
`INSERT OR REPLACE INTO sec_dependencies
|
|
59
|
+
(node_id, ecosystem, package_name, declared_constraint, resolved_version, scope, source_manifests)
|
|
60
|
+
VALUES (?, ?, ?, ?, ?, 'production', '["package.json"]')`,
|
|
61
|
+
[nodeId, ecosystem, packageName, `^${version}`, version]
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function insertVulnerability(vulnNodeId, cveId, depNodeId, severity = 7.5) {
|
|
65
|
+
const rawDb = db.getRawDb();
|
|
66
|
+
db.upsertNode({
|
|
67
|
+
id: vulnNodeId,
|
|
68
|
+
kind: "vulnerability",
|
|
69
|
+
name: cveId,
|
|
70
|
+
qualifiedName: cveId,
|
|
71
|
+
filePath: "",
|
|
72
|
+
language: "unknown",
|
|
73
|
+
startLine: 0,
|
|
74
|
+
endLine: 0,
|
|
75
|
+
startColumn: 0,
|
|
76
|
+
endColumn: 0,
|
|
77
|
+
updatedAt: Date.now()
|
|
78
|
+
});
|
|
79
|
+
rawDb.run(
|
|
80
|
+
`INSERT OR REPLACE INTO sec_vulnerabilities (node_id, cve_id, severity_score, affected_ranges, source_database)
|
|
81
|
+
VALUES (?, ?, ?, '[]', 'OSV')`,
|
|
82
|
+
[vulnNodeId, cveId, severity]
|
|
83
|
+
);
|
|
84
|
+
db.insertEdge({
|
|
85
|
+
source: depNodeId,
|
|
86
|
+
target: vulnNodeId,
|
|
87
|
+
kind: "has_vulnerability",
|
|
88
|
+
filePath: ""
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function insertReachability(vulnNodeId, verdict, paths = null, unresolvedSymbols = null, entryPointCount = 0) {
|
|
92
|
+
const rawDb = db.getRawDb();
|
|
93
|
+
rawDb.run(
|
|
94
|
+
`INSERT INTO sec_reachability (vulnerability_node_id, verdict, paths, unresolved_symbols, reaching_entry_point_count, analyzed_at)
|
|
95
|
+
VALUES (?, ?, ?, ?, ?, ?)`,
|
|
96
|
+
[
|
|
97
|
+
vulnNodeId,
|
|
98
|
+
verdict,
|
|
99
|
+
paths ? JSON.stringify(paths) : null,
|
|
100
|
+
unresolvedSymbols ? JSON.stringify(unresolvedSymbols) : null,
|
|
101
|
+
entryPointCount,
|
|
102
|
+
Date.now()
|
|
103
|
+
]
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function insertImpact(vulnNodeId, layers, entryPoints, pathCount) {
|
|
107
|
+
const rawDb = db.getRawDb();
|
|
108
|
+
rawDb.run(
|
|
109
|
+
`INSERT INTO sec_impact (vulnerability_node_id, affected_layers, affected_entry_points, distinct_path_count, analyzed_at)
|
|
110
|
+
VALUES (?, ?, ?, ?, ?)`,
|
|
111
|
+
[vulnNodeId, JSON.stringify(layers), JSON.stringify(entryPoints), pathCount, Date.now()]
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
(0, import_vitest.describe)("export()", () => {
|
|
115
|
+
(0, import_vitest.it)("should produce valid CycloneDX 1.5 VEX with empty vulnerabilities when none exist", () => {
|
|
116
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
117
|
+
const vex = exporter.export();
|
|
118
|
+
(0, import_vitest.expect)(vex.bomFormat).toBe("CycloneDX");
|
|
119
|
+
(0, import_vitest.expect)(vex.specVersion).toBe("1.5");
|
|
120
|
+
(0, import_vitest.expect)(vex.version).toBe(1);
|
|
121
|
+
(0, import_vitest.expect)(vex.metadata).toBeDefined();
|
|
122
|
+
(0, import_vitest.expect)(vex.vulnerabilities).toEqual([]);
|
|
123
|
+
});
|
|
124
|
+
(0, import_vitest.it)("should include correct metadata with tool name, version, and timestamp", () => {
|
|
125
|
+
const exporter = new import_vex.VEXExporter(db, "/projects/my-app");
|
|
126
|
+
const vex = exporter.export();
|
|
127
|
+
const meta = vex.metadata;
|
|
128
|
+
(0, import_vitest.expect)(meta.tools.components[0].name).toBe("kirograph-sec");
|
|
129
|
+
(0, import_vitest.expect)(meta.tools.components[0].version).toBe("0.1.0");
|
|
130
|
+
(0, import_vitest.expect)(meta.timestamp).toMatch(/^\d{4}-\d{2}-\d{2}T/);
|
|
131
|
+
(0, import_vitest.expect)(meta.component.name).toBe("my-app");
|
|
132
|
+
});
|
|
133
|
+
(0, import_vitest.it)('should map "affected" verdict correctly', () => {
|
|
134
|
+
insertDependency("dep-1", "npm", "lodash", "4.17.20");
|
|
135
|
+
insertVulnerability("vuln-1", "CVE-2021-23337", "dep-1", 9.8);
|
|
136
|
+
insertReachability(
|
|
137
|
+
"vuln-1",
|
|
138
|
+
"affected",
|
|
139
|
+
[
|
|
140
|
+
{ entryPoint: "ep-1", path: ["ep-1", "mid-1", "dep-1"] },
|
|
141
|
+
{ entryPoint: "ep-2", path: ["ep-2", "dep-1"] }
|
|
142
|
+
],
|
|
143
|
+
null,
|
|
144
|
+
2
|
|
145
|
+
);
|
|
146
|
+
insertImpact("vuln-1", ["api", "service"], ["ep-1", "ep-2"], 2);
|
|
147
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
148
|
+
const vex = exporter.export();
|
|
149
|
+
(0, import_vitest.expect)(vex.vulnerabilities).toHaveLength(1);
|
|
150
|
+
const v = vex.vulnerabilities[0];
|
|
151
|
+
(0, import_vitest.expect)(v.id).toBe("CVE-2021-23337");
|
|
152
|
+
(0, import_vitest.expect)(v.analysis?.state).toBe("affected");
|
|
153
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("2 entry points");
|
|
154
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("2 layers");
|
|
155
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("Shortest path length: 2 nodes");
|
|
156
|
+
(0, import_vitest.expect)(v.affects).toEqual([{ ref: "pkg:npm/lodash@4.17.20" }]);
|
|
157
|
+
(0, import_vitest.expect)(v.ratings).toEqual([{ score: 9.8, method: "CVSSv31" }]);
|
|
158
|
+
});
|
|
159
|
+
(0, import_vitest.it)('should map "not_affected" verdict with justification "code_not_reachable"', () => {
|
|
160
|
+
insertDependency("dep-1", "npm", "express", "4.17.1");
|
|
161
|
+
insertVulnerability("vuln-1", "CVE-2022-24999", "dep-1", 5.3);
|
|
162
|
+
insertReachability("vuln-1", "not_affected", null, null, 0);
|
|
163
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
164
|
+
const vex = exporter.export();
|
|
165
|
+
(0, import_vitest.expect)(vex.vulnerabilities).toHaveLength(1);
|
|
166
|
+
const v = vex.vulnerabilities[0];
|
|
167
|
+
(0, import_vitest.expect)(v.analysis?.state).toBe("not_affected");
|
|
168
|
+
(0, import_vitest.expect)(v.analysis?.justification).toBe("code_not_reachable");
|
|
169
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("No reachable path found");
|
|
170
|
+
});
|
|
171
|
+
(0, import_vitest.it)('should map "under_investigation" verdict with unresolved symbols', () => {
|
|
172
|
+
insertDependency("dep-1", "pypi", "requests", "2.28.0");
|
|
173
|
+
insertVulnerability("vuln-1", "CVE-2023-32681", "dep-1", 6.1);
|
|
174
|
+
insertReachability(
|
|
175
|
+
"vuln-1",
|
|
176
|
+
"under_investigation",
|
|
177
|
+
null,
|
|
178
|
+
["sym-unresolved-1", "sym-unresolved-2"],
|
|
179
|
+
0
|
|
180
|
+
);
|
|
181
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
182
|
+
const vex = exporter.export();
|
|
183
|
+
(0, import_vitest.expect)(vex.vulnerabilities).toHaveLength(1);
|
|
184
|
+
const v = vex.vulnerabilities[0];
|
|
185
|
+
(0, import_vitest.expect)(v.analysis?.state).toBe("under_investigation");
|
|
186
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("2 unresolved symbols");
|
|
187
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("sym-unresolved-1");
|
|
188
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("sym-unresolved-2");
|
|
189
|
+
});
|
|
190
|
+
(0, import_vitest.it)('should set "under_investigation" when no reachability analysis performed', () => {
|
|
191
|
+
insertDependency("dep-1", "cargo", "serde", "1.0.188");
|
|
192
|
+
insertVulnerability("vuln-1", "CVE-2024-00001", "dep-1", 4);
|
|
193
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
194
|
+
const vex = exporter.export();
|
|
195
|
+
(0, import_vitest.expect)(vex.vulnerabilities).toHaveLength(1);
|
|
196
|
+
const v = vex.vulnerabilities[0];
|
|
197
|
+
(0, import_vitest.expect)(v.analysis?.state).toBe("under_investigation");
|
|
198
|
+
(0, import_vitest.expect)(v.analysis?.detail).toContain("has not yet been executed");
|
|
199
|
+
});
|
|
200
|
+
(0, import_vitest.it)("should handle multiple vulnerabilities", () => {
|
|
201
|
+
insertDependency("dep-1", "npm", "lodash", "4.17.20");
|
|
202
|
+
insertDependency("dep-2", "npm", "express", "4.17.1");
|
|
203
|
+
insertVulnerability("vuln-1", "CVE-2021-23337", "dep-1", 9.8);
|
|
204
|
+
insertVulnerability("vuln-2", "CVE-2022-24999", "dep-2", 5.3);
|
|
205
|
+
insertReachability(
|
|
206
|
+
"vuln-1",
|
|
207
|
+
"affected",
|
|
208
|
+
[{ entryPoint: "ep-1", path: ["ep-1", "dep-1"] }],
|
|
209
|
+
null,
|
|
210
|
+
1
|
|
211
|
+
);
|
|
212
|
+
insertReachability("vuln-2", "not_affected", null, null, 0);
|
|
213
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
214
|
+
const vex = exporter.export();
|
|
215
|
+
(0, import_vitest.expect)(vex.vulnerabilities).toHaveLength(2);
|
|
216
|
+
const affected = vex.vulnerabilities.find((v) => v.id === "CVE-2021-23337");
|
|
217
|
+
const notAffected = vex.vulnerabilities.find((v) => v.id === "CVE-2022-24999");
|
|
218
|
+
(0, import_vitest.expect)(affected?.analysis?.state).toBe("affected");
|
|
219
|
+
(0, import_vitest.expect)(notAffected?.analysis?.state).toBe("not_affected");
|
|
220
|
+
});
|
|
221
|
+
(0, import_vitest.it)("should use declared_constraint as version when resolved_version is null", () => {
|
|
222
|
+
const rawDb = db.getRawDb();
|
|
223
|
+
db.upsertNode({
|
|
224
|
+
id: "dep-1",
|
|
225
|
+
kind: "dependency",
|
|
226
|
+
name: "axios",
|
|
227
|
+
qualifiedName: "npm/axios",
|
|
228
|
+
filePath: "package.json",
|
|
229
|
+
language: "unknown",
|
|
230
|
+
startLine: 0,
|
|
231
|
+
endLine: 0,
|
|
232
|
+
startColumn: 0,
|
|
233
|
+
endColumn: 0,
|
|
234
|
+
updatedAt: Date.now()
|
|
235
|
+
});
|
|
236
|
+
rawDb.run(
|
|
237
|
+
`INSERT OR REPLACE INTO sec_dependencies
|
|
238
|
+
(node_id, ecosystem, package_name, declared_constraint, resolved_version, scope, source_manifests)
|
|
239
|
+
VALUES ('dep-1', 'npm', 'axios', '^1.0.0', NULL, 'production', '["package.json"]')`
|
|
240
|
+
);
|
|
241
|
+
insertVulnerability("vuln-1", "CVE-2023-45857", "dep-1", 6.5);
|
|
242
|
+
insertReachability("vuln-1", "not_affected", null, null, 0);
|
|
243
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
244
|
+
const vex = exporter.export();
|
|
245
|
+
(0, import_vitest.expect)(vex.vulnerabilities[0].affects).toEqual([{ ref: "pkg:npm/axios@^1.0.0" }]);
|
|
246
|
+
});
|
|
247
|
+
(0, import_vitest.it)("should handle vulnerability with no severity score", () => {
|
|
248
|
+
insertDependency("dep-1", "go", "github.com/gin-gonic/gin", "1.9.1");
|
|
249
|
+
insertVulnerability("vuln-1", "CVE-2023-99999", "dep-1", null);
|
|
250
|
+
insertReachability("vuln-1", "not_affected", null, null, 0);
|
|
251
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
252
|
+
const vex = exporter.export();
|
|
253
|
+
(0, import_vitest.expect)(vex.vulnerabilities[0].ratings).toBeUndefined();
|
|
254
|
+
});
|
|
255
|
+
(0, import_vitest.it)('should handle "under_investigation" with empty unresolved symbols', () => {
|
|
256
|
+
insertDependency("dep-1", "npm", "minimist", "1.2.5");
|
|
257
|
+
insertVulnerability("vuln-1", "CVE-2021-44906", "dep-1", 9.8);
|
|
258
|
+
insertReachability("vuln-1", "under_investigation", null, [], 0);
|
|
259
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
260
|
+
const vex = exporter.export();
|
|
261
|
+
const v = vex.vulnerabilities[0];
|
|
262
|
+
(0, import_vitest.expect)(v.analysis?.state).toBe("under_investigation");
|
|
263
|
+
(0, import_vitest.expect)(v.analysis?.detail).toBe("Reachability analysis pending.");
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
(0, import_vitest.describe)("exportJSON()", () => {
|
|
267
|
+
(0, import_vitest.it)("should return pretty-printed JSON string", () => {
|
|
268
|
+
const exporter = new import_vex.VEXExporter(db, tmpDir);
|
|
269
|
+
const json = exporter.exportJSON();
|
|
270
|
+
(0, import_vitest.expect)(() => JSON.parse(json)).not.toThrow();
|
|
271
|
+
(0, import_vitest.expect)(json).toContain("\n");
|
|
272
|
+
const parsed = JSON.parse(json);
|
|
273
|
+
(0, import_vitest.expect)(parsed.bomFormat).toBe("CycloneDX");
|
|
274
|
+
(0, import_vitest.expect)(parsed.specVersion).toBe("1.5");
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
//# sourceMappingURL=vex.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/security/export/vex.test.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Unit tests for VEXExporter\n *\n * Tests CycloneDX 1.5 VEX generation with various vulnerability/reachability scenarios.\n */\n\nimport { describe, it, expect, beforeEach, afterEach } from 'vitest';\nimport { VEXExporter } from './vex';\nimport { GraphDatabase } from '../../db/database';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\n\ndescribe('VEXExporter', () => {\n let db: GraphDatabase;\n let tmpDir: string;\n\n beforeEach(() => {\n tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'vex-test-'));\n db = new GraphDatabase(tmpDir);\n db.applySecuritySchema();\n });\n\n afterEach(() => {\n db.close();\n fs.rmSync(tmpDir, { recursive: true, force: true });\n });\n\n /**\n * Helper to insert a dependency node into the database.\n */\n function insertDependency(\n nodeId: string,\n ecosystem: string,\n packageName: string,\n version: string,\n ): void {\n const rawDb = db.getRawDb();\n\n db.upsertNode({\n id: nodeId,\n kind: 'dependency',\n name: packageName,\n qualifiedName: `${ecosystem}/${packageName}`,\n filePath: 'package.json',\n language: 'unknown',\n startLine: 0,\n endLine: 0,\n startColumn: 0,\n endColumn: 0,\n updatedAt: Date.now(),\n });\n\n rawDb.run(\n `INSERT OR REPLACE INTO sec_dependencies\n (node_id, ecosystem, package_name, declared_constraint, resolved_version, scope, source_manifests)\n VALUES (?, ?, ?, ?, ?, 'production', '[\"package.json\"]')`,\n [nodeId, ecosystem, packageName, `^${version}`, version],\n );\n }\n\n /**\n * Helper to insert a vulnerability node linked to a dependency.\n */\n function insertVulnerability(\n vulnNodeId: string,\n cveId: string,\n depNodeId: string,\n severity: number | null = 7.5,\n ): void {\n const rawDb = db.getRawDb();\n\n db.upsertNode({\n id: vulnNodeId,\n kind: 'vulnerability',\n name: cveId,\n qualifiedName: cveId,\n filePath: '',\n language: 'unknown',\n startLine: 0,\n endLine: 0,\n startColumn: 0,\n endColumn: 0,\n updatedAt: Date.now(),\n });\n\n rawDb.run(\n `INSERT OR REPLACE INTO sec_vulnerabilities (node_id, cve_id, severity_score, affected_ranges, source_database)\n VALUES (?, ?, ?, '[]', 'OSV')`,\n [vulnNodeId, cveId, severity],\n );\n\n db.insertEdge({\n source: depNodeId,\n target: vulnNodeId,\n kind: 'has_vulnerability',\n filePath: '',\n });\n }\n\n /**\n * Helper to insert a reachability result.\n */\n function insertReachability(\n vulnNodeId: string,\n verdict: string,\n paths: any[] | null = null,\n unresolvedSymbols: string[] | null = null,\n entryPointCount: number = 0,\n ): void {\n const rawDb = db.getRawDb();\n rawDb.run(\n `INSERT INTO sec_reachability (vulnerability_node_id, verdict, paths, unresolved_symbols, reaching_entry_point_count, analyzed_at)\n VALUES (?, ?, ?, ?, ?, ?)`,\n [\n vulnNodeId,\n verdict,\n paths ? JSON.stringify(paths) : null,\n unresolvedSymbols ? JSON.stringify(unresolvedSymbols) : null,\n entryPointCount,\n Date.now(),\n ],\n );\n }\n\n /**\n * Helper to insert an impact summary.\n */\n function insertImpact(\n vulnNodeId: string,\n layers: string[],\n entryPoints: string[],\n pathCount: number,\n ): void {\n const rawDb = db.getRawDb();\n rawDb.run(\n `INSERT INTO sec_impact (vulnerability_node_id, affected_layers, affected_entry_points, distinct_path_count, analyzed_at)\n VALUES (?, ?, ?, ?, ?)`,\n [vulnNodeId, JSON.stringify(layers), JSON.stringify(entryPoints), pathCount, Date.now()],\n );\n }\n\n describe('export()', () => {\n it('should produce valid CycloneDX 1.5 VEX with empty vulnerabilities when none exist', () => {\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.bomFormat).toBe('CycloneDX');\n expect(vex.specVersion).toBe('1.5');\n expect(vex.version).toBe(1);\n expect(vex.metadata).toBeDefined();\n expect(vex.vulnerabilities).toEqual([]);\n });\n\n it('should include correct metadata with tool name, version, and timestamp', () => {\n const exporter = new VEXExporter(db, '/projects/my-app');\n const vex = exporter.export();\n\n const meta = vex.metadata as any;\n expect(meta.tools.components[0].name).toBe('kirograph-sec');\n expect(meta.tools.components[0].version).toBe('0.1.0');\n expect(meta.timestamp).toMatch(/^\\d{4}-\\d{2}-\\d{2}T/);\n expect(meta.component.name).toBe('my-app');\n });\n\n it('should map \"affected\" verdict correctly', () => {\n insertDependency('dep-1', 'npm', 'lodash', '4.17.20');\n insertVulnerability('vuln-1', 'CVE-2021-23337', 'dep-1', 9.8);\n insertReachability(\n 'vuln-1',\n 'affected',\n [\n { entryPoint: 'ep-1', path: ['ep-1', 'mid-1', 'dep-1'] },\n { entryPoint: 'ep-2', path: ['ep-2', 'dep-1'] },\n ],\n null,\n 2,\n );\n insertImpact('vuln-1', ['api', 'service'], ['ep-1', 'ep-2'], 2);\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.vulnerabilities).toHaveLength(1);\n const v = vex.vulnerabilities[0];\n expect(v.id).toBe('CVE-2021-23337');\n expect(v.analysis?.state).toBe('affected');\n expect(v.analysis?.detail).toContain('2 entry points');\n expect(v.analysis?.detail).toContain('2 layers');\n expect(v.analysis?.detail).toContain('Shortest path length: 2 nodes');\n expect(v.affects).toEqual([{ ref: 'pkg:npm/lodash@4.17.20' }]);\n expect(v.ratings).toEqual([{ score: 9.8, method: 'CVSSv31' }]);\n });\n\n it('should map \"not_affected\" verdict with justification \"code_not_reachable\"', () => {\n insertDependency('dep-1', 'npm', 'express', '4.17.1');\n insertVulnerability('vuln-1', 'CVE-2022-24999', 'dep-1', 5.3);\n insertReachability('vuln-1', 'not_affected', null, null, 0);\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.vulnerabilities).toHaveLength(1);\n const v = vex.vulnerabilities[0];\n expect(v.analysis?.state).toBe('not_affected');\n expect(v.analysis?.justification).toBe('code_not_reachable');\n expect(v.analysis?.detail).toContain('No reachable path found');\n });\n\n it('should map \"under_investigation\" verdict with unresolved symbols', () => {\n insertDependency('dep-1', 'pypi', 'requests', '2.28.0');\n insertVulnerability('vuln-1', 'CVE-2023-32681', 'dep-1', 6.1);\n insertReachability(\n 'vuln-1',\n 'under_investigation',\n null,\n ['sym-unresolved-1', 'sym-unresolved-2'],\n 0,\n );\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.vulnerabilities).toHaveLength(1);\n const v = vex.vulnerabilities[0];\n expect(v.analysis?.state).toBe('under_investigation');\n expect(v.analysis?.detail).toContain('2 unresolved symbols');\n expect(v.analysis?.detail).toContain('sym-unresolved-1');\n expect(v.analysis?.detail).toContain('sym-unresolved-2');\n });\n\n it('should set \"under_investigation\" when no reachability analysis performed', () => {\n insertDependency('dep-1', 'cargo', 'serde', '1.0.188');\n insertVulnerability('vuln-1', 'CVE-2024-00001', 'dep-1', 4.0);\n // No reachability row inserted\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.vulnerabilities).toHaveLength(1);\n const v = vex.vulnerabilities[0];\n expect(v.analysis?.state).toBe('under_investigation');\n expect(v.analysis?.detail).toContain('has not yet been executed');\n });\n\n it('should handle multiple vulnerabilities', () => {\n insertDependency('dep-1', 'npm', 'lodash', '4.17.20');\n insertDependency('dep-2', 'npm', 'express', '4.17.1');\n\n insertVulnerability('vuln-1', 'CVE-2021-23337', 'dep-1', 9.8);\n insertVulnerability('vuln-2', 'CVE-2022-24999', 'dep-2', 5.3);\n\n insertReachability(\n 'vuln-1',\n 'affected',\n [{ entryPoint: 'ep-1', path: ['ep-1', 'dep-1'] }],\n null,\n 1,\n );\n insertReachability('vuln-2', 'not_affected', null, null, 0);\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.vulnerabilities).toHaveLength(2);\n const affected = vex.vulnerabilities.find(v => v.id === 'CVE-2021-23337');\n const notAffected = vex.vulnerabilities.find(v => v.id === 'CVE-2022-24999');\n expect(affected?.analysis?.state).toBe('affected');\n expect(notAffected?.analysis?.state).toBe('not_affected');\n });\n\n it('should use declared_constraint as version when resolved_version is null', () => {\n const rawDb = db.getRawDb();\n\n db.upsertNode({\n id: 'dep-1',\n kind: 'dependency',\n name: 'axios',\n qualifiedName: 'npm/axios',\n filePath: 'package.json',\n language: 'unknown',\n startLine: 0,\n endLine: 0,\n startColumn: 0,\n endColumn: 0,\n updatedAt: Date.now(),\n });\n\n rawDb.run(\n `INSERT OR REPLACE INTO sec_dependencies\n (node_id, ecosystem, package_name, declared_constraint, resolved_version, scope, source_manifests)\n VALUES ('dep-1', 'npm', 'axios', '^1.0.0', NULL, 'production', '[\"package.json\"]')`,\n );\n insertVulnerability('vuln-1', 'CVE-2023-45857', 'dep-1', 6.5);\n insertReachability('vuln-1', 'not_affected', null, null, 0);\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.vulnerabilities[0].affects).toEqual([{ ref: 'pkg:npm/axios@^1.0.0' }]);\n });\n\n it('should handle vulnerability with no severity score', () => {\n insertDependency('dep-1', 'go', 'github.com/gin-gonic/gin', '1.9.1');\n insertVulnerability('vuln-1', 'CVE-2023-99999', 'dep-1', null);\n insertReachability('vuln-1', 'not_affected', null, null, 0);\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n expect(vex.vulnerabilities[0].ratings).toBeUndefined();\n });\n\n it('should handle \"under_investigation\" with empty unresolved symbols', () => {\n insertDependency('dep-1', 'npm', 'minimist', '1.2.5');\n insertVulnerability('vuln-1', 'CVE-2021-44906', 'dep-1', 9.8);\n insertReachability('vuln-1', 'under_investigation', null, [], 0);\n\n const exporter = new VEXExporter(db, tmpDir);\n const vex = exporter.export();\n\n const v = vex.vulnerabilities[0];\n expect(v.analysis?.state).toBe('under_investigation');\n expect(v.analysis?.detail).toBe('Reachability analysis pending.');\n });\n });\n\n describe('exportJSON()', () => {\n it('should return pretty-printed JSON string', () => {\n const exporter = new VEXExporter(db, tmpDir);\n const json = exporter.exportJSON();\n\n expect(() => JSON.parse(json)).not.toThrow();\n // Pretty-printed means it contains newlines\n expect(json).toContain('\\n');\n\n const parsed = JSON.parse(json);\n expect(parsed.bomFormat).toBe('CycloneDX');\n expect(parsed.specVersion).toBe('1.5');\n });\n });\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAMA,oBAA4D;AAC5D,iBAA4B;AAC5B,sBAA8B;AAC9B,SAAoB;AACpB,WAAsB;AACtB,SAAoB;AAAA,IAEpB,wBAAS,eAAe,MAAM;AAC5B,MAAI;AACJ,MAAI;AAEJ,gCAAW,MAAM;AACf,aAAS,GAAG,YAAY,KAAK,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC;AAC3D,SAAK,IAAI,8BAAc,MAAM;AAC7B,OAAG,oBAAoB;AAAA,EACzB,CAAC;AAED,+BAAU,MAAM;AACd,OAAG,MAAM;AACT,OAAG,OAAO,QAAQ,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EACpD,CAAC;AAKD,WAAS,iBACP,QACA,WACA,aACA,SACM;AACN,UAAM,QAAQ,GAAG,SAAS;AAE1B,OAAG,WAAW;AAAA,MACZ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,MAAM;AAAA,MACN,eAAe,GAAG,SAAS,IAAI,WAAW;AAAA,MAC1C,UAAU;AAAA,MACV,UAAU;AAAA,MACV,WAAW;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,MACb,WAAW;AAAA,MACX,WAAW,KAAK,IAAI;AAAA,IACtB,CAAC;AAED,UAAM;AAAA,MACJ;AAAA;AAAA;AAAA,MAGA,CAAC,QAAQ,WAAW,aAAa,IAAI,OAAO,IAAI,OAAO;AAAA,IACzD;AAAA,EACF;AAKA,WAAS,oBACP,YACA,OACA,WACA,WAA0B,KACpB;AACN,UAAM,QAAQ,GAAG,SAAS;AAE1B,OAAG,WAAW;AAAA,MACZ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,MAAM;AAAA,MACN,eAAe;AAAA,MACf,UAAU;AAAA,MACV,UAAU;AAAA,MACV,WAAW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C7B,0BAAG,4CAA4C,MAAM;AACnD,YAAM,WAAW,IAAI,uBAAY,IAAI,MAAM;AAC3C,YAAM,OAAO,SAAS,WAAW;AAEjC,gCAAO,MAAM,KAAK,MAAM,IAAI,CAAC,EAAE,IAAI,QAAQ;AAE3C,gCAAO,IAAI,EAAE,UAAU,IAAI;AAE3B,YAAM,SAAS,KAAK,MAAM,IAAI;AAC9B,gCAAO,OAAO,SAAS,EAAE,KAAK,WAAW;AACzC,gCAAO,OAAO,WAAW,EAAE,KAAK,KAAK;AAAA,IACvC,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var security_exports = {};
|
|
20
|
+
__export(security_exports, {
|
|
21
|
+
DependencyGraphIntegrator: () => import_integrator.DependencyGraphIntegrator,
|
|
22
|
+
ManifestParseError: () => import_errors.ManifestParseError,
|
|
23
|
+
ManifestParser: () => import_parser.ManifestParser,
|
|
24
|
+
OsvAdapter: () => import_osv_adapter.OsvAdapter,
|
|
25
|
+
ReachabilityAnalyzer: () => import_reachability.ReachabilityAnalyzer,
|
|
26
|
+
SBOMExporter: () => import_sbom.SBOMExporter,
|
|
27
|
+
SecurityError: () => import_errors.SecurityError,
|
|
28
|
+
SecurityPipeline: () => import_pipeline.SecurityPipeline,
|
|
29
|
+
VEXExporter: () => import_vex.VEXExporter,
|
|
30
|
+
VulnDatabaseError: () => import_errors.VulnDatabaseError,
|
|
31
|
+
VulnerabilityDatabaseClient: () => import_client.VulnerabilityDatabaseClient,
|
|
32
|
+
buildFixSuggestion: () => import_fix_suggestions.buildFixSuggestion,
|
|
33
|
+
formatFixSuggestion: () => import_fix_suggestions.formatFixSuggestion,
|
|
34
|
+
formatSecurityWarnings: () => import_context_warnings.formatSecurityWarnings,
|
|
35
|
+
getSecurityWarningsForNodes: () => import_context_warnings.getSecurityWarningsForNodes
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(security_exports);
|
|
38
|
+
var import_pipeline = require("./pipeline");
|
|
39
|
+
var import_parser = require("./manifest/parser");
|
|
40
|
+
var import_integrator = require("./integrator");
|
|
41
|
+
var import_client = require("./vuln/client");
|
|
42
|
+
var import_osv_adapter = require("./vuln/osv-adapter");
|
|
43
|
+
var import_reachability = require("./reachability");
|
|
44
|
+
var import_sbom = require("./export/sbom");
|
|
45
|
+
var import_vex = require("./export/vex");
|
|
46
|
+
var import_fix_suggestions = require("./export/fix-suggestions");
|
|
47
|
+
var import_context_warnings = require("./context-warnings");
|
|
48
|
+
var import_errors = require("./errors");
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
DependencyGraphIntegrator,
|
|
52
|
+
ManifestParseError,
|
|
53
|
+
ManifestParser,
|
|
54
|
+
OsvAdapter,
|
|
55
|
+
ReachabilityAnalyzer,
|
|
56
|
+
SBOMExporter,
|
|
57
|
+
SecurityError,
|
|
58
|
+
SecurityPipeline,
|
|
59
|
+
VEXExporter,
|
|
60
|
+
VulnDatabaseError,
|
|
61
|
+
VulnerabilityDatabaseClient,
|
|
62
|
+
buildFixSuggestion,
|
|
63
|
+
formatFixSuggestion,
|
|
64
|
+
formatSecurityWarnings,
|
|
65
|
+
getSecurityWarningsForNodes
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=index.js.map
|