@openai/codex-security 0.8.3 → 0.10.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 +36 -746
- package/_bundled_plugin/.codex-plugin/plugin.json +2 -0
- package/_bundled_plugin/.mcp.json +7 -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 +5 -2
- 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/baseline-auditor.md +18 -0
- package/_bundled_plugin/references/core-scan.md +5 -42
- package/_bundled_plugin/references/default-severity-rubric.md +9 -4
- package/_bundled_plugin/references/final-report.md +5 -3
- package/_bundled_plugin/references/finding-detail-fields.md +18 -18
- package/_bundled_plugin/references/focused-investigator.md +13 -0
- 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/scan-prologue.md +2 -2
- package/_bundled_plugin/references/scan-runtime.md +4 -2
- package/_bundled_plugin/references/security-guidance.md +14 -1
- package/_bundled_plugin/references/validate-scan-findings.md +3 -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 +192 -352
- package/_bundled_plugin/scripts/dispatch_inventory_tool +7 -0
- package/_bundled_plugin/scripts/filesystem_identity.py +1 -0
- package/_bundled_plugin/scripts/finalize_scan_contract.py +182 -230
- package/_bundled_plugin/scripts/finding_preview.py +20 -0
- package/_bundled_plugin/scripts/launch_codex_security_mcp +55 -16
- package/_bundled_plugin/scripts/legacy_findings.py +148 -0
- package/_bundled_plugin/scripts/posix_scan_local_files.py +37 -1
- package/_bundled_plugin/scripts/read_codex_session.mjs +21 -0
- package/_bundled_plugin/scripts/report_projection.py +81 -43
- 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 +9 -2
- package/_bundled_plugin/scripts/threat_model_projection.py +22 -26
- package/_bundled_plugin/scripts/validate_scan_contract.py +7 -1
- package/_bundled_plugin/scripts/windows_scan_local_files.py +582 -20
- package/_bundled_plugin/scripts/workbench/__init__.py +1 -1
- package/_bundled_plugin/scripts/workbench/handoff.py +100 -23
- package/_bundled_plugin/scripts/workbench/retained_coverage.py +30 -51
- 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 +9 -17
- 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 +91 -7
- package/_bundled_plugin/scripts/workbench_cli.py +54 -14
- package/_bundled_plugin/scripts/workbench_constants.py +12 -0
- package/_bundled_plugin/scripts/workbench_coverage_receipts.py +3 -3
- package/_bundled_plugin/scripts/workbench_db.py +562 -303
- package/_bundled_plugin/scripts/workbench_feedback.py +57 -11
- package/_bundled_plugin/scripts/workbench_finding_index.py +1 -0
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +4 -0
- package/_bundled_plugin/scripts/workbench_native_indexes.py +238 -41
- package/_bundled_plugin/scripts/workbench_progress.py +169 -4
- package/_bundled_plugin/scripts/workbench_publication.py +16 -13
- package/_bundled_plugin/scripts/workbench_remediation.py +155 -2
- package/_bundled_plugin/scripts/workbench_saved_results.py +176 -81
- package/_bundled_plugin/scripts/workbench_scan_history.py +398 -174
- package/_bundled_plugin/scripts/workbench_scan_start.py +224 -31
- package/_bundled_plugin/scripts/workbench_scan_usage.py +675 -73
- package/_bundled_plugin/scripts/workbench_schema.py +258 -63
- package/_bundled_plugin/scripts/workbench_setup.py +14 -2
- package/_bundled_plugin/scripts/workbench_source_excerpt.py +13 -0
- package/_bundled_plugin/scripts/workbench_source_scopes.py +18 -0
- package/_bundled_plugin/scripts/workbench_target.py +594 -136
- package/_bundled_plugin/scripts/workbench_target_state.py +1110 -21
- package/_bundled_plugin/scripts/workbench_validation.py +43 -3
- package/_bundled_plugin/shared/workbench-history-repairs.json +77 -35
- package/_bundled_plugin/shared/workbench-migrations.json +100 -0
- package/_bundled_plugin/skills/cloud-findings/SKILL.md +5 -5
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +7 -50
- package/_bundled_plugin/skills/fix-finding/SKILL.md +2 -1
- package/_bundled_plugin/skills/publish-findings/SKILL.md +24 -153
- package/_bundled_plugin/skills/publish-findings/agents/openai.yaml +2 -2
- package/_bundled_plugin/skills/publish-findings/references/checkmarx-import.md +37 -0
- package/_bundled_plugin/skills/publish-findings/references/wiz-import.md +3 -3
- package/_bundled_plugin/skills/publish-findings/scripts/collect_checkmarx.py +409 -0
- package/_bundled_plugin/skills/publish-findings/scripts/collect_continuum.py +224 -0
- package/_bundled_plugin/skills/publish-findings/scripts/collector_paths.py +63 -0
- package/_bundled_plugin/skills/security-scan/SKILL.md +9 -46
- package/_bundled_plugin/skills/security-scan/agents/openai.yaml +2 -2
- package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +3 -21
- package/_bundled_plugin/skills/security-scan/references/managed-scan.md +11 -0
- package/_bundled_plugin/skills/security-scan/references/scan-results.md +15 -0
- package/_bundled_plugin/skills/security-scan/references/scoped-paths.md +23 -0
- package/_bundled_plugin/skills/security-scan/references/sdk-files.md +24 -0
- package/_bundled_plugin/skills/threat-model-visualize/scripts/build_explorer.py +22 -1
- package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +6 -2
- package/bin/codex-security.mjs +2 -2
- package/dist/api.d.ts +45 -5
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1192 -427
- package/dist/api.js.map +1 -1
- package/dist/armorcode-findings.d.ts +9 -0
- package/dist/armorcode-findings.d.ts.map +1 -0
- package/dist/armorcode-findings.js +145 -0
- package/dist/armorcode-findings.js.map +1 -0
- package/dist/artifact-export.d.ts +2 -0
- package/dist/artifact-export.d.ts.map +1 -1
- package/dist/artifact-export.js +29 -13
- package/dist/artifact-export.js.map +1 -1
- package/dist/auth.d.ts +6 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +37 -18
- package/dist/auth.js.map +1 -1
- package/dist/batch-cost.d.ts +18 -0
- package/dist/batch-cost.d.ts.map +1 -0
- package/dist/batch-cost.js +41 -0
- package/dist/batch-cost.js.map +1 -0
- 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 +1 -1
- package/dist/blackduck-findings.d.ts.map +1 -1
- package/dist/blackduck-findings.js +24 -22
- package/dist/blackduck-findings.js.map +1 -1
- package/dist/bulk-scan-discovery.d.ts.map +1 -1
- package/dist/bulk-scan-discovery.js +4 -4
- package/dist/bulk-scan-discovery.js.map +1 -1
- package/dist/bundled-plugin.d.ts +4 -0
- package/dist/bundled-plugin.d.ts.map +1 -0
- package/dist/bundled-plugin.js +23 -0
- package/dist/bundled-plugin.js.map +1 -0
- 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-scan-severity.d.ts +1 -1
- package/dist/classify-scan-severity.d.ts.map +1 -1
- package/dist/classify-scan-severity.js +11 -3
- package/dist/classify-scan-severity.js.map +1 -1
- package/dist/classify-severity-records.d.ts +1 -9
- package/dist/classify-severity-records.d.ts.map +1 -1
- package/dist/classify-severity-records.js +3 -13
- package/dist/classify-severity-records.js.map +1 -1
- package/dist/classify-severity.d.ts.map +1 -1
- package/dist/classify-severity.js +11 -10
- package/dist/classify-severity.js.map +1 -1
- package/dist/cli-argument.d.ts +4 -0
- package/dist/cli-argument.d.ts.map +1 -0
- package/dist/cli-argument.js +17 -0
- package/dist/cli-argument.js.map +1 -0
- package/dist/cli-help.d.ts +1 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +71 -29
- package/dist/cli-help.js.map +1 -1
- package/dist/cli-hook.d.ts +3 -0
- package/dist/cli-hook.d.ts.map +1 -0
- package/dist/cli-hook.js +87 -0
- package/dist/cli-hook.js.map +1 -0
- package/dist/cli-integrations.d.ts +13 -0
- package/dist/cli-integrations.d.ts.map +1 -0
- package/dist/cli-integrations.js +333 -0
- package/dist/cli-integrations.js.map +1 -0
- package/dist/cli-mcp.d.ts +15 -0
- package/dist/cli-mcp.d.ts.map +1 -0
- package/dist/cli-mcp.js +178 -0
- package/dist/cli-mcp.js.map +1 -0
- package/dist/cli-token-view.d.ts +10 -0
- package/dist/cli-token-view.d.ts.map +1 -0
- package/dist/cli-token-view.js +41 -0
- package/dist/cli-token-view.js.map +1 -0
- package/dist/cli.d.ts +16 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3382 -2017
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +35 -33
- package/dist/cloud-publish.js.map +1 -1
- package/dist/codex-sdk-environment.d.ts +6 -0
- package/dist/codex-sdk-environment.d.ts.map +1 -1
- package/dist/codex-sdk-environment.js +19 -0
- package/dist/codex-sdk-environment.js.map +1 -1
- package/dist/command-words.d.ts +3 -0
- package/dist/command-words.d.ts.map +1 -0
- package/dist/command-words.js +46 -0
- package/dist/command-words.js.map +1 -0
- package/dist/component-scan.d.ts +19 -4
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +67 -9
- package/dist/component-scan.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +130 -67
- package/dist/config.js.map +1 -1
- package/dist/continuum-findings.d.ts +1 -1
- package/dist/continuum-findings.d.ts.map +1 -1
- package/dist/continuum-findings.js +149 -19
- package/dist/continuum-findings.js.map +1 -1
- package/dist/contract-values.d.ts +2 -0
- package/dist/contract-values.d.ts.map +1 -1
- package/dist/contract-values.js +12 -9
- package/dist/contract-values.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 -112
- package/dist/cost-model.js.map +1 -1
- package/dist/cost.d.ts +42 -3
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +484 -149
- 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 +29 -19
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/deduplication/local.d.ts +4 -2
- package/dist/deduplication/local.d.ts.map +1 -1
- package/dist/deduplication/local.js +9 -2
- package/dist/deduplication/local.js.map +1 -1
- package/dist/deduplication/refusal.d.ts.map +1 -1
- package/dist/deduplication/refusal.js +26 -5
- package/dist/deduplication/refusal.js.map +1 -1
- package/dist/deduplication/scan.d.ts +5 -0
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +24 -7
- 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 +2 -0
- package/dist/deep-scan.d.ts.map +1 -1
- package/dist/deep-scan.js +44 -19
- package/dist/deep-scan.js.map +1 -1
- package/dist/default-severity-rubric.d.ts +1 -1
- package/dist/default-severity-rubric.d.ts.map +1 -1
- package/dist/default-severity-rubric.js +1 -1
- 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 +86 -45
- package/dist/endor-findings.js.map +1 -1
- package/dist/errors.d.ts +4 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +15 -4
- package/dist/errors.js.map +1 -1
- package/dist/executable-path.d.ts +3 -0
- package/dist/executable-path.d.ts.map +1 -1
- package/dist/executable-path.js +26 -0
- package/dist/executable-path.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 +19 -7
- package/dist/external-findings-import.js.map +1 -1
- package/dist/external-findings-local.d.ts +69 -5
- package/dist/external-findings-local.d.ts.map +1 -1
- package/dist/external-findings-local.js +537 -108
- package/dist/external-findings-local.js.map +1 -1
- package/dist/external-findings-publish.d.ts +13 -6
- package/dist/external-findings-publish.d.ts.map +1 -1
- package/dist/external-findings-publish.js +895 -1142
- package/dist/external-findings-publish.js.map +1 -1
- package/dist/external-findings-read.d.ts +21 -2
- package/dist/external-findings-read.d.ts.map +1 -1
- package/dist/external-findings-read.js +130 -68
- package/dist/external-findings-read.js.map +1 -1
- package/dist/external-findings.d.ts +15 -3
- package/dist/external-findings.d.ts.map +1 -1
- package/dist/external-findings.js +54 -2
- package/dist/external-findings.js.map +1 -1
- package/dist/external-import-contract.d.ts +8 -12
- package/dist/external-import-contract.d.ts.map +1 -1
- package/dist/external-import-contract.js +51 -184
- 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/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/github-advisories.d.ts.map +1 -1
- package/dist/github-advisories.js +0 -2
- package/dist/github-advisories.js.map +1 -1
- package/dist/github-dependabot-findings.d.ts.map +1 -1
- package/dist/github-dependabot-findings.js +18 -8
- 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 +73 -316
- package/dist/github-findings.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-remediation.d.ts +1 -0
- package/dist/hosted-remediation.d.ts.map +1 -1
- package/dist/hosted-remediation.js +23 -3
- package/dist/hosted-remediation.js.map +1 -1
- package/dist/hosted-scan-protocol.js +2 -2
- package/dist/hosted-scan-protocol.js.map +1 -1
- package/dist/hosted-scan.d.ts.map +1 -1
- package/dist/hosted-scan.js +16 -11
- 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/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 +21 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/inspector-findings.d.ts.map +1 -1
- package/dist/inspector-findings.js +52 -86
- package/dist/inspector-findings.js.map +1 -1
- package/dist/knowledge-base.d.ts +1 -1
- package/dist/knowledge-base.d.ts.map +1 -1
- package/dist/knowledge-base.js +102 -32
- package/dist/knowledge-base.js.map +1 -1
- package/dist/linear.d.ts +11 -0
- package/dist/linear.d.ts.map +1 -1
- package/dist/linear.js.map +1 -1
- package/dist/local-git-metadata.d.ts +5 -2
- package/dist/local-git-metadata.d.ts.map +1 -1
- package/dist/local-git-metadata.js +8 -5
- package/dist/local-git-metadata.js.map +1 -1
- package/dist/multiscan.d.ts +10 -4
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +217 -102
- 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 +5 -2
- package/dist/opengrep-findings.d.ts.map +1 -1
- package/dist/opengrep-findings.js +54 -33
- 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/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 +99 -9
- package/dist/private-finding-import.d.ts.map +1 -1
- package/dist/private-finding-import.js +116 -152
- package/dist/private-finding-import.js.map +1 -1
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +53 -13
- package/dist/project-config.js.map +1 -1
- package/dist/prompt-files.d.ts +7 -2
- package/dist/prompt-files.d.ts.map +1 -1
- package/dist/prompt-files.js +42 -20
- package/dist/prompt-files.js.map +1 -1
- package/dist/provider-profile.d.ts +1 -1
- package/dist/provider-profile.d.ts.map +1 -1
- package/dist/provider-profile.js +12 -10
- 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.d.ts +1 -1
- package/dist/publication.d.ts.map +1 -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/record.d.ts +1 -5
- package/dist/record.d.ts.map +1 -1
- package/dist/record.js +3 -51
- package/dist/record.js.map +1 -1
- package/dist/remediation.d.ts +1 -4
- package/dist/remediation.d.ts.map +1 -1
- package/dist/remediation.js +6 -8
- 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 +4 -0
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +1 -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 +54 -6
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1084 -256
- package/dist/runtime.js.map +1 -1
- package/dist/saved-scan-bootstrap.d.ts +7 -1
- package/dist/saved-scan-bootstrap.d.ts.map +1 -1
- package/dist/saved-scan-bootstrap.js +269 -114
- package/dist/saved-scan-bootstrap.js.map +1 -1
- package/dist/scan-activity.d.ts.map +1 -1
- package/dist/scan-activity.js +141 -56
- package/dist/scan-activity.js.map +1 -1
- package/dist/scan-archive-path.d.ts +2 -0
- package/dist/scan-archive-path.d.ts.map +1 -0
- package/dist/scan-archive-path.js +5 -0
- package/dist/scan-archive-path.js.map +1 -0
- package/dist/scan-comparison.d.ts +10 -5
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +66 -17
- 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 +92 -43
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-executor.d.ts +10 -1
- package/dist/scan-executor.d.ts.map +1 -1
- package/dist/scan-executor.js +24 -2
- package/dist/scan-executor.js.map +1 -1
- package/dist/scan-history-renderer.d.ts +1 -0
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +34 -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 +131 -78
- 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 +25 -13
- package/dist/scanner-import.d.ts.map +1 -1
- package/dist/scanner-import.js +216 -97
- package/dist/scanner-import.js.map +1 -1
- package/dist/scanner-repository-url.d.ts +4 -1
- package/dist/scanner-repository-url.d.ts.map +1 -1
- package/dist/scanner-repository-url.js +10 -6
- package/dist/scanner-repository-url.js.map +1 -1
- package/dist/security-policy.d.ts +1 -1
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js +26 -6
- 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 +72 -42
- 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 +157 -6
- package/dist/semgrep-platform-findings.d.ts.map +1 -1
- package/dist/semgrep-platform-findings.js +766 -103
- package/dist/semgrep-platform-findings.js.map +1 -1
- 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/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 +9 -2
- package/dist/snyk-findings.d.ts.map +1 -1
- package/dist/snyk-findings.js +90 -70
- package/dist/snyk-findings.js.map +1 -1
- package/dist/snyk-rest-findings.d.ts +59 -0
- package/dist/snyk-rest-findings.d.ts.map +1 -0
- package/dist/snyk-rest-findings.js +879 -0
- package/dist/snyk-rest-findings.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.map +1 -1
- package/dist/sonar-collector.js +0 -3
- package/dist/sonar-collector.js.map +1 -1
- package/dist/sonar-findings.d.ts +1 -1
- package/dist/sonar-findings.d.ts.map +1 -1
- package/dist/sonar-findings.js +2 -4
- package/dist/sonar-findings.js.map +1 -1
- package/dist/sonar-import.d.ts +3 -0
- package/dist/sonar-import.d.ts.map +1 -1
- package/dist/sonar-import.js +30 -34
- package/dist/sonar-import.js.map +1 -1
- package/dist/stored-finding-projection.d.ts +6 -0
- package/dist/stored-finding-projection.d.ts.map +1 -0
- package/dist/stored-finding-projection.js +104 -0
- package/dist/stored-finding-projection.js.map +1 -0
- package/dist/stored-findings-publication.d.ts +23 -0
- package/dist/stored-findings-publication.d.ts.map +1 -0
- package/dist/stored-findings-publication.js +169 -0
- package/dist/stored-findings-publication.js.map +1 -0
- 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 +8 -1
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +131 -42
- package/dist/targets.js.map +1 -1
- package/dist/tenable-findings.d.ts +6 -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-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 +424 -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/trusted-executable.d.ts +6 -0
- package/dist/trusted-executable.d.ts.map +1 -1
- package/dist/trusted-executable.js +140 -37
- package/dist/trusted-executable.js.map +1 -1
- package/dist/validation-records.js +1 -1
- package/dist/validation-records.js.map +1 -1
- package/dist/veracode-findings.d.ts +1 -1
- package/dist/veracode-findings.d.ts.map +1 -1
- package/dist/veracode-findings.js +19 -6
- package/dist/veracode-findings.js.map +1 -1
- package/dist/version.d.ts +3 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +184 -32
- package/dist/version.js.map +1 -1
- 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 +26 -1
- package/dist/windows-path.js.map +1 -1
- package/dist/wiz-findings.d.ts +6 -2
- package/dist/wiz-findings.d.ts.map +1 -1
- package/dist/wiz-findings.js +65 -89
- package/dist/wiz-findings.js.map +1 -1
- package/docs/classify-severity-records.md +27 -12
- package/docs/cli.md +853 -639
- package/docs/dedupe-records.md +44 -24
- package/docs/findings-service.md +84 -44
- package/docs/hosted-remediation.md +27 -11
- package/docs/hosted-scans.md +50 -42
- package/docs/sdk.md +903 -0
- package/docs/telemetry.md +236 -0
- package/docs/validate-records.md +78 -44
- package/package.json +23 -16
- package/schemas/external-findings.schema.json +4 -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/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 -155
- package/dist/finding-normalization.js.map +0 -1
- package/dist/reader-selection.d.ts +0 -13
- package/dist/reader-selection.d.ts.map +0 -1
- package/dist/reader-selection.js +0 -81
- package/dist/reader-selection.js.map +0 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MA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O,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AACxF,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EACL,wCAAwC,EACxC,6BAA6B,EAC7B,gCAAgC,EAChC,KAAK,wBAAwB,GAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,8 @@ export { publishScanToCustom } from "./custom-publish.js";
|
|
|
21
21
|
export { deduplicateRecords } from "./deduplication/records.js";
|
|
22
22
|
export { deduplicateScan, deduplicateScanDirectory, } from "./deduplication/scan.js";
|
|
23
23
|
export { ExternalPublicationError, prepareExternalPublication, prepareNormalizedExternalPublication, } from "./external-findings-publish.js";
|
|
24
|
-
export { prepareNormalizedLocalImport, listLocalExternalFindings, } from "./external-findings-local.js";
|
|
24
|
+
export { prepareNormalizedLocalImport, listLocalExternalImports, listLocalExternalFindings, listLocalFindingPublications, selectLocalExternalFindings, } from "./external-findings-local.js";
|
|
25
|
+
export { NoPublishableFindingsError, } from "./external-findings.js";
|
|
25
26
|
export { normalizeGitHubCodeScanningAlerts, normalizeGitHubAdvisories, readGitHubFindings, } from "./github-findings.js";
|
|
26
27
|
export { importGitHubAdvisories } from "./github-advisories.js";
|
|
27
28
|
export { normalizeGitHubDependabotAlerts } from "./github-dependabot-findings.js";
|
|
@@ -32,16 +33,24 @@ export { DiffTarget, normalizeRepository, normalizeTarget, repositoryRevision, v
|
|
|
32
33
|
export { BUNDLED_PLUGIN_VERSION, VERSION } from "./version.js";
|
|
33
34
|
export { classifySeverityRecords, classifySeverityRecordsInputSchema, } from "./classify-severity-records.js";
|
|
34
35
|
export { validateRecords } from "./validation-records.js";
|
|
35
|
-
export {
|
|
36
|
+
export { readOperationTelemetry, summarizeOperationTelemetry, } from "./operation-telemetry.js";
|
|
37
|
+
export { prepareLocalExternalImport, } from "./external-findings-import.js";
|
|
38
|
+
export { prepareStoredFindingsPublication, } from "./stored-findings-publication.js";
|
|
39
|
+
export { readTenableFindings } from "./tenable-findings.js";
|
|
36
40
|
export { normalizeOpenGrepFindings, readOpenGrepFindings, } from "./opengrep-findings.js";
|
|
37
41
|
export { readSonarFindings } from "./sonar-findings.js";
|
|
38
42
|
export { collectSonarIssues, } from "./sonar-collector.js";
|
|
39
43
|
export { normalizeVeracodeFindings, readVeracodeFindings, } from "./veracode-findings.js";
|
|
44
|
+
export { normalizeTrivyFindings, readTrivyFindings } from "./trivy-findings.js";
|
|
40
45
|
export { normalizeBlackDuckFindings, readBlackDuckFindings, } from "./blackduck-findings.js";
|
|
41
46
|
export { normalizeContinuumFindings, readContinuumFindings, } from "./continuum-findings.js";
|
|
47
|
+
export { readCheckmarxFindings } from "./checkmarx-findings.js";
|
|
42
48
|
export { normalizeInspectorFindings, readInspectorFindings, } from "./inspector-findings.js";
|
|
43
49
|
export { normalizeSnykFindingsExport, normalizeSnykJson, normalizeSnykSarif, readSnykFindings, } from "./snyk-findings.js";
|
|
44
|
-
export {
|
|
50
|
+
export { collectSnykIssues, normalizeSnykIssues, SNYK_REST_ISSUES_FORMAT, } from "./snyk-rest-findings.js";
|
|
45
51
|
export { normalizeSemgrepFindings, normalizeSemgrepSarif, readSemgrepFindings, } from "./semgrep-findings.js";
|
|
52
|
+
export { collectSemgrepPlatformFindings } from "./semgrep-platform-collector.js";
|
|
53
|
+
export { collectSelectedSemgrepGuardianFindings } from "./semgrep-guardian-findings.js";
|
|
54
|
+
export { normalizeSelectedSemgrepPlatformFindings, selectSemgrepPlatformFindings, normalizeSemgrepPlatformFindings, } from "./semgrep-platform-findings.js";
|
|
46
55
|
export { normalizeEndorFindings, normalizeEndorSarif, readEndorFindings, } from "./endor-findings.js";
|
|
47
56
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AAUjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAW9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAe3E,OAAO,EACL,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQxD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAa7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA6BzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,4BAA4B,EAC5B,8BAA8B,EAC9B,oBAAoB,EACpB,4BAA4B,EAC5B,uBA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mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EACL,uBAAuB,EACvB,kCAAkC,GACnC,MAAM,gCAAgC,CAAC;AAQxC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAO1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAqB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wCAAwC,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC","sourcesContent":["export { exportArtifact } from \"./artifact-export.js\";\nexport type {\n ExportArtifactOptions,\n ArtifactExportResult,\n} from \"./artifact-export.js\";\nexport { CodexSecurity, createSecurity } from \"./api.js\";\nexport {\n runHostedRemediation,\n HostedRemediationInputSchema,\n HostedRemediationPreparationError,\n} from \"./hosted-remediation.js\";\nexport type {\n HostedRemediationInput,\n HostedRemediationOptions,\n HostedRemediationResult,\n RemediationExecutor,\n RemediationExecutionRequest,\n RemediationExecutionResult,\n RemediationExecutionEvent,\n} from \"./hosted-remediation.js\";\nexport { runHostedRemediationProtocol } from \"./hosted-remediation-protocol.js\";\nexport type { FindingPatch, FindingVerification } from \"./remediation.js\";\nexport {\n runHostedScan,\n HostedScanInputSchema,\n HostedScanPreparationError,\n} from \"./hosted-scan.js\";\nexport type {\n HostedScanInput,\n HostedScanOptions,\n HostedScanResult,\n} from \"./hosted-scan.js\";\nexport type {\n ScanExecutor,\n ScanExecutionRequest,\n ScanExecutionResult,\n ScanExecutionEvent,\n} from \"./scan-executor.js\";\nexport { loadProjectConfig, resolveProjectConfig } from \"./project-config.js\";\nexport type {\n ResolvedProjectConfig,\n ProjectConfigProvenance,\n} from \"./project-config.js\";\nexport type {\n ProjectConfigInput,\n ProjectScope,\n} from \"./project-config-schema.js\";\nexport type { ScanSettings } from \"./scan-settings.js\";\nexport type { SeverityRubricSnapshot } from \"./severity-rubric.js\";\nexport { classifySeverity } from \"./classify-severity.js\";\nexport { suggestOwners, suggestOwnersFromScan } from \"./suggest-owners.js\";\nexport type {\n OwnerFinding,\n CodeownerIdentity,\n OwnerIdentity,\n OwnerSuggestion,\n OwnerSuggestions,\n SuggestOwnersOptions,\n} from \"./suggest-owners.js\";\nexport type {\n ClassifySeverityOptions,\n SeverityClassificationFinding,\n SeverityClassification,\n SeverityAssessment,\n} from \"./classify-severity.js\";\nexport {\n classifyScanSeverity,\n classifyScanDirectorySeverity,\n} from \"./classify-scan-severity.js\";\nexport type {\n ClassifyScanSeverityOptions,\n ScanSeverityClassification,\n} from \"./classify-scan-severity.js\";\nexport { runComponentScans } from \"./component-scan.js\";\nexport type {\n ComponentDeduplicationSummary,\n ComponentReceipt,\n ComponentScanOptions,\n ComponentScanEvent,\n ComponentScanResult,\n} from \"./component-scan.js\";\nexport { normalizeComponentPlan, planComponents } from \"./component-plan.js\";\nexport type {\n ComponentPlan,\n ComponentPlanningOptions,\n} from \"./component-plan.js\";\nexport { estimateScanCost } from \"./cost.js\";\nexport type {\n ScanAccountRateLimit,\n ScanAccountRateLimitWindow,\n ScanCost,\n ScanSessionEvent,\n ScanUsageObservation,\n ScanWorkerEvent,\n} from \"./cost.js\";\nexport type { ScanTokenUsage } from \"./cost-model.js\";\nexport type { DeepScanProgress } from \"./scan-progress.js\";\nexport type { CustomValidationResult } from \"./custom-validation.js\";\nexport type { ScanActivity, ScanActivityStatus } from \"./scan-activity.js\";\nexport { matchScanFindings } from \"./scan-comparison.js\";\nexport type {\n ScanComparisonInput,\n ScanComparisonOptions,\n ScanComparisonProgress,\n ScanComparisonResult,\n} from \"./scan-comparison.js\";\nexport type {\n CodexSecurityMetadata,\n DeepScanOptions,\n PatchOptions,\n PatchResult,\n ScanAuthMode,\n ScanAuthentication,\n ScanBudget,\n ScanOptions,\n ScanPreflight,\n ScanReconnectDetails,\n ScanTrustedAccessStatus,\n ScanWarningDetails,\n ValidationOptions,\n ValidationResult,\n} from \"./api.js\";\nexport type {\n ScanPhase,\n ScanProgress,\n ScanWorkerPhase,\n ScanWorkerStatus,\n} from \"./worker-progress.js\";\nexport { CodexLoginHandle } from \"./auth.js\";\nexport type { AccountStatus, LoginResult } from \"./auth.js\";\n\nexport {\n AuthenticationRequiredError,\n CodexSecurityError,\n ConfigurationError,\n ContractValidationError,\n DeduplicationReviewError,\n IncompleteScanError,\n InvalidTargetError,\n LocalPluginBootstrapError,\n OutputDirectoryError,\n OutputDirectoryNotEmptyError,\n OutputInsideProtectedRootError,\n PluginBootstrapError,\n PluginPythonUnavailableError,\n SandboxUnavailableError,\n ScanCostLimitExceededError,\n ScanInterruptedError,\n} from \"./errors.js\";\nexport type {\n DeduplicationReviewFailureCategory,\n DeduplicationReviewFailureMetadata,\n DeduplicationReviewStage,\n ProtectedScanPathKind,\n} from \"./errors.js\";\nexport {\n DEFAULT_CODEX_CONFIG,\n mergedCodexConfig,\n writeCodexConfig,\n} from \"./config.js\";\nexport type { CodexSecurityConfig, JsonObject, JsonValue } from \"./config.js\";\nexport { loadContract, requireScanFile } from \"./contract.js\";\nexport type { LoadedContract, ScanExpectation } from \"./contract.js\";\nexport type * from \"./models.js\";\nexport {\n resolveSecurityPolicyTarget,\n securityPolicyDiff,\n} from \"./security-policy.js\";\nexport type {\n SecurityPolicyDraft,\n SecurityPolicyOptions,\n SecurityPolicyPreflight,\n SecurityPolicyStage,\n SecurityPolicyTarget,\n} from \"./security-policy.js\";\nexport { checkScanPublication, publishScan } from \"./publish.js\";\nexport { publishScanToCustom } from \"./custom-publish.js\";\nexport type {\n PublishScanToCustomOptions,\n CustomPublicationResult,\n} from \"./custom-publish.js\";\nexport { deduplicateRecords } from \"./deduplication/records.js\";\nexport type {\n DeduplicateRecordsInput,\n DeduplicateRecordsOptions,\n DeduplicateRecordsResult,\n} from \"./deduplication/records.js\";\nexport type {\n DeduplicationReviewRequest,\n DeduplicationReviewAttribution,\n DeduplicationReviewRunner,\n} from \"./deduplication/review.js\";\nexport {\n deduplicateScan,\n deduplicateScanDirectory,\n} from \"./deduplication/scan.js\";\nexport type {\n DeduplicateScanDirectoryOptions,\n DeduplicateScanOptions,\n DeduplicateScanResult,\n} from \"./deduplication/scan.js\";\nexport type { DeduplicationRefusal } from \"./deduplication/deduplication.js\";\nexport type { FindingEmbeddingBinding } from \"./deduplication/local.js\";\nexport type {\n DeduplicationDiagnostic,\n DeduplicationDiagnosticObserver,\n} from \"./deduplication/diagnostics.js\";\nexport type { FindingEmbedder } from \"./server/embeddings.js\";\nexport {\n ExternalPublicationError,\n prepareExternalPublication,\n prepareNormalizedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport type {\n ExternalPublicationOptions,\n NormalizedExternalPublicationOptions,\n ExternalPublicationDependencies,\n ExternalPublicationPreview,\n ExternalPublicationProgress,\n ExternalPublicationResult,\n PreparedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport {\n prepareNormalizedLocalImport,\n listLocalExternalFindings,\n} from \"./external-findings-local.js\";\nexport type {\n StoredExternalFinding,\n NormalizedLocalImportOptions,\n LocalExternalImportDependencies,\n LocalExternalImportPreview,\n LocalExternalImportResult,\n PreparedLocalExternalImport,\n} from \"./external-findings-local.js\";\nexport type {\n ExternalFinding,\n ExternalFindings,\n ExternalSourceRepository,\n} from \"./external-findings.js\";\nexport type {\n ExternalFindingEvidence,\n FindingImportRequest,\n FindingImportReceipt,\n ImportRepository,\n SourceReport,\n} from \"./external-import-models.js\";\nexport {\n normalizeGitHubCodeScanningAlerts,\n normalizeGitHubAdvisories,\n readGitHubFindings,\n} from \"./github-findings.js\";\nexport { importGitHubAdvisories } from \"./github-advisories.js\";\nexport { normalizeGitHubDependabotAlerts } from \"./github-dependabot-findings.js\";\nexport type {\n GitHubAdvisoryImportOptions,\n ImportedGitHubAdvisory,\n} from \"./github-advisories.js\";\nexport { importGitHubCodeScanningAlerts } from \"./github.js\";\nexport type {\n GitHubCodeScanningImportOptions,\n ImportedGitHubCodeScanningAlert,\n} from \"./github.js\";\nexport type {\n CheckScanPublicationOptions,\n CheckScanPublicationResult,\n PublishScanOptions,\n PublishScanProgress,\n PublishScanResult,\n} from \"./publish.js\";\nexport { ScanResult } from \"./result.js\";\nexport type {\n RepositoryFinding,\n ScanResultOptions,\n TurnResultMetadata,\n} from \"./result.js\";\nexport {\n bootstrapPlugin,\n bundledPluginRoot,\n cleanupSdkDirectory,\n createIsolatedHome,\n createMarketplace,\n extractPluginZip,\n importAmbientAuth,\n MARKETPLACE_NAME,\n pluginExecutionEnvironment,\n pluginMetadata,\n PLUGIN_NAME,\n prepareOutputDir,\n resolveCodexCommand,\n resolvePluginPath,\n resolvePluginPython,\n validateOutputDir,\n} from \"./runtime.js\";\nexport type {\n CodexCommand,\n PluginInstall,\n PluginPythonOptions,\n ProcessEnvironment,\n} from \"./runtime.js\";\nexport {\n DiffTarget,\n normalizeRepository,\n normalizeTarget,\n repositoryRevision,\n validateMode,\n} from \"./targets.js\";\nexport type { NormalizedTarget, ScanMode, ScanTarget } from \"./targets.js\";\nexport type { AbsolutePath } from \"./config-path.js\";\nexport { BUNDLED_PLUGIN_VERSION, VERSION } from \"./version.js\";\n\nexport {\n classifySeverityRecords,\n classifySeverityRecordsInputSchema,\n} from \"./classify-severity-records.js\";\nexport type {\n ClassifySeverityRecordsInput,\n ClassifySeverityRecordsOptions,\n ClassifySeverityRecordsResult,\n CanonicalSeverityAssessment,\n SeverityClassificationReviewRequest,\n} from \"./classify-severity-records.js\";\nexport { validateRecords } from \"./validation-records.js\";\nexport type {\n ValidateRecordsInput,\n ValidateRecordsOptions,\n ValidationReviewRequest,\n} from \"./validation-records.js\";\n\nexport { prepareLocalExternalImport } from \"./external-findings-import.js\";\nexport {\n normalizeOpenGrepFindings,\n readOpenGrepFindings,\n type OpenGrepImportOptions,\n} from \"./opengrep-findings.js\";\nexport { readSonarFindings, type SonarCapture } from \"./sonar-findings.js\";\nexport {\n collectSonarIssues,\n type SonarCollectionOptions,\n} from \"./sonar-collector.js\";\nexport {\n normalizeVeracodeFindings,\n readVeracodeFindings,\n} from \"./veracode-findings.js\";\nexport {\n normalizeBlackDuckFindings,\n readBlackDuckFindings,\n} from \"./blackduck-findings.js\";\nexport {\n normalizeContinuumFindings,\n readContinuumFindings,\n} from \"./continuum-findings.js\";\nexport {\n normalizeInspectorFindings,\n readInspectorFindings,\n} from \"./inspector-findings.js\";\nexport {\n normalizeSnykFindingsExport,\n normalizeSnykJson,\n normalizeSnykSarif,\n readSnykFindings,\n} from \"./snyk-findings.js\";\nexport { normalizeSelectedSemgrepPlatformFindings } from \"./semgrep-platform-findings.js\";\nexport {\n normalizeSemgrepFindings,\n normalizeSemgrepSarif,\n readSemgrepFindings,\n type SemgrepImportOptions,\n} from \"./semgrep-findings.js\";\nexport {\n normalizeEndorFindings,\n normalizeEndorSarif,\n readEndorFindings,\n} from \"./endor-findings.js\";\n"]}
|
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AC;AACjC,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AAMxF,OAAO,EACL,wCAAwC,EACxC,6BAA6B,EAC7B,gCAAgC,GAEjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC","sourcesContent":["export { exportArtifact } from \"./artifact-export.js\";\nexport type {\n ExportArtifactOptions,\n ArtifactExportResult,\n} from \"./artifact-export.js\";\nexport { CodexSecurity, createSecurity } from \"./api.js\";\nexport {\n runHostedRemediation,\n HostedRemediationInputSchema,\n HostedRemediationPreparationError,\n} from \"./hosted-remediation.js\";\nexport type {\n HostedRemediationInput,\n HostedRemediationOptions,\n HostedRemediationResult,\n RemediationExecutor,\n RemediationExecutionRequest,\n RemediationExecutionResult,\n RemediationExecutionEvent,\n} from \"./hosted-remediation.js\";\nexport { runHostedRemediationProtocol } from \"./hosted-remediation-protocol.js\";\nexport type { FindingPatch, FindingVerification } from \"./remediation.js\";\nexport {\n runHostedScan,\n HostedScanInputSchema,\n HostedScanPreparationError,\n} from \"./hosted-scan.js\";\nexport type {\n HostedScanInput,\n HostedScanOptions,\n HostedScanResult,\n} from \"./hosted-scan.js\";\nexport type {\n ScanExecutor,\n ScanExecutionRequest,\n ScanExecutionResult,\n ScanExecutionEvent,\n} from \"./scan-executor.js\";\nexport { loadProjectConfig, resolveProjectConfig } from \"./project-config.js\";\nexport type {\n ResolvedProjectConfig,\n ProjectConfigProvenance,\n} from \"./project-config.js\";\nexport type {\n ProjectConfigInput,\n ProjectScope,\n} from \"./project-config-schema.js\";\nexport type { ScanSettings } from \"./scan-settings.js\";\nexport type { SeverityRubricSnapshot } from \"./severity-rubric.js\";\nexport { classifySeverity } from \"./classify-severity.js\";\nexport { suggestOwners, suggestOwnersFromScan } from \"./suggest-owners.js\";\nexport type {\n OwnerFinding,\n CodeownerIdentity,\n OwnerIdentity,\n OwnerSuggestion,\n OwnerSuggestions,\n SuggestOwnersOptions,\n} from \"./suggest-owners.js\";\nexport type {\n ClassifySeverityOptions,\n SeverityClassificationFinding,\n SeverityClassification,\n SeverityAssessment,\n} from \"./classify-severity.js\";\nexport {\n classifyScanSeverity,\n classifyScanDirectorySeverity,\n} from \"./classify-scan-severity.js\";\nexport type {\n ClassifyScanSeverityOptions,\n ScanSeverityClassification,\n} from \"./classify-scan-severity.js\";\nexport { runComponentScans } from \"./component-scan.js\";\nexport type {\n ComponentDeduplicationSummary,\n ComponentReceipt,\n ComponentScanOptions,\n ComponentScanEvent,\n ComponentScanResult,\n} from \"./component-scan.js\";\nexport { normalizeComponentPlan, planComponents } from \"./component-plan.js\";\nexport type {\n ComponentPlan,\n ComponentPlanningOptions,\n} from \"./component-plan.js\";\nexport { estimateScanCost } from \"./cost.js\";\nexport type {\n ScanAccountRateLimit,\n ScanAccountRateLimitWindow,\n ScanCost,\n ScanSessionEvent,\n ScanUsageMeasurement,\n ScanUsageObservation,\n ScanWorkerEvent,\n} from \"./cost.js\";\nexport type { ScanPricingContext, ScanTokenUsage } from \"./cost-model.js\";\nexport type { DeepScanProgress } from \"./scan-progress.js\";\nexport type { CustomValidationResult } from \"./custom-validation.js\";\nexport type { ScanActivity, ScanActivityStatus } from \"./scan-activity.js\";\nexport { matchScanFindings } from \"./scan-comparison.js\";\nexport type {\n ScanComparisonInput,\n ScanComparisonOptions,\n ScanComparisonProgress,\n ScanComparisonResult,\n} from \"./scan-comparison.js\";\nexport type {\n CodexSecurityMetadata,\n DeepScanOptions,\n PatchOptions,\n PatchResult,\n ScanAuthMode,\n ScanAuthentication,\n ScanBudget,\n ScanLifecycle,\n ScanOptions,\n ScanPreflight,\n ScanReconnectDetails,\n ScanTrustedAccessStatus,\n ScanWarningDetails,\n ValidationOptions,\n ValidationResult,\n} from \"./api.js\";\nexport type {\n ScanPhase,\n ScanProgress,\n ScanWorkerPhase,\n ScanWorkerStatus,\n} from \"./worker-progress.js\";\nexport { CodexLoginHandle } from \"./auth.js\";\nexport type { AccountStatus, LoginResult } from \"./auth.js\";\n\nexport {\n AuthenticationRequiredError,\n CodexSecurityError,\n ConfigurationError,\n ContractValidationError,\n DeduplicationReviewError,\n IncompleteScanError,\n InvalidTargetError,\n LocalPluginBootstrapError,\n OutputDirectoryError,\n OutputDirectoryNotEmptyError,\n OutputInsideProtectedRootError,\n PluginBootstrapError,\n PluginPythonUnavailableError,\n SandboxUnavailableError,\n ScanCostLimitExceededError,\n ScanInterruptedError,\n} from \"./errors.js\";\nexport type {\n DeduplicationReviewFailureCategory,\n DeduplicationReviewFailureMetadata,\n DeduplicationReviewStage,\n ProtectedScanPathKind,\n} from \"./errors.js\";\nexport {\n DEFAULT_CODEX_CONFIG,\n mergedCodexConfig,\n writeCodexConfig,\n} from \"./config.js\";\nexport type { CodexSecurityConfig, JsonObject, JsonValue } from \"./config.js\";\nexport { loadContract, requireScanFile } from \"./contract.js\";\nexport type { LoadedContract, ScanExpectation } from \"./contract.js\";\nexport type * from \"./models.js\";\nexport {\n resolveSecurityPolicyTarget,\n securityPolicyDiff,\n} from \"./security-policy.js\";\nexport type {\n SecurityPolicyDraft,\n SecurityPolicyOptions,\n SecurityPolicyPreflight,\n SecurityPolicyStage,\n SecurityPolicyTarget,\n} from \"./security-policy.js\";\nexport { checkScanPublication, publishScan } from \"./publish.js\";\nexport { publishScanToCustom } from \"./custom-publish.js\";\nexport type {\n PublishScanToCustomOptions,\n CustomPublicationResult,\n} from \"./custom-publish.js\";\nexport { deduplicateRecords } from \"./deduplication/records.js\";\nexport type {\n DeduplicateRecordsInput,\n DeduplicateRecordsOptions,\n DeduplicateRecordsResult,\n} from \"./deduplication/records.js\";\nexport type {\n DeduplicationReviewRequest,\n DeduplicationReviewAttribution,\n DeduplicationReviewRunner,\n} from \"./deduplication/review.js\";\nexport {\n deduplicateScan,\n deduplicateScanDirectory,\n} from \"./deduplication/scan.js\";\nexport type {\n DeduplicateScanDirectoryOptions,\n DeduplicateScanOptions,\n DeduplicateScanResult,\n} from \"./deduplication/scan.js\";\nexport type { DeduplicationRefusal } from \"./deduplication/deduplication.js\";\nexport type { FindingEmbeddingBinding } from \"./deduplication/local.js\";\nexport type {\n PublicationTelemetry,\n PublicationTelemetryObserver,\n} from \"./publication-telemetry.js\";\nexport type {\n DeduplicationDiagnostic,\n DeduplicationDiagnosticObserver,\n} from \"./deduplication/diagnostics.js\";\nexport type {\n FindingEmbedder,\n EmbeddingUsageObservation,\n EmbeddingUsageObserver,\n} from \"./server/embeddings.js\";\nexport {\n ExternalPublicationError,\n prepareExternalPublication,\n prepareNormalizedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport type {\n ExternalPublicationOptions,\n NormalizedExternalPublicationOptions,\n ExternalPublicationDependencies,\n ExternalPublicationPreview,\n ExternalPublicationProgress,\n ExternalPublicationResult,\n PreparedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport {\n prepareNormalizedLocalImport,\n listLocalExternalImports,\n listLocalExternalFindings,\n listLocalFindingPublications,\n selectLocalExternalFindings,\n} from \"./external-findings-local.js\";\nexport type {\n ExternalFindingProvenance,\n LocalExternalFindingSelection,\n SelectedLocalExternalFindings,\n StoredExternalImport,\n StoredFindingPublication,\n StoredExternalFinding,\n NormalizedLocalImportOptions,\n LocalExternalImportDependencies,\n LocalExternalImportPreview,\n LocalExternalImportResult,\n PreparedLocalExternalImport,\n} from \"./external-findings-local.js\";\nexport {\n NoPublishableFindingsError,\n type ExternalFinding,\n type ExternalFindings,\n type ExternalSourceRepository,\n} from \"./external-findings.js\";\nexport type {\n ExternalFindingEvidence,\n FindingImportRequest,\n FindingImportReceipt,\n ImportRepository,\n SourceReport,\n} from \"./external-import-models.js\";\nexport {\n normalizeGitHubCodeScanningAlerts,\n normalizeGitHubAdvisories,\n readGitHubFindings,\n} from \"./github-findings.js\";\nexport { importGitHubAdvisories } from \"./github-advisories.js\";\nexport { normalizeGitHubDependabotAlerts } from \"./github-dependabot-findings.js\";\nexport type {\n GitHubAdvisoryImportOptions,\n ImportedGitHubAdvisory,\n} from \"./github-advisories.js\";\nexport { importGitHubCodeScanningAlerts } from \"./github.js\";\nexport type {\n GitHubCodeScanningImportOptions,\n ImportedGitHubCodeScanningAlert,\n} from \"./github.js\";\nexport type {\n CheckScanPublicationOptions,\n CheckScanPublicationResult,\n PublishScanOptions,\n PublishScanProgress,\n PublishScanResult,\n} from \"./publish.js\";\nexport { ScanResult } from \"./result.js\";\nexport type {\n RepositoryFinding,\n ScanResultOptions,\n TurnResultMetadata,\n} from \"./result.js\";\nexport {\n bootstrapPlugin,\n bundledPluginRoot,\n cleanupSdkDirectory,\n createIsolatedHome,\n createMarketplace,\n extractPluginZip,\n importAmbientAuth,\n MARKETPLACE_NAME,\n pluginExecutionEnvironment,\n pluginMetadata,\n PLUGIN_NAME,\n prepareOutputDir,\n resolveCodexCommand,\n resolvePluginPath,\n resolvePluginPython,\n validateOutputDir,\n} from \"./runtime.js\";\nexport type {\n CodexCommand,\n PluginInstall,\n PluginPythonOptions,\n ProcessEnvironment,\n} from \"./runtime.js\";\nexport {\n DiffTarget,\n normalizeRepository,\n normalizeTarget,\n repositoryRevision,\n validateMode,\n} from \"./targets.js\";\nexport type { NormalizedTarget, ScanMode, ScanTarget } from \"./targets.js\";\nexport type { AbsolutePath } from \"./config-path.js\";\nexport { BUNDLED_PLUGIN_VERSION, VERSION } from \"./version.js\";\n\nexport {\n classifySeverityRecords,\n classifySeverityRecordsInputSchema,\n} from \"./classify-severity-records.js\";\nexport type {\n ClassifySeverityRecordsInput,\n ClassifySeverityRecordsOptions,\n ClassifySeverityRecordsResult,\n CanonicalSeverityAssessment,\n SeverityClassificationReviewRequest,\n} from \"./classify-severity-records.js\";\nexport { validateRecords } from \"./validation-records.js\";\nexport type {\n ValidateRecordsInput,\n ValidateRecordsOptions,\n ValidationReviewRequest,\n} from \"./validation-records.js\";\n\nexport {\n readOperationTelemetry,\n summarizeOperationTelemetry,\n} from \"./operation-telemetry.js\";\nexport type {\n OperationTelemetryEvent,\n OperationOutcome,\n OperationFailureCategory,\n} from \"./operation-telemetry.js\";\n\nexport {\n prepareLocalExternalImport,\n type LocalExternalImportOptions,\n} from \"./external-findings-import.js\";\nexport {\n prepareStoredFindingsPublication,\n type StoredFindingsPublication,\n type StoredFindingsPublicationGroup,\n} from \"./stored-findings-publication.js\";\nexport { readTenableFindings } from \"./tenable-findings.js\";\nexport {\n normalizeOpenGrepFindings,\n readOpenGrepFindings,\n type OpenGrepImportOptions,\n} from \"./opengrep-findings.js\";\nexport { readSonarFindings, type SonarCapture } from \"./sonar-findings.js\";\nexport {\n collectSonarIssues,\n type SonarCollectionOptions,\n} from \"./sonar-collector.js\";\nexport {\n normalizeVeracodeFindings,\n readVeracodeFindings,\n} from \"./veracode-findings.js\";\nexport { normalizeTrivyFindings, readTrivyFindings } from \"./trivy-findings.js\";\nexport {\n normalizeBlackDuckFindings,\n readBlackDuckFindings,\n} from \"./blackduck-findings.js\";\nexport {\n normalizeContinuumFindings,\n readContinuumFindings,\n} from \"./continuum-findings.js\";\nexport { readCheckmarxFindings } from \"./checkmarx-findings.js\";\nexport {\n normalizeInspectorFindings,\n readInspectorFindings,\n} from \"./inspector-findings.js\";\nexport {\n normalizeSnykFindingsExport,\n normalizeSnykJson,\n normalizeSnykSarif,\n readSnykFindings,\n} from \"./snyk-findings.js\";\nexport {\n collectSnykIssues,\n normalizeSnykIssues,\n SNYK_REST_ISSUES_FORMAT,\n type CollectSnykIssuesOptions,\n type SnykIssuesExport,\n type SnykIssuesFindings,\n type SnykIssuesProduct,\n} from \"./snyk-rest-findings.js\";\nexport {\n normalizeSemgrepFindings,\n normalizeSemgrepSarif,\n readSemgrepFindings,\n type SemgrepImportOptions,\n} from \"./semgrep-findings.js\";\nexport { collectSemgrepPlatformFindings } from \"./semgrep-platform-collector.js\";\nexport { collectSelectedSemgrepGuardianFindings } from \"./semgrep-guardian-findings.js\";\nexport type {\n SemgrepPlatformOptions,\n SemgrepPlatformReport,\n} from \"./semgrep-platform-collector.js\";\nexport type { HostedScannerHttpOptions } from \"./hosted-scanner-http.js\";\nexport {\n normalizeSelectedSemgrepPlatformFindings,\n selectSemgrepPlatformFindings,\n normalizeSemgrepPlatformFindings,\n type SemgrepPlatformSelection,\n} from \"./semgrep-platform-findings.js\";\nexport {\n normalizeEndorFindings,\n normalizeEndorSarif,\n readEndorFindings,\n} from \"./endor-findings.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector-findings.d.ts","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspector-findings.d.ts","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAkX5D,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,MAAM,EAAE,oBAAoB,EAC5B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,CAAC,wBAAwB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CA0DhE;AAsKD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,gBAAgB,CA4ClB;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { posix } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import
|
|
4
|
-
import { cloudRepositoryUrlKey, repositoryUrlKey, validateExternalEvidence, } from "./external-import-contract.js";
|
|
3
|
+
import { cloudRepositoryUrlKey, repositoryUrlKey, validateEnrichedExternalEvidence, } from "./external-import-contract.js";
|
|
5
4
|
import { isGitHubCloudHost } from "./git-remote.js";
|
|
6
5
|
import { CodexSecurityError, errorMessage } from "./errors.js";
|
|
7
6
|
import { isRecord } from "./record.js";
|
|
8
|
-
import { normalizeRecords, readScannerJson, record, repositoryFilePath, requiredText, text, } from "./scanner-import.js";
|
|
7
|
+
import { awsTimestampSeconds, concreteVersion, normalizeRecords, readScannerJson, record, repositoryFilePath, requiredText, scannerSeverity, strings, text, } from "./scanner-import.js";
|
|
9
8
|
const listFindings = z.strictObject({ findings: z.array(z.unknown()) });
|
|
10
9
|
const format = "aws-inspector2-list-findings/v1";
|
|
11
10
|
const findingArn = /^(arn:(aws[a-zA-Z-]*):inspector2:([a-z]{2}(?:-gov)?-[a-z]+-\d):(\d{12})):finding\/[a-f0-9]{32}$/u;
|
|
@@ -227,6 +226,7 @@ const repositoryFinding = z.object({
|
|
|
227
226
|
fileName: optionalValue,
|
|
228
227
|
filePath: optionalValue,
|
|
229
228
|
startLine: optionalValue,
|
|
229
|
+
endLine: optionalValue,
|
|
230
230
|
}),
|
|
231
231
|
sourceLambdaLayerArn: absent,
|
|
232
232
|
})
|
|
@@ -301,12 +301,7 @@ export function inspectorReportRepository(provider, findings, target, projectMap
|
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
function timestamp(value) {
|
|
304
|
-
const seconds =
|
|
305
|
-
? value
|
|
306
|
-
: typeof value === "string" &&
|
|
307
|
-
/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d+)?(?:Z|[+-]\d\d:\d\d)$/u.test(value)
|
|
308
|
-
? Date.parse(value) / 1000
|
|
309
|
-
: NaN;
|
|
304
|
+
const seconds = awsTimestampSeconds(value);
|
|
310
305
|
if (!Number.isFinite(seconds))
|
|
311
306
|
throw new Error("Invalid Inspector timestamp.");
|
|
312
307
|
return Math.floor(seconds);
|
|
@@ -366,37 +361,6 @@ function manifestPath(path) {
|
|
|
366
361
|
? path
|
|
367
362
|
: null;
|
|
368
363
|
}
|
|
369
|
-
function concreteVersion(value, ecosystem, osPackage) {
|
|
370
|
-
const version = text(value);
|
|
371
|
-
if (!version)
|
|
372
|
-
return null;
|
|
373
|
-
// Debian versions use internal tildes for prereleases and backports.
|
|
374
|
-
if (osPackage && version.includes("~"))
|
|
375
|
-
return /^(?:\d+:)?\d[a-z\d.+~]*(?:-[a-z\d.+~]+)*$/iu.test(version)
|
|
376
|
-
? version
|
|
377
|
-
: null;
|
|
378
|
-
if (validSemver(version))
|
|
379
|
-
return version;
|
|
380
|
-
if (ecosystem === "npm" || ecosystem === "cargo")
|
|
381
|
-
return null;
|
|
382
|
-
if (ecosystem === "java" || ecosystem === "maven") {
|
|
383
|
-
if (version === "LATEST" ||
|
|
384
|
-
version === "RELEASE" ||
|
|
385
|
-
version.startsWith("latest."))
|
|
386
|
-
return null;
|
|
387
|
-
return /^[a-z\d][\w.+-]*$/iu.test(version) && !version.endsWith("+")
|
|
388
|
-
? version
|
|
389
|
-
: null;
|
|
390
|
-
}
|
|
391
|
-
if (!ecosystem && version.endsWith("+"))
|
|
392
|
-
return null;
|
|
393
|
-
const publicVersion = ecosystem === "pypi" ? version.split("+", 1)[0] : version;
|
|
394
|
-
return /\d/u.test(version) &&
|
|
395
|
-
/^(?:\d+:)?[a-z\d][\w.+!-]*$/iu.test(version) &&
|
|
396
|
-
!/(?:^|\.)x(?:\.|$)/iu.test(publicVersion)
|
|
397
|
-
? version
|
|
398
|
-
: null;
|
|
399
|
-
}
|
|
400
364
|
function evidence({ native: finding, pkg, code }, id, source, target) {
|
|
401
365
|
const { description, severity, remediation, firstObservedAt, lastObservedAt, updatedAt, status, } = finding;
|
|
402
366
|
const { recommendation } = record(remediation, "Inspector remediation");
|
|
@@ -424,37 +388,34 @@ function evidence({ native: finding, pkg, code }, id, source, target) {
|
|
|
424
388
|
};
|
|
425
389
|
});
|
|
426
390
|
const locations = [...paths].map((path) => ({ path, line: null }));
|
|
391
|
+
let endLine = null;
|
|
427
392
|
if (code) {
|
|
428
|
-
const { fileName, filePath, startLine } = code.filePath;
|
|
393
|
+
const { fileName, filePath, startLine, endLine: end } = code.filePath;
|
|
429
394
|
const path = repositoryFilePath(filePath);
|
|
430
|
-
if (path && posix.basename(path) === fileName)
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
395
|
+
if (path && posix.basename(path) === fileName) {
|
|
396
|
+
const line = typeof startLine === "number" &&
|
|
397
|
+
Number.isSafeInteger(startLine) &&
|
|
398
|
+
startLine > 0
|
|
399
|
+
? startLine
|
|
400
|
+
: null;
|
|
401
|
+
locations.push({ path, line });
|
|
402
|
+
if (line !== null &&
|
|
403
|
+
typeof end === "number" &&
|
|
404
|
+
Number.isSafeInteger(end) &&
|
|
405
|
+
end >= line)
|
|
406
|
+
endLine = end;
|
|
407
|
+
}
|
|
439
408
|
}
|
|
440
|
-
|
|
409
|
+
const advisoryIds = pkg ? [pkg.vulnerabilityId] : [];
|
|
410
|
+
const base = {
|
|
441
411
|
title: text(finding["title"]) ??
|
|
442
412
|
pkg?.vulnerabilityId ??
|
|
443
413
|
code?.detectorName ??
|
|
444
414
|
id,
|
|
445
415
|
description: requiredText(description, "Inspector description"),
|
|
446
|
-
severity:
|
|
447
|
-
? level
|
|
448
|
-
: "unknown",
|
|
416
|
+
severity: scannerSeverity(level),
|
|
449
417
|
url: text(pkg?.sourceUrl),
|
|
450
|
-
advisory_ids:
|
|
451
|
-
? [
|
|
452
|
-
...new Set([
|
|
453
|
-
pkg.vulnerabilityId,
|
|
454
|
-
...(pkg.relatedVulnerabilities ?? []),
|
|
455
|
-
]),
|
|
456
|
-
]
|
|
457
|
-
: [],
|
|
418
|
+
advisory_ids: advisoryIds,
|
|
458
419
|
packages,
|
|
459
420
|
locations,
|
|
460
421
|
source_updated_at: updatedAt === undefined ? null : timestamp(updatedAt),
|
|
@@ -463,7 +424,19 @@ function evidence({ native: finding, pkg, code }, id, source, target) {
|
|
|
463
424
|
sourceRepositoryUrl: source,
|
|
464
425
|
finding: structuredClone(finding),
|
|
465
426
|
},
|
|
466
|
-
}
|
|
427
|
+
};
|
|
428
|
+
const enrichment = code
|
|
429
|
+
? {
|
|
430
|
+
details: {
|
|
431
|
+
kind: "sast",
|
|
432
|
+
repository: { url: source },
|
|
433
|
+
rule: { id: code.detectorId, name: code.detectorName },
|
|
434
|
+
weakness_ids: strings(code.cwes),
|
|
435
|
+
code: endLine === null ? null : { end_line: endLine },
|
|
436
|
+
},
|
|
437
|
+
}
|
|
438
|
+
: undefined;
|
|
439
|
+
return validateEnrichedExternalEvidence(base, target, enrichment);
|
|
467
440
|
}
|
|
468
441
|
export function normalizeInspectorFindings(input, sourceRepositoryUrl, target = "cloud", projectMap) {
|
|
469
442
|
const source = repositoryUrl(sourceRepositoryUrl);
|
|
@@ -480,30 +453,23 @@ export function normalizeInspectorFindings(input, sourceRepositoryUrl, target =
|
|
|
480
453
|
claims: repositoryClaims(finding),
|
|
481
454
|
}));
|
|
482
455
|
checkReportScope(rows, target, projectMap);
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
reason: errorMessage(error),
|
|
496
|
-
});
|
|
456
|
+
const result = normalizeRecords(rows, ({ finding }, id) => evidence(selectedFinding(finding), id, source, target), ({ finding }) => identity(record(finding, "Inspector finding")).arn, target);
|
|
457
|
+
if (!result.excluded.length || !result.findings.length)
|
|
458
|
+
return result;
|
|
459
|
+
// Only surviving rows can supply shared provider and host evidence on replay.
|
|
460
|
+
const skipped = new Set(result.excluded.map((row) => row.position));
|
|
461
|
+
const retained = rows.filter((row) => !skipped.has(row.position));
|
|
462
|
+
checkReportScope(retained, target, projectMap, (row, error) => {
|
|
463
|
+
skipped.add(row.position);
|
|
464
|
+
result.excluded.push({
|
|
465
|
+
position: row.position,
|
|
466
|
+
source_finding_id: identity(record(row.finding, "Inspector finding")).arn,
|
|
467
|
+
reason: errorMessage(error),
|
|
497
468
|
});
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
return false;
|
|
503
|
-
});
|
|
504
|
-
result.excluded.sort((a, b) => a.position - b.position);
|
|
505
|
-
}
|
|
506
|
-
return normalizeRecords(rows, ({ finding }, id) => evidence(selectedFinding(finding), id, source, target), ({ finding }) => identity(record(finding, "Inspector finding")).arn, target, { filter: checkRetainedScope });
|
|
469
|
+
});
|
|
470
|
+
result.findings = result.findings.filter((_, i) => !skipped.has(retained[i].position));
|
|
471
|
+
result.excluded.sort((a, b) => a.position - b.position);
|
|
472
|
+
return result;
|
|
507
473
|
}
|
|
508
474
|
export async function readInspectorFindings(path, sourceRepositoryUrl, target = "cloud", projectMap) {
|
|
509
475
|
const mapping = projectMap && new Map(projectMap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector-findings.js","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,WAAW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ExternalFinding,\n ExternalFindings,\n ExternalSourceRepository,\n} from \"./external-findings.js\";\nimport {\n cloudRepositoryUrlKey,\n repositoryUrlKey,\n validateExternalEvidence,\n type ExternalImportTarget,\n} from \"./external-import-contract.js\";\nimport { isGitHubCloudHost } from \"./git-remote.js\";\nimport { CodexSecurityError, errorMessage } from \"./errors.js\";\nimport type { Provider } from \"./external-import-models.js\";\nimport { isRecord } from \"./record.js\";\nimport {\n normalizeRecords,\n readScannerJson,\n record,\n repositoryFilePath,\n requiredText,\n text,\n} from \"./scanner-import.js\";\n\ntype Native = Record<string, unknown>;\n\nconst listFindings = z.strictObject({ findings: z.array(z.unknown()) });\nconst format = \"aws-inspector2-list-findings/v1\";\nconst findingArn =\n /^(arn:(aws[a-zA-Z-]*):inspector2:([a-z]{2}(?:-gov)?-[a-z]+-\\d):(\\d{12})):finding\\/[a-f0-9]{32}$/u;\nconst integrationArn =\n /^arn:aws[a-zA-Z-]*:inspector2:[a-z]{2}(?:-gov)?-[a-z]+-\\d:\\d{12}:codesecurity-integration\\/[a-f0-9-]{36}$/u;\nconst projectSuffix =\n /^project-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/u;\nconst absoluteUrl = /^[a-z][a-z\\d+.-]*:\\/\\//iu;\n\nfunction repositoryUrl(value: unknown): string {\n const raw = requiredText(value, \"Inspector --source-repository-url\");\n const url = URL.parse(raw);\n const path = /^https?:\\/\\/[^/?#]+(\\/[^?#]+)$/iu.exec(raw)?.[1];\n if (\n !url ||\n !path ||\n url.username ||\n url.password ||\n /[\\s\\\\?#]|%(?:2f|5c)/iu.test(raw) ||\n path !== url.pathname ||\n !/^\\/[^/]+(?:\\/[^/]+)+\\/?$/u.test(path)\n )\n throw new Error(\n \"Use a complete HTTP(S) Inspector source repository URL with a namespace and repository, without credentials, query or fragment.\",\n );\n return raw;\n}\n\nfunction projectIntegration(projectArn: string): string {\n const separator = projectArn.lastIndexOf(\"/\");\n const parent = projectArn.slice(0, separator);\n if (\n !integrationArn.test(parent) ||\n !projectSuffix.test(projectArn.slice(separator + 1))\n )\n throw new Error(\"Expected a full Inspector repository project ARN.\");\n return parent;\n}\n\n/** @internal Validate an operator-supplied project binding. */\nexport function validateInspectorProjectMapping(\n projectArn: string,\n canonicalUrl: unknown,\n): string {\n projectIntegration(projectArn);\n return repositoryUrl(canonicalUrl);\n}\n\nfunction identity(finding: Native) {\n const arn = requiredText(finding[\"findingArn\"], \"Inspector finding ARN\");\n const match = findingArn.exec(arn);\n if (!match) throw new Error(\"Expected an Inspector2 finding ARN.\");\n if (finding[\"awsAccountId\"] !== match[4])\n throw new Error(\"Inspector finding ARN and AWS account do not match.\");\n return {\n arn,\n issuer: match[1]!,\n partition: match[2]!,\n region: match[3]!,\n account: match[4]!,\n };\n}\n\nfunction repositoryClaim(\n { issuer, partition, region, account }: ReturnType<typeof identity>,\n resource: Native,\n) {\n for (const [field, expected] of Object.entries({\n partition,\n region,\n provider: \"AWS\",\n providerAccountId: account,\n })) {\n if (resource[field] !== undefined && resource[field] !== expected)\n throw new Error(\n \"Inspector repository resource and finding scope do not match.\",\n );\n }\n const { codeRepository } = record(\n resource[\"details\"] ?? {},\n \"Inspector resource details\",\n );\n const repo = record(codeRepository ?? {}, \"Inspector codeRepository\");\n const optional = (field: string) =>\n repo[field] === undefined\n ? undefined\n : requiredText(repo[field], `Inspector codeRepository.${field}`);\n const nativeId = requiredText(\n resource[\"id\"],\n \"Inspector repository resource ID\",\n );\n let integration = optional(\"integrationArn\");\n if (\n integration !== undefined &&\n (!integration.startsWith(issuer + \":\") || !integrationArn.test(integration))\n )\n throw new Error(\n \"Inspector integration ARN does not match the finding scope.\",\n );\n if (nativeId.startsWith(\"arn:\")) {\n const parent = projectIntegration(nativeId);\n if (\n !parent.startsWith(issuer + \":\") ||\n (integration !== undefined && parent !== integration)\n )\n throw new Error(\n \"Inspector repository resource ARN does not match its project or integration.\",\n );\n integration = parent;\n }\n return {\n project: JSON.stringify([issuer, nativeId]),\n integration,\n provider: optional(\"providerType\"),\n nativeId,\n name: optional(\"projectName\"),\n };\n}\n\nfunction checkRepositoryMapping(\n { nativeId, name }: ReturnType<typeof repositoryClaim>,\n source: string,\n provider: string | undefined,\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n) {\n const hostname = new URL(source).hostname;\n const knownGitHub = isGitHubCloudHost(hostname);\n const gitlab = provider === \"GITLAB_SELF_MANAGED\";\n const github = provider === \"GITHUB\" || knownGitHub;\n if (\n hostname === \"gitlab.com\" ||\n (gitlab && knownGitHub) ||\n (provider !== undefined && !gitlab && provider !== \"GITHUB\")\n )\n throw new Error(\n \"Inspector repository provider does not match the selected mapping.\",\n );\n if (target === \"cloud\" && !github)\n throw new Error(\n \"Inspector Cloud requires a GitHub repository provider; self-managed GitLab is local only.\",\n );\n const urls = [nativeId, name].filter(\n (url): url is string => !!url && absoluteUrl.test(url),\n );\n const key = github && !projectMap ? cloudRepositoryUrlKey : repositoryUrlKey;\n const path = new URL(\n (github ? cloudRepositoryUrlKey : repositoryUrlKey)(source),\n ).pathname.slice(1);\n const slug = github ? name?.toLowerCase() : name;\n const matchesSlug =\n !slug ||\n absoluteUrl.test(slug) ||\n slug === path ||\n slug === posix.basename(path) ||\n (gitlab && projectMap && path.endsWith(\"/\" + slug));\n if (\n !matchesSlug ||\n urls.some((url) => key(repositoryUrl(url)) !== key(source))\n )\n throw new Error(\n \"Inspector native repository does not match --source-repository-url.\",\n );\n if (projectMap) {\n // repositoryClaim validated this ARN and its issuer before the lookup.\n const trustedUrl = nativeId.startsWith(\"arn:\")\n ? projectMap.get(nativeId)\n : undefined;\n if (trustedUrl === undefined)\n throw new Error(\n \"Inspector project ARN is missing from the trusted mapping.\",\n );\n if (\n repositoryUrlKey(repositoryUrl(trustedUrl)) !== repositoryUrlKey(source)\n )\n throw new Error(\n \"Inspector project ARN mapping does not match the source repository URL.\",\n );\n return true;\n }\n return urls.length > 0;\n}\n\nfunction repositoryClaims(finding: unknown) {\n if (!isRecord(finding) || !Array.isArray(finding[\"resources\"])) return [];\n const claims = [];\n let origin: ReturnType<typeof identity> | undefined;\n for (const resource of finding[\"resources\"]) {\n if (!isRecord(resource) || resource[\"type\"] !== \"CODE_REPOSITORY\") continue;\n origin ??= identity(finding);\n claims.push(repositoryClaim(origin, resource));\n }\n return claims;\n}\n\n/** Claims from the whole export must identify one project, including excluded rows. */\nfunction checkReportScope<\n T extends { claims: ReturnType<typeof repositoryClaims>; source: string },\n>(\n rows: readonly T[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n exclude: (row: T, error: unknown) => void = (_, error) => {\n throw error;\n },\n): string | undefined {\n const claims = rows.flatMap((row) => row.claims);\n function shared(field: \"project\" | \"integration\" | \"provider\") {\n const values = new Set(claims.map((claim) => claim[field]));\n values.delete(undefined);\n if (values.size > 1)\n throw new Error(\n \"Inspector export identifies more than one repository project or integration.\",\n );\n return values.values().next().value;\n }\n shared(\"project\");\n shared(\"integration\");\n const provider = shared(\"provider\");\n type Claim = ReturnType<typeof repositoryClaim>;\n // A bare project ID can recur across integrations in the same account and Region.\n const sharedProvider = claims.find(\n (claim) => claim.integration && claim.provider,\n )?.provider;\n const providerFor = (claim: Claim) =>\n claim.provider ?? (claim.integration ? sharedProvider : undefined);\n const missingHost = () =>\n new Error(\n \"Inspector needs a matching native repository URL or a trusted project ARN mapping to identify the Git host.\",\n );\n const needHost = [];\n let sharedHost = false;\n for (const row of rows) {\n try {\n // Only a fully verified row can supply evidence to another row.\n const scopedMatches = row.claims.flatMap((claim) => {\n const proven = checkRepositoryMapping(\n claim,\n row.source,\n providerFor(claim),\n target,\n projectMap,\n );\n if (claim.integration) return [proven];\n if (!proven) throw missingHost();\n return [];\n });\n if (scopedMatches.includes(true)) sharedHost = true;\n else if (scopedMatches.length) needHost.push(row);\n } catch (error) {\n exclude(row, error);\n }\n }\n if (!sharedHost) for (const row of needHost) exclude(row, missingHost());\n return claims.every((claim) => providerFor(claim) === provider)\n ? provider\n : undefined;\n}\n\nconst nonempty = z.string().regex(/\\S/u, \"Expected nonempty text.\");\nconst optionalValue = z.unknown().optional();\nconst absent = z.never().optional();\nconst vulnerablePackage = z.object({\n name: nonempty,\n version: nonempty,\n packageManager: optionalValue,\n epoch: optionalValue,\n release: optionalValue,\n fixedInVersion: optionalValue,\n filePath: optionalValue,\n sourceLayerHash: absent,\n sourceLambdaLayerArn: absent,\n});\nconst repositoryFinding = z.object({\n type: z.enum([\"PACKAGE_VULNERABILITY\", \"CODE_VULNERABILITY\"]),\n resources: z\n .array(\n z.object({\n type: z.literal(\"CODE_REPOSITORY\"),\n details: z.strictObject({ codeRepository: optionalValue }).nullish(),\n }),\n )\n .min(1),\n networkReachabilityDetails: absent,\n packageVulnerabilityDetails: z\n .object({\n vulnerabilityId: nonempty,\n source: nonempty,\n sourceUrl: optionalValue,\n relatedVulnerabilities: z.array(nonempty).nullish(),\n vulnerablePackages: z.array(vulnerablePackage).nullish(),\n })\n .optional(),\n codeVulnerabilityDetails: z\n .object({\n detectorName: nonempty,\n detectorId: nonempty,\n cwes: z.array(z.unknown()),\n filePath: z.object({\n fileName: optionalValue,\n filePath: optionalValue,\n startLine: optionalValue,\n }),\n sourceLambdaLayerArn: absent,\n })\n .optional(),\n});\nfunction selectedFinding(value: unknown) {\n const native = record(value, \"Inspector finding\");\n const parsed = repositoryFinding.safeParse(native);\n if (!parsed.success)\n throw new Error(\n `Expected an Inspector vulnerability on CODE_REPOSITORY resources. ${z.prettifyError(parsed.error)}`,\n );\n const {\n type,\n packageVulnerabilityDetails: pkg,\n codeVulnerabilityDetails: code,\n } = parsed.data;\n if (\n (pkg && type !== \"PACKAGE_VULNERABILITY\") ||\n (code && type !== \"CODE_VULNERABILITY\")\n )\n throw new Error(\n \"Inspector finding contains details for a different finding type.\",\n );\n return { native, pkg, code };\n}\n\nfunction isInspectorFinding(value: unknown, occurrenceId?: string): boolean {\n return (\n isRecord(value) &&\n typeof value[\"findingArn\"] === \"string\" &&\n findingArn.test(value[\"findingArn\"]) &&\n (occurrenceId === undefined || value[\"findingArn\"] === occurrenceId) &&\n Array.isArray(value[\"resources\"])\n );\n}\n\nfunction hasInspectorEvidence(\n sourceData: unknown,\n occurrenceId?: string,\n): boolean {\n return (\n isRecord(sourceData) &&\n (sourceData[\"format\"] === format ||\n isInspectorFinding(sourceData[\"finding\"], occurrenceId) ||\n isInspectorFinding(sourceData, occurrenceId))\n );\n}\n\nexport function inspectorReportRepository(\n provider: Provider,\n findings: readonly ExternalFinding[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n): (ExternalSourceRepository & { findingId: string }) | undefined {\n if (provider !== \"inspector\") {\n if (\n findings.some(({ evidence, source_finding_id }) =>\n hasInspectorEvidence(evidence.source_data, source_finding_id),\n )\n )\n throw new CodexSecurityError(\n \"Retained Inspector evidence requires the inspector provider.\",\n );\n return undefined;\n }\n const retained = [];\n for (const { source_finding_id: id, evidence } of findings) {\n const data = evidence.source_data;\n if (!isRecord(data) || data[\"format\"] !== format) {\n if (projectMap || hasInspectorEvidence(data) || findingArn.test(id))\n throw new Error(\n \"Expected retained Inspector ListFindings evidence for the finding ARN.\",\n );\n continue;\n }\n const source = repositoryUrl(data[\"sourceRepositoryUrl\"]);\n const { native: finding } = selectedFinding(data[\"finding\"]);\n if (finding[\"findingArn\"] !== id)\n throw new Error(\n \"Inspector source_finding_id does not match the retained finding ARN.\",\n );\n retained.push({\n source,\n claims: repositoryClaims(finding),\n id,\n declared: evidence.details?.repository?.url,\n });\n }\n const first = retained[0];\n if (!first) return undefined;\n // A supplied map owns the path casing on custom hosts.\n const github =\n checkReportScope(retained, target, projectMap) === \"GITHUB\" && !projectMap;\n const key =\n github || target === \"cloud\" ? cloudRepositoryUrlKey : repositoryUrlKey;\n const repository = key(first.source);\n for (const { source, declared } of retained) {\n if (key(source) !== repository)\n throw new Error(\n \"Inspector export identifies more than one source repository.\",\n );\n if (declared && key(declared) !== repository)\n throw new Error(\n \"Retained scanner repository does not match the normalized evidence repository.\",\n );\n }\n return {\n findingId: first.id,\n url: first.source,\n ...(github && { platform: \"github\" }),\n };\n}\n\nfunction timestamp(value: unknown): number {\n const seconds =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\" &&\n /^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.\\d+)?(?:Z|[+-]\\d\\d:\\d\\d)$/u.test(\n value,\n )\n ? Date.parse(value) / 1000\n : NaN;\n if (!Number.isFinite(seconds))\n throw new Error(\"Invalid Inspector timestamp.\");\n return Math.floor(seconds);\n}\n\nconst ecosystems = new Map(\n Object.entries({\n BUNDLER: \"rubygems\",\n GEMSPEC: \"rubygems\",\n CARGO: \"cargo\",\n COMPOSER: \"composer\",\n NPM: \"npm\",\n YARN: \"npm\",\n NODEPKG: \"npm\",\n NUGET: \"nuget\",\n DOTNET_CORE: \"nuget\",\n GOBINARY: \"go\",\n GOMOD: \"go\",\n JAR: \"java\",\n POM: \"maven\",\n PIP: \"pypi\",\n PIPENV: \"pypi\",\n POETRY: \"pypi\",\n PYTHONPKG: \"pypi\",\n }),\n);\n\nconst manifests = new Set([\n \"package.json\",\n \"package-lock.json\",\n \"npm-shrinkwrap.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"Cargo.toml\",\n \"Cargo.lock\",\n \"composer.json\",\n \"composer.lock\",\n \"Gemfile\",\n \"Gemfile.lock\",\n \"go.mod\",\n \"go.sum\",\n \"pom.xml\",\n \"build.gradle\",\n \"build.gradle.kts\",\n \"gradle.lockfile\",\n \"Pipfile\",\n \"Pipfile.lock\",\n \"poetry.lock\",\n \"pyproject.toml\",\n \"uv.lock\",\n \"packages.config\",\n \"packages.lock.json\",\n]);\n\nfunction manifestPath(path: string | null): string | null {\n if (!path) return null;\n const name = posix.basename(path);\n return manifests.has(name) ||\n /^requirements(?:[-_.].*)?\\.txt$/u.test(name) ||\n /\\.(?:csproj|fsproj|vbproj|gemspec)$/u.test(name)\n ? path\n : null;\n}\n\nfunction concreteVersion(\n value: unknown,\n ecosystem: string | null,\n osPackage: boolean,\n): string | null {\n const version = text(value);\n if (!version) return null;\n // Debian versions use internal tildes for prereleases and backports.\n if (osPackage && version.includes(\"~\"))\n return /^(?:\\d+:)?\\d[a-z\\d.+~]*(?:-[a-z\\d.+~]+)*$/iu.test(version)\n ? version\n : null;\n if (validSemver(version)) return version;\n if (ecosystem === \"npm\" || ecosystem === \"cargo\") return null;\n if (ecosystem === \"java\" || ecosystem === \"maven\") {\n if (\n version === \"LATEST\" ||\n version === \"RELEASE\" ||\n version.startsWith(\"latest.\")\n )\n return null;\n return /^[a-z\\d][\\w.+-]*$/iu.test(version) && !version.endsWith(\"+\")\n ? version\n : null;\n }\n if (!ecosystem && version.endsWith(\"+\")) return null;\n const publicVersion =\n ecosystem === \"pypi\" ? version.split(\"+\", 1)[0]! : version;\n return /\\d/u.test(version) &&\n /^(?:\\d+:)?[a-z\\d][\\w.+!-]*$/iu.test(version) &&\n !/(?:^|\\.)x(?:\\.|$)/iu.test(publicVersion)\n ? version\n : null;\n}\n\nfunction evidence(\n { native: finding, pkg, code }: ReturnType<typeof selectedFinding>,\n id: string,\n source: string,\n target: ExternalImportTarget,\n) {\n const {\n description,\n severity,\n remediation,\n firstObservedAt,\n lastObservedAt,\n updatedAt,\n status,\n } = finding;\n const { recommendation } = record(remediation, \"Inspector remediation\");\n record(recommendation ?? {}, \"Inspector recommendation\");\n requiredText(status, \"Inspector status\");\n timestamp(firstObservedAt);\n timestamp(lastObservedAt);\n const level = requiredText(severity, \"Inspector severity\").toLowerCase();\n const paths = new Set<string>();\n const packages = (pkg?.vulnerablePackages ?? []).map((item) => {\n const path = repositoryFilePath(item.filePath);\n if (path) paths.add(path);\n const ecosystem = ecosystems.get(text(item.packageManager) ?? \"\") ?? null;\n const version = (value: unknown) =>\n concreteVersion(value, ecosystem, item.packageManager === \"OS\");\n const fixed = version(item.fixedInVersion);\n const splitVersion =\n item.packageManager === \"OS\" &&\n (item.epoch != null || item.release != null);\n return {\n name: item.name,\n ecosystem,\n installed_version: splitVersion ? null : version(item.version),\n manifest_path: manifestPath(path),\n fixed_versions: fixed ? [fixed] : [],\n };\n });\n const locations: { path: string; line: number | null }[] = [...paths].map(\n (path) => ({ path, line: null }),\n );\n if (code) {\n const { fileName, filePath, startLine } = code.filePath;\n const path = repositoryFilePath(filePath);\n if (path && posix.basename(path) === fileName)\n locations.push({\n path,\n line:\n typeof startLine === \"number\" &&\n Number.isSafeInteger(startLine) &&\n startLine > 0\n ? startLine\n : null,\n });\n }\n return validateExternalEvidence(\n {\n title:\n text(finding[\"title\"]) ??\n pkg?.vulnerabilityId ??\n code?.detectorName ??\n id,\n description: requiredText(description, \"Inspector description\"),\n severity: [\"critical\", \"high\", \"medium\", \"low\", \"informational\"].includes(\n level,\n )\n ? level\n : \"unknown\",\n url: text(pkg?.sourceUrl),\n advisory_ids: pkg\n ? [\n ...new Set([\n pkg.vulnerabilityId,\n ...(pkg.relatedVulnerabilities ?? []),\n ]),\n ]\n : [],\n packages,\n locations,\n source_updated_at: updatedAt === undefined ? null : timestamp(updatedAt),\n source_data: {\n format,\n sourceRepositoryUrl: source,\n finding: structuredClone(finding),\n },\n },\n target,\n );\n}\n\nexport function normalizeInspectorFindings(\n input: unknown,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): ExternalFindings {\n const source = repositoryUrl(sourceRepositoryUrl);\n if (\n isRecord(input) &&\n (Object.hasOwn(input, \"NextToken\") || Object.hasOwn(input, \"nextToken\"))\n )\n throw new Error(\n \"Inspector export has a continuation key; supply the complete paginated CLI JSON output.\",\n );\n const report = listFindings.safeParse(input);\n if (!report.success)\n throw new Error(\n \"Expected only a complete native Inspector ListFindings response with a findings array.\",\n );\n const rows = report.data.findings.map((finding, i) => ({\n finding,\n source,\n position: i + 1,\n claims: repositoryClaims(finding),\n }));\n checkReportScope(rows, target, projectMap);\n function checkRetainedScope(\n result: ExternalFindings,\n removedIds?: Set<string>,\n ) {\n if (!result.excluded.length || !result.findings.length) return;\n // Only surviving rows can supply shared provider and host evidence on replay.\n const skipped = new Set(result.excluded.map((row) => row.position));\n const retained = rows.filter((row) => !skipped.has(row.position));\n checkReportScope(retained, target, projectMap, (row, error) => {\n skipped.add(row.position);\n result.excluded.push({\n position: row.position,\n source_finding_id: identity(record(row.finding, \"Inspector finding\"))\n .arn,\n reason: errorMessage(error),\n });\n });\n result.findings = result.findings.filter((finding, i) => {\n if (!skipped.has(retained[i]!.position)) return true;\n removedIds?.add(finding.source_finding_id);\n return false;\n });\n result.excluded.sort((a, b) => a.position - b.position);\n }\n return normalizeRecords(\n rows,\n ({ finding }, id) => evidence(selectedFinding(finding), id, source, target),\n ({ finding }) => identity(record(finding, \"Inspector finding\")).arn,\n target,\n { filter: checkRetainedScope },\n );\n}\n\nexport async function readInspectorFindings(\n path: string,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): Promise<ExternalFindings> {\n const mapping = projectMap && new Map(projectMap);\n return normalizeInspectorFindings(\n await readScannerJson(path),\n sourceRepositoryUrl,\n target,\n mapping,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"inspector-findings.js","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,gCAAgC,GAEjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,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,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5D,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC1B,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG;YACzE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;SAC5B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CACtC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,CAC9C,CAAC;IACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAY,EACZ,mBAA2B,EAC3B,MAAM,GAAyB,OAAO,EACtC,UAAwC;IAExC,MAAM,OAAO,GAAG,UAAU,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IAClD,OAAO,0BAA0B,CAC/B,MAAM,eAAe,CAAC,IAAI,CAAC,EAC3B,mBAAmB,EACnB,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { posix } from \"node:path\";\nimport { z } from \"zod\";\nimport type {\n ExternalFinding,\n ExternalFindings,\n ExternalSourceRepository,\n} from \"./external-findings.js\";\nimport {\n cloudRepositoryUrlKey,\n repositoryUrlKey,\n validateEnrichedExternalEvidence,\n type ExternalImportTarget,\n} from \"./external-import-contract.js\";\nimport { isGitHubCloudHost } from \"./git-remote.js\";\nimport { CodexSecurityError, errorMessage } from \"./errors.js\";\nimport type { Provider } from \"./external-import-models.js\";\nimport { isRecord } from \"./record.js\";\nimport {\n awsTimestampSeconds,\n concreteVersion,\n normalizeRecords,\n readScannerJson,\n record,\n repositoryFilePath,\n requiredText,\n scannerSeverity,\n strings,\n text,\n} from \"./scanner-import.js\";\n\ntype Native = Record<string, unknown>;\n\nconst listFindings = z.strictObject({ findings: z.array(z.unknown()) });\nconst format = \"aws-inspector2-list-findings/v1\";\nconst findingArn =\n /^(arn:(aws[a-zA-Z-]*):inspector2:([a-z]{2}(?:-gov)?-[a-z]+-\\d):(\\d{12})):finding\\/[a-f0-9]{32}$/u;\nconst integrationArn =\n /^arn:aws[a-zA-Z-]*:inspector2:[a-z]{2}(?:-gov)?-[a-z]+-\\d:\\d{12}:codesecurity-integration\\/[a-f0-9-]{36}$/u;\nconst projectSuffix =\n /^project-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/u;\nconst absoluteUrl = /^[a-z][a-z\\d+.-]*:\\/\\//iu;\n\nfunction repositoryUrl(value: unknown): string {\n const raw = requiredText(value, \"Inspector --source-repository-url\");\n const url = URL.parse(raw);\n const path = /^https?:\\/\\/[^/?#]+(\\/[^?#]+)$/iu.exec(raw)?.[1];\n if (\n !url ||\n !path ||\n url.username ||\n url.password ||\n /[\\s\\\\?#]|%(?:2f|5c)/iu.test(raw) ||\n path !== url.pathname ||\n !/^\\/[^/]+(?:\\/[^/]+)+\\/?$/u.test(path)\n )\n throw new Error(\n \"Use a complete HTTP(S) Inspector source repository URL with a namespace and repository, without credentials, query or fragment.\",\n );\n return raw;\n}\n\nfunction projectIntegration(projectArn: string): string {\n const separator = projectArn.lastIndexOf(\"/\");\n const parent = projectArn.slice(0, separator);\n if (\n !integrationArn.test(parent) ||\n !projectSuffix.test(projectArn.slice(separator + 1))\n )\n throw new Error(\"Expected a full Inspector repository project ARN.\");\n return parent;\n}\n\n/** @internal Validate an operator-supplied project binding. */\nexport function validateInspectorProjectMapping(\n projectArn: string,\n canonicalUrl: unknown,\n): string {\n projectIntegration(projectArn);\n return repositoryUrl(canonicalUrl);\n}\n\nfunction identity(finding: Native) {\n const arn = requiredText(finding[\"findingArn\"], \"Inspector finding ARN\");\n const match = findingArn.exec(arn);\n if (!match) throw new Error(\"Expected an Inspector2 finding ARN.\");\n if (finding[\"awsAccountId\"] !== match[4])\n throw new Error(\"Inspector finding ARN and AWS account do not match.\");\n return {\n arn,\n issuer: match[1]!,\n partition: match[2]!,\n region: match[3]!,\n account: match[4]!,\n };\n}\n\nfunction repositoryClaim(\n { issuer, partition, region, account }: ReturnType<typeof identity>,\n resource: Native,\n) {\n for (const [field, expected] of Object.entries({\n partition,\n region,\n provider: \"AWS\",\n providerAccountId: account,\n })) {\n if (resource[field] !== undefined && resource[field] !== expected)\n throw new Error(\n \"Inspector repository resource and finding scope do not match.\",\n );\n }\n const { codeRepository } = record(\n resource[\"details\"] ?? {},\n \"Inspector resource details\",\n );\n const repo = record(codeRepository ?? {}, \"Inspector codeRepository\");\n const optional = (field: string) =>\n repo[field] === undefined\n ? undefined\n : requiredText(repo[field], `Inspector codeRepository.${field}`);\n const nativeId = requiredText(\n resource[\"id\"],\n \"Inspector repository resource ID\",\n );\n let integration = optional(\"integrationArn\");\n if (\n integration !== undefined &&\n (!integration.startsWith(issuer + \":\") || !integrationArn.test(integration))\n )\n throw new Error(\n \"Inspector integration ARN does not match the finding scope.\",\n );\n if (nativeId.startsWith(\"arn:\")) {\n const parent = projectIntegration(nativeId);\n if (\n !parent.startsWith(issuer + \":\") ||\n (integration !== undefined && parent !== integration)\n )\n throw new Error(\n \"Inspector repository resource ARN does not match its project or integration.\",\n );\n integration = parent;\n }\n return {\n project: JSON.stringify([issuer, nativeId]),\n integration,\n provider: optional(\"providerType\"),\n nativeId,\n name: optional(\"projectName\"),\n };\n}\n\nfunction checkRepositoryMapping(\n { nativeId, name }: ReturnType<typeof repositoryClaim>,\n source: string,\n provider: string | undefined,\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n) {\n const hostname = new URL(source).hostname;\n const knownGitHub = isGitHubCloudHost(hostname);\n const gitlab = provider === \"GITLAB_SELF_MANAGED\";\n const github = provider === \"GITHUB\" || knownGitHub;\n if (\n hostname === \"gitlab.com\" ||\n (gitlab && knownGitHub) ||\n (provider !== undefined && !gitlab && provider !== \"GITHUB\")\n )\n throw new Error(\n \"Inspector repository provider does not match the selected mapping.\",\n );\n if (target === \"cloud\" && !github)\n throw new Error(\n \"Inspector Cloud requires a GitHub repository provider; self-managed GitLab is local only.\",\n );\n const urls = [nativeId, name].filter(\n (url): url is string => !!url && absoluteUrl.test(url),\n );\n const key = github && !projectMap ? cloudRepositoryUrlKey : repositoryUrlKey;\n const path = new URL(\n (github ? cloudRepositoryUrlKey : repositoryUrlKey)(source),\n ).pathname.slice(1);\n const slug = github ? name?.toLowerCase() : name;\n const matchesSlug =\n !slug ||\n absoluteUrl.test(slug) ||\n slug === path ||\n slug === posix.basename(path) ||\n (gitlab && projectMap && path.endsWith(\"/\" + slug));\n if (\n !matchesSlug ||\n urls.some((url) => key(repositoryUrl(url)) !== key(source))\n )\n throw new Error(\n \"Inspector native repository does not match --source-repository-url.\",\n );\n if (projectMap) {\n // repositoryClaim validated this ARN and its issuer before the lookup.\n const trustedUrl = nativeId.startsWith(\"arn:\")\n ? projectMap.get(nativeId)\n : undefined;\n if (trustedUrl === undefined)\n throw new Error(\n \"Inspector project ARN is missing from the trusted mapping.\",\n );\n if (\n repositoryUrlKey(repositoryUrl(trustedUrl)) !== repositoryUrlKey(source)\n )\n throw new Error(\n \"Inspector project ARN mapping does not match the source repository URL.\",\n );\n return true;\n }\n return urls.length > 0;\n}\n\nfunction repositoryClaims(finding: unknown) {\n if (!isRecord(finding) || !Array.isArray(finding[\"resources\"])) return [];\n const claims = [];\n let origin: ReturnType<typeof identity> | undefined;\n for (const resource of finding[\"resources\"]) {\n if (!isRecord(resource) || resource[\"type\"] !== \"CODE_REPOSITORY\") continue;\n origin ??= identity(finding);\n claims.push(repositoryClaim(origin, resource));\n }\n return claims;\n}\n\n/** Claims from the whole export must identify one project, including excluded rows. */\nfunction checkReportScope<\n T extends { claims: ReturnType<typeof repositoryClaims>; source: string },\n>(\n rows: readonly T[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n exclude: (row: T, error: unknown) => void = (_, error) => {\n throw error;\n },\n): string | undefined {\n const claims = rows.flatMap((row) => row.claims);\n function shared(field: \"project\" | \"integration\" | \"provider\") {\n const values = new Set(claims.map((claim) => claim[field]));\n values.delete(undefined);\n if (values.size > 1)\n throw new Error(\n \"Inspector export identifies more than one repository project or integration.\",\n );\n return values.values().next().value;\n }\n shared(\"project\");\n shared(\"integration\");\n const provider = shared(\"provider\");\n type Claim = ReturnType<typeof repositoryClaim>;\n // A bare project ID can recur across integrations in the same account and Region.\n const sharedProvider = claims.find(\n (claim) => claim.integration && claim.provider,\n )?.provider;\n const providerFor = (claim: Claim) =>\n claim.provider ?? (claim.integration ? sharedProvider : undefined);\n const missingHost = () =>\n new Error(\n \"Inspector needs a matching native repository URL or a trusted project ARN mapping to identify the Git host.\",\n );\n const needHost = [];\n let sharedHost = false;\n for (const row of rows) {\n try {\n // Only a fully verified row can supply evidence to another row.\n const scopedMatches = row.claims.flatMap((claim) => {\n const proven = checkRepositoryMapping(\n claim,\n row.source,\n providerFor(claim),\n target,\n projectMap,\n );\n if (claim.integration) return [proven];\n if (!proven) throw missingHost();\n return [];\n });\n if (scopedMatches.includes(true)) sharedHost = true;\n else if (scopedMatches.length) needHost.push(row);\n } catch (error) {\n exclude(row, error);\n }\n }\n if (!sharedHost) for (const row of needHost) exclude(row, missingHost());\n return claims.every((claim) => providerFor(claim) === provider)\n ? provider\n : undefined;\n}\n\nconst nonempty = z.string().regex(/\\S/u, \"Expected nonempty text.\");\nconst optionalValue = z.unknown().optional();\nconst absent = z.never().optional();\nconst vulnerablePackage = z.object({\n name: nonempty,\n version: nonempty,\n packageManager: optionalValue,\n epoch: optionalValue,\n release: optionalValue,\n fixedInVersion: optionalValue,\n filePath: optionalValue,\n sourceLayerHash: absent,\n sourceLambdaLayerArn: absent,\n});\nconst repositoryFinding = z.object({\n type: z.enum([\"PACKAGE_VULNERABILITY\", \"CODE_VULNERABILITY\"]),\n resources: z\n .array(\n z.object({\n type: z.literal(\"CODE_REPOSITORY\"),\n details: z.strictObject({ codeRepository: optionalValue }).nullish(),\n }),\n )\n .min(1),\n networkReachabilityDetails: absent,\n packageVulnerabilityDetails: z\n .object({\n vulnerabilityId: nonempty,\n source: nonempty,\n sourceUrl: optionalValue,\n relatedVulnerabilities: z.array(nonempty).nullish(),\n vulnerablePackages: z.array(vulnerablePackage).nullish(),\n })\n .optional(),\n codeVulnerabilityDetails: z\n .object({\n detectorName: nonempty,\n detectorId: nonempty,\n cwes: z.array(z.unknown()),\n filePath: z.object({\n fileName: optionalValue,\n filePath: optionalValue,\n startLine: optionalValue,\n endLine: optionalValue,\n }),\n sourceLambdaLayerArn: absent,\n })\n .optional(),\n});\nfunction selectedFinding(value: unknown) {\n const native = record(value, \"Inspector finding\");\n const parsed = repositoryFinding.safeParse(native);\n if (!parsed.success)\n throw new Error(\n `Expected an Inspector vulnerability on CODE_REPOSITORY resources. ${z.prettifyError(parsed.error)}`,\n );\n const {\n type,\n packageVulnerabilityDetails: pkg,\n codeVulnerabilityDetails: code,\n } = parsed.data;\n if (\n (pkg && type !== \"PACKAGE_VULNERABILITY\") ||\n (code && type !== \"CODE_VULNERABILITY\")\n )\n throw new Error(\n \"Inspector finding contains details for a different finding type.\",\n );\n return { native, pkg, code };\n}\n\nfunction isInspectorFinding(value: unknown, occurrenceId?: string): boolean {\n return (\n isRecord(value) &&\n typeof value[\"findingArn\"] === \"string\" &&\n findingArn.test(value[\"findingArn\"]) &&\n (occurrenceId === undefined || value[\"findingArn\"] === occurrenceId) &&\n Array.isArray(value[\"resources\"])\n );\n}\n\nfunction hasInspectorEvidence(\n sourceData: unknown,\n occurrenceId?: string,\n): boolean {\n return (\n isRecord(sourceData) &&\n (sourceData[\"format\"] === format ||\n isInspectorFinding(sourceData[\"finding\"], occurrenceId) ||\n isInspectorFinding(sourceData, occurrenceId))\n );\n}\n\nexport function inspectorReportRepository(\n provider: Provider,\n findings: readonly ExternalFinding[],\n target: ExternalImportTarget,\n projectMap?: ReadonlyMap<string, string>,\n): (ExternalSourceRepository & { findingId: string }) | undefined {\n if (provider !== \"inspector\") {\n if (\n findings.some(({ evidence, source_finding_id }) =>\n hasInspectorEvidence(evidence.source_data, source_finding_id),\n )\n )\n throw new CodexSecurityError(\n \"Retained Inspector evidence requires the inspector provider.\",\n );\n return undefined;\n }\n const retained = [];\n for (const { source_finding_id: id, evidence } of findings) {\n const data = evidence.source_data;\n if (!isRecord(data) || data[\"format\"] !== format) {\n if (projectMap || hasInspectorEvidence(data) || findingArn.test(id))\n throw new Error(\n \"Expected retained Inspector ListFindings evidence for the finding ARN.\",\n );\n continue;\n }\n const source = repositoryUrl(data[\"sourceRepositoryUrl\"]);\n const { native: finding } = selectedFinding(data[\"finding\"]);\n if (finding[\"findingArn\"] !== id)\n throw new Error(\n \"Inspector source_finding_id does not match the retained finding ARN.\",\n );\n retained.push({\n source,\n claims: repositoryClaims(finding),\n id,\n declared: evidence.details?.repository?.url,\n });\n }\n const first = retained[0];\n if (!first) return undefined;\n // A supplied map owns the path casing on custom hosts.\n const github =\n checkReportScope(retained, target, projectMap) === \"GITHUB\" && !projectMap;\n const key =\n github || target === \"cloud\" ? cloudRepositoryUrlKey : repositoryUrlKey;\n const repository = key(first.source);\n for (const { source, declared } of retained) {\n if (key(source) !== repository)\n throw new Error(\n \"Inspector export identifies more than one source repository.\",\n );\n if (declared && key(declared) !== repository)\n throw new Error(\n \"Retained scanner repository does not match the normalized evidence repository.\",\n );\n }\n return {\n findingId: first.id,\n url: first.source,\n ...(github && { platform: \"github\" }),\n };\n}\n\nfunction timestamp(value: unknown): number {\n const seconds = awsTimestampSeconds(value);\n if (!Number.isFinite(seconds))\n throw new Error(\"Invalid Inspector timestamp.\");\n return Math.floor(seconds);\n}\n\nconst ecosystems = new Map(\n Object.entries({\n BUNDLER: \"rubygems\",\n GEMSPEC: \"rubygems\",\n CARGO: \"cargo\",\n COMPOSER: \"composer\",\n NPM: \"npm\",\n YARN: \"npm\",\n NODEPKG: \"npm\",\n NUGET: \"nuget\",\n DOTNET_CORE: \"nuget\",\n GOBINARY: \"go\",\n GOMOD: \"go\",\n JAR: \"java\",\n POM: \"maven\",\n PIP: \"pypi\",\n PIPENV: \"pypi\",\n POETRY: \"pypi\",\n PYTHONPKG: \"pypi\",\n }),\n);\n\nconst manifests = new Set([\n \"package.json\",\n \"package-lock.json\",\n \"npm-shrinkwrap.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"Cargo.toml\",\n \"Cargo.lock\",\n \"composer.json\",\n \"composer.lock\",\n \"Gemfile\",\n \"Gemfile.lock\",\n \"go.mod\",\n \"go.sum\",\n \"pom.xml\",\n \"build.gradle\",\n \"build.gradle.kts\",\n \"gradle.lockfile\",\n \"Pipfile\",\n \"Pipfile.lock\",\n \"poetry.lock\",\n \"pyproject.toml\",\n \"uv.lock\",\n \"packages.config\",\n \"packages.lock.json\",\n]);\n\nfunction manifestPath(path: string | null): string | null {\n if (!path) return null;\n const name = posix.basename(path);\n return manifests.has(name) ||\n /^requirements(?:[-_.].*)?\\.txt$/u.test(name) ||\n /\\.(?:csproj|fsproj|vbproj|gemspec)$/u.test(name)\n ? path\n : null;\n}\n\nfunction evidence(\n { native: finding, pkg, code }: ReturnType<typeof selectedFinding>,\n id: string,\n source: string,\n target: ExternalImportTarget,\n) {\n const {\n description,\n severity,\n remediation,\n firstObservedAt,\n lastObservedAt,\n updatedAt,\n status,\n } = finding;\n const { recommendation } = record(remediation, \"Inspector remediation\");\n record(recommendation ?? {}, \"Inspector recommendation\");\n requiredText(status, \"Inspector status\");\n timestamp(firstObservedAt);\n timestamp(lastObservedAt);\n const level = requiredText(severity, \"Inspector severity\").toLowerCase();\n const paths = new Set<string>();\n const packages = (pkg?.vulnerablePackages ?? []).map((item) => {\n const path = repositoryFilePath(item.filePath);\n if (path) paths.add(path);\n const ecosystem = ecosystems.get(text(item.packageManager) ?? \"\") ?? null;\n const version = (value: unknown) =>\n concreteVersion(value, ecosystem, item.packageManager === \"OS\");\n const fixed = version(item.fixedInVersion);\n const splitVersion =\n item.packageManager === \"OS\" &&\n (item.epoch != null || item.release != null);\n return {\n name: item.name,\n ecosystem,\n installed_version: splitVersion ? null : version(item.version),\n manifest_path: manifestPath(path),\n fixed_versions: fixed ? [fixed] : [],\n };\n });\n const locations: { path: string; line: number | null }[] = [...paths].map(\n (path) => ({ path, line: null }),\n );\n let endLine: number | null = null;\n if (code) {\n const { fileName, filePath, startLine, endLine: end } = code.filePath;\n const path = repositoryFilePath(filePath);\n if (path && posix.basename(path) === fileName) {\n const line =\n typeof startLine === \"number\" &&\n Number.isSafeInteger(startLine) &&\n startLine > 0\n ? startLine\n : null;\n locations.push({ path, line });\n if (\n line !== null &&\n typeof end === \"number\" &&\n Number.isSafeInteger(end) &&\n end >= line\n )\n endLine = end;\n }\n }\n const advisoryIds = pkg ? [pkg.vulnerabilityId] : [];\n const base = {\n title:\n text(finding[\"title\"]) ??\n pkg?.vulnerabilityId ??\n code?.detectorName ??\n id,\n description: requiredText(description, \"Inspector description\"),\n severity: scannerSeverity(level),\n url: text(pkg?.sourceUrl),\n advisory_ids: advisoryIds,\n packages,\n locations,\n source_updated_at: updatedAt === undefined ? null : timestamp(updatedAt),\n source_data: {\n format,\n sourceRepositoryUrl: source,\n finding: structuredClone(finding),\n },\n };\n const enrichment = code\n ? {\n details: {\n kind: \"sast\",\n repository: { url: source },\n rule: { id: code.detectorId, name: code.detectorName },\n weakness_ids: strings(code.cwes),\n code: endLine === null ? null : { end_line: endLine },\n },\n }\n : undefined;\n return validateEnrichedExternalEvidence(base, target, enrichment);\n}\n\nexport function normalizeInspectorFindings(\n input: unknown,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): ExternalFindings {\n const source = repositoryUrl(sourceRepositoryUrl);\n if (\n isRecord(input) &&\n (Object.hasOwn(input, \"NextToken\") || Object.hasOwn(input, \"nextToken\"))\n )\n throw new Error(\n \"Inspector export has a continuation key; supply the complete paginated CLI JSON output.\",\n );\n const report = listFindings.safeParse(input);\n if (!report.success)\n throw new Error(\n \"Expected only a complete native Inspector ListFindings response with a findings array.\",\n );\n const rows = report.data.findings.map((finding, i) => ({\n finding,\n source,\n position: i + 1,\n claims: repositoryClaims(finding),\n }));\n checkReportScope(rows, target, projectMap);\n const result = normalizeRecords(\n rows,\n ({ finding }, id) => evidence(selectedFinding(finding), id, source, target),\n ({ finding }) => identity(record(finding, \"Inspector finding\")).arn,\n target,\n );\n if (!result.excluded.length || !result.findings.length) return result;\n // Only surviving rows can supply shared provider and host evidence on replay.\n const skipped = new Set(result.excluded.map((row) => row.position));\n const retained = rows.filter((row) => !skipped.has(row.position));\n checkReportScope(retained, target, projectMap, (row, error) => {\n skipped.add(row.position);\n result.excluded.push({\n position: row.position,\n source_finding_id: identity(record(row.finding, \"Inspector finding\")).arn,\n reason: errorMessage(error),\n });\n });\n result.findings = result.findings.filter(\n (_, i) => !skipped.has(retained[i]!.position),\n );\n result.excluded.sort((a, b) => a.position - b.position);\n return result;\n}\n\nexport async function readInspectorFindings(\n path: string,\n sourceRepositoryUrl: string,\n target: ExternalImportTarget = \"cloud\",\n projectMap?: ReadonlyMap<string, string>,\n): Promise<ExternalFindings> {\n const mapping = projectMap && new Map(projectMap);\n return normalizeInspectorFindings(\n await readScannerJson(path),\n sourceRepositoryUrl,\n target,\n mapping,\n );\n}\n"]}
|
package/dist/knowledge-base.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export interface KnowledgeBaseSnapshot {
|
|
|
10
10
|
readonly documents: Readonly<Record<string, string>>;
|
|
11
11
|
}
|
|
12
12
|
export declare function knowledgeBaseProtectedRoots(snapshot: KnowledgeBaseSnapshot, signal?: AbortSignal): Promise<string[]>;
|
|
13
|
-
export declare function prepareKnowledgeBase(input: readonly string[] | KnowledgeBaseSnapshot, signal?: AbortSignal, directory?: string): Promise<PreparedKnowledgeBase>;
|
|
13
|
+
export declare function prepareKnowledgeBase(input: readonly string[] | KnowledgeBaseSnapshot, signal?: AbortSignal, directory?: string, repository?: string): Promise<PreparedKnowledgeBase>;
|
|
14
14
|
//# sourceMappingURL=knowledge-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-base.d.ts","sourceRoot":"","sources":["../src/knowledge-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"knowledge-base.d.ts","sourceRoot":"","sources":["../src/knowledge-base.ts"],"names":[],"mappings":"AAkCA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD;AAED,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,qBAAqB,EAC/B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,EAAE,CAAC,CASnB;AA4FD,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,qBAAqB,EAChD,MAAM,CAAC,EAAE,WAAW,EACpB,SAAS,CAAC,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,CAAC,CAiChC"}
|