@openai/codex-security 0.5.1 → 0.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 +151 -36
- package/_bundled_plugin/.mcp.json +1 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/native/THIRD_PARTY_NOTICES.txt +1 -1
- package/_bundled_plugin/mcp/native/darwin-arm64/unix.node +0 -0
- package/_bundled_plugin/mcp/native/darwin-x64/unix.node +0 -0
- package/_bundled_plugin/mcp/native/linux-arm64-gnu/unix.node +0 -0
- package/_bundled_plugin/mcp/native/linux-arm64-musl/unix.node +0 -0
- package/_bundled_plugin/mcp/native/linux-x64-gnu/unix.node +0 -0
- package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
- package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
- package/_bundled_plugin/references/access-advisory.md +11 -0
- package/_bundled_plugin/references/core-scan.md +30 -77
- package/_bundled_plugin/references/final-report.md +45 -189
- package/_bundled_plugin/references/scan-contract.md +2 -0
- package/_bundled_plugin/references/scan-prologue.md +1 -1
- package/_bundled_plugin/references/scan-runtime.md +1 -5
- package/_bundled_plugin/references/threat-model.md +33 -41
- package/_bundled_plugin/schemas/coverage.schema.json +12 -1
- package/_bundled_plugin/schemas/scan-manifest.schema.json +1 -0
- package/_bundled_plugin/schemas/tools/deep-reducer.schema.json +38 -1
- package/_bundled_plugin/scripts/deep_scan_config.py +39 -39
- package/_bundled_plugin/scripts/deep_scan_workbench.py +145 -85
- package/_bundled_plugin/scripts/finalize_scan_contract.py +189 -57
- package/_bundled_plugin/scripts/report_projection.py +44 -15
- package/_bundled_plugin/scripts/threat_model_projection.py +4 -2
- package/_bundled_plugin/scripts/windows_scan_local_files.py +43 -14
- package/_bundled_plugin/scripts/workbench/retained_coverage.py +3218 -0
- package/_bundled_plugin/scripts/workbench/retained_records.py +627 -0
- package/_bundled_plugin/scripts/workbench/saved_coverage.py +644 -1
- package/_bundled_plugin/scripts/workbench/saved_outputs.py +72 -0
- package/_bundled_plugin/scripts/workbench/saved_sources.py +712 -0
- package/_bundled_plugin/scripts/workbench_cli.py +3 -0
- package/_bundled_plugin/scripts/workbench_coverage_receipts.py +479 -0
- package/_bundled_plugin/scripts/workbench_db.py +51 -22
- package/_bundled_plugin/scripts/workbench_feedback.py +0 -1
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +53 -9
- package/_bundled_plugin/scripts/workbench_native_indexes.py +56 -44
- package/_bundled_plugin/scripts/workbench_saved_results.py +641 -2387
- package/_bundled_plugin/scripts/workbench_scan_history.py +72 -7
- package/_bundled_plugin/scripts/workbench_schema.py +1 -1
- package/_bundled_plugin/scripts/workbench_source_scopes.py +4 -1
- package/_bundled_plugin/scripts/workbench_target.py +142 -17
- package/_bundled_plugin/scripts/workbench_validation.py +9 -2
- package/_bundled_plugin/shared/workbench-history-repairs.json +21 -0
- package/_bundled_plugin/shared/workbench-migrations.json +44 -0
- package/_bundled_plugin/skills/assess-patch-risk/SKILL.md +3 -14
- package/_bundled_plugin/skills/assess-patch-risk/references/windows-validation.md +14 -0
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +38 -103
- package/_bundled_plugin/skills/attack-path-analysis/references/attack-path-facts.md +11 -73
- package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +57 -116
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +28 -51
- package/_bundled_plugin/skills/define-security-policy/SKILL.md +9 -9
- package/_bundled_plugin/skills/finding-discovery/SKILL.md +26 -140
- package/_bundled_plugin/skills/fix-finding/SKILL.md +19 -30
- package/_bundled_plugin/skills/propose-security-hardening/SKILL.md +28 -218
- package/_bundled_plugin/skills/propose-security-hardening/references/proposal-format.md +29 -424
- package/_bundled_plugin/skills/publish-findings/SKILL.md +134 -0
- package/_bundled_plugin/skills/publish-findings/agents/openai.yaml +6 -0
- package/_bundled_plugin/skills/publish-findings/references/wiz-import.md +64 -0
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +12 -12
- package/_bundled_plugin/skills/security-scan/SKILL.md +28 -16
- package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +11 -17
- package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +52 -69
- package/_bundled_plugin/skills/threat-model/SKILL.md +16 -9
- package/_bundled_plugin/skills/triage-finding/SKILL.md +5 -15
- package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +6 -6
- package/_bundled_plugin/skills/validation/SKILL.md +42 -104
- package/_bundled_plugin/skills/validation/references/validation-guidance.md +21 -106
- package/_bundled_plugin/skills/verify-fix/SKILL.md +8 -4
- package/_bundled_plugin/skills/vulnerability-writeup/SKILL.md +21 -159
- package/_bundled_plugin/skills/vulnerability-writeup/references/report-format.md +18 -60
- package/dist/api.d.ts +8 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +414 -72
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +4 -1
- package/dist/auth.js.map +1 -1
- package/dist/classify-severity-records.d.ts +5 -2
- package/dist/classify-severity-records.d.ts.map +1 -1
- package/dist/classify-severity-records.js +40 -34
- package/dist/classify-severity-records.js.map +1 -1
- package/dist/classify-severity.d.ts +5 -1
- package/dist/classify-severity.d.ts.map +1 -1
- package/dist/classify-severity.js +20 -30
- package/dist/classify-severity.js.map +1 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +1 -0
- package/dist/cli-help.js.map +1 -1
- package/dist/cli.d.ts +9 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +802 -149
- package/dist/cli.js.map +1 -1
- package/dist/cloud-endpoint.d.ts +6 -0
- package/dist/cloud-endpoint.d.ts.map +1 -0
- package/dist/cloud-endpoint.js +51 -0
- package/dist/cloud-endpoint.js.map +1 -0
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +7 -5
- package/dist/cloud-publish.js.map +1 -1
- package/dist/component-scan.d.ts +8 -2
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +2 -0
- package/dist/component-scan.js.map +1 -1
- package/dist/contract.d.ts +2 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +67 -33
- package/dist/contract.js.map +1 -1
- package/dist/cost.d.ts +18 -0
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +107 -12
- package/dist/cost.js.map +1 -1
- package/dist/coverage-presentation.d.ts +6 -0
- package/dist/coverage-presentation.d.ts.map +1 -0
- package/dist/coverage-presentation.js +34 -0
- package/dist/coverage-presentation.js.map +1 -0
- package/dist/custom-validation-prompt.js +3 -3
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +30 -4
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/checkpointed-review.d.ts.map +1 -1
- package/dist/deduplication/checkpointed-review.js +3 -1
- package/dist/deduplication/checkpointed-review.js.map +1 -1
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +7 -5
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/default-severity-rubric.d.ts +3 -0
- package/dist/default-severity-rubric.d.ts.map +1 -0
- package/dist/default-severity-rubric.js +67 -0
- package/dist/default-severity-rubric.js.map +1 -0
- package/dist/endor-findings.d.ts +8 -0
- package/dist/endor-findings.d.ts.map +1 -0
- package/dist/endor-findings.js +238 -0
- package/dist/endor-findings.js.map +1 -0
- package/dist/external-findings-import.d.ts +5 -0
- package/dist/external-findings-import.d.ts.map +1 -0
- package/dist/external-findings-import.js +46 -0
- package/dist/external-findings-import.js.map +1 -0
- package/dist/external-findings-local.d.ts +63 -0
- package/dist/external-findings-local.d.ts.map +1 -0
- package/dist/external-findings-local.js +344 -0
- package/dist/external-findings-local.js.map +1 -0
- package/dist/external-findings-publish.d.ts +73 -0
- package/dist/external-findings-publish.d.ts.map +1 -0
- package/dist/external-findings-publish.js +721 -0
- package/dist/external-findings-publish.js.map +1 -0
- package/dist/external-findings-read.d.ts +16 -0
- package/dist/external-findings-read.d.ts.map +1 -0
- package/dist/external-findings-read.js +97 -0
- package/dist/external-findings-read.js.map +1 -0
- package/dist/external-findings.d.ts +21 -0
- package/dist/external-findings.d.ts.map +1 -0
- package/dist/external-findings.js +2 -0
- package/dist/external-findings.js.map +1 -0
- package/dist/external-import-contract.d.ts +15 -0
- package/dist/external-import-contract.d.ts.map +1 -0
- package/dist/external-import-contract.js +262 -0
- package/dist/external-import-contract.js.map +1 -0
- package/dist/external-import-models.d.ts +362 -0
- package/dist/external-import-models.d.ts.map +1 -0
- package/dist/external-import-models.js +3 -0
- package/dist/external-import-models.js.map +1 -0
- package/dist/external-imports-feature.d.ts +6 -0
- package/dist/external-imports-feature.d.ts.map +1 -0
- package/dist/external-imports-feature.js +51 -0
- package/dist/external-imports-feature.js.map +1 -0
- package/dist/finding-workflow.d.ts +23 -6
- package/dist/finding-workflow.d.ts.map +1 -1
- package/dist/finding-workflow.js +23 -10
- package/dist/finding-workflow.js.map +1 -1
- package/dist/github-advisories.d.ts +386 -0
- package/dist/github-advisories.d.ts.map +1 -0
- package/dist/github-advisories.js +133 -0
- package/dist/github-advisories.js.map +1 -0
- package/dist/github-findings.d.ts +11 -0
- package/dist/github-findings.d.ts.map +1 -0
- package/dist/github-findings.js +258 -0
- package/dist/github-findings.js.map +1 -0
- package/dist/hosted-remediation-protocol.d.ts +2 -1
- package/dist/hosted-remediation-protocol.d.ts.map +1 -1
- package/dist/hosted-remediation-protocol.js +17 -11
- package/dist/hosted-remediation-protocol.js.map +1 -1
- package/dist/hosted-remediation.d.ts +4 -0
- package/dist/hosted-remediation.d.ts.map +1 -1
- package/dist/hosted-remediation.js +22 -3
- package/dist/hosted-remediation.js.map +1 -1
- package/dist/hosted-scan.d.ts +16 -0
- package/dist/hosted-scan.d.ts.map +1 -1
- package/dist/hosted-scan.js +9 -2
- package/dist/hosted-scan.js.map +1 -1
- package/dist/import-scan.js +1 -1
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.d.ts +1 -0
- package/dist/knowledge-base.d.ts.map +1 -1
- package/dist/knowledge-base.js +17 -8
- package/dist/knowledge-base.js.map +1 -1
- package/dist/models.d.ts +1 -0
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/owner-evidence.d.ts +2 -0
- package/dist/owner-evidence.d.ts.map +1 -1
- package/dist/owner-evidence.js +2 -1
- package/dist/owner-evidence.js.map +1 -1
- package/dist/project-config-schema.d.ts +2 -0
- package/dist/project-config-schema.d.ts.map +1 -1
- package/dist/project-config-schema.js +1 -0
- package/dist/project-config-schema.js.map +1 -1
- package/dist/project-config.d.ts +1 -0
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +2 -0
- package/dist/project-config.js.map +1 -1
- package/dist/publish.d.ts +2 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +1 -1
- package/dist/publish.js.map +1 -1
- package/dist/remediation.d.ts +7 -25
- package/dist/remediation.d.ts.map +1 -1
- package/dist/remediation.js +18 -28
- package/dist/remediation.js.map +1 -1
- package/dist/result.d.ts +4 -0
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +10 -0
- package/dist/result.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +10 -8
- package/dist/runtime.js.map +1 -1
- package/dist/scan-dashboard.d.ts +5 -3
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +79 -26
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +8 -2
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/scan-owner-suggestions.d.ts +8 -0
- package/dist/scan-owner-suggestions.d.ts.map +1 -0
- package/dist/scan-owner-suggestions.js +33 -0
- package/dist/scan-owner-suggestions.js.map +1 -0
- package/dist/scan-settings.d.ts +1 -0
- package/dist/scan-settings.d.ts.map +1 -1
- package/dist/scan-settings.js +4 -0
- package/dist/scan-settings.js.map +1 -1
- package/dist/scan-usage-display.d.ts +8 -0
- package/dist/scan-usage-display.d.ts.map +1 -0
- package/dist/scan-usage-display.js +46 -0
- package/dist/scan-usage-display.js.map +1 -0
- package/dist/scanner-import.d.ts +20 -0
- package/dist/scanner-import.d.ts.map +1 -0
- package/dist/scanner-import.js +208 -0
- package/dist/scanner-import.js.map +1 -0
- package/dist/security-policy-diff.d.ts +2 -0
- package/dist/security-policy-diff.d.ts.map +1 -0
- package/dist/security-policy-diff.js +197 -0
- package/dist/security-policy-diff.js.map +1 -0
- package/dist/security-policy.d.ts +7 -3
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js +11 -76
- package/dist/security-policy.js.map +1 -1
- package/dist/semgrep-findings.d.ts +10 -0
- package/dist/semgrep-findings.d.ts.map +1 -0
- package/dist/semgrep-findings.js +293 -0
- package/dist/semgrep-findings.js.map +1 -0
- package/dist/severity-review.d.ts +3 -0
- package/dist/severity-review.d.ts.map +1 -1
- package/dist/severity-review.js +19 -0
- package/dist/severity-review.js.map +1 -1
- package/dist/severity-store.js +7 -2
- package/dist/severity-store.js.map +1 -1
- package/dist/skill-authentication.d.ts +18 -0
- package/dist/skill-authentication.d.ts.map +1 -0
- package/dist/skill-authentication.js +82 -0
- package/dist/skill-authentication.js.map +1 -0
- package/dist/snyk-findings.d.ts +10 -0
- package/dist/snyk-findings.d.ts.map +1 -0
- package/dist/snyk-findings.js +350 -0
- package/dist/snyk-findings.js.map +1 -0
- package/dist/suggest-owners.d.ts +4 -1
- package/dist/suggest-owners.d.ts.map +1 -1
- package/dist/suggest-owners.js +53 -21
- package/dist/suggest-owners.js.map +1 -1
- package/dist/targets.d.ts +2 -2
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +16 -3
- package/dist/targets.js.map +1 -1
- package/dist/wiz-csv.d.ts +9 -0
- package/dist/wiz-csv.d.ts.map +1 -0
- package/dist/wiz-csv.js +116 -0
- package/dist/wiz-csv.js.map +1 -0
- package/dist/wiz-findings.d.ts +5 -0
- package/dist/wiz-findings.d.ts.map +1 -0
- package/dist/wiz-findings.js +464 -0
- package/dist/wiz-findings.js.map +1 -0
- package/docs/classify-severity-records.md +30 -13
- package/docs/cli.md +835 -47
- package/docs/findings-service.md +119 -118
- package/docs/hosted-remediation.md +43 -24
- package/docs/hosted-scans.md +38 -0
- package/package.json +11 -9
- package/schemas/external-findings.schema.json +1421 -0
- package/schemas/project-config.schema.json +4 -0
- package/_bundled_plugin/scripts/generate_in_scope_files.py +0 -277
- package/_bundled_plugin/scripts/generate_rank_input.py +0 -350
- package/_bundled_plugin/scripts/rank_preview.py +0 -129
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
2
|
+
import { scanAuthentication, selectedScanEnvironment, } from "./api.js";
|
|
3
|
+
import { environmentEntry } from "./auth.js";
|
|
4
|
+
import { deepMerge, EXTERNAL_CODEX_PROVIDERS, isExternalModelProvider, modelProviderConfigOverride, scanModelProvider, } from "./config.js";
|
|
5
|
+
import { AuthenticationRequiredError } from "./errors.js";
|
|
6
|
+
/** Resolve a skill's authentication before preparing homes or launching Codex. */
|
|
7
|
+
export function resolveSkillAuthentication(options, processEnvironment, ambientConfig) {
|
|
8
|
+
const overrides = parseToml(stringifyToml(options.codexOverrides ?? {}));
|
|
9
|
+
const config = deepMerge(structuredClone(ambientConfig), overrides);
|
|
10
|
+
const provider = options.modelProvider ?? scanModelProvider(config);
|
|
11
|
+
// Native Codex ignores configured tables for these built-in providers.
|
|
12
|
+
const providerConfiguration = typeof provider === "string" &&
|
|
13
|
+
!["openai", "ollama", "lmstudio"].includes(provider)
|
|
14
|
+
? config["model_providers"]?.[provider]
|
|
15
|
+
: undefined;
|
|
16
|
+
const providerEnvKey = typeof providerConfiguration?.["env_key"] === "string"
|
|
17
|
+
? providerConfiguration["env_key"]
|
|
18
|
+
: undefined;
|
|
19
|
+
const commandAuth = providerConfiguration?.["auth"] != null;
|
|
20
|
+
const explicitChatgpt = options.auth === "chatgpt" && !isExternalModelProvider(provider);
|
|
21
|
+
const providerBearer = typeof providerConfiguration?.["experimental_bearer_token"] === "string";
|
|
22
|
+
const providerKeyConfigured = providerEnvKey !== undefined || providerBearer;
|
|
23
|
+
const requiresOpenAiAuth = !commandAuth &&
|
|
24
|
+
(explicitChatgpt || !providerKeyConfigured) &&
|
|
25
|
+
(provider === undefined ||
|
|
26
|
+
provider === "openai" ||
|
|
27
|
+
providerConfiguration?.["requires_openai_auth"] === true ||
|
|
28
|
+
(explicitChatgpt && providerKeyConfigured));
|
|
29
|
+
let authentication;
|
|
30
|
+
let configOverrides = [];
|
|
31
|
+
if (providerEnvKey !== undefined && !commandAuth && !explicitChatgpt) {
|
|
32
|
+
const key = environmentEntry(processEnvironment, providerEnvKey)?.trim();
|
|
33
|
+
if (!key && options.auth === "api-key") {
|
|
34
|
+
throw new AuthenticationRequiredError(`API-key authentication requires ${providerEnvKey}. Set a valid API key for the selected provider.`);
|
|
35
|
+
}
|
|
36
|
+
authentication = key
|
|
37
|
+
? { method: "api_key", source: providerEnvKey, verified: false }
|
|
38
|
+
: { method: "stored_credentials", verified: false };
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
authentication = scanAuthentication(processEnvironment, options.auth, provider, commandAuth);
|
|
42
|
+
}
|
|
43
|
+
if (authentication.method === "stored_credentials" &&
|
|
44
|
+
isExternalModelProvider(provider)) {
|
|
45
|
+
const externalProvider = EXTERNAL_CODEX_PROVIDERS[provider];
|
|
46
|
+
throw new AuthenticationRequiredError(`Set ${providerEnvKey ?? externalProvider.env_key} to run ${options.command} through ${externalProvider.name}.`);
|
|
47
|
+
}
|
|
48
|
+
let selected = selectedScanEnvironment(processEnvironment, authentication.method === "command" ? "chatgpt" : options.auth, provider);
|
|
49
|
+
if (explicitChatgpt &&
|
|
50
|
+
!commandAuth &&
|
|
51
|
+
providerConfiguration !== undefined &&
|
|
52
|
+
providerKeyConfigured) {
|
|
53
|
+
if (providerEnvKey !== undefined) {
|
|
54
|
+
selected = Object.fromEntries(Object.entries(selected).filter(([name]) => process.platform === "win32"
|
|
55
|
+
? name.toUpperCase() !== providerEnvKey.toUpperCase()
|
|
56
|
+
: name !== providerEnvKey));
|
|
57
|
+
}
|
|
58
|
+
// Native provider keys take precedence over stored authentication.
|
|
59
|
+
// Apply explicit ChatGPT selection to the home and CLI configuration.
|
|
60
|
+
const providerOverrides = typeof provider === "string"
|
|
61
|
+
? overrides["model_providers"]?.[provider]
|
|
62
|
+
: undefined;
|
|
63
|
+
for (const selectedConfig of [providerConfiguration, providerOverrides]) {
|
|
64
|
+
if (selectedConfig === undefined)
|
|
65
|
+
continue;
|
|
66
|
+
delete selectedConfig["env_key"];
|
|
67
|
+
delete selectedConfig["experimental_bearer_token"];
|
|
68
|
+
selectedConfig["requires_openai_auth"] = true;
|
|
69
|
+
}
|
|
70
|
+
configOverrides = modelProviderConfigOverride(overrides);
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
authentication,
|
|
74
|
+
provider,
|
|
75
|
+
providerConfiguration,
|
|
76
|
+
providerEnvKey,
|
|
77
|
+
requiresOpenAiAuth,
|
|
78
|
+
environment: selected,
|
|
79
|
+
configOverrides,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=skill-authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-authentication.js","sourceRoot":"","sources":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cAAc,CAAC,2BAA2B,CAAC,CAAC;YACnD,cAAc,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAAC;QAChD,CAAC;QACD,eAAe,GAAG,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO;QACL,cAAc;QACd,QAAQ;QACR,qBAAqB;QACrB,cAAc;QACd,kBAAkB;QAClB,WAAW,EAAE,QAAQ;QACrB,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import { parse as parseToml, stringify as stringifyToml } from \"smol-toml\";\nimport {\n scanAuthentication,\n selectedScanEnvironment,\n type ScanAuthMode,\n type ScanAuthentication,\n} from \"./api.js\";\nimport { environmentEntry } from \"./auth.js\";\nimport {\n deepMerge,\n EXTERNAL_CODEX_PROVIDERS,\n isExternalModelProvider,\n modelProviderConfigOverride,\n scanModelProvider,\n type JsonObject,\n} from \"./config.js\";\nimport { AuthenticationRequiredError } from \"./errors.js\";\n\n/** Resolve a skill's authentication before preparing homes or launching Codex. */\nexport function resolveSkillAuthentication(\n options: {\n auth: ScanAuthMode;\n modelProvider?: string;\n codexOverrides?: JsonObject;\n command: \"validate\" | \"patch\" | \"verify-fix\";\n },\n processEnvironment: NodeJS.ProcessEnv,\n ambientConfig: JsonObject,\n) {\n const overrides = parseToml(\n stringifyToml(options.codexOverrides ?? {}),\n ) as JsonObject;\n const config = deepMerge(structuredClone(ambientConfig), overrides);\n const provider = options.modelProvider ?? scanModelProvider(config);\n // Native Codex ignores configured tables for these built-in providers.\n const providerConfiguration =\n typeof provider === \"string\" &&\n ![\"openai\", \"ollama\", \"lmstudio\"].includes(provider)\n ? (config[\"model_providers\"] as Record<string, JsonObject> | undefined)?.[\n provider\n ]\n : undefined;\n const providerEnvKey =\n typeof providerConfiguration?.[\"env_key\"] === \"string\"\n ? providerConfiguration[\"env_key\"]\n : undefined;\n const commandAuth = providerConfiguration?.[\"auth\"] != null;\n const explicitChatgpt =\n options.auth === \"chatgpt\" && !isExternalModelProvider(provider);\n const providerBearer =\n typeof providerConfiguration?.[\"experimental_bearer_token\"] === \"string\";\n const providerKeyConfigured = providerEnvKey !== undefined || providerBearer;\n const requiresOpenAiAuth =\n !commandAuth &&\n (explicitChatgpt || !providerKeyConfigured) &&\n (provider === undefined ||\n provider === \"openai\" ||\n providerConfiguration?.[\"requires_openai_auth\"] === true ||\n (explicitChatgpt && providerKeyConfigured));\n let authentication: ScanAuthentication;\n let configOverrides: string[] = [];\n if (providerEnvKey !== undefined && !commandAuth && !explicitChatgpt) {\n const key = environmentEntry(processEnvironment, providerEnvKey)?.trim();\n if (!key && options.auth === \"api-key\") {\n throw new AuthenticationRequiredError(\n `API-key authentication requires ${providerEnvKey}. Set a valid API key for the selected provider.`,\n );\n }\n authentication = key\n ? { method: \"api_key\", source: providerEnvKey, verified: false }\n : { method: \"stored_credentials\", verified: false };\n } else {\n authentication = scanAuthentication(\n processEnvironment,\n options.auth,\n provider,\n commandAuth,\n );\n }\n if (\n authentication.method === \"stored_credentials\" &&\n isExternalModelProvider(provider)\n ) {\n const externalProvider = EXTERNAL_CODEX_PROVIDERS[provider];\n throw new AuthenticationRequiredError(\n `Set ${providerEnvKey ?? externalProvider.env_key} to run ${options.command} through ${externalProvider.name}.`,\n );\n }\n let selected = selectedScanEnvironment(\n processEnvironment,\n authentication.method === \"command\" ? \"chatgpt\" : options.auth,\n provider,\n );\n if (\n explicitChatgpt &&\n !commandAuth &&\n providerConfiguration !== undefined &&\n providerKeyConfigured\n ) {\n if (providerEnvKey !== undefined) {\n selected = Object.fromEntries(\n Object.entries(selected).filter(([name]) =>\n process.platform === \"win32\"\n ? name.toUpperCase() !== providerEnvKey.toUpperCase()\n : name !== providerEnvKey,\n ),\n );\n }\n // Native provider keys take precedence over stored authentication.\n // Apply explicit ChatGPT selection to the home and CLI configuration.\n const providerOverrides =\n typeof provider === \"string\"\n ? (\n overrides[\"model_providers\"] as\n Record<string, JsonObject> | undefined\n )?.[provider]\n : undefined;\n for (const selectedConfig of [providerConfiguration, providerOverrides]) {\n if (selectedConfig === undefined) continue;\n delete selectedConfig[\"env_key\"];\n delete selectedConfig[\"experimental_bearer_token\"];\n selectedConfig[\"requires_openai_auth\"] = true;\n }\n configOverrides = modelProviderConfigOverride(overrides);\n }\n return {\n authentication,\n provider,\n providerConfiguration,\n providerEnvKey,\n requiresOpenAiAuth,\n environment: selected,\n configOverrides,\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ExternalImportTarget } from "./external-import-contract.js";
|
|
2
|
+
import type { ExternalFindings } from "./external-findings.js";
|
|
3
|
+
/** Import the official Snyk Codex plugin's documented local SCA bundle. */
|
|
4
|
+
export declare function normalizeSnykFindingsExport(input: unknown, target?: ExternalImportTarget): ExternalFindings;
|
|
5
|
+
/** Snyk Open Source's formatter groups all dependency paths for an advisory in a project. */
|
|
6
|
+
export declare function normalizeSnykSarif(input: unknown, target?: ExternalImportTarget): ExternalFindings;
|
|
7
|
+
/** Import native `snyk test --json` Open Source vulnerability occurrences. */
|
|
8
|
+
export declare function normalizeSnykJson(input: unknown, target?: ExternalImportTarget): ExternalFindings;
|
|
9
|
+
export declare function readSnykFindings(path: string, target?: ExternalImportTarget): Promise<ExternalFindings>;
|
|
10
|
+
//# sourceMappingURL=snyk-findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snyk-findings.d.ts","sourceRoot":"","sources":["../src/snyk-findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA2D/D,2EAA2E;AAC3E,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,oBAA8B,GACrC,gBAAgB,CAgFlB;AAiGD,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,oBAA8B,GACrC,gBAAgB,CA2KlB;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,oBAA8B,GACrC,gBAAgB,CAiGlB;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,oBAA8B,GACrC,OAAO,CAAC,gBAAgB,CAAC,CAS3B"}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { validateExternalEvidence } from "./external-import-contract.js";
|
|
2
|
+
import { isRecord } from "./record.js";
|
|
3
|
+
import { array, hasSarifExternalPropertyReferences, normalizeRecords, readScannerJson, record, requiredText, sarifRunContextForResult, stableId, strings, text, } from "./scanner-import.js";
|
|
4
|
+
function snykIdentity(value, project) {
|
|
5
|
+
const result = record(value, "SARIF result");
|
|
6
|
+
const id = requiredText(result["ruleId"], "Snyk advisory ruleId");
|
|
7
|
+
const paths = array(result["locations"] ?? [], "Result locations")
|
|
8
|
+
.map((value) => {
|
|
9
|
+
const physical = record(record(value, "Location")["physicalLocation"] ?? {}, "Physical location");
|
|
10
|
+
const artifact = record(physical["artifactLocation"] ?? {}, "Artifact location");
|
|
11
|
+
if (artifact["index"] !== undefined ||
|
|
12
|
+
artifact["uriBaseId"] !== undefined)
|
|
13
|
+
throw new Error("Snyk SARIF artifact references are unsupported; use direct manifest URIs from the Snyk Open Source formatter.");
|
|
14
|
+
return text(artifact["uri"]);
|
|
15
|
+
})
|
|
16
|
+
.filter((path) => path !== null);
|
|
17
|
+
const fields = [id, [...new Set(paths)].sort()];
|
|
18
|
+
if (project !== null)
|
|
19
|
+
fields.push(project);
|
|
20
|
+
return stableId("snyk-sarif", fields);
|
|
21
|
+
}
|
|
22
|
+
function snykSarifProject(run) {
|
|
23
|
+
const details = run["automationDetails"];
|
|
24
|
+
const id = isRecord(details) ? text(details["id"]) : null;
|
|
25
|
+
// The formatter appends a run index and export timestamp after the project name.
|
|
26
|
+
return /^Snyk\/Open Source\/(.+)\/\d+\/[^/]+$/su.exec(id ?? "")?.[1] ?? null;
|
|
27
|
+
}
|
|
28
|
+
function pluginIdentity(value) {
|
|
29
|
+
const finding = record(value, "Snyk plugin finding");
|
|
30
|
+
const id = record(finding["id"], "Snyk plugin identity");
|
|
31
|
+
return stableId("snyk-plugin", [
|
|
32
|
+
requiredText(id["kind"], "Identity kind"),
|
|
33
|
+
requiredText(id["value"], "Finding identity"),
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
/** Import the official Snyk Codex plugin's documented local SCA bundle. */
|
|
37
|
+
export function normalizeSnykFindingsExport(input, target = "cloud") {
|
|
38
|
+
const document = record(input, "Snyk plugin export");
|
|
39
|
+
if (document["format"] !== "snyk-findings-export/v1" ||
|
|
40
|
+
document["provider"] !== "snyk")
|
|
41
|
+
throw new Error("Expected a snyk-findings-export/v1 bundle from Snyk.");
|
|
42
|
+
const collection = record(document["collection"], "Snyk collection");
|
|
43
|
+
const sourceTarget = record(collection["target"], "Snyk target");
|
|
44
|
+
const { findings: _findings, ...context } = document;
|
|
45
|
+
return normalizeRecords(array(document["findings"], "Snyk findings"), (value, sourceFindingId) => {
|
|
46
|
+
const finding = record(value, "Snyk plugin finding");
|
|
47
|
+
const observation = record(finding["observation"], "Snyk observation");
|
|
48
|
+
if (finding["originatingScanner"] !== "snyk-open-source" ||
|
|
49
|
+
finding["category"] !== "dependency_vulnerability" ||
|
|
50
|
+
observation["scan"] !== "sca")
|
|
51
|
+
throw new Error("Only Snyk Open Source SCA vulnerability findings are supported from plugin bundles.");
|
|
52
|
+
record(finding["nativeRecord"], "Snyk native MCP record");
|
|
53
|
+
const asset = record(finding["asset"], "Snyk asset");
|
|
54
|
+
const pkg = record(asset["package"], "Snyk package");
|
|
55
|
+
const rule = record(finding["rule"], "Snyk rule");
|
|
56
|
+
const aliases = record(rule["aliases"] ?? {}, "Snyk rule aliases");
|
|
57
|
+
const remediation = record(finding["remediation"] ?? {}, "Snyk remediation");
|
|
58
|
+
const severity = text(record(finding["severity"], "Snyk severity")["value"])?.toLowerCase();
|
|
59
|
+
const revision = text(sourceTarget["revision"]);
|
|
60
|
+
return {
|
|
61
|
+
source_finding_id: sourceFindingId,
|
|
62
|
+
evidence: validateExternalEvidence({
|
|
63
|
+
title: requiredText(finding["title"], "Snyk title"),
|
|
64
|
+
description: text(record(finding["description"] ?? {}, "Snyk description")["text"]),
|
|
65
|
+
severity: ["critical", "high", "medium", "low"].includes(severity ?? "")
|
|
66
|
+
? severity
|
|
67
|
+
: "unknown",
|
|
68
|
+
advisory_ids: [
|
|
69
|
+
...new Set([
|
|
70
|
+
requiredText(rule["id"], "Snyk advisory ID"),
|
|
71
|
+
...strings(aliases["cve"]),
|
|
72
|
+
]),
|
|
73
|
+
],
|
|
74
|
+
packages: [
|
|
75
|
+
{
|
|
76
|
+
name: requiredText(pkg["name"], "Snyk package name"),
|
|
77
|
+
ecosystem: text(pkg["ecosystem"]),
|
|
78
|
+
installed_version: text(pkg["version"]),
|
|
79
|
+
// Plugin v1 manifests are target-relative, without a Git-root offset.
|
|
80
|
+
manifest_path: null,
|
|
81
|
+
fixed_versions: strings(remediation["fixedIn"]),
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
locations: [],
|
|
85
|
+
code_revision: sourceTarget["workingTreeDirty"] === false &&
|
|
86
|
+
revision !== "unknown"
|
|
87
|
+
? revision
|
|
88
|
+
: null,
|
|
89
|
+
source_data: structuredClone({ ...context, finding }),
|
|
90
|
+
}, target),
|
|
91
|
+
};
|
|
92
|
+
}, pluginIdentity, target);
|
|
93
|
+
}
|
|
94
|
+
function normalizeGitRepositoryUrl(repository, cloudRepositoryUrl) {
|
|
95
|
+
// Cloud's selected catalog repository supplies connected GitHub host context;
|
|
96
|
+
// imported evidence alone cannot establish an Enterprise host's SSH aliases.
|
|
97
|
+
const destination = cloudRepositoryUrl
|
|
98
|
+
? new URL(cloudRepositoryUrl)
|
|
99
|
+
: undefined;
|
|
100
|
+
const connectedHost = destination?.protocol === "https:"
|
|
101
|
+
? destination.hostname.toLowerCase()
|
|
102
|
+
: undefined;
|
|
103
|
+
const connectedTenant = /^([^.]+)\.ghe\.com$/u.exec(connectedHost ?? "")?.[1];
|
|
104
|
+
const isGitHubSshUser = (username, hostname) => (username === "git" &&
|
|
105
|
+
(hostname === "github.com" || hostname === connectedHost)) ||
|
|
106
|
+
(username === connectedTenant && hostname === connectedHost);
|
|
107
|
+
const scp = /^([^@/:]+)@([^/:]+):(.+)$/u.exec(repository);
|
|
108
|
+
if (scp && isGitHubSshUser(scp[1], scp[2].toLowerCase()))
|
|
109
|
+
return `https://${scp[2]}/${scp[3]}`;
|
|
110
|
+
// Compare Git's literal SSH userinfo before URL strips tabs or newlines.
|
|
111
|
+
const ssh = /^ssh:\/\/([^/]+)@/u.exec(repository);
|
|
112
|
+
if (ssh) {
|
|
113
|
+
// Git retains these bytes, but URL parsing would erase them from the alias.
|
|
114
|
+
if (/[\t\r\n]/u.test(repository))
|
|
115
|
+
return repository;
|
|
116
|
+
const url = new URL(repository);
|
|
117
|
+
const hostname = url.hostname.toLowerCase();
|
|
118
|
+
const githubSsh = isGitHubSshUser(ssh[1], hostname) &&
|
|
119
|
+
(url.port === "" || url.port === "22");
|
|
120
|
+
const githubSshOverHttps = ssh[1] === "git" && hostname === "ssh.github.com" && url.port === "443";
|
|
121
|
+
if (githubSshOverHttps)
|
|
122
|
+
return `https://github.com${url.pathname}`;
|
|
123
|
+
if (githubSsh)
|
|
124
|
+
return `https://${hostname}${url.pathname}`;
|
|
125
|
+
}
|
|
126
|
+
return repository;
|
|
127
|
+
}
|
|
128
|
+
/** @internal Repository claims retained in original Snyk evidence. */
|
|
129
|
+
export function snykRepositoryUrls(sourceData, { normalizeGitRemote = true, cloudRepositoryUrl, } = {}) {
|
|
130
|
+
if (!sourceData ||
|
|
131
|
+
typeof sourceData !== "object" ||
|
|
132
|
+
Array.isArray(sourceData))
|
|
133
|
+
return [];
|
|
134
|
+
const source = sourceData;
|
|
135
|
+
if (source["format"] === "snyk-findings-export/v1") {
|
|
136
|
+
const collection = record(source["collection"], "Snyk collection");
|
|
137
|
+
const target = record(collection["target"], "Snyk target");
|
|
138
|
+
const repository = text(target["repository"]);
|
|
139
|
+
if (repository === null || repository === "unknown")
|
|
140
|
+
return [];
|
|
141
|
+
return [
|
|
142
|
+
normalizeGitRemote
|
|
143
|
+
? normalizeGitRepositoryUrl(repository, cloudRepositoryUrl)
|
|
144
|
+
: repository,
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
// Generic normalized evidence may use these field names for opaque metadata.
|
|
148
|
+
const document = source["document"];
|
|
149
|
+
const driver = source["driver"];
|
|
150
|
+
if (!isRecord(document) ||
|
|
151
|
+
document["version"] !== "2.1.0" ||
|
|
152
|
+
!isRecord(driver) ||
|
|
153
|
+
driver["name"] !== "Snyk Open Source")
|
|
154
|
+
return [];
|
|
155
|
+
const run = source["run"];
|
|
156
|
+
if (run == null)
|
|
157
|
+
return [];
|
|
158
|
+
return array(record(run, "Snyk run context")["versionControlProvenance"] ?? [], "Snyk version control provenance").map((entry) => {
|
|
159
|
+
const repository = requiredText(record(entry, "Snyk repository provenance")["repositoryUri"], "Snyk repository URI");
|
|
160
|
+
return normalizeGitRemote
|
|
161
|
+
? normalizeGitRepositoryUrl(repository, cloudRepositoryUrl)
|
|
162
|
+
: repository;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/** Snyk Open Source's formatter groups all dependency paths for an advisory in a project. */
|
|
166
|
+
export function normalizeSnykSarif(input, target = "cloud") {
|
|
167
|
+
const document = record(input, "Snyk SARIF");
|
|
168
|
+
if (document["version"] !== "2.1.0")
|
|
169
|
+
throw new Error("Expected Snyk Open Source SARIF 2.1.0.");
|
|
170
|
+
const entries = array(document["runs"], "SARIF runs").flatMap((value) => {
|
|
171
|
+
const run = record(value, "SARIF run");
|
|
172
|
+
const driver = record(record(run["tool"], "SARIF tool")["driver"], "SARIF driver");
|
|
173
|
+
if (driver["name"] !== "Snyk Open Source")
|
|
174
|
+
throw new Error("Only Snyk Open Source SARIF is supported; Code, Container, and IaC need separate mappings.");
|
|
175
|
+
if (hasSarifExternalPropertyReferences(run["externalPropertyFileReferences"]))
|
|
176
|
+
throw new Error("External SARIF property files are unsupported; use a self-contained report.");
|
|
177
|
+
const rules = array(driver["rules"], "SARIF rules").map((rule) => record(rule, "SARIF rule"));
|
|
178
|
+
const rulesById = new Map();
|
|
179
|
+
rules.forEach((rule, index) => {
|
|
180
|
+
const id = rule["id"];
|
|
181
|
+
rulesById.set(id, rulesById.has(id) ? null : { rule, index });
|
|
182
|
+
});
|
|
183
|
+
const project = snykSarifProject(run);
|
|
184
|
+
const { results: _results, tool: _tool, ...runContext } = run;
|
|
185
|
+
const { rules: _rules, ...driverContext } = driver;
|
|
186
|
+
const { driver: _driver, ...toolContext } = record(run["tool"], "SARIF tool");
|
|
187
|
+
runContext["tool"] = toolContext;
|
|
188
|
+
const { runs: _runs, ...documentContext } = document;
|
|
189
|
+
return array(run["results"], "SARIF results").map((result) => ({
|
|
190
|
+
result,
|
|
191
|
+
rulesById,
|
|
192
|
+
project,
|
|
193
|
+
runContext,
|
|
194
|
+
driverContext,
|
|
195
|
+
documentContext,
|
|
196
|
+
}));
|
|
197
|
+
});
|
|
198
|
+
return normalizeRecords(entries, ({ result: value, rulesById, runContext, driverContext, documentContext }, sourceFindingId) => {
|
|
199
|
+
const result = record(value, "SARIF result");
|
|
200
|
+
const id = requiredText(result["ruleId"], "Snyk advisory ruleId");
|
|
201
|
+
const match = rulesById.get(id);
|
|
202
|
+
if (!match)
|
|
203
|
+
throw new Error("Result must reference exactly one rule in its run.");
|
|
204
|
+
const { rule, index } = match;
|
|
205
|
+
if (result["ruleIndex"] !== undefined && result["ruleIndex"] !== index)
|
|
206
|
+
throw new Error("Result ruleIndex and ruleId disagree.");
|
|
207
|
+
if (result["rule"] !== undefined) {
|
|
208
|
+
const ref = record(result["rule"], "Rule reference");
|
|
209
|
+
if (ref["toolComponent"] !== undefined ||
|
|
210
|
+
(ref["id"] !== undefined && ref["id"] !== id) ||
|
|
211
|
+
(ref["index"] !== undefined && ref["index"] !== index) ||
|
|
212
|
+
(ref["guid"] !== undefined && ref["guid"] !== rule["guid"]))
|
|
213
|
+
throw new Error("Result uses an inconsistent or external rule reference.");
|
|
214
|
+
}
|
|
215
|
+
const help = requiredText(record(rule["help"], "Rule help")["markdown"], "Rule help markdown");
|
|
216
|
+
const manager = /^\* Package Manager: (.+)$/mu.exec(help)?.[1] ?? null;
|
|
217
|
+
if (!manager || !/^\* Vulnerable module: .+$/mu.test(help))
|
|
218
|
+
throw new Error("Expected the Snyk Open Source vulnerability profile; license findings are unsupported.");
|
|
219
|
+
const title = requiredText(record(rule["shortDescription"], "Rule shortDescription")["text"], "Rule title");
|
|
220
|
+
const severity = /^(Critical|High|Medium|Low) severity - /u
|
|
221
|
+
.exec(title)?.[1]
|
|
222
|
+
?.toLowerCase() ?? "unknown";
|
|
223
|
+
const message = requiredText(record(result["message"], "Result message")["text"], "Result message text");
|
|
224
|
+
const locations = array(result["locations"] ?? [], "Result locations").map((v) => record(v, "Location"));
|
|
225
|
+
const packages = [];
|
|
226
|
+
for (const location of locations) {
|
|
227
|
+
for (const logical of array(location["logicalLocations"] ?? [], "Logical locations")) {
|
|
228
|
+
const coordinate = text(record(logical, "Logical location")["fullyQualifiedName"]);
|
|
229
|
+
if (!coordinate)
|
|
230
|
+
continue;
|
|
231
|
+
const split = coordinate.lastIndexOf("@");
|
|
232
|
+
if (split <= 0)
|
|
233
|
+
continue;
|
|
234
|
+
packages.push({
|
|
235
|
+
name: coordinate.slice(0, split),
|
|
236
|
+
ecosystem: manager,
|
|
237
|
+
installed_version: coordinate.slice(split + 1) || null,
|
|
238
|
+
manifest_path: null,
|
|
239
|
+
fixed_versions: [],
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const description = [message, help].join("\n\n");
|
|
244
|
+
// Use the project, advisory group, and literal manifest set within the caller's namespace.
|
|
245
|
+
return {
|
|
246
|
+
source_finding_id: sourceFindingId,
|
|
247
|
+
evidence: validateExternalEvidence({
|
|
248
|
+
title,
|
|
249
|
+
description,
|
|
250
|
+
severity,
|
|
251
|
+
advisory_ids: [
|
|
252
|
+
...new Set([
|
|
253
|
+
id,
|
|
254
|
+
...(text(record(rule["fullDescription"] ?? {}, "Full description")["text"])?.match(/\bCVE-\d{4}-\d+\b/gu) ?? []),
|
|
255
|
+
]),
|
|
256
|
+
],
|
|
257
|
+
packages,
|
|
258
|
+
// Snyk emits target-relative paths without a Git-root offset and may
|
|
259
|
+
// synthesize startLine=1. Keep both only in the original evidence.
|
|
260
|
+
locations: [],
|
|
261
|
+
source_data: structuredClone({
|
|
262
|
+
document: documentContext,
|
|
263
|
+
run: sarifRunContextForResult(runContext, result, rule, driverContext, documentContext),
|
|
264
|
+
driver: driverContext,
|
|
265
|
+
rule,
|
|
266
|
+
result,
|
|
267
|
+
}),
|
|
268
|
+
}, target),
|
|
269
|
+
};
|
|
270
|
+
}, ({ result, project }) => snykIdentity(result, project), target);
|
|
271
|
+
}
|
|
272
|
+
/** Import native `snyk test --json` Open Source vulnerability occurrences. */
|
|
273
|
+
export function normalizeSnykJson(input, target = "cloud") {
|
|
274
|
+
const projects = Array.isArray(input) ? input : [input];
|
|
275
|
+
const entries = projects.flatMap((value) => {
|
|
276
|
+
const project = record(value, "Snyk Open Source project");
|
|
277
|
+
if (project["error"])
|
|
278
|
+
throw new Error(`Snyk scan failed: ${String(project["error"])}`);
|
|
279
|
+
if (project["docker"] || project["applications"])
|
|
280
|
+
throw new Error("Snyk Container JSON is unsupported; use Open Source SCA results.");
|
|
281
|
+
if (typeof project["ok"] !== "boolean")
|
|
282
|
+
throw new Error("Expected a completed Snyk Open Source test result.");
|
|
283
|
+
const manager = requiredText(project["packageManager"], "Snyk package manager");
|
|
284
|
+
const manifest = text(project["displayTargetFile"]) ?? text(project["targetFile"]);
|
|
285
|
+
const { vulnerabilities, ...context } = project;
|
|
286
|
+
return array(vulnerabilities, "Snyk vulnerabilities").map((value) => ({
|
|
287
|
+
value,
|
|
288
|
+
context,
|
|
289
|
+
manager,
|
|
290
|
+
manifest,
|
|
291
|
+
}));
|
|
292
|
+
});
|
|
293
|
+
return normalizeRecords(entries, ({ value, context, manager }, sourceFindingId) => {
|
|
294
|
+
const vulnerability = record(value, "Snyk vulnerability");
|
|
295
|
+
if (vulnerability["type"] === "license")
|
|
296
|
+
throw new Error("Snyk license findings are unsupported; only Open Source SCA vulnerabilities are imported.");
|
|
297
|
+
const identifiers = record(vulnerability["identifiers"] ?? {}, "Snyk identifiers");
|
|
298
|
+
const severity = text(vulnerability["severity"])?.toLowerCase();
|
|
299
|
+
return {
|
|
300
|
+
source_finding_id: sourceFindingId,
|
|
301
|
+
evidence: validateExternalEvidence({
|
|
302
|
+
title: requiredText(vulnerability["title"], "Snyk vulnerability title"),
|
|
303
|
+
description: text(vulnerability["description"]),
|
|
304
|
+
severity: ["critical", "high", "medium", "low"].includes(severity ?? "")
|
|
305
|
+
? severity
|
|
306
|
+
: "unknown",
|
|
307
|
+
advisory_ids: [
|
|
308
|
+
...new Set([
|
|
309
|
+
requiredText(vulnerability["id"], "Snyk advisory ID"),
|
|
310
|
+
...strings(identifiers["CVE"]),
|
|
311
|
+
]),
|
|
312
|
+
],
|
|
313
|
+
packages: [
|
|
314
|
+
{
|
|
315
|
+
name: requiredText(vulnerability["name"] ?? vulnerability["packageName"], "Snyk package name"),
|
|
316
|
+
ecosystem: manager,
|
|
317
|
+
installed_version: text(vulnerability["version"]),
|
|
318
|
+
// Native test paths are scan-target-relative, without a Git-root offset.
|
|
319
|
+
manifest_path: null,
|
|
320
|
+
fixed_versions: strings(vulnerability["fixedIn"]),
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
locations: [],
|
|
324
|
+
source_data: structuredClone({ project: context, vulnerability }),
|
|
325
|
+
}, target),
|
|
326
|
+
};
|
|
327
|
+
}, ({ value, manager, manifest }) => {
|
|
328
|
+
const vulnerability = record(value, "Snyk vulnerability");
|
|
329
|
+
return stableId("snyk-json", [
|
|
330
|
+
manager,
|
|
331
|
+
manifest,
|
|
332
|
+
requiredText(vulnerability["id"], "Snyk advisory ID"),
|
|
333
|
+
requiredText(vulnerability["name"] ?? vulnerability["packageName"], "Snyk package name"),
|
|
334
|
+
text(vulnerability["version"]),
|
|
335
|
+
array(vulnerability["from"] ?? [], "Snyk dependency path").map((item) => requiredText(item, "Snyk dependency")),
|
|
336
|
+
]);
|
|
337
|
+
}, target);
|
|
338
|
+
}
|
|
339
|
+
export async function readSnykFindings(path, target = "cloud") {
|
|
340
|
+
const input = await readScannerJson(path);
|
|
341
|
+
if (Array.isArray(input))
|
|
342
|
+
return normalizeSnykJson(input, target);
|
|
343
|
+
const document = record(input, "Snyk findings");
|
|
344
|
+
if (document["format"] === "snyk-findings-export/v1")
|
|
345
|
+
return normalizeSnykFindingsExport(document, target);
|
|
346
|
+
if (document["version"] === "2.1.0")
|
|
347
|
+
return normalizeSnykSarif(document, target);
|
|
348
|
+
return normalizeSnykJson(document, target);
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=snyk-findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snyk-findings.js","sourceRoot":"","sources":["../src/snyk-findings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,KAAK,EACL,kCAAkC,EAClC,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,YAAY,EACZ,wBAAwB,EACxB,QAAQ,EACR,OAAO,EACP,IAAI,GACL,MAAM,qBAAqB,CAAC;AAE7B,SAAS,YAAY,CAAC,KAAc,EAAE,OAAsB;IAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAC7C,MAAM,EAAE,GAAG,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AAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACtE,YAAY,CAAC,IAAI,EAAE,iBAAiB,CAAC,CACtC;SACF,CAAC,CAAC;IACL,CAAC,EACD,MAAM,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,MAAM,GAAyB,OAAO;IAEtC,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAChD,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,yBAAyB;QAClD,OAAO,2BAA2B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvD,IAAI,QAAQ,CAAC,SAAS,CAAC,KAAK,OAAO;QACjC,OAAO,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import type { ExternalImportTarget } from \"./external-import-contract.js\";\nimport { validateExternalEvidence } from \"./external-import-contract.js\";\nimport type { ExternalFindings } from \"./external-findings.js\";\nimport { isRecord } from \"./record.js\";\nimport {\n array,\n hasSarifExternalPropertyReferences,\n normalizeRecords,\n readScannerJson,\n record,\n requiredText,\n sarifRunContextForResult,\n stableId,\n strings,\n text,\n} from \"./scanner-import.js\";\n\nfunction snykIdentity(value: unknown, project: string | null): string {\n const result = record(value, \"SARIF result\");\n const id = requiredText(result[\"ruleId\"], \"Snyk advisory ruleId\");\n const paths = array(result[\"locations\"] ?? [], \"Result locations\")\n .map((value) => {\n const physical = record(\n record(value, \"Location\")[\"physicalLocation\"] ?? {},\n \"Physical location\",\n );\n const artifact = record(\n physical[\"artifactLocation\"] ?? {},\n \"Artifact location\",\n );\n if (\n artifact[\"index\"] !== undefined ||\n artifact[\"uriBaseId\"] !== undefined\n )\n throw new Error(\n \"Snyk SARIF artifact references are unsupported; use direct manifest URIs from the Snyk Open Source formatter.\",\n );\n return text(artifact[\"uri\"]);\n })\n .filter((path): path is string => path !== null);\n const fields: unknown[] = [id, [...new Set(paths)].sort()];\n if (project !== null) fields.push(project);\n return stableId(\"snyk-sarif\", fields);\n}\n\nfunction snykSarifProject(run: Record<string, unknown>): string | null {\n const details = run[\"automationDetails\"];\n const id = isRecord(details) ? text(details[\"id\"]) : null;\n // The formatter appends a run index and export timestamp after the project name.\n return /^Snyk\\/Open Source\\/(.+)\\/\\d+\\/[^/]+$/su.exec(id ?? \"\")?.[1] ?? null;\n}\n\nfunction pluginIdentity(value: unknown): string {\n const finding = record(value, \"Snyk plugin finding\");\n const id = record(finding[\"id\"], \"Snyk plugin identity\");\n return stableId(\"snyk-plugin\", [\n requiredText(id[\"kind\"], \"Identity kind\"),\n requiredText(id[\"value\"], \"Finding identity\"),\n ]);\n}\n\n/** Import the official Snyk Codex plugin's documented local SCA bundle. */\nexport function normalizeSnykFindingsExport(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n const document = record(input, \"Snyk plugin export\");\n if (\n document[\"format\"] !== \"snyk-findings-export/v1\" ||\n document[\"provider\"] !== \"snyk\"\n )\n throw new Error(\"Expected a snyk-findings-export/v1 bundle from Snyk.\");\n const collection = record(document[\"collection\"], \"Snyk collection\");\n const sourceTarget = record(collection[\"target\"], \"Snyk target\");\n const { findings: _findings, ...context } = document;\n return normalizeRecords(\n array(document[\"findings\"], \"Snyk findings\"),\n (value, sourceFindingId) => {\n const finding = record(value, \"Snyk plugin finding\");\n const observation = record(finding[\"observation\"], \"Snyk observation\");\n if (\n finding[\"originatingScanner\"] !== \"snyk-open-source\" ||\n finding[\"category\"] !== \"dependency_vulnerability\" ||\n observation[\"scan\"] !== \"sca\"\n )\n throw new Error(\n \"Only Snyk Open Source SCA vulnerability findings are supported from plugin bundles.\",\n );\n record(finding[\"nativeRecord\"], \"Snyk native MCP record\");\n const asset = record(finding[\"asset\"], \"Snyk asset\");\n const pkg = record(asset[\"package\"], \"Snyk package\");\n const rule = record(finding[\"rule\"], \"Snyk rule\");\n const aliases = record(rule[\"aliases\"] ?? {}, \"Snyk rule aliases\");\n const remediation = record(\n finding[\"remediation\"] ?? {},\n \"Snyk remediation\",\n );\n const severity = text(\n record(finding[\"severity\"], \"Snyk severity\")[\"value\"],\n )?.toLowerCase();\n const revision = text(sourceTarget[\"revision\"]);\n return {\n source_finding_id: sourceFindingId,\n evidence: validateExternalEvidence(\n {\n title: requiredText(finding[\"title\"], \"Snyk title\"),\n description: text(\n record(finding[\"description\"] ?? {}, \"Snyk description\")[\"text\"],\n ),\n severity: [\"critical\", \"high\", \"medium\", \"low\"].includes(\n severity ?? \"\",\n )\n ? severity\n : \"unknown\",\n advisory_ids: [\n ...new Set([\n requiredText(rule[\"id\"], \"Snyk advisory ID\"),\n ...strings(aliases[\"cve\"]),\n ]),\n ],\n packages: [\n {\n name: requiredText(pkg[\"name\"], \"Snyk package name\"),\n ecosystem: text(pkg[\"ecosystem\"]),\n installed_version: text(pkg[\"version\"]),\n // Plugin v1 manifests are target-relative, without a Git-root offset.\n manifest_path: null,\n fixed_versions: strings(remediation[\"fixedIn\"]),\n },\n ],\n locations: [],\n code_revision:\n sourceTarget[\"workingTreeDirty\"] === false &&\n revision !== \"unknown\"\n ? revision\n : null,\n source_data: structuredClone({ ...context, finding }),\n },\n target,\n ),\n };\n },\n pluginIdentity,\n target,\n );\n}\n\nfunction normalizeGitRepositoryUrl(\n repository: string,\n cloudRepositoryUrl?: string,\n): string {\n // Cloud's selected catalog repository supplies connected GitHub host context;\n // imported evidence alone cannot establish an Enterprise host's SSH aliases.\n const destination = cloudRepositoryUrl\n ? new URL(cloudRepositoryUrl)\n : undefined;\n const connectedHost =\n destination?.protocol === \"https:\"\n ? destination.hostname.toLowerCase()\n : undefined;\n const connectedTenant = /^([^.]+)\\.ghe\\.com$/u.exec(connectedHost ?? \"\")?.[1];\n const isGitHubSshUser = (username: string, hostname: string) =>\n (username === \"git\" &&\n (hostname === \"github.com\" || hostname === connectedHost)) ||\n (username === connectedTenant && hostname === connectedHost);\n const scp = /^([^@/:]+)@([^/:]+):(.+)$/u.exec(repository);\n if (scp && isGitHubSshUser(scp[1]!, scp[2]!.toLowerCase()))\n return `https://${scp[2]}/${scp[3]}`;\n // Compare Git's literal SSH userinfo before URL strips tabs or newlines.\n const ssh = /^ssh:\\/\\/([^/]+)@/u.exec(repository);\n if (ssh) {\n // Git retains these bytes, but URL parsing would erase them from the alias.\n if (/[\\t\\r\\n]/u.test(repository)) return repository;\n const url = new URL(repository);\n const hostname = url.hostname.toLowerCase();\n const githubSsh =\n isGitHubSshUser(ssh[1]!, hostname) &&\n (url.port === \"\" || url.port === \"22\");\n const githubSshOverHttps =\n ssh[1] === \"git\" && hostname === \"ssh.github.com\" && url.port === \"443\";\n if (githubSshOverHttps) return `https://github.com${url.pathname}`;\n if (githubSsh) return `https://${hostname}${url.pathname}`;\n }\n return repository;\n}\n\n/** @internal Repository claims retained in original Snyk evidence. */\nexport function snykRepositoryUrls(\n sourceData: unknown,\n {\n normalizeGitRemote = true,\n cloudRepositoryUrl,\n }: {\n normalizeGitRemote?: boolean;\n /** The selected destination from the authenticated Cloud repository catalog. */\n cloudRepositoryUrl?: string;\n } = {},\n): string[] {\n if (\n !sourceData ||\n typeof sourceData !== \"object\" ||\n Array.isArray(sourceData)\n )\n return [];\n const source = sourceData as Record<string, unknown>;\n if (source[\"format\"] === \"snyk-findings-export/v1\") {\n const collection = record(source[\"collection\"], \"Snyk collection\");\n const target = record(collection[\"target\"], \"Snyk target\");\n const repository = text(target[\"repository\"]);\n if (repository === null || repository === \"unknown\") return [];\n return [\n normalizeGitRemote\n ? normalizeGitRepositoryUrl(repository, cloudRepositoryUrl)\n : repository,\n ];\n }\n // Generic normalized evidence may use these field names for opaque metadata.\n const document = source[\"document\"];\n const driver = source[\"driver\"];\n if (\n !isRecord(document) ||\n document[\"version\"] !== \"2.1.0\" ||\n !isRecord(driver) ||\n driver[\"name\"] !== \"Snyk Open Source\"\n )\n return [];\n const run = source[\"run\"];\n if (run == null) return [];\n return array(\n record(run, \"Snyk run context\")[\"versionControlProvenance\"] ?? [],\n \"Snyk version control provenance\",\n ).map((entry) => {\n const repository = requiredText(\n record(entry, \"Snyk repository provenance\")[\"repositoryUri\"],\n \"Snyk repository URI\",\n );\n return normalizeGitRemote\n ? normalizeGitRepositoryUrl(repository, cloudRepositoryUrl)\n : repository;\n });\n}\n\n/** Snyk Open Source's formatter groups all dependency paths for an advisory in a project. */\nexport function normalizeSnykSarif(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n const document = record(input, \"Snyk SARIF\");\n if (document[\"version\"] !== \"2.1.0\")\n throw new Error(\"Expected Snyk Open Source SARIF 2.1.0.\");\n const entries = array(document[\"runs\"], \"SARIF runs\").flatMap((value) => {\n const run = record(value, \"SARIF run\");\n const driver = record(\n record(run[\"tool\"], \"SARIF tool\")[\"driver\"],\n \"SARIF driver\",\n );\n if (driver[\"name\"] !== \"Snyk Open Source\")\n throw new Error(\n \"Only Snyk Open Source SARIF is supported; Code, Container, and IaC need separate mappings.\",\n );\n if (\n hasSarifExternalPropertyReferences(run[\"externalPropertyFileReferences\"])\n )\n throw new Error(\n \"External SARIF property files are unsupported; use a self-contained report.\",\n );\n const rules = array(driver[\"rules\"], \"SARIF rules\").map((rule) =>\n record(rule, \"SARIF rule\"),\n );\n const rulesById = new Map<\n unknown,\n { rule: Record<string, unknown>; index: number } | null\n >();\n rules.forEach((rule, index) => {\n const id = rule[\"id\"];\n rulesById.set(id, rulesById.has(id) ? null : { rule, index });\n });\n const project = snykSarifProject(run);\n const { results: _results, tool: _tool, ...runContext } = run;\n const { rules: _rules, ...driverContext } = driver;\n const { driver: _driver, ...toolContext } = record(\n run[\"tool\"],\n \"SARIF tool\",\n );\n runContext[\"tool\"] = toolContext;\n const { runs: _runs, ...documentContext } = document;\n return array(run[\"results\"], \"SARIF results\").map((result) => ({\n result,\n rulesById,\n project,\n runContext,\n driverContext,\n documentContext,\n }));\n });\n return normalizeRecords(\n entries,\n (\n { result: value, rulesById, runContext, driverContext, documentContext },\n sourceFindingId,\n ) => {\n const result = record(value, \"SARIF result\");\n const id = requiredText(result[\"ruleId\"], \"Snyk advisory ruleId\");\n const match = rulesById.get(id);\n if (!match)\n throw new Error(\"Result must reference exactly one rule in its run.\");\n const { rule, index } = match;\n if (result[\"ruleIndex\"] !== undefined && result[\"ruleIndex\"] !== index)\n throw new Error(\"Result ruleIndex and ruleId disagree.\");\n if (result[\"rule\"] !== undefined) {\n const ref = record(result[\"rule\"], \"Rule reference\");\n if (\n ref[\"toolComponent\"] !== undefined ||\n (ref[\"id\"] !== undefined && ref[\"id\"] !== id) ||\n (ref[\"index\"] !== undefined && ref[\"index\"] !== index) ||\n (ref[\"guid\"] !== undefined && ref[\"guid\"] !== rule[\"guid\"])\n )\n throw new Error(\n \"Result uses an inconsistent or external rule reference.\",\n );\n }\n const help = requiredText(\n record(rule[\"help\"], \"Rule help\")[\"markdown\"],\n \"Rule help markdown\",\n );\n const manager = /^\\* Package Manager: (.+)$/mu.exec(help)?.[1] ?? null;\n if (!manager || !/^\\* Vulnerable module: .+$/mu.test(help))\n throw new Error(\n \"Expected the Snyk Open Source vulnerability profile; license findings are unsupported.\",\n );\n const title = requiredText(\n record(rule[\"shortDescription\"], \"Rule shortDescription\")[\"text\"],\n \"Rule title\",\n );\n const severity =\n /^(Critical|High|Medium|Low) severity - /u\n .exec(title)?.[1]\n ?.toLowerCase() ?? \"unknown\";\n const message = requiredText(\n record(result[\"message\"], \"Result message\")[\"text\"],\n \"Result message text\",\n );\n const locations = array(\n result[\"locations\"] ?? [],\n \"Result locations\",\n ).map((v) => record(v, \"Location\"));\n const packages: {\n name: string;\n ecosystem: string;\n installed_version: string | null;\n manifest_path: string | null;\n fixed_versions: string[];\n }[] = [];\n for (const location of locations) {\n for (const logical of array(\n location[\"logicalLocations\"] ?? [],\n \"Logical locations\",\n )) {\n const coordinate = text(\n record(logical, \"Logical location\")[\"fullyQualifiedName\"],\n );\n if (!coordinate) continue;\n const split = coordinate.lastIndexOf(\"@\");\n if (split <= 0) continue;\n packages.push({\n name: coordinate.slice(0, split),\n ecosystem: manager,\n installed_version: coordinate.slice(split + 1) || null,\n manifest_path: null,\n fixed_versions: [],\n });\n }\n }\n const description = [message, help].join(\"\\n\\n\");\n // Use the project, advisory group, and literal manifest set within the caller's namespace.\n return {\n source_finding_id: sourceFindingId,\n evidence: validateExternalEvidence(\n {\n title,\n description,\n severity,\n advisory_ids: [\n ...new Set([\n id,\n ...(text(\n record(rule[\"fullDescription\"] ?? {}, \"Full description\")[\n \"text\"\n ],\n )?.match(/\\bCVE-\\d{4}-\\d+\\b/gu) ?? []),\n ]),\n ],\n packages,\n // Snyk emits target-relative paths without a Git-root offset and may\n // synthesize startLine=1. Keep both only in the original evidence.\n locations: [],\n source_data: structuredClone({\n document: documentContext,\n run: sarifRunContextForResult(\n runContext,\n result,\n rule,\n driverContext,\n documentContext,\n ),\n driver: driverContext,\n rule,\n result,\n }),\n },\n target,\n ),\n };\n },\n ({ result, project }) => snykIdentity(result, project),\n target,\n );\n}\n\n/** Import native `snyk test --json` Open Source vulnerability occurrences. */\nexport function normalizeSnykJson(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n const projects = Array.isArray(input) ? input : [input];\n const entries = projects.flatMap((value) => {\n const project = record(value, \"Snyk Open Source project\");\n if (project[\"error\"])\n throw new Error(`Snyk scan failed: ${String(project[\"error\"])}`);\n if (project[\"docker\"] || project[\"applications\"])\n throw new Error(\n \"Snyk Container JSON is unsupported; use Open Source SCA results.\",\n );\n if (typeof project[\"ok\"] !== \"boolean\")\n throw new Error(\"Expected a completed Snyk Open Source test result.\");\n const manager = requiredText(\n project[\"packageManager\"],\n \"Snyk package manager\",\n );\n const manifest =\n text(project[\"displayTargetFile\"]) ?? text(project[\"targetFile\"]);\n const { vulnerabilities, ...context } = project;\n return array(vulnerabilities, \"Snyk vulnerabilities\").map((value) => ({\n value,\n context,\n manager,\n manifest,\n }));\n });\n return normalizeRecords(\n entries,\n ({ value, context, manager }, sourceFindingId) => {\n const vulnerability = record(value, \"Snyk vulnerability\");\n if (vulnerability[\"type\"] === \"license\")\n throw new Error(\n \"Snyk license findings are unsupported; only Open Source SCA vulnerabilities are imported.\",\n );\n const identifiers = record(\n vulnerability[\"identifiers\"] ?? {},\n \"Snyk identifiers\",\n );\n const severity = text(vulnerability[\"severity\"])?.toLowerCase();\n return {\n source_finding_id: sourceFindingId,\n evidence: validateExternalEvidence(\n {\n title: requiredText(\n vulnerability[\"title\"],\n \"Snyk vulnerability title\",\n ),\n description: text(vulnerability[\"description\"]),\n severity: [\"critical\", \"high\", \"medium\", \"low\"].includes(\n severity ?? \"\",\n )\n ? severity\n : \"unknown\",\n advisory_ids: [\n ...new Set([\n requiredText(vulnerability[\"id\"], \"Snyk advisory ID\"),\n ...strings(identifiers[\"CVE\"]),\n ]),\n ],\n packages: [\n {\n name: requiredText(\n vulnerability[\"name\"] ?? vulnerability[\"packageName\"],\n \"Snyk package name\",\n ),\n ecosystem: manager,\n installed_version: text(vulnerability[\"version\"]),\n // Native test paths are scan-target-relative, without a Git-root offset.\n manifest_path: null,\n fixed_versions: strings(vulnerability[\"fixedIn\"]),\n },\n ],\n locations: [],\n source_data: structuredClone({ project: context, vulnerability }),\n },\n target,\n ),\n };\n },\n ({ value, manager, manifest }) => {\n const vulnerability = record(value, \"Snyk vulnerability\");\n return stableId(\"snyk-json\", [\n manager,\n manifest,\n requiredText(vulnerability[\"id\"], \"Snyk advisory ID\"),\n requiredText(\n vulnerability[\"name\"] ?? vulnerability[\"packageName\"],\n \"Snyk package name\",\n ),\n text(vulnerability[\"version\"]),\n array(vulnerability[\"from\"] ?? [], \"Snyk dependency path\").map((item) =>\n requiredText(item, \"Snyk dependency\"),\n ),\n ]);\n },\n target,\n );\n}\n\nexport async function readSnykFindings(\n path: string,\n target: ExternalImportTarget = \"cloud\",\n): Promise<ExternalFindings> {\n const input = await readScannerJson(path);\n if (Array.isArray(input)) return normalizeSnykJson(input, target);\n const document = record(input, \"Snyk findings\");\n if (document[\"format\"] === \"snyk-findings-export/v1\")\n return normalizeSnykFindingsExport(document, target);\n if (document[\"version\"] === \"2.1.0\")\n return normalizeSnykSarif(document, target);\n return normalizeSnykJson(document, target);\n}\n"]}
|
package/dist/suggest-owners.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare const findingSchema: z.ZodObject<{
|
|
|
15
15
|
startLine: z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
endLine: z.ZodOptional<z.ZodNumber>;
|
|
17
17
|
}, z.core.$strip>>;
|
|
18
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
18
19
|
}, z.core.$strip>;
|
|
19
20
|
export type OwnerFinding = z.infer<typeof findingSchema>;
|
|
20
21
|
export type SuggestOwnersOptions = Omit<ReadOnlyCodexOptions, "auth" | "workingDirectory">;
|
|
@@ -26,7 +27,7 @@ export interface OwnerSuggestion {
|
|
|
26
27
|
status: "identified" | "abstained" | "error";
|
|
27
28
|
owner: OwnerIdentity | CodeownerIdentity | null;
|
|
28
29
|
reason: string;
|
|
29
|
-
evidence: Omit<OwnerEvidence, "identityIndex" | "content">[];
|
|
30
|
+
evidence: Omit<OwnerEvidence, "identityIndex" | "content" | "blameCommit">[];
|
|
30
31
|
limitations: string[];
|
|
31
32
|
}
|
|
32
33
|
export interface OwnerSuggestions extends ScanModelConfiguration {
|
|
@@ -36,4 +37,6 @@ export interface OwnerSuggestions extends ScanModelConfiguration {
|
|
|
36
37
|
}
|
|
37
38
|
/** Suggest contributors from local Git evidence without changing findings or assigning tickets. */
|
|
38
39
|
export declare function suggestOwners(repository: string, findings: readonly OwnerFinding[], options?: SuggestOwnersOptions): Promise<OwnerSuggestions>;
|
|
40
|
+
/** Finalize decisions recorded by the scan itself. This path never invokes a model. */
|
|
41
|
+
export declare function suggestOwnersFromScan(repository: string, findings: readonly OwnerFinding[], options?: SuggestOwnersOptions): Promise<OwnerSuggestions>;
|
|
39
42
|
//# sourceMappingURL=suggest-owners.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-owners.d.ts","sourceRoot":"","sources":["../src/suggest-owners.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"suggest-owners.d.ts","sourceRoot":"","sources":["../src/suggest-owners.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAczD,QAAA,MAAM,aAAa;;;;;;;;;;;;;iBASjB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,oBAAoB,EACpB,MAAM,GAAG,kBAAkB,CAC5B,CAAC;AACF,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC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