@openai/codex-security 0.8.2 → 0.9.1
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 +201 -178
- package/_bundled_plugin/.app.json +4 -0
- package/_bundled_plugin/.mcp.json +6 -1
- package/_bundled_plugin/examples/completed-scan/findings.json +16 -4
- package/_bundled_plugin/examples/completed-scan/report.md +11 -8
- package/_bundled_plugin/examples/completed-scan/scan-manifest.json +4 -2
- package/_bundled_plugin/mcp/fzstd-LICENSE.txt +21 -0
- package/_bundled_plugin/mcp/helpers.mjs +2 -11
- package/_bundled_plugin/mcp/helpers.mjs.br +0 -0
- package/_bundled_plugin/mcp/native/THIRD_PARTY_NOTICES.txt +3 -210
- 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/linux-x64-musl/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/package.json +1 -0
- package/_bundled_plugin/mcp/permission-profile-preflight.mjs +51 -14
- package/_bundled_plugin/mcp/server.mjs +2 -11
- package/_bundled_plugin/mcp/server.mjs.br +0 -0
- package/_bundled_plugin/mcp/session-decompression.mjs +712 -0
- package/_bundled_plugin/references/artifact-storage.md +1 -1
- package/_bundled_plugin/references/core-scan.md +14 -5
- package/_bundled_plugin/references/default-severity-rubric.md +33 -0
- package/_bundled_plugin/references/final-report.md +5 -3
- package/_bundled_plugin/references/finding-detail-fields.md +19 -18
- package/_bundled_plugin/references/sarif-adapter.md +8 -2
- package/_bundled_plugin/references/scan-artifacts.md +21 -12
- package/_bundled_plugin/references/scan-contract.md +27 -33
- package/_bundled_plugin/references/threat-model.md +1 -0
- package/_bundled_plugin/schemas/tools/scan-draft.schema.json +2 -2
- package/_bundled_plugin/scripts/check_deep_scan_target.py +97 -0
- package/_bundled_plugin/scripts/codex_profile.mjs +7 -1
- package/_bundled_plugin/scripts/deep_scan_config.py +20 -1
- package/_bundled_plugin/scripts/deep_scan_workbench.py +188 -454
- package/_bundled_plugin/scripts/filesystem_identity.py +1 -0
- package/_bundled_plugin/scripts/finalize_scan_contract.py +317 -377
- package/_bundled_plugin/scripts/finding_preview.py +25 -29
- package/_bundled_plugin/scripts/launch_codex_security_mcp +1 -0
- package/_bundled_plugin/scripts/legacy_findings.py +148 -0
- package/_bundled_plugin/scripts/posix_scan_local_files.py +198 -0
- package/_bundled_plugin/scripts/read_codex_session.mjs +21 -0
- package/_bundled_plugin/scripts/report_projection.py +167 -178
- package/_bundled_plugin/scripts/review_state.py +8 -2
- package/_bundled_plugin/scripts/servicenow_avit.py +20 -0
- package/_bundled_plugin/scripts/snapshot_sqlite.py +1 -0
- package/_bundled_plugin/scripts/threat_model_projection.py +22 -26
- package/_bundled_plugin/scripts/validate_scan_contract.py +9 -7
- package/_bundled_plugin/scripts/windows_scan_local_files.py +600 -72
- package/_bundled_plugin/scripts/workbench/__init__.py +1 -1
- package/_bundled_plugin/scripts/workbench/handoff.py +47 -0
- package/_bundled_plugin/scripts/workbench/retained_coverage.py +38 -75
- package/_bundled_plugin/scripts/workbench/retained_records.py +18 -30
- package/_bundled_plugin/scripts/workbench/runtime_toml.py +4 -1
- package/_bundled_plugin/scripts/workbench/saved_coverage.py +152 -248
- package/_bundled_plugin/scripts/workbench/saved_outputs.py +9 -0
- package/_bundled_plugin/scripts/workbench/saved_sources.py +47 -40
- package/_bundled_plugin/scripts/workbench/storage.py +71 -7
- package/_bundled_plugin/scripts/workbench_cli.py +121 -14
- package/_bundled_plugin/scripts/workbench_constants.py +19 -0
- package/_bundled_plugin/scripts/workbench_coverage_receipts.py +3 -3
- package/_bundled_plugin/scripts/workbench_db.py +550 -492
- package/_bundled_plugin/scripts/workbench_feedback.py +8 -7
- package/_bundled_plugin/scripts/workbench_finding_index.py +1 -0
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +90 -4
- package/_bundled_plugin/scripts/workbench_native_indexes.py +29 -33
- package/_bundled_plugin/scripts/workbench_progress.py +10 -1
- package/_bundled_plugin/scripts/workbench_publication.py +14 -10
- package/_bundled_plugin/scripts/workbench_remediation.py +508 -11
- package/_bundled_plugin/scripts/workbench_saved_results.py +132 -77
- package/_bundled_plugin/scripts/workbench_scan_history.py +139 -80
- package/_bundled_plugin/scripts/workbench_scan_start.py +84 -25
- package/_bundled_plugin/scripts/workbench_scan_usage.py +666 -117
- package/_bundled_plugin/scripts/workbench_schema.py +44 -55
- package/_bundled_plugin/scripts/workbench_setup.py +251 -0
- package/_bundled_plugin/scripts/workbench_source_excerpt.py +13 -0
- package/_bundled_plugin/scripts/workbench_source_scopes.py +33 -23
- package/_bundled_plugin/scripts/workbench_target.py +330 -66
- package/_bundled_plugin/scripts/workbench_target_state.py +3 -0
- package/_bundled_plugin/scripts/workbench_validation.py +44 -12
- package/_bundled_plugin/shared/workbench-history-repairs.json +19 -16
- package/_bundled_plugin/shared/workbench-migrations.json +53 -0
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +1 -1
- package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +4 -68
- package/_bundled_plugin/skills/check-skills/SKILL.md +43 -0
- package/_bundled_plugin/skills/check-skills/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/cloud-findings/SKILL.md +6 -4
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +7 -50
- package/_bundled_plugin/skills/fix-finding/SKILL.md +19 -2
- package/_bundled_plugin/skills/publish-findings/SKILL.md +81 -45
- package/_bundled_plugin/skills/publish-findings/references/checkmarx-import.md +37 -0
- package/_bundled_plugin/skills/publish-findings/references/wiz-import.md +5 -24
- package/_bundled_plugin/skills/publish-findings/scripts/collect_checkmarx.py +464 -0
- package/_bundled_plugin/skills/threat-model-visualize/scripts/build_explorer.py +36 -9
- package/_bundled_plugin/skills/track-findings/SKILL.md +5 -3
- package/_bundled_plugin/skills/triage-finding/references/github-rest-intake.md +22 -68
- package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +12 -6
- package/dist/api.d.ts +45 -5
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1144 -411
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +10 -7
- package/dist/auth.js.map +1 -1
- package/dist/bedrock-oss-pricing.d.ts +6 -0
- package/dist/bedrock-oss-pricing.d.ts.map +1 -0
- package/dist/bedrock-oss-pricing.js +58 -0
- package/dist/bedrock-oss-pricing.js.map +1 -0
- package/dist/bedrock-pricing.d.ts +15 -0
- package/dist/bedrock-pricing.d.ts.map +1 -0
- package/dist/bedrock-pricing.js +117 -0
- package/dist/bedrock-pricing.js.map +1 -0
- package/dist/blackduck-findings.d.ts +8 -0
- package/dist/blackduck-findings.d.ts.map +1 -0
- package/dist/blackduck-findings.js +320 -0
- package/dist/blackduck-findings.js.map +1 -0
- package/dist/bulk-scan-discovery.d.ts.map +1 -1
- package/dist/bulk-scan-discovery.js +51 -36
- package/dist/bulk-scan-discovery.js.map +1 -1
- package/dist/checkmarx-evidence.d.ts +19 -0
- package/dist/checkmarx-evidence.d.ts.map +1 -0
- package/dist/checkmarx-evidence.js +36 -0
- package/dist/checkmarx-evidence.js.map +1 -0
- package/dist/checkmarx-findings.d.ts +4 -0
- package/dist/checkmarx-findings.d.ts.map +1 -0
- package/dist/checkmarx-findings.js +27 -0
- package/dist/checkmarx-findings.js.map +1 -0
- package/dist/checkmarx-one.d.ts +4 -0
- package/dist/checkmarx-one.d.ts.map +1 -0
- package/dist/checkmarx-one.js +53 -0
- package/dist/checkmarx-one.js.map +1 -0
- package/dist/checkmarx-repository.d.ts +12 -0
- package/dist/checkmarx-repository.d.ts.map +1 -0
- package/dist/checkmarx-repository.js +181 -0
- package/dist/checkmarx-repository.js.map +1 -0
- package/dist/checkmarx-xml.d.ts +12 -0
- package/dist/checkmarx-xml.d.ts.map +1 -0
- package/dist/checkmarx-xml.js +196 -0
- package/dist/checkmarx-xml.js.map +1 -0
- package/dist/classify-severity-records.d.ts +6 -9
- package/dist/classify-severity-records.d.ts.map +1 -1
- package/dist/classify-severity-records.js +9 -21
- package/dist/classify-severity-records.js.map +1 -1
- package/dist/classify-severity.d.ts +4 -1
- package/dist/classify-severity.d.ts.map +1 -1
- package/dist/classify-severity.js +30 -13
- package/dist/classify-severity.js.map +1 -1
- package/dist/cli.d.ts +14 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2112 -1266
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.js +2 -2
- package/dist/cloud-publish.js.map +1 -1
- package/dist/codex-prompt.d.ts +2 -0
- package/dist/codex-prompt.d.ts.map +1 -1
- package/dist/codex-prompt.js +6 -0
- package/dist/codex-prompt.js.map +1 -1
- package/dist/component-scan.d.ts +16 -3
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +32 -6
- package/dist/component-scan.js.map +1 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +221 -65
- package/dist/config.js.map +1 -1
- package/dist/continuum-findings.d.ts +7 -0
- package/dist/continuum-findings.d.ts.map +1 -0
- package/dist/continuum-findings.js +225 -0
- package/dist/continuum-findings.js.map +1 -0
- package/dist/contract-values.d.ts +30 -0
- package/dist/contract-values.d.ts.map +1 -0
- package/dist/contract-values.js +78 -0
- package/dist/contract-values.js.map +1 -0
- package/dist/contract.d.ts +2 -20
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +58 -669
- package/dist/contract.js.map +1 -1
- package/dist/cost-model.d.ts +13 -1
- package/dist/cost-model.d.ts.map +1 -1
- package/dist/cost-model.js +66 -115
- package/dist/cost-model.js.map +1 -1
- package/dist/cost.d.ts +61 -4
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +2560 -100
- package/dist/cost.js.map +1 -1
- package/dist/custom-publish.d.ts +4 -0
- package/dist/custom-publish.d.ts.map +1 -1
- package/dist/custom-publish.js +40 -3
- package/dist/custom-publish.js.map +1 -1
- package/dist/custom-validation-prompt.d.ts +1 -1
- package/dist/custom-validation-prompt.d.ts.map +1 -1
- package/dist/custom-validation-prompt.js +5 -0
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/custom-validation.d.ts +2 -0
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +4 -0
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/deduplication-prompts.d.ts +4 -4
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
- package/dist/deduplication/deduplication-prompts.js +2 -2
- package/dist/deduplication/deduplication-prompts.js.map +1 -1
- package/dist/deduplication/deduplication-reviewer.d.ts +14 -11
- package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
- package/dist/deduplication/deduplication-reviewer.js +11 -4
- package/dist/deduplication/deduplication-reviewer.js.map +1 -1
- package/dist/deduplication/deduplication.js.map +1 -1
- package/dist/deduplication/finding-schema.d.ts +19 -1
- package/dist/deduplication/finding-schema.d.ts.map +1 -1
- package/dist/deduplication/finding-schema.js +25 -0
- package/dist/deduplication/finding-schema.js.map +1 -1
- package/dist/deduplication/local.d.ts +2 -2
- package/dist/deduplication/local.d.ts.map +1 -1
- package/dist/deduplication/local.js +5 -10
- package/dist/deduplication/local.js.map +1 -1
- package/dist/deduplication/records.d.ts +8 -2
- package/dist/deduplication/records.d.ts.map +1 -1
- package/dist/deduplication/records.js +36 -8
- package/dist/deduplication/records.js.map +1 -1
- package/dist/deduplication/refusal.d.ts.map +1 -1
- package/dist/deduplication/refusal.js +25 -5
- package/dist/deduplication/refusal.js.map +1 -1
- package/dist/deduplication/scan.d.ts +3 -0
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +1 -1
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/deep-config.d.ts +0 -1
- package/dist/deep-config.d.ts.map +1 -1
- package/dist/deep-config.js +22 -33
- package/dist/deep-config.js.map +1 -1
- package/dist/deep-scan-defaults.d.ts +2 -0
- package/dist/deep-scan-defaults.d.ts.map +1 -1
- package/dist/deep-scan-defaults.js +28 -1
- package/dist/deep-scan-defaults.js.map +1 -1
- package/dist/deep-scan.d.ts +13 -0
- package/dist/deep-scan.d.ts.map +1 -1
- package/dist/deep-scan.js +262 -7
- package/dist/deep-scan.js.map +1 -1
- package/dist/default-severity-rubric.d.ts +1 -2
- package/dist/default-severity-rubric.d.ts.map +1 -1
- package/dist/default-severity-rubric.js +2 -66
- package/dist/default-severity-rubric.js.map +1 -1
- package/dist/endor-findings.d.ts +3 -1
- package/dist/endor-findings.d.ts.map +1 -1
- package/dist/endor-findings.js +108 -80
- package/dist/endor-findings.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -2
- package/dist/errors.js.map +1 -1
- package/dist/external-findings-import.d.ts +5 -3
- package/dist/external-findings-import.d.ts.map +1 -1
- package/dist/external-findings-import.js +11 -16
- package/dist/external-findings-import.js.map +1 -1
- package/dist/external-findings-local.d.ts +15 -4
- package/dist/external-findings-local.d.ts.map +1 -1
- package/dist/external-findings-local.js +619 -225
- package/dist/external-findings-local.js.map +1 -1
- package/dist/external-findings-publish.d.ts +20 -6
- package/dist/external-findings-publish.d.ts.map +1 -1
- package/dist/external-findings-publish.js +2356 -308
- package/dist/external-findings-publish.js.map +1 -1
- package/dist/external-findings-read.d.ts +28 -2
- package/dist/external-findings-read.d.ts.map +1 -1
- package/dist/external-findings-read.js +174 -81
- package/dist/external-findings-read.js.map +1 -1
- package/dist/external-findings.d.ts +17 -3
- package/dist/external-findings.d.ts.map +1 -1
- package/dist/external-findings.js +153 -1
- package/dist/external-findings.js.map +1 -1
- package/dist/external-import-contract.d.ts +33 -1
- package/dist/external-import-contract.d.ts.map +1 -1
- package/dist/external-import-contract.js +335 -51
- package/dist/external-import-contract.js.map +1 -1
- package/dist/external-import-models.d.ts +1 -1
- package/dist/external-import-models.d.ts.map +1 -1
- package/dist/external-import-models.js.map +1 -1
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +5 -4
- package/dist/feedback.js.map +1 -1
- package/dist/finding-prompt.d.ts +5 -0
- package/dist/finding-prompt.d.ts.map +1 -0
- package/dist/finding-prompt.js +32 -0
- package/dist/finding-prompt.js.map +1 -0
- package/dist/finding-retrieval.d.ts +3 -3
- package/dist/finding-retrieval.d.ts.map +1 -1
- package/dist/finding-retrieval.js.map +1 -1
- package/dist/finding-workflow.d.ts +6 -1
- package/dist/finding-workflow.d.ts.map +1 -1
- package/dist/finding-workflow.js +2 -2
- package/dist/finding-workflow.js.map +1 -1
- package/dist/findings-client.d.ts +1 -0
- package/dist/findings-client.d.ts.map +1 -1
- package/dist/findings-client.js +27 -3
- package/dist/findings-client.js.map +1 -1
- package/dist/git-remote.d.ts +4 -0
- package/dist/git-remote.d.ts.map +1 -1
- package/dist/git-remote.js +20 -0
- package/dist/git-remote.js.map +1 -1
- package/dist/github-advisories.d.ts +3 -12
- package/dist/github-advisories.d.ts.map +1 -1
- package/dist/github-advisories.js +9 -31
- package/dist/github-advisories.js.map +1 -1
- package/dist/github-dependabot-findings.d.ts.map +1 -1
- package/dist/github-dependabot-findings.js +22 -20
- package/dist/github-dependabot-findings.js.map +1 -1
- package/dist/github-findings.d.ts +4 -1
- package/dist/github-findings.d.ts.map +1 -1
- package/dist/github-findings.js +392 -79
- package/dist/github-findings.js.map +1 -1
- package/dist/github.d.ts +17 -7
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +43 -30
- package/dist/github.js.map +1 -1
- package/dist/host-protocol.d.ts +2 -2
- package/dist/host-protocol.d.ts.map +1 -1
- package/dist/host-protocol.js.map +1 -1
- package/dist/host-records-protocol.d.ts +10 -11
- package/dist/host-records-protocol.d.ts.map +1 -1
- package/dist/host-records-protocol.js +69 -9
- package/dist/host-records-protocol.js.map +1 -1
- package/dist/hosted-git-remotes.d.ts +5 -0
- package/dist/hosted-git-remotes.d.ts.map +1 -0
- package/dist/hosted-git-remotes.js +285 -0
- package/dist/hosted-git-remotes.js.map +1 -0
- package/dist/hosted-git-repository.d.ts +28 -0
- package/dist/hosted-git-repository.d.ts.map +1 -0
- package/dist/hosted-git-repository.js +222 -0
- package/dist/hosted-git-repository.js.map +1 -0
- package/dist/hosted-scan-protocol.js +2 -2
- package/dist/hosted-scan-protocol.js.map +1 -1
- package/dist/hosted-scan.d.ts +15 -0
- package/dist/hosted-scan.d.ts.map +1 -1
- package/dist/hosted-scan.js +71 -44
- package/dist/hosted-scan.js.map +1 -1
- package/dist/hosted-scanner-http.d.ts +21 -0
- package/dist/hosted-scanner-http.d.ts.map +1 -0
- package/dist/hosted-scanner-http.js +204 -0
- package/dist/hosted-scanner-http.js.map +1 -0
- package/dist/hosted-scanner-v1.d.ts +6 -0
- package/dist/hosted-scanner-v1.d.ts.map +1 -0
- package/dist/hosted-scanner-v1.js +60 -0
- package/dist/hosted-scanner-v1.js.map +1 -0
- package/dist/import-scan.d.ts.map +1 -1
- package/dist/import-scan.js +3 -0
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +24 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/inspector-findings.d.ts.map +1 -1
- package/dist/inspector-findings.js +58 -81
- package/dist/inspector-findings.js.map +1 -1
- package/dist/knowledge-base.d.ts.map +1 -1
- package/dist/knowledge-base.js +86 -10
- package/dist/knowledge-base.js.map +1 -1
- package/dist/local-git-metadata.d.ts +5 -0
- package/dist/local-git-metadata.d.ts.map +1 -0
- package/dist/local-git-metadata.js +130 -0
- package/dist/local-git-metadata.js.map +1 -0
- package/dist/multiscan.d.ts +6 -4
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +160 -77
- package/dist/multiscan.js.map +1 -1
- package/dist/native-json-findings.d.ts +2 -1
- package/dist/native-json-findings.d.ts.map +1 -1
- package/dist/native-json-findings.js +12 -2
- package/dist/native-json-findings.js.map +1 -1
- package/dist/opengrep-findings.d.ts +1 -0
- package/dist/opengrep-findings.d.ts.map +1 -1
- package/dist/opengrep-findings.js +49 -31
- package/dist/opengrep-findings.js.map +1 -1
- package/dist/operation-telemetry.d.ts +104 -0
- package/dist/operation-telemetry.d.ts.map +1 -0
- package/dist/operation-telemetry.js +293 -0
- package/dist/operation-telemetry.js.map +1 -0
- package/dist/patch-tui.d.ts.map +1 -1
- package/dist/patch-tui.js +90 -35
- package/dist/patch-tui.js.map +1 -1
- package/dist/plugin-python-probe.d.ts +4 -0
- package/dist/plugin-python-probe.d.ts.map +1 -0
- package/dist/plugin-python-probe.js +10 -0
- package/dist/plugin-python-probe.js.map +1 -0
- package/dist/private-finding-import.d.ts +341 -0
- package/dist/private-finding-import.d.ts.map +1 -0
- package/dist/private-finding-import.js +411 -0
- package/dist/private-finding-import.js.map +1 -0
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +2 -2
- package/dist/project-config.js.map +1 -1
- package/dist/provider-profile.d.ts +11 -3
- package/dist/provider-profile.d.ts.map +1 -1
- package/dist/provider-profile.js +80 -11
- package/dist/provider-profile.js.map +1 -1
- package/dist/publication-telemetry.d.ts +45 -0
- package/dist/publication-telemetry.d.ts.map +1 -0
- package/dist/publication-telemetry.js +50 -0
- package/dist/publication-telemetry.js.map +1 -0
- package/dist/publication.js +7 -1
- package/dist/publication.js.map +1 -1
- package/dist/publish.d.ts +4 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +42 -2
- package/dist/publish.js.map +1 -1
- package/dist/reader-selection.d.ts +15 -0
- package/dist/reader-selection.d.ts.map +1 -0
- package/dist/reader-selection.js +89 -0
- package/dist/reader-selection.js.map +1 -0
- package/dist/record.d.ts +6 -1
- package/dist/record.d.ts.map +1 -1
- package/dist/record.js +53 -2
- package/dist/record.js.map +1 -1
- package/dist/remediation.d.ts +3 -1
- package/dist/remediation.d.ts.map +1 -1
- package/dist/remediation.js +28 -2
- package/dist/remediation.js.map +1 -1
- package/dist/request-metadata.d.ts +3 -0
- package/dist/request-metadata.d.ts.map +1 -1
- package/dist/request-metadata.js +9 -0
- package/dist/request-metadata.js.map +1 -1
- package/dist/result.d.ts +6 -0
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +3 -1
- package/dist/result.js.map +1 -1
- package/dist/retry-windows-rename.d.ts +8 -0
- package/dist/retry-windows-rename.d.ts.map +1 -0
- package/dist/retry-windows-rename.js +24 -0
- package/dist/retry-windows-rename.js.map +1 -0
- package/dist/runtime.d.ts +22 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +408 -162
- package/dist/runtime.js.map +1 -1
- package/dist/saved-scan-bootstrap.d.ts +1 -0
- package/dist/saved-scan-bootstrap.d.ts.map +1 -1
- package/dist/saved-scan-bootstrap.js +18 -15
- package/dist/saved-scan-bootstrap.js.map +1 -1
- package/dist/scan-activity.d.ts.map +1 -1
- package/dist/scan-activity.js +172 -64
- package/dist/scan-activity.js.map +1 -1
- package/dist/scan-comparison.d.ts +10 -5
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +68 -25
- package/dist/scan-comparison.js.map +1 -1
- package/dist/scan-dashboard.d.ts +7 -6
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +91 -79
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-executor.d.ts +12 -1
- package/dist/scan-executor.d.ts.map +1 -1
- package/dist/scan-executor.js +22 -2
- package/dist/scan-executor.js.map +1 -1
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +31 -28
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/scan-logs.d.ts +12 -0
- package/dist/scan-logs.d.ts.map +1 -1
- package/dist/scan-logs.js +106 -77
- package/dist/scan-logs.js.map +1 -1
- package/dist/scan-measurement.d.ts +26 -0
- package/dist/scan-measurement.d.ts.map +1 -0
- package/dist/scan-measurement.js +77 -0
- package/dist/scan-measurement.js.map +1 -0
- package/dist/scan-progress.d.ts +1 -0
- package/dist/scan-progress.d.ts.map +1 -1
- package/dist/scan-progress.js +3 -0
- package/dist/scan-progress.js.map +1 -1
- package/dist/scan-sessions.d.ts.map +1 -1
- package/dist/scan-sessions.js +4 -1
- package/dist/scan-sessions.js.map +1 -1
- package/dist/scan-settings.d.ts +1 -1
- package/dist/scan-settings.d.ts.map +1 -1
- package/dist/scan-settings.js +1 -24
- package/dist/scan-settings.js.map +1 -1
- package/dist/scanner-import.d.ts +64 -6
- package/dist/scanner-import.d.ts.map +1 -1
- package/dist/scanner-import.js +406 -48
- package/dist/scanner-import.js.map +1 -1
- package/dist/scanner-repository-url.d.ts +17 -0
- package/dist/scanner-repository-url.d.ts.map +1 -0
- package/dist/scanner-repository-url.js +71 -0
- package/dist/scanner-repository-url.js.map +1 -0
- package/dist/security-policy.d.ts +1 -1
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js.map +1 -1
- package/dist/semgrep-findings.d.ts +6 -3
- package/dist/semgrep-findings.d.ts.map +1 -1
- package/dist/semgrep-findings.js +124 -88
- package/dist/semgrep-findings.js.map +1 -1
- package/dist/semgrep-guardian-findings.d.ts +38 -0
- package/dist/semgrep-guardian-findings.d.ts.map +1 -0
- package/dist/semgrep-guardian-findings.js +165 -0
- package/dist/semgrep-guardian-findings.js.map +1 -0
- package/dist/semgrep-platform-collector.d.ts +26 -0
- package/dist/semgrep-platform-collector.d.ts.map +1 -0
- package/dist/semgrep-platform-collector.js +108 -0
- package/dist/semgrep-platform-collector.js.map +1 -0
- package/dist/semgrep-platform-findings.d.ts +213 -0
- package/dist/semgrep-platform-findings.d.ts.map +1 -0
- package/dist/semgrep-platform-findings.js +1078 -0
- package/dist/semgrep-platform-findings.js.map +1 -0
- package/dist/semgrep-platform-v1.d.ts +6 -0
- package/dist/semgrep-platform-v1.d.ts.map +1 -0
- package/dist/semgrep-platform-v1.js +83 -0
- package/dist/semgrep-platform-v1.js.map +1 -0
- package/dist/server/api.d.ts +1 -1
- package/dist/server/api.d.ts.map +1 -1
- package/dist/server/api.js.map +1 -1
- package/dist/server/embedding-tokenizer.cdx.json +33 -0
- package/dist/server/embedding-tokenizer.d.ts +2 -0
- package/dist/server/embedding-tokenizer.d.ts.map +1 -0
- package/dist/server/embedding-tokenizer.js +322 -0
- package/dist/server/embedding-tokenizer.js.map +6 -0
- package/dist/server/embeddings.d.ts +16 -2
- package/dist/server/embeddings.d.ts.map +1 -1
- package/dist/server/embeddings.js +35 -5
- package/dist/server/embeddings.js.map +1 -1
- package/dist/session-lines.d.ts +5 -0
- package/dist/session-lines.d.ts.map +1 -0
- package/dist/session-lines.js +60 -0
- package/dist/session-lines.js.map +1 -0
- package/dist/severity-review.d.ts +3 -1
- package/dist/severity-review.d.ts.map +1 -1
- package/dist/severity-review.js +3 -2
- package/dist/severity-review.js.map +1 -1
- package/dist/severity-rubric.d.ts +20 -0
- package/dist/severity-rubric.d.ts.map +1 -0
- package/dist/severity-rubric.js +73 -0
- package/dist/severity-rubric.js.map +1 -0
- package/dist/severity-store.js +15 -5
- package/dist/severity-store.js.map +1 -1
- package/dist/skill-authentication.d.ts +1 -0
- package/dist/skill-authentication.d.ts.map +1 -1
- package/dist/skill-authentication.js +1 -0
- package/dist/skill-authentication.js.map +1 -1
- package/dist/snyk-findings.d.ts +7 -2
- package/dist/snyk-findings.d.ts.map +1 -1
- package/dist/snyk-findings.js +108 -84
- package/dist/snyk-findings.js.map +1 -1
- package/dist/snyk-rest-findings.d.ts +76 -0
- package/dist/snyk-rest-findings.d.ts.map +1 -0
- package/dist/snyk-rest-findings.js +1051 -0
- package/dist/snyk-rest-findings.js.map +1 -0
- package/dist/snyk-rest-v1.d.ts +28 -0
- package/dist/snyk-rest-v1.d.ts.map +1 -0
- package/dist/snyk-rest-v1.js +132 -0
- package/dist/snyk-rest-v1.js.map +1 -0
- package/dist/snyk-token-origin.d.ts +4 -0
- package/dist/snyk-token-origin.d.ts.map +1 -0
- package/dist/snyk-token-origin.js +82 -0
- package/dist/snyk-token-origin.js.map +1 -0
- package/dist/sonar-collector.d.ts +16 -0
- package/dist/sonar-collector.d.ts.map +1 -0
- package/dist/sonar-collector.js +380 -0
- package/dist/sonar-collector.js.map +1 -0
- package/dist/sonar-findings.d.ts +49 -0
- package/dist/sonar-findings.d.ts.map +1 -0
- package/dist/sonar-findings.js +288 -0
- package/dist/sonar-findings.js.map +1 -0
- package/dist/sonar-import.d.ts +111 -0
- package/dist/sonar-import.d.ts.map +1 -0
- package/dist/sonar-import.js +277 -0
- package/dist/sonar-import.js.map +1 -0
- package/dist/suggest-owners.d.ts.map +1 -1
- package/dist/suggest-owners.js +2 -1
- package/dist/suggest-owners.js.map +1 -1
- package/dist/target-drift.d.ts +9 -0
- package/dist/target-drift.d.ts.map +1 -0
- package/dist/target-drift.js +27 -0
- package/dist/target-drift.js.map +1 -0
- package/dist/targets.d.ts +5 -0
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +73 -31
- package/dist/targets.js.map +1 -1
- package/dist/tenable-findings.d.ts +9 -0
- package/dist/tenable-findings.d.ts.map +1 -0
- package/dist/tenable-findings.js +122 -0
- package/dist/tenable-findings.js.map +1 -0
- package/dist/terminal-columns.d.ts +4 -0
- package/dist/terminal-columns.d.ts.map +1 -0
- package/dist/terminal-columns.js +19 -0
- package/dist/terminal-columns.js.map +1 -0
- package/dist/terminal-stream.d.ts +13 -0
- package/dist/terminal-stream.d.ts.map +1 -0
- package/dist/terminal-stream.js +35 -0
- package/dist/terminal-stream.js.map +1 -0
- package/dist/trivy-findings.d.ts +19 -0
- package/dist/trivy-findings.d.ts.map +1 -0
- package/dist/trivy-findings.js +435 -0
- package/dist/trivy-findings.js.map +1 -0
- package/dist/trivy-import.d.ts +19 -0
- package/dist/trivy-import.d.ts.map +1 -0
- package/dist/trivy-import.js +151 -0
- package/dist/trivy-import.js.map +1 -0
- package/dist/validation-records.d.ts +0 -3
- package/dist/validation-records.d.ts.map +1 -1
- package/dist/validation-records.js +1 -17
- package/dist/validation-records.js.map +1 -1
- package/dist/veracode-findings.d.ts +9 -0
- package/dist/veracode-findings.d.ts.map +1 -0
- package/dist/veracode-findings.js +409 -0
- package/dist/veracode-findings.js.map +1 -0
- package/dist/vertex-pricing.d.ts +8 -0
- package/dist/vertex-pricing.d.ts.map +1 -0
- package/dist/vertex-pricing.js +20 -0
- package/dist/vertex-pricing.js.map +1 -0
- package/dist/windows-path.d.ts +1 -0
- package/dist/windows-path.d.ts.map +1 -1
- package/dist/windows-path.js +27 -1
- package/dist/windows-path.js.map +1 -1
- package/dist/wiz-csv.d.ts +2 -2
- package/dist/wiz-csv.d.ts.map +1 -1
- package/dist/wiz-csv.js +1 -3
- package/dist/wiz-csv.js.map +1 -1
- package/dist/wiz-findings.d.ts +14 -2
- package/dist/wiz-findings.d.ts.map +1 -1
- package/dist/wiz-findings.js +143 -50
- package/dist/wiz-findings.js.map +1 -1
- package/docs/classify-severity-records.md +28 -13
- package/docs/cli.md +623 -843
- package/docs/dedupe-records.md +54 -24
- package/docs/findings-service.md +87 -47
- package/docs/hosted-remediation.md +14 -7
- package/docs/hosted-scans.md +64 -41
- package/docs/telemetry.md +236 -0
- package/docs/validate-records.md +78 -44
- package/package.json +19 -17
- package/schemas/external-findings.schema.json +14 -1
- package/schemas/hosted-scan-v2.fixture.json +16 -1
- 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/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/schemas/tools/deep-reducer.schema.json +0 -96
- package/_bundled_plugin/scripts/validate_tracking_source.py +0 -82
- package/_bundled_plugin/scripts/workbench_local_dedupe.py +0 -136
- package/dist/deduplication/records-protocol.d.ts +0 -4
- package/dist/deduplication/records-protocol.d.ts.map +0 -1
- package/dist/deduplication/records-protocol.js +0 -49
- package/dist/deduplication/records-protocol.js.map +0 -1
- package/dist/external-imports-feature.d.ts +0 -6
- package/dist/external-imports-feature.d.ts.map +0 -1
- package/dist/external-imports-feature.js +0 -51
- package/dist/external-imports-feature.js.map +0 -1
- package/dist/finding-normalization.d.ts +0 -5
- package/dist/finding-normalization.d.ts.map +0 -1
- package/dist/finding-normalization.js +0 -120
- package/dist/finding-normalization.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endor-findings.d.ts","sourceRoot":"","sources":["../src/endor-findings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endor-findings.d.ts","sourceRoot":"","sources":["../src/endor-findings.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAiG/D,kFAAkF;AAClF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,oBAA8B,GACrC,gBAAgB,CAElB;AAID,8FAA8F;AAC9F,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,gBAAgB,WAEvE;AA6KD,yFAAyF;AACzF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,oBAA8B,GACrC,gBAAgB,CA4GlB;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,oBAA8B,GACrC,OAAO,CAAC,gBAAgB,CAAC,CAE3B"}
|
package/dist/endor-findings.js
CHANGED
|
@@ -1,40 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { markPreviousCloudProjection } from "./reader-selection.js";
|
|
2
|
+
import { validateEnrichedExternalEvidence, validateExternalEvidence, } from "./external-import-contract.js";
|
|
3
|
+
import { asRecord } from "./record.js";
|
|
4
|
+
import { array, normalizeRecords, readScannerJson, record, relativePath, reportableScannerSeverity, requiredText, sarifRunRepositories, sarifRunResults, strings, readSarifRuns, text, validateSarifRuleReference, } from "./scanner-import.js";
|
|
4
5
|
/** @internal Repository claims retained in the adapter's original SARIF context. */
|
|
5
|
-
export function endorRepositoryUrls(sourceData) {
|
|
6
|
-
|
|
7
|
-
return [];
|
|
8
|
-
const run = sourceData["runContext"];
|
|
6
|
+
export function endorRepositoryUrls(sourceData, retainedUrlsOnly = false) {
|
|
7
|
+
const run = asRecord(sourceData)?.["runContext"];
|
|
9
8
|
if (run == null)
|
|
10
9
|
return [];
|
|
11
|
-
|
|
10
|
+
if (retainedUrlsOnly) {
|
|
11
|
+
// Historical projections can retain opaque run metadata alongside explicit URLs.
|
|
12
|
+
const entries = asRecord(run)?.["versionControlProvenance"];
|
|
13
|
+
if (!Array.isArray(entries))
|
|
14
|
+
return [];
|
|
15
|
+
return entries
|
|
16
|
+
.map((entry) => asRecord(entry)?.["repositoryUri"])
|
|
17
|
+
.filter((url) => typeof url === "string");
|
|
18
|
+
}
|
|
19
|
+
return sarifRunRepositories(run, "Endor").map((ref) => ref.url);
|
|
20
|
+
}
|
|
21
|
+
function positiveCount(value) {
|
|
22
|
+
return ((typeof value === "number" || typeof value === "string") &&
|
|
23
|
+
Number(value) > 0);
|
|
24
|
+
}
|
|
25
|
+
function endorListObjects(root) {
|
|
26
|
+
const list = record(root["list"], "Endor list");
|
|
27
|
+
const response = record(list["response"] ?? {}, "Endor list response");
|
|
28
|
+
const { next_page_id: nextId, next_page_token: token, total_size: total, } = response;
|
|
29
|
+
if (nextId != null && typeof nextId !== "string")
|
|
30
|
+
throw new Error("Endor next_page_id must be a string.");
|
|
31
|
+
if (text(nextId) ||
|
|
32
|
+
(token != null && token !== 0 && token !== "0" && token !== ""))
|
|
33
|
+
throw new Error("The Endor list response has another page. Supply a complete export or an explicitly selected array.");
|
|
34
|
+
const values = array(list["objects"] ?? [], "Endor list.objects");
|
|
35
|
+
if (values.length)
|
|
36
|
+
return values;
|
|
37
|
+
// Protobuf can omit an empty repeated field. Recognize only its known
|
|
38
|
+
// pagination envelope; don't mistake an unrecognized payload for no matches.
|
|
39
|
+
if (positiveCount(total) ||
|
|
40
|
+
(list["objects"] == null &&
|
|
41
|
+
(Object.keys(list).some((key) => key !== "response" && key !== "objects") ||
|
|
42
|
+
Object.keys(response).some((key) => !["next_page_token", "next_page_id"].includes(key) &&
|
|
43
|
+
!(key === "total_size" && (total === 0 || total === "0"))))))
|
|
44
|
+
throw new Error("Expected Endor list.objects in the finding export.");
|
|
45
|
+
const { count } = record(root["count_response"] ?? {}, "Endor count response");
|
|
46
|
+
const { groups } = record(root["group_response"] ?? {}, "Endor group response");
|
|
47
|
+
if (positiveCount(count) ||
|
|
48
|
+
(groups != null && Object.keys(record(groups, "Endor groups")).length))
|
|
49
|
+
throw new Error("The Endor report contains a summary without finding objects. Supply the complete finding export.");
|
|
50
|
+
return values;
|
|
12
51
|
}
|
|
13
52
|
/** Saved Endor Finding objects, an array, or an unmasked ListFindingsResponse. */
|
|
14
53
|
export function normalizeEndorFindings(input, target = "cloud") {
|
|
54
|
+
return normalizeReport(input, target, false);
|
|
55
|
+
}
|
|
56
|
+
const reducedReports = new WeakSet();
|
|
57
|
+
/** A native upload would ask the worker to reconstruct fields that Cloud could not accept. */
|
|
58
|
+
export function requiresStructuredEndorReport(findings) {
|
|
59
|
+
return reducedReports.has(findings);
|
|
60
|
+
}
|
|
61
|
+
/** @internal Reproduce the selection from before malware and fully qualified package mapping. */
|
|
62
|
+
export function normalizePreviousEndorFindings(input, target = "cloud") {
|
|
63
|
+
return normalizeReport(input, target, true);
|
|
64
|
+
}
|
|
65
|
+
function normalizeReport(input, target, previous) {
|
|
15
66
|
const root = Array.isArray(input) ? null : record(input, "Endor report");
|
|
16
67
|
if (root?.["version"] === "2.1.0" && root["runs"] !== undefined)
|
|
17
68
|
return normalizeEndorSarif(root, target);
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const response = record(list["response"] ?? {}, "Endor list response");
|
|
21
|
-
const token = response["next_page_token"];
|
|
22
|
-
if (text(response["next_page_id"]) ||
|
|
23
|
-
(token != null && token !== 0 && token !== "0" && token !== "")) {
|
|
24
|
-
throw new Error("The Endor list response has another page. Supply a complete export or an explicitly selected array.");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const values = list
|
|
28
|
-
? array(list["objects"] ?? [], "Endor list.objects")
|
|
69
|
+
const values = root?.["list"] !== undefined
|
|
70
|
+
? endorListObjects(root)
|
|
29
71
|
: Array.isArray(input)
|
|
30
72
|
? input
|
|
31
73
|
: [input];
|
|
32
|
-
|
|
74
|
+
let changed = false;
|
|
75
|
+
let reduced = false;
|
|
76
|
+
const result = normalizeRecords(values, (value) => {
|
|
33
77
|
const finding = record(value, "Endor finding");
|
|
34
78
|
const meta = record(finding["meta"], "Endor meta");
|
|
35
79
|
const spec = record(finding["spec"], "Endor spec");
|
|
36
80
|
requiredText(spec["project_uuid"], "Endor project_uuid");
|
|
37
|
-
const
|
|
81
|
+
const bareName = text(spec["target_dependency_name"]);
|
|
82
|
+
const name = bareName ??
|
|
83
|
+
(previous ? null : text(spec["target_dependency_package_name"]));
|
|
38
84
|
const paths = [
|
|
39
85
|
...new Set(strings(spec["dependency_file_paths"])
|
|
40
86
|
.map(relativePath)
|
|
@@ -66,12 +112,15 @@ export function normalizeEndorFindings(input, target = "cloud") {
|
|
|
66
112
|
const vulnerability = record(metadata["vulnerability"] ?? {}, "Endor vulnerability");
|
|
67
113
|
const advisory = text(record(vulnerability["meta"] ?? {}, "Vulnerability meta")["name"]);
|
|
68
114
|
const aliases = strings(record(vulnerability["spec"] ?? {}, "Vulnerability spec")["aliases"]);
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
115
|
+
const vulnerabilityIds = [
|
|
116
|
+
...new Set([...(advisory ? [advisory] : []), ...aliases]),
|
|
117
|
+
];
|
|
118
|
+
const malware = previous ? undefined : asRecord(metadata["malware"]);
|
|
119
|
+
const advisories = new Set([
|
|
120
|
+
...vulnerabilityIds,
|
|
121
|
+
...strings([asRecord(malware?.["meta"])?.["name"]]),
|
|
122
|
+
...strings(asRecord(malware?.["spec"])?.["aliases"]),
|
|
123
|
+
]);
|
|
75
124
|
// A recommended version can refer to an introducing dependency; retain it in source_data.
|
|
76
125
|
const packages = name
|
|
77
126
|
? (paths.length ? paths : [null]).map((path) => ({
|
|
@@ -86,7 +135,11 @@ export function normalizeEndorFindings(input, target = "cloud") {
|
|
|
86
135
|
: [];
|
|
87
136
|
const context = record(finding["context"] ?? {}, "Endor context");
|
|
88
137
|
const updated = text(meta["update_time"]);
|
|
89
|
-
|
|
138
|
+
const malwareIds = advisories.size > vulnerabilityIds.length
|
|
139
|
+
? { advisory_ids: [...advisories] }
|
|
140
|
+
: undefined;
|
|
141
|
+
const fallbackPackage = name !== bareName ? { packages } : undefined;
|
|
142
|
+
const evidence = validateEnrichedExternalEvidence({
|
|
90
143
|
title: requiredText(meta["name"], "Endor finding title"),
|
|
91
144
|
description: [
|
|
92
145
|
text(spec["summary"]),
|
|
@@ -95,69 +148,49 @@ export function normalizeEndorFindings(input, target = "cloud") {
|
|
|
95
148
|
]
|
|
96
149
|
.filter(Boolean)
|
|
97
150
|
.join("\n\n") || text(meta["description"]),
|
|
98
|
-
severity,
|
|
151
|
+
severity: reportableScannerSeverity(text(spec["level"])?.replace(/^FINDING_LEVEL_/u, "")),
|
|
99
152
|
branch: context["type"] === "CONTEXT_TYPE_REF" ? text(context["id"]) : null,
|
|
100
153
|
code_revision: text(record(spec["source_code_version"] ?? {}, "Endor source code version")["sha"]),
|
|
101
154
|
source_updated_at: updated === null ? null : Math.floor(Date.parse(updated) / 1000),
|
|
102
|
-
advisory_ids:
|
|
103
|
-
|
|
104
|
-
],
|
|
105
|
-
packages,
|
|
155
|
+
advisory_ids: vulnerabilityIds,
|
|
156
|
+
packages: bareName ? packages : [],
|
|
106
157
|
locations,
|
|
107
158
|
source_data: structuredClone(finding),
|
|
108
|
-
}, target);
|
|
159
|
+
}, target, malwareIds && fallbackPackage && { ...malwareIds, ...fallbackPackage }, malwareIds, fallbackPackage);
|
|
160
|
+
const acceptedIds = evidence.advisory_ids.length;
|
|
161
|
+
const acceptedPackages = evidence.packages.length;
|
|
162
|
+
changed ||=
|
|
163
|
+
acceptedIds > vulnerabilityIds.length ||
|
|
164
|
+
(!bareName && acceptedPackages > 0);
|
|
165
|
+
reduced ||=
|
|
166
|
+
acceptedIds < advisories.size || acceptedPackages < packages.length;
|
|
167
|
+
return evidence;
|
|
109
168
|
}, (value) => requiredText(record(value, "Endor finding")["uuid"], "Endor finding uuid"), target);
|
|
169
|
+
if (target === "cloud") {
|
|
170
|
+
if (changed)
|
|
171
|
+
markPreviousCloudProjection(result);
|
|
172
|
+
if (reduced)
|
|
173
|
+
reducedReports.add(result);
|
|
174
|
+
}
|
|
175
|
+
return result;
|
|
110
176
|
}
|
|
111
177
|
/** Endor's documented SARIF producer uses properties.finding-uuid, not its rule name. */
|
|
112
178
|
export function normalizeEndorSarif(input, target = "cloud") {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
throw new Error("Expected Endor SARIF 2.1.0.");
|
|
116
|
-
const entries = array(document["runs"], "SARIF runs").flatMap((value) => {
|
|
117
|
-
const run = record(value, "SARIF run");
|
|
118
|
-
const tool = record(run["tool"], "SARIF tool");
|
|
119
|
-
const driver = record(tool["driver"], "SARIF driver");
|
|
120
|
-
if (driver["name"] !== "endorctl")
|
|
179
|
+
const entries = readSarifRuns(input, "Endor", (context) => {
|
|
180
|
+
if (context.driver["name"] !== "endorctl")
|
|
121
181
|
throw new Error("Expected the endorctl SARIF producer.");
|
|
122
|
-
|
|
123
|
-
throw new Error("Use a self-contained Endor SARIF report.");
|
|
124
|
-
const rules = array(driver["rules"] ?? [], "Endor rules").map((r) => record(r, "Endor rule"));
|
|
125
|
-
const rulesById = indexSarifRules(rules);
|
|
126
|
-
const { runs: _runs, ...documentContext } = document;
|
|
127
|
-
const { results: _results, tool: _tool, ...runContext } = run;
|
|
128
|
-
const { rules: _rules, ...driverContext } = driver;
|
|
129
|
-
const { driver: _driver, ...toolContext } = tool;
|
|
130
|
-
return array(run["results"] ?? [], "Endor results").map((result) => ({
|
|
131
|
-
result,
|
|
132
|
-
rulesById,
|
|
133
|
-
documentContext,
|
|
134
|
-
runContext,
|
|
135
|
-
driverContext,
|
|
136
|
-
toolContext,
|
|
137
|
-
}));
|
|
182
|
+
return sarifRunResults(context, "Endor");
|
|
138
183
|
});
|
|
139
|
-
return normalizeRecords(entries, ({ result: value,
|
|
184
|
+
return normalizeRecords(entries, ({ result: value, context }) => {
|
|
140
185
|
const result = record(value, "Endor result");
|
|
141
186
|
const properties = record(result["properties"], "Endor result properties");
|
|
142
187
|
requiredText(properties["project-uuid"], "Endor project-uuid");
|
|
143
188
|
const ruleId = requiredText(result["ruleId"], "Endor ruleId");
|
|
144
|
-
const selectedRule = rulesById.get(ruleId);
|
|
189
|
+
const selectedRule = context.rulesById.get(ruleId);
|
|
145
190
|
if (!selectedRule)
|
|
146
191
|
throw new Error("Endor result must reference exactly one rule in its run.");
|
|
147
|
-
const { rule
|
|
148
|
-
|
|
149
|
-
result["ruleIndex"] !== ruleIndex)
|
|
150
|
-
throw new Error("Endor ruleIndex and ruleId disagree.");
|
|
151
|
-
if (result["rule"] !== undefined) {
|
|
152
|
-
const reference = record(result["rule"], "Endor rule reference");
|
|
153
|
-
if (reference["toolComponent"] !== undefined ||
|
|
154
|
-
(reference["id"] !== undefined && reference["id"] !== ruleId) ||
|
|
155
|
-
(reference["index"] !== undefined &&
|
|
156
|
-
reference["index"] !== ruleIndex) ||
|
|
157
|
-
(reference["guid"] !== undefined &&
|
|
158
|
-
reference["guid"] !== rule["guid"]))
|
|
159
|
-
throw new Error("Inconsistent or external Endor rule reference.");
|
|
160
|
-
}
|
|
192
|
+
const { rule } = selectedRule;
|
|
193
|
+
validateSarifRuleReference(result, ruleId, selectedRule, "Endor");
|
|
161
194
|
const message = record(result["message"], "Endor message");
|
|
162
195
|
const short = record(rule["shortDescription"] ?? {}, "Endor shortDescription");
|
|
163
196
|
const full = record(rule["fullDescription"] ?? {}, "Endor fullDescription");
|
|
@@ -208,12 +241,7 @@ export function normalizeEndorSarif(input, target = "cloud") {
|
|
|
208
241
|
locations: [
|
|
209
242
|
...new Map(locations.map((location) => [JSON.stringify(location), location])).values(),
|
|
210
243
|
],
|
|
211
|
-
source_data:
|
|
212
|
-
...context,
|
|
213
|
-
runContext: sarifRunContextForResult(context.runContext, result, rule, context.documentContext, context.driverContext, context.toolContext),
|
|
214
|
-
rule,
|
|
215
|
-
result,
|
|
216
|
-
}),
|
|
244
|
+
source_data: context.sourceData(result, rule),
|
|
217
245
|
}, target);
|
|
218
246
|
}, ({ result }) => requiredText(record(record(result, "Endor result")["properties"], "Endor result properties")["finding-uuid"], "Endor finding-uuid"), target);
|
|
219
247
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endor-findings.js","sourceRoot":"","sources":["../src/endor-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,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,OAAO,EACP,IAAI,GACL,MAAM,qBAAqB,CAAC;AAE7B,oFAAoF;AACpF,MAAM,UAAU,mBAAmB,CAAC,UAAmB;IACrD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;Q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AAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAY,EACZ,MAAM,GAAyB,OAAO;IAEtC,OAAO,sBAAsB,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AACrE,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 indexSarifRules,\n normalizeRecords,\n readScannerJson,\n record,\n relativePath,\n requiredText,\n sarifRunContextForResult,\n strings,\n text,\n} from \"./scanner-import.js\";\n\n/** @internal Repository claims retained in the adapter's original SARIF context. */\nexport function endorRepositoryUrls(sourceData: unknown): string[] {\n if (!isRecord(sourceData)) return [];\n const run = sourceData[\"runContext\"];\n if (run == null) return [];\n return array(\n record(run, \"Endor run context\")[\"versionControlProvenance\"] ?? [],\n \"Endor version control provenance\",\n ).map((entry) =>\n requiredText(\n record(entry, \"Endor repository provenance\")[\"repositoryUri\"],\n \"Endor repository URI\",\n ),\n );\n}\n\n/** Saved Endor Finding objects, an array, or an unmasked ListFindingsResponse. */\nexport function normalizeEndorFindings(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n const root = Array.isArray(input) ? null : record(input, \"Endor report\");\n if (root?.[\"version\"] === \"2.1.0\" && root[\"runs\"] !== undefined)\n return normalizeEndorSarif(root, target);\n const list =\n root?.[\"list\"] === undefined ? null : record(root[\"list\"], \"Endor list\");\n if (list) {\n const response = record(list[\"response\"] ?? {}, \"Endor list response\");\n const token = response[\"next_page_token\"];\n if (\n text(response[\"next_page_id\"]) ||\n (token != null && token !== 0 && token !== \"0\" && token !== \"\")\n ) {\n throw new Error(\n \"The Endor list response has another page. Supply a complete export or an explicitly selected array.\",\n );\n }\n }\n const values = list\n ? array(list[\"objects\"] ?? [], \"Endor list.objects\")\n : Array.isArray(input)\n ? input\n : [input];\n return normalizeRecords(\n values,\n (value) => {\n const finding = record(value, \"Endor finding\");\n const meta = record(finding[\"meta\"], \"Endor meta\");\n const spec = record(finding[\"spec\"], \"Endor spec\");\n requiredText(spec[\"project_uuid\"], \"Endor project_uuid\");\n const name = text(spec[\"target_dependency_name\"]);\n const paths = [\n ...new Set(\n strings(spec[\"dependency_file_paths\"])\n .map(relativePath)\n .filter((p): p is string => p !== null),\n ),\n ];\n const metadata = record(\n spec[\"finding_metadata\"] ?? {},\n \"Endor finding_metadata\",\n );\n const codeLocations = [\"sast_data\", \"ai_sast_data\"].flatMap((field) => {\n const data = record(metadata[field] ?? {}, `Endor ${field}`);\n const location = record(\n data[\"location\"] ?? {},\n `Endor ${field} location`,\n );\n const path = relativePath(location[\"relative_path\"]);\n if (path === null) return [];\n const line = location[\"start_line\"];\n return [\n {\n path,\n line:\n typeof line === \"number\" && Number.isSafeInteger(line) && line > 0\n ? line\n : null,\n },\n ];\n });\n const locations = [\n ...paths\n .filter(\n (path) => !codeLocations.some((location) => location.path === path),\n )\n .map((path) => ({ path })),\n ...new Map(\n codeLocations.map((location) => [JSON.stringify(location), location]),\n ).values(),\n ];\n const vulnerability = record(\n metadata[\"vulnerability\"] ?? {},\n \"Endor vulnerability\",\n );\n const advisory = text(\n record(vulnerability[\"meta\"] ?? {}, \"Vulnerability meta\")[\"name\"],\n );\n const aliases = strings(\n record(vulnerability[\"spec\"] ?? {}, \"Vulnerability spec\")[\"aliases\"],\n );\n const level = text(spec[\"level\"])\n ?.replace(/^FINDING_LEVEL_/u, \"\")\n .toLowerCase();\n const severity =\n level && [\"critical\", \"high\", \"medium\", \"low\"].includes(level)\n ? level\n : \"unknown\";\n // A recommended version can refer to an introducing dependency; retain it in source_data.\n const packages = name\n ? (paths.length ? paths : [null]).map((path) => ({\n name,\n ecosystem:\n text(spec[\"ecosystem\"])\n ?.replace(/^ECOSYSTEM_/u, \"\")\n .toLowerCase() ?? null,\n installed_version: text(spec[\"target_dependency_version\"]),\n manifest_path: path,\n fixed_versions: [],\n }))\n : [];\n const context = record(finding[\"context\"] ?? {}, \"Endor context\");\n const updated = text(meta[\"update_time\"]);\n return validateExternalEvidence(\n {\n title: requiredText(meta[\"name\"], \"Endor finding title\"),\n description:\n [\n text(spec[\"summary\"]),\n text(spec[\"explanation\"]),\n text(spec[\"remediation\"]),\n ]\n .filter(Boolean)\n .join(\"\\n\\n\") || text(meta[\"description\"]),\n severity,\n branch:\n context[\"type\"] === \"CONTEXT_TYPE_REF\" ? text(context[\"id\"]) : null,\n code_revision: text(\n record(\n spec[\"source_code_version\"] ?? {},\n \"Endor source code version\",\n )[\"sha\"],\n ),\n source_updated_at:\n updated === null ? null : Math.floor(Date.parse(updated) / 1000),\n advisory_ids: [\n ...new Set([...(advisory ? [advisory] : []), ...aliases]),\n ],\n packages,\n locations,\n source_data: structuredClone(finding),\n },\n target,\n );\n },\n (value) =>\n requiredText(\n record(value, \"Endor finding\")[\"uuid\"],\n \"Endor finding uuid\",\n ),\n target,\n );\n}\n\n/** Endor's documented SARIF producer uses properties.finding-uuid, not its rule name. */\nexport function normalizeEndorSarif(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n const document = record(input, \"Endor SARIF\");\n if (document[\"version\"] !== \"2.1.0\")\n throw new Error(\"Expected Endor SARIF 2.1.0.\");\n const entries = array(document[\"runs\"], \"SARIF runs\").flatMap((value) => {\n const run = record(value, \"SARIF run\");\n const tool = record(run[\"tool\"], \"SARIF tool\");\n const driver = record(tool[\"driver\"], \"SARIF driver\");\n if (driver[\"name\"] !== \"endorctl\")\n throw new Error(\"Expected the endorctl SARIF producer.\");\n if (\n hasSarifExternalPropertyReferences(run[\"externalPropertyFileReferences\"])\n )\n throw new Error(\"Use a self-contained Endor SARIF report.\");\n const rules = array(driver[\"rules\"] ?? [], \"Endor rules\").map((r) =>\n record(r, \"Endor rule\"),\n );\n const rulesById = indexSarifRules(rules);\n const { runs: _runs, ...documentContext } = document;\n const { results: _results, tool: _tool, ...runContext } = run;\n const { rules: _rules, ...driverContext } = driver;\n const { driver: _driver, ...toolContext } = tool;\n return array(run[\"results\"] ?? [], \"Endor results\").map((result) => ({\n result,\n rulesById,\n documentContext,\n runContext,\n driverContext,\n toolContext,\n }));\n });\n return normalizeRecords(\n entries,\n ({ result: value, rulesById, ...context }) => {\n const result = record(value, \"Endor result\");\n const properties = record(\n result[\"properties\"],\n \"Endor result properties\",\n );\n requiredText(properties[\"project-uuid\"], \"Endor project-uuid\");\n const ruleId = requiredText(result[\"ruleId\"], \"Endor ruleId\");\n const selectedRule = rulesById.get(ruleId);\n if (!selectedRule)\n throw new Error(\n \"Endor result must reference exactly one rule in its run.\",\n );\n const { rule, index: ruleIndex } = selectedRule;\n if (\n result[\"ruleIndex\"] !== undefined &&\n result[\"ruleIndex\"] !== ruleIndex\n )\n throw new Error(\"Endor ruleIndex and ruleId disagree.\");\n if (result[\"rule\"] !== undefined) {\n const reference = record(result[\"rule\"], \"Endor rule reference\");\n if (\n reference[\"toolComponent\"] !== undefined ||\n (reference[\"id\"] !== undefined && reference[\"id\"] !== ruleId) ||\n (reference[\"index\"] !== undefined &&\n reference[\"index\"] !== ruleIndex) ||\n (reference[\"guid\"] !== undefined &&\n reference[\"guid\"] !== rule[\"guid\"])\n )\n throw new Error(\"Inconsistent or external Endor rule reference.\");\n }\n const message = record(result[\"message\"], \"Endor message\");\n const short = record(\n rule[\"shortDescription\"] ?? {},\n \"Endor shortDescription\",\n );\n const full = record(\n rule[\"fullDescription\"] ?? {},\n \"Endor fullDescription\",\n );\n const help = record(rule[\"help\"] ?? {}, \"Endor help\");\n const hasCodeLocations = strings(properties[\"categories\"]).some(\n (category) => category === \"SAST\" || category === \"SECRETS\",\n );\n const locations = array(\n result[\"locations\"] ?? [],\n \"Endor locations\",\n ).flatMap((v) => {\n const physical = record(\n record(v, \"Endor 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 return [];\n const uri = text(artifact[\"uri\"]);\n if (uri === null || /^[A-Za-z][A-Za-z0-9+.-]*:/u.test(uri)) return [];\n let path: string | null;\n try {\n path = relativePath(decodeURIComponent(uri));\n } catch {\n return [];\n }\n if (path === null) return [];\n const line = hasCodeLocations\n ? record(physical[\"region\"] ?? {}, \"Endor region\")[\"startLine\"]\n : null;\n return [\n {\n path,\n line:\n typeof line === \"number\" && Number.isSafeInteger(line) && line > 0\n ? line\n : null,\n },\n ];\n });\n return validateExternalEvidence(\n {\n title: text(short[\"text\"]) ?? text(rule[\"name\"]) ?? ruleId,\n url: text(properties[\"finding-url\"]),\n description: [\n text(message[\"markdown\"]) ?? text(message[\"text\"]),\n text(full[\"text\"]),\n text(help[\"markdown\"]) ?? text(help[\"text\"]),\n ]\n .filter(Boolean)\n .join(\"\\n\\n\"),\n // Diagnostic level and CVSS are not Endor's finding severity. Keep both as source evidence.\n severity: \"unknown\",\n locations: [\n ...new Map(\n locations.map((location) => [JSON.stringify(location), location]),\n ).values(),\n ],\n source_data: structuredClone({\n ...context,\n runContext: sarifRunContextForResult(\n context.runContext,\n result,\n rule,\n context.documentContext,\n context.driverContext,\n context.toolContext,\n ),\n rule,\n result,\n }),\n },\n target,\n );\n },\n ({ result }) =>\n requiredText(\n record(\n record(result, \"Endor result\")[\"properties\"],\n \"Endor result properties\",\n )[\"finding-uuid\"],\n \"Endor finding-uuid\",\n ),\n target,\n );\n}\n\nexport async function readEndorFindings(\n path: string,\n target: ExternalImportTarget = \"cloud\",\n): Promise<ExternalFindings> {\n return normalizeEndorFindings(await readScannerJson(path), target);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"endor-findings.js","sourceRoot":"","sources":["../src/endor-findings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAA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gBAClB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC7C;iBACE,MAAM,CAAC,OAAO,CAAC;iBACf,IAAI,CAAC,MAAM,CAAC;YACf,4FAA4F;YAC5F,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE;gBACT,GAAG,IAAI,GAAG,CACR,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAClE,CAAC,MAAM,EAAE;aACX;YACD,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC;SAC9C,EACD,MAAM,CACP,CAAC;IACJ,CAAC,EACD,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CACb,YAAY,CACV,MAAM,CACJ,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,YAAY,CAAC,EAC5C,yBAAyB,CAC1B,CAAC,cAAc,CAAC,EACjB,oBAAoB,CACrB,EACH,MAAM,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAY,EACZ,MAAM,GAAyB,OAAO;IAEtC,OAAO,sBAAsB,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import { markPreviousCloudProjection } from \"./reader-selection.js\";\nimport {\n type ExternalImportTarget,\n validateEnrichedExternalEvidence,\n validateExternalEvidence,\n} from \"./external-import-contract.js\";\nimport type { ExternalFindings } from \"./external-findings.js\";\nimport { asRecord } from \"./record.js\";\nimport {\n array,\n normalizeRecords,\n readScannerJson,\n record,\n relativePath,\n reportableScannerSeverity,\n requiredText,\n sarifRunRepositories,\n sarifRunResults,\n strings,\n readSarifRuns,\n text,\n validateSarifRuleReference,\n} from \"./scanner-import.js\";\n\n/** @internal Repository claims retained in the adapter's original SARIF context. */\nexport function endorRepositoryUrls(\n sourceData: unknown,\n retainedUrlsOnly = false,\n): string[] {\n const run = asRecord(sourceData)?.[\"runContext\"];\n if (run == null) return [];\n if (retainedUrlsOnly) {\n // Historical projections can retain opaque run metadata alongside explicit URLs.\n const entries = asRecord(run)?.[\"versionControlProvenance\"];\n if (!Array.isArray(entries)) return [];\n return entries\n .map((entry) => asRecord(entry)?.[\"repositoryUri\"])\n .filter((url) => typeof url === \"string\");\n }\n return sarifRunRepositories(run, \"Endor\").map((ref) => ref.url);\n}\n\nfunction positiveCount(value: unknown): boolean {\n return (\n (typeof value === \"number\" || typeof value === \"string\") &&\n Number(value) > 0\n );\n}\n\nfunction endorListObjects(root: Record<string, unknown>): unknown[] {\n const list = record(root[\"list\"], \"Endor list\");\n const response = record(list[\"response\"] ?? {}, \"Endor list response\");\n const {\n next_page_id: nextId,\n next_page_token: token,\n total_size: total,\n } = response;\n if (nextId != null && typeof nextId !== \"string\")\n throw new Error(\"Endor next_page_id must be a string.\");\n if (\n text(nextId) ||\n (token != null && token !== 0 && token !== \"0\" && token !== \"\")\n )\n throw new Error(\n \"The Endor list response has another page. Supply a complete export or an explicitly selected array.\",\n );\n const values = array(list[\"objects\"] ?? [], \"Endor list.objects\");\n if (values.length) return values;\n\n // Protobuf can omit an empty repeated field. Recognize only its known\n // pagination envelope; don't mistake an unrecognized payload for no matches.\n if (\n positiveCount(total) ||\n (list[\"objects\"] == null &&\n (Object.keys(list).some(\n (key) => key !== \"response\" && key !== \"objects\",\n ) ||\n Object.keys(response).some(\n (key) =>\n ![\"next_page_token\", \"next_page_id\"].includes(key) &&\n !(key === \"total_size\" && (total === 0 || total === \"0\")),\n )))\n )\n throw new Error(\"Expected Endor list.objects in the finding export.\");\n\n const { count } = record(\n root[\"count_response\"] ?? {},\n \"Endor count response\",\n );\n const { groups } = record(\n root[\"group_response\"] ?? {},\n \"Endor group response\",\n );\n if (\n positiveCount(count) ||\n (groups != null && Object.keys(record(groups, \"Endor groups\")).length)\n )\n throw new Error(\n \"The Endor report contains a summary without finding objects. Supply the complete finding export.\",\n );\n return values;\n}\n\n/** Saved Endor Finding objects, an array, or an unmasked ListFindingsResponse. */\nexport function normalizeEndorFindings(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n return normalizeReport(input, target, false);\n}\n\nconst reducedReports = new WeakSet<ExternalFindings>();\n\n/** A native upload would ask the worker to reconstruct fields that Cloud could not accept. */\nexport function requiresStructuredEndorReport(findings: ExternalFindings) {\n return reducedReports.has(findings);\n}\n\n/** @internal Reproduce the selection from before malware and fully qualified package mapping. */\nexport function normalizePreviousEndorFindings(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n return normalizeReport(input, target, true);\n}\n\nfunction normalizeReport(\n input: unknown,\n target: ExternalImportTarget,\n previous: boolean,\n): ExternalFindings {\n const root = Array.isArray(input) ? null : record(input, \"Endor report\");\n if (root?.[\"version\"] === \"2.1.0\" && root[\"runs\"] !== undefined)\n return normalizeEndorSarif(root, target);\n const values =\n root?.[\"list\"] !== undefined\n ? endorListObjects(root)\n : Array.isArray(input)\n ? input\n : [input];\n let changed = false;\n let reduced = false;\n const result = normalizeRecords(\n values,\n (value) => {\n const finding = record(value, \"Endor finding\");\n const meta = record(finding[\"meta\"], \"Endor meta\");\n const spec = record(finding[\"spec\"], \"Endor spec\");\n requiredText(spec[\"project_uuid\"], \"Endor project_uuid\");\n const bareName = text(spec[\"target_dependency_name\"]);\n const name =\n bareName ??\n (previous ? null : text(spec[\"target_dependency_package_name\"]));\n const paths = [\n ...new Set(\n strings(spec[\"dependency_file_paths\"])\n .map(relativePath)\n .filter((p): p is string => p !== null),\n ),\n ];\n const metadata = record(\n spec[\"finding_metadata\"] ?? {},\n \"Endor finding_metadata\",\n );\n const codeLocations = [\"sast_data\", \"ai_sast_data\"].flatMap((field) => {\n const data = record(metadata[field] ?? {}, `Endor ${field}`);\n const location = record(\n data[\"location\"] ?? {},\n `Endor ${field} location`,\n );\n const path = relativePath(location[\"relative_path\"]);\n if (path === null) return [];\n const line = location[\"start_line\"];\n return [\n {\n path,\n line:\n typeof line === \"number\" && Number.isSafeInteger(line) && line > 0\n ? line\n : null,\n },\n ];\n });\n const locations = [\n ...paths\n .filter(\n (path) => !codeLocations.some((location) => location.path === path),\n )\n .map((path) => ({ path })),\n ...new Map(\n codeLocations.map((location) => [JSON.stringify(location), location]),\n ).values(),\n ];\n const vulnerability = record(\n metadata[\"vulnerability\"] ?? {},\n \"Endor vulnerability\",\n );\n const advisory = text(\n record(vulnerability[\"meta\"] ?? {}, \"Vulnerability meta\")[\"name\"],\n );\n const aliases = strings(\n record(vulnerability[\"spec\"] ?? {}, \"Vulnerability spec\")[\"aliases\"],\n );\n const vulnerabilityIds = [\n ...new Set([...(advisory ? [advisory] : []), ...aliases]),\n ];\n const malware = previous ? undefined : asRecord(metadata[\"malware\"]);\n const advisories = new Set([\n ...vulnerabilityIds,\n ...strings([asRecord(malware?.[\"meta\"])?.[\"name\"]]),\n ...strings(asRecord(malware?.[\"spec\"])?.[\"aliases\"]),\n ]);\n // A recommended version can refer to an introducing dependency; retain it in source_data.\n const packages = name\n ? (paths.length ? paths : [null]).map((path) => ({\n name,\n ecosystem:\n text(spec[\"ecosystem\"])\n ?.replace(/^ECOSYSTEM_/u, \"\")\n .toLowerCase() ?? null,\n installed_version: text(spec[\"target_dependency_version\"]),\n manifest_path: path,\n fixed_versions: [],\n }))\n : [];\n const context = record(finding[\"context\"] ?? {}, \"Endor context\");\n const updated = text(meta[\"update_time\"]);\n const malwareIds =\n advisories.size > vulnerabilityIds.length\n ? { advisory_ids: [...advisories] }\n : undefined;\n const fallbackPackage = name !== bareName ? { packages } : undefined;\n const evidence = validateEnrichedExternalEvidence(\n {\n title: requiredText(meta[\"name\"], \"Endor finding title\"),\n description:\n [\n text(spec[\"summary\"]),\n text(spec[\"explanation\"]),\n text(spec[\"remediation\"]),\n ]\n .filter(Boolean)\n .join(\"\\n\\n\") || text(meta[\"description\"]),\n severity: reportableScannerSeverity(\n text(spec[\"level\"])?.replace(/^FINDING_LEVEL_/u, \"\"),\n ),\n branch:\n context[\"type\"] === \"CONTEXT_TYPE_REF\" ? text(context[\"id\"]) : null,\n code_revision: text(\n record(\n spec[\"source_code_version\"] ?? {},\n \"Endor source code version\",\n )[\"sha\"],\n ),\n source_updated_at:\n updated === null ? null : Math.floor(Date.parse(updated) / 1000),\n advisory_ids: vulnerabilityIds,\n packages: bareName ? packages : [],\n locations,\n source_data: structuredClone(finding),\n },\n target,\n malwareIds && fallbackPackage && { ...malwareIds, ...fallbackPackage },\n malwareIds,\n fallbackPackage,\n );\n const acceptedIds = evidence.advisory_ids!.length;\n const acceptedPackages = evidence.packages!.length;\n changed ||=\n acceptedIds > vulnerabilityIds.length ||\n (!bareName && acceptedPackages > 0);\n reduced ||=\n acceptedIds < advisories.size || acceptedPackages < packages.length;\n return evidence;\n },\n (value) =>\n requiredText(\n record(value, \"Endor finding\")[\"uuid\"],\n \"Endor finding uuid\",\n ),\n target,\n );\n if (target === \"cloud\") {\n if (changed) markPreviousCloudProjection(result);\n if (reduced) reducedReports.add(result);\n }\n return result;\n}\n\n/** Endor's documented SARIF producer uses properties.finding-uuid, not its rule name. */\nexport function normalizeEndorSarif(\n input: unknown,\n target: ExternalImportTarget = \"cloud\",\n): ExternalFindings {\n const entries = readSarifRuns(input, \"Endor\", (context) => {\n if (context.driver[\"name\"] !== \"endorctl\")\n throw new Error(\"Expected the endorctl SARIF producer.\");\n return sarifRunResults(context, \"Endor\");\n });\n return normalizeRecords(\n entries,\n ({ result: value, context }) => {\n const result = record(value, \"Endor result\");\n const properties = record(\n result[\"properties\"],\n \"Endor result properties\",\n );\n requiredText(properties[\"project-uuid\"], \"Endor project-uuid\");\n const ruleId = requiredText(result[\"ruleId\"], \"Endor ruleId\");\n const selectedRule = context.rulesById.get(ruleId);\n if (!selectedRule)\n throw new Error(\n \"Endor result must reference exactly one rule in its run.\",\n );\n const { rule } = selectedRule;\n validateSarifRuleReference(result, ruleId, selectedRule, \"Endor\");\n const message = record(result[\"message\"], \"Endor message\");\n const short = record(\n rule[\"shortDescription\"] ?? {},\n \"Endor shortDescription\",\n );\n const full = record(\n rule[\"fullDescription\"] ?? {},\n \"Endor fullDescription\",\n );\n const help = record(rule[\"help\"] ?? {}, \"Endor help\");\n const hasCodeLocations = strings(properties[\"categories\"]).some(\n (category) => category === \"SAST\" || category === \"SECRETS\",\n );\n const locations = array(\n result[\"locations\"] ?? [],\n \"Endor locations\",\n ).flatMap((v) => {\n const physical = record(\n record(v, \"Endor 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 return [];\n const uri = text(artifact[\"uri\"]);\n if (uri === null || /^[A-Za-z][A-Za-z0-9+.-]*:/u.test(uri)) return [];\n let path: string | null;\n try {\n path = relativePath(decodeURIComponent(uri));\n } catch {\n return [];\n }\n if (path === null) return [];\n const line = hasCodeLocations\n ? record(physical[\"region\"] ?? {}, \"Endor region\")[\"startLine\"]\n : null;\n return [\n {\n path,\n line:\n typeof line === \"number\" && Number.isSafeInteger(line) && line > 0\n ? line\n : null,\n },\n ];\n });\n return validateExternalEvidence(\n {\n title: text(short[\"text\"]) ?? text(rule[\"name\"]) ?? ruleId,\n url: text(properties[\"finding-url\"]),\n description: [\n text(message[\"markdown\"]) ?? text(message[\"text\"]),\n text(full[\"text\"]),\n text(help[\"markdown\"]) ?? text(help[\"text\"]),\n ]\n .filter(Boolean)\n .join(\"\\n\\n\"),\n // Diagnostic level and CVSS are not Endor's finding severity. Keep both as source evidence.\n severity: \"unknown\",\n locations: [\n ...new Map(\n locations.map((location) => [JSON.stringify(location), location]),\n ).values(),\n ],\n source_data: context.sourceData(result, rule),\n },\n target,\n );\n },\n ({ result }) =>\n requiredText(\n record(\n record(result, \"Endor result\")[\"properties\"],\n \"Endor result properties\",\n )[\"finding-uuid\"],\n \"Endor finding-uuid\",\n ),\n target,\n );\n}\n\nexport async function readEndorFindings(\n path: string,\n target: ExternalImportTarget = \"cloud\",\n): Promise<ExternalFindings> {\n return normalizeEndorFindings(await readScannerJson(path), target);\n}\n"]}
|
package/dist/errors.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare class OutputDirectoryNotEmptyError extends OutputDirectoryError {
|
|
|
39
39
|
readonly directory: string;
|
|
40
40
|
constructor(directory: string, operation?: "scan" | "policy");
|
|
41
41
|
}
|
|
42
|
-
export type ProtectedScanPathKind = "output" | "temporary" | "runtime";
|
|
42
|
+
export type ProtectedScanPathKind = "output" | "state" | "temporary" | "runtime";
|
|
43
43
|
export declare class OutputInsideProtectedRootError extends OutputDirectoryError {
|
|
44
44
|
readonly outputDirectory: string;
|
|
45
45
|
readonly protectedRoot: string;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3E,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAKxD;AAED,kDAAkD;AAClD,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAGzD;CACF;AAED,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,aAAa,CAAC;AACnE,MAAM,MAAM,kCAAkC,GAC5C,YAAY,GAAG,eAAe,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,kCAAkC;IACjD,KAAK,EAAE,wBAAwB,CAA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AAa,EAAE,MAAM,EACrB,QAAQ,GAAE,qBAAgC,EAY3D;CACF;AACD,qBAAa,mBAAoB,SAAQ,kBAAkB;CAAG;AAC9D,qBAAa,uBAAwB,SAAQ,kBAAkB;CAAG;AAClE,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEhC,YAAmB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAG1E;CACF;AAED,qBAAa,0BAA2B,SAAQ,oBAAoB;IAClE,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEzC,YACE,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACxB,OAAO,EAAE,MAAM,EAQhB;CACF"}
|
package/dist/errors.js
CHANGED
|
@@ -51,7 +51,14 @@ export class OutputInsideProtectedRootError extends OutputDirectoryError {
|
|
|
51
51
|
protectedRoot;
|
|
52
52
|
pathKind;
|
|
53
53
|
constructor(outputDirectory, protectedRoot, pathKind = "output") {
|
|
54
|
-
super(
|
|
54
|
+
super(pathKind === "state"
|
|
55
|
+
? [
|
|
56
|
+
"Codex Security state directory must be outside the protected scan root and cannot contain it.",
|
|
57
|
+
` Resolved path: ${outputDirectory}`,
|
|
58
|
+
` Protected root: ${protectedRoot}`,
|
|
59
|
+
"Set CODEX_SECURITY_STATE_DIR to a private directory that does not overlap the protected root. For hosted scans, set stateDirectory on the request.",
|
|
60
|
+
].join("\n")
|
|
61
|
+
: `Scan ${pathKind} directory must be outside the protected scan root: ${outputDirectory}`);
|
|
55
62
|
this.outputDirectory = outputDirectory;
|
|
56
63
|
this.protectedRoot = protectedRoot;
|
|
57
64
|
this.pathKind = pathKind;
|
|
@@ -72,7 +79,7 @@ export class ScanCostLimitExceededError extends ScanInterruptedError {
|
|
|
72
79
|
maxCostUsd;
|
|
73
80
|
cost;
|
|
74
81
|
constructor(maxCostUsd, cost, scanDir) {
|
|
75
|
-
super(`Scan stopped: short-context budget baseline ${formatUsd(cost.estimatedUsd)} exceeded the ${formatUsd(maxCostUsd)} limit; estimated cost ${formatScanCost(cost)};
|
|
82
|
+
super(`Scan stopped: short-context budget baseline ${formatUsd(cost.estimatedUsd)} exceeded the ${formatUsd(maxCostUsd)} limit; estimated cost ${formatScanCost(cost)}; scan output directory: ${scanDir}.`, scanDir);
|
|
76
83
|
this.maxCostUsd = maxCostUsd;
|
|
77
84
|
this.cost = cost;
|
|
78
85
|
}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAE3E,wEAAwE;AACxE,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAmB;IAC7C,OAAO,CACL,MAAM,CAAC,MAAM;QACb,IAAI,YAAY,CAAC,4BAA4B,EAAE,YAAY,CAAC,CAC7D,CAAC;AACJ,CAAC;AAED,kDAAkD;AAClD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,OAAe,EAAE,OAAsB;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAcD,MAAM,OAAO,wBAAyB,SAAQ,kBAAkB;IAE5C,QAAQ;IAD1B,YACkB,QAAsD,EACtE,aAAa,GAAW,QAAQ,CAAC,MAAM;QAEvC,KAAK,CACH,+GAA+G,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E;gBACtC,qBAAqB,aAAa,EAAE;gBACpC,oJAAoJ;aACrJ,CAAC,IAAI,CAAC,IAAI,CAAC;YACd,CAAC,CAAC,QAAQ,QAAQ,uDAAuD,eAAe,EAAE,CAC7F,CAAC;+BAbc,eAAe;6BACf,aAAa;wBACb,QAAQ;IAY1B,CAAC;CACF;AACD,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;CAAG;AAC9D,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;CAAG;AAClE,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAC1C,OAAO,CAAS;IAEhC,YAAmB,OAAe,EAAE,OAAe,EAAE,OAAsB;QACzE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED,MAAM,OAAO,0BAA2B,SAAQ,oBAAoB;IAClD,UAAU,CAAS;IACnB,IAAI,CAAqB;IAEzC,YACE,UAAkB,EAClB,IAAwB,EACxB,OAAe;QAEf,KAAK,CACH,+CAA+C,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,iBAAiB,SAAS,CAAC,UAAU,CAAC,0BAA0B,cAAc,CAAC,IAAI,CAAC,4BAA4B,OAAO,GAAG,EACrM,OAAO,CACR,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF","sourcesContent":["import { formatScanCost, formatUsd, type ScanCost } from \"./cost-model.js\";\n\n/** Returns the original error message without altering its contents. */\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nexport function abortReason(signal: AbortSignal): unknown {\n return (\n signal.reason ??\n new DOMException(\"The operation was aborted.\", \"AbortError\")\n );\n}\n\n/** Base error for Codex Security SDK failures. */\nexport class CodexSecurityError extends Error {\n public constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = new.target.name;\n }\n}\n\nexport type DeduplicationReviewStage = \"screening\" | \"pair-review\";\nexport type DeduplicationReviewFailureCategory =\n \"validation\" | \"no-submission\" | \"model\" | \"transport\" | \"refusal\";\n\nexport interface DeduplicationReviewFailureMetadata {\n stage: DeduplicationReviewStage;\n model: string;\n category: DeduplicationReviewFailureCategory;\n attempts: number;\n reason: string;\n}\n\nexport class DeduplicationReviewError extends CodexSecurityError {\n public constructor(\n public readonly metadata: Readonly<DeduplicationReviewFailureMetadata>,\n displayReason: string = metadata.reason,\n ) {\n super(\n `Codex did not complete a validated deduplication review. Findings are unchanged; retry the command. Reason: ${displayReason}`,\n );\n }\n}\n\nexport class ConfigurationError extends CodexSecurityError {}\nexport class AuthenticationRequiredError extends CodexSecurityError {}\nexport class PluginBootstrapError extends CodexSecurityError {}\nexport class LocalPluginBootstrapError extends PluginBootstrapError {}\nexport class PluginPythonUnavailableError extends PluginBootstrapError {}\nexport class SandboxUnavailableError extends CodexSecurityError {}\nexport class InvalidTargetError extends CodexSecurityError {}\nexport class OutputDirectoryError extends CodexSecurityError {}\nexport class OutputDirectoryNotEmptyError extends OutputDirectoryError {\n public constructor(\n public readonly directory: string,\n operation: \"scan\" | \"policy\" = \"scan\",\n ) {\n super(\n operation === \"policy\"\n ? `Policy output directory is not empty: ${directory}. Choose a new or empty directory.`\n : `Scan output directory is not empty: ${directory}. To keep the existing results and start a new scan, add --archive-existing.`,\n );\n }\n}\nexport type ProtectedScanPathKind =\n \"output\" | \"state\" | \"temporary\" | \"runtime\";\n\nexport class OutputInsideProtectedRootError extends OutputDirectoryError {\n public constructor(\n public readonly outputDirectory: string,\n public readonly protectedRoot: string,\n public readonly pathKind: ProtectedScanPathKind = \"output\",\n ) {\n super(\n pathKind === \"state\"\n ? [\n \"Codex Security state directory must be outside the protected scan root and cannot contain it.\",\n ` Resolved path: ${outputDirectory}`,\n ` Protected root: ${protectedRoot}`,\n \"Set CODEX_SECURITY_STATE_DIR to a private directory that does not overlap the protected root. For hosted scans, set stateDirectory on the request.\",\n ].join(\"\\n\")\n : `Scan ${pathKind} directory must be outside the protected scan root: ${outputDirectory}`,\n );\n }\n}\nexport class IncompleteScanError extends CodexSecurityError {}\nexport class ContractValidationError extends CodexSecurityError {}\nexport class ScanInterruptedError extends CodexSecurityError {\n public readonly scanDir: string;\n\n public constructor(message: string, scanDir: string, options?: ErrorOptions) {\n super(message, options);\n this.scanDir = scanDir;\n }\n}\n\nexport class ScanCostLimitExceededError extends ScanInterruptedError {\n public readonly maxCostUsd: number;\n public readonly cost: Readonly<ScanCost>;\n\n public constructor(\n maxCostUsd: number,\n cost: Readonly<ScanCost>,\n scanDir: string,\n ) {\n super(\n `Scan stopped: short-context budget baseline ${formatUsd(cost.estimatedUsd)} exceeded the ${formatUsd(maxCostUsd)} limit; estimated cost ${formatScanCost(cost)}; scan output directory: ${scanDir}.`,\n scanDir,\n );\n this.maxCostUsd = maxCostUsd;\n this.cost = cost;\n }\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type LocalExternalImportDependencies } from "./external-findings-local.js";
|
|
1
|
+
import { type ExternalFindingsReaderOptions } from "./external-findings-read.js";
|
|
2
|
+
import { type LocalExternalImportDependencies, type NormalizedLocalImportOptions } from "./external-findings-local.js";
|
|
3
|
+
export interface LocalExternalImportOptions extends Omit<NormalizedLocalImportOptions, "provider">, ExternalFindingsReaderOptions {
|
|
4
|
+
}
|
|
3
5
|
/** Read an installed vendor format and prepare it for the local workbench. */
|
|
4
|
-
export declare function prepareLocalExternalImport(path: string, options:
|
|
6
|
+
export declare function prepareLocalExternalImport(path: string, options: LocalExternalImportOptions, dependencies?: LocalExternalImportDependencies): Promise<import("./external-findings-local.js").PreparedLocalExternalImport>;
|
|
5
7
|
//# sourceMappingURL=external-findings-import.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-findings-import.d.ts","sourceRoot":"","sources":["../src/external-findings-import.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"external-findings-import.d.ts","sourceRoot":"","sources":["../src/external-findings-import.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,6BAA6B,EAEnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EAClC,MAAM,8BAA8B,CAAC;AAOtC,MAAM,WAAW,0BACf,SACE,IAAI,CAAC,4BAA4B,EAAE,UAAU,CAAC,EAC9C,6BAA6B;CAAG;AAEpC,8EAA8E;AAC9E,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,0BAA0B,EACnC,YAAY,GAAE,+BAAoC,+EAsDnD"}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { cloudRepositoryUrlKey, repositoryUrlKey, } from "./external-import-contract.js";
|
|
2
2
|
import { EXTERNAL_FINDINGS_PROVIDERS, readExternalFindings, } from "./external-findings-read.js";
|
|
3
|
-
import { prepareLocalImport, } from "./external-findings-local.js";
|
|
4
|
-
import { snapshotImportOptions } from "./external-findings.js";
|
|
3
|
+
import { distinctSourceRepositories, prepareLocalImport, } from "./external-findings-local.js";
|
|
4
|
+
import { snapshotImportOptions, snapshotSourceRepositories, } from "./external-findings.js";
|
|
5
5
|
import { abortable } from "./targets.js";
|
|
6
|
-
import { requireExternalImports } from "./external-imports-feature.js";
|
|
7
6
|
/** Read an installed vendor format and prepare it for the local workbench. */
|
|
8
7
|
export async function prepareLocalExternalImport(path, options, dependencies = {}) {
|
|
9
8
|
dependencies.signal?.throwIfAborted();
|
|
10
|
-
requireExternalImports(dependencies.environment);
|
|
11
9
|
const settings = snapshotImportOptions(options);
|
|
12
|
-
const
|
|
10
|
+
const readerSources = distinctSourceRepositories(snapshotSourceRepositories(dependencies.sourceRepositories));
|
|
11
|
+
const parsed = await abortable(() => readExternalFindings(path, settings, "local", readerSources), dependencies.signal);
|
|
13
12
|
const normalizedOptions = {
|
|
14
13
|
...settings,
|
|
15
14
|
provider: EXTERNAL_FINDINGS_PROVIDERS[settings.provider],
|
|
16
15
|
};
|
|
17
16
|
let sourceRepositories = parsed.sourceRepositories ?? [];
|
|
18
|
-
if (normalizedOptions.provider === "semgrep"
|
|
17
|
+
if (normalizedOptions.provider === "semgrep" &&
|
|
18
|
+
parsed.sourceRepositories &&
|
|
19
|
+
settings.sourceRepositoryUrl) {
|
|
19
20
|
// The Cloud reader allows custom GitHub casing. Local provenance must also
|
|
20
21
|
// agree with the caller's source URL when the checkout has no remote.
|
|
21
22
|
const source = settings.sourceRepositoryUrl;
|
|
22
|
-
const knownGitHub =
|
|
23
|
+
const knownGitHub = readerSources.some(({ url, platform }) => platform === "github" &&
|
|
23
24
|
cloudRepositoryUrlKey(url) === cloudRepositoryUrlKey(source));
|
|
24
25
|
const key = knownGitHub ? cloudRepositoryUrlKey : repositoryUrlKey;
|
|
26
|
+
sourceRepositories = distinctSourceRepositories(sourceRepositories);
|
|
25
27
|
for (const reference of sourceRepositories) {
|
|
26
28
|
if (key(reference.url) !== key(source))
|
|
27
29
|
throw new Error("SARIF source repository does not match the declared source repository URL.");
|
|
@@ -35,14 +37,7 @@ export async function prepareLocalExternalImport(path, options, dependencies = {
|
|
|
35
37
|
})),
|
|
36
38
|
];
|
|
37
39
|
}
|
|
38
|
-
const { environment,
|
|
39
|
-
return prepareLocalImport(parsed.findings, normalizedOptions, {
|
|
40
|
-
...workbench,
|
|
41
|
-
environment,
|
|
42
|
-
sourceRepositories: [
|
|
43
|
-
...(dependencies.sourceRepositories ?? []),
|
|
44
|
-
...sourceRepositories,
|
|
45
|
-
],
|
|
46
|
-
});
|
|
40
|
+
const { environment, runWorkbench, signal } = dependencies;
|
|
41
|
+
return prepareLocalImport(parsed.findings, normalizedOptions, { environment, runWorkbench, signal }, readerSources, sourceRepositories);
|
|
47
42
|
}
|
|
48
43
|
//# sourceMappingURL=external-findings-import.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-findings-import.js","sourceRoot":"","sources":["../src/external-findings-import.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"external-findings-import.js","sourceRoot":"","sources":["../src/external-findings-import.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,2BAA2B,EAE3B,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,GAGnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,IAAY,EACZ,OAAmC,EACnC,YAAY,GAAoC,EAAE;IAElD,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IACtC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,aAAa,GAAG,0BAA0B,CAC9C,0BAA0B,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAC5D,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,EAClE,YAAY,CAAC,MAAM,CACpB,CAAC;IACF,MAAM,iBAAiB,GAAG;QACxB,GAAG,QAAQ;QACX,QAAQ,EAAE,2BAA2B,CAAC,QAAQ,CAAC,QAAQ,CAAC;KACzD,CAAC;IACF,IAAI,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC;IACzD,IACE,iBAAiB,CAAC,QAAQ,KAAK,SAAS;QACxC,MAAM,CAAC,kBAAkB;QACzB,QAAQ,CAAC,mBAAmB,EAC5B,CAAC;QACD,2EAA2E;QAC3E,sEAAsE;QACtE,MAAM,MAAM,GAAG,QAAQ,CAAC,mBAAmB,CAAC;QAC5C,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CACpC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CACpB,QAAQ,KAAK,QAAQ;YACrB,qBAAqB,CAAC,GAAG,CAAC,KAAK,qBAAqB,CAAC,MAAM,CAAC,CAC/D,CAAC;QACF,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,gBAAgB,CAAC;QACnE,kBAAkB,GAAG,0BAA0B,CAAC,kBAAkB,CAAC,CAAC;QACpE,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;YAC3C,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC;gBACpC,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;QACN,CAAC;QACD,IAAI,WAAW;YACb,kBAAkB,GAAG;gBACnB,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE;gBACnC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;oBACxC,GAAG,SAAS;oBACZ,QAAQ,EAAE,QAAiB;iBAC5B,CAAC,CAAC;aACJ,CAAC;IACN,CAAC;IACD,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;IAC3D,OAAO,kBAAkB,CACvB,MAAM,CAAC,QAAQ,EACf,iBAAiB,EACjB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,EACrC,aAAa,EACb,kBAAkB,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import {\n cloudRepositoryUrlKey,\n repositoryUrlKey,\n} from \"./external-import-contract.js\";\nimport {\n EXTERNAL_FINDINGS_PROVIDERS,\n type ExternalFindingsReaderOptions,\n readExternalFindings,\n} from \"./external-findings-read.js\";\nimport {\n distinctSourceRepositories,\n prepareLocalImport,\n type LocalExternalImportDependencies,\n type NormalizedLocalImportOptions,\n} from \"./external-findings-local.js\";\nimport {\n snapshotImportOptions,\n snapshotSourceRepositories,\n} from \"./external-findings.js\";\nimport { abortable } from \"./targets.js\";\n\nexport interface LocalExternalImportOptions\n extends\n Omit<NormalizedLocalImportOptions, \"provider\">,\n ExternalFindingsReaderOptions {}\n\n/** Read an installed vendor format and prepare it for the local workbench. */\nexport async function prepareLocalExternalImport(\n path: string,\n options: LocalExternalImportOptions,\n dependencies: LocalExternalImportDependencies = {},\n) {\n dependencies.signal?.throwIfAborted();\n const settings = snapshotImportOptions(options);\n const readerSources = distinctSourceRepositories(\n snapshotSourceRepositories(dependencies.sourceRepositories),\n );\n const parsed = await abortable(\n () => readExternalFindings(path, settings, \"local\", readerSources),\n dependencies.signal,\n );\n const normalizedOptions = {\n ...settings,\n provider: EXTERNAL_FINDINGS_PROVIDERS[settings.provider],\n };\n let sourceRepositories = parsed.sourceRepositories ?? [];\n if (\n normalizedOptions.provider === \"semgrep\" &&\n parsed.sourceRepositories &&\n settings.sourceRepositoryUrl\n ) {\n // The Cloud reader allows custom GitHub casing. Local provenance must also\n // agree with the caller's source URL when the checkout has no remote.\n const source = settings.sourceRepositoryUrl;\n const knownGitHub = readerSources.some(\n ({ url, platform }) =>\n platform === \"github\" &&\n cloudRepositoryUrlKey(url) === cloudRepositoryUrlKey(source),\n );\n const key = knownGitHub ? cloudRepositoryUrlKey : repositoryUrlKey;\n sourceRepositories = distinctSourceRepositories(sourceRepositories);\n for (const reference of sourceRepositories) {\n if (key(reference.url) !== key(source))\n throw new Error(\n \"SARIF source repository does not match the declared source repository URL.\",\n );\n }\n if (knownGitHub)\n sourceRepositories = [\n { url: source, platform: \"github\" },\n ...sourceRepositories.map((reference) => ({\n ...reference,\n platform: \"github\" as const,\n })),\n ];\n }\n const { environment, runWorkbench, signal } = dependencies;\n return prepareLocalImport(\n parsed.findings,\n normalizedOptions,\n { environment, runWorkbench, signal },\n readerSources,\n sourceRepositories,\n );\n}\n"]}
|