@openai/codex-security 0.9.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -788
- package/_bundled_plugin/.codex-plugin/plugin.json +2 -0
- package/_bundled_plugin/.mcp.json +3 -0
- package/_bundled_plugin/mcp/helpers.mjs.br +0 -0
- 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/server.mjs.br +0 -0
- package/_bundled_plugin/references/access-advisory.md +1 -1
- 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/final-report.md +1 -1
- package/_bundled_plugin/references/focused-investigator.md +13 -0
- 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/threat-model.md +1 -0
- package/_bundled_plugin/references/validate-scan-findings.md +3 -0
- package/_bundled_plugin/scripts/deep_scan_workbench.py +30 -12
- package/_bundled_plugin/scripts/dispatch_inventory_tool +7 -0
- package/_bundled_plugin/scripts/finalize_scan_contract.py +47 -9
- package/_bundled_plugin/scripts/launch_codex_security_mcp +54 -16
- package/_bundled_plugin/scripts/launch_codex_security_mcp.cmd +2 -0
- package/_bundled_plugin/scripts/posix_scan_local_files.py +26 -1
- package/_bundled_plugin/scripts/snapshot_sqlite.py +8 -2
- package/_bundled_plugin/scripts/windows_scan_local_files.py +216 -25
- package/_bundled_plugin/scripts/workbench/handoff.py +55 -25
- package/_bundled_plugin/scripts/workbench/storage.py +25 -5
- package/_bundled_plugin/scripts/workbench_cli.py +24 -2
- package/_bundled_plugin/scripts/workbench_constants.py +2 -0
- package/_bundled_plugin/scripts/workbench_db.py +257 -268
- package/_bundled_plugin/scripts/workbench_feedback.py +49 -4
- package/_bundled_plugin/scripts/workbench_native_indexes.py +226 -29
- package/_bundled_plugin/scripts/workbench_progress.py +159 -3
- package/_bundled_plugin/scripts/workbench_publication.py +2 -3
- package/_bundled_plugin/scripts/workbench_remediation.py +142 -2
- package/_bundled_plugin/scripts/workbench_saved_results.py +48 -8
- package/_bundled_plugin/scripts/workbench_scan_history.py +291 -134
- package/_bundled_plugin/scripts/workbench_scan_start.py +208 -11
- package/_bundled_plugin/scripts/workbench_scan_usage.py +36 -10
- package/_bundled_plugin/scripts/workbench_schema.py +220 -14
- package/_bundled_plugin/scripts/workbench_setup.py +1 -1
- package/_bundled_plugin/scripts/workbench_source_scopes.py +8 -0
- package/_bundled_plugin/scripts/workbench_target.py +486 -85
- package/_bundled_plugin/scripts/workbench_target_state.py +1108 -22
- package/_bundled_plugin/shared/workbench-history-repairs.json +64 -14
- package/_bundled_plugin/shared/workbench-migrations.json +66 -0
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +4 -2
- package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +2 -2
- package/_bundled_plugin/skills/fix-finding/SKILL.md +1 -0
- package/_bundled_plugin/skills/publish-findings/SKILL.md +26 -160
- package/_bundled_plugin/skills/publish-findings/agents/openai.yaml +2 -2
- package/_bundled_plugin/skills/publish-findings/references/checkmarx-import.md +2 -2
- package/_bundled_plugin/skills/publish-findings/scripts/collect_checkmarx.py +3 -58
- 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/bin/codex-security.mjs +2 -2
- package/dist/api.d.ts +7 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +459 -157
- 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 +33 -12
- 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/blackduck-findings.d.ts +1 -1
- package/dist/blackduck-findings.d.ts.map +1 -1
- package/dist/blackduck-findings.js +5 -18
- package/dist/blackduck-findings.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/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-diagnostics.d.ts +10 -0
- package/dist/classify-severity-diagnostics.d.ts.map +1 -0
- package/dist/classify-severity-diagnostics.js +57 -0
- package/dist/classify-severity-diagnostics.js.map +1 -0
- package/dist/classify-severity-records.d.ts +4 -0
- package/dist/classify-severity-records.d.ts.map +1 -1
- package/dist/classify-severity-records.js +35 -8
- package/dist/classify-severity-records.js.map +1 -1
- package/dist/classify-severity.d.ts.map +1 -1
- package/dist/classify-severity.js +9 -6
- 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 +8 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1860 -903
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +33 -31
- 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-plan.d.ts.map +1 -1
- package/dist/component-plan.js +3 -3
- package/dist/component-plan.js.map +1 -1
- package/dist/component-scan.d.ts +3 -1
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +40 -7
- 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 +30 -1
- package/dist/config.js.map +1 -1
- package/dist/continuum-aws.d.ts +6 -0
- package/dist/continuum-aws.d.ts.map +1 -0
- package/dist/continuum-aws.js +202 -0
- package/dist/continuum-aws.js.map +1 -0
- package/dist/continuum-collector.d.ts +44 -0
- package/dist/continuum-collector.d.ts.map +1 -0
- package/dist/continuum-collector.js +266 -0
- package/dist/continuum-collector.js.map +1 -0
- package/dist/continuum-findings.d.ts +31 -2
- package/dist/continuum-findings.d.ts.map +1 -1
- package/dist/continuum-findings.js +497 -59
- package/dist/continuum-findings.js.map +1 -1
- package/dist/contract.d.ts +1 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +3 -0
- package/dist/contract.js.map +1 -1
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +1 -45
- package/dist/cost.js.map +1 -1
- package/dist/crowdstrike-findings.d.ts +7 -0
- package/dist/crowdstrike-findings.d.ts.map +1 -0
- package/dist/crowdstrike-findings.js +210 -0
- package/dist/crowdstrike-findings.js.map +1 -0
- 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 +3 -1
- package/dist/deduplication/local.d.ts.map +1 -1
- package/dist/deduplication/local.js +8 -1
- package/dist/deduplication/local.js.map +1 -1
- package/dist/deduplication/refusal.d.ts.map +1 -1
- package/dist/deduplication/refusal.js +2 -1
- package/dist/deduplication/refusal.js.map +1 -1
- package/dist/deduplication/scan.d.ts +2 -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-scan.d.ts.map +1 -1
- package/dist/deep-scan.js +16 -15
- package/dist/deep-scan.js.map +1 -1
- package/dist/endor-findings.d.ts +2 -2
- package/dist/endor-findings.d.ts.map +1 -1
- package/dist/endor-findings.js +6 -23
- package/dist/endor-findings.js.map +1 -1
- package/dist/errors.d.ts +3 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -3
- 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.map +1 -1
- package/dist/external-findings-import.js +12 -1
- package/dist/external-findings-import.js.map +1 -1
- package/dist/external-findings-local.d.ts +66 -4
- package/dist/external-findings-local.d.ts.map +1 -1
- package/dist/external-findings-local.js +258 -59
- package/dist/external-findings-local.js.map +1 -1
- package/dist/external-findings-publish.d.ts +6 -1
- package/dist/external-findings-publish.d.ts.map +1 -1
- package/dist/external-findings-publish.js +330 -1633
- package/dist/external-findings-publish.js.map +1 -1
- package/dist/external-findings-read.d.ts +11 -2
- package/dist/external-findings-read.d.ts.map +1 -1
- package/dist/external-findings-read.js +56 -53
- package/dist/external-findings-read.js.map +1 -1
- package/dist/external-findings.d.ts +1 -1
- package/dist/external-findings.d.ts.map +1 -1
- package/dist/external-findings.js +12 -1
- package/dist/external-findings.js.map +1 -1
- package/dist/external-import-contract.d.ts +6 -11
- package/dist/external-import-contract.d.ts.map +1 -1
- package/dist/external-import-contract.js +35 -177
- 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/finding-prompt.d.ts.map +1 -1
- package/dist/finding-prompt.js +2 -2
- package/dist/finding-prompt.js.map +1 -1
- package/dist/github-dependabot-findings.d.ts.map +1 -1
- package/dist/github-dependabot-findings.js +3 -4
- package/dist/github-dependabot-findings.js.map +1 -1
- package/dist/github-findings.d.ts.map +1 -1
- package/dist/github-findings.js +19 -287
- package/dist/github-findings.js.map +1 -1
- package/dist/host-protocol.d.ts +6 -0
- package/dist/host-protocol.d.ts.map +1 -1
- package/dist/host-protocol.js +11 -1
- package/dist/host-protocol.js.map +1 -1
- package/dist/host-records-protocol.d.ts +2 -0
- package/dist/host-records-protocol.d.ts.map +1 -1
- package/dist/host-records-protocol.js +4 -0
- package/dist/host-records-protocol.js.map +1 -1
- 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/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/inspector-findings.d.ts.map +1 -1
- package/dist/inspector-findings.js +19 -35
- 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 +34 -27
- 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 -4
- package/dist/local-git-metadata.js.map +1 -1
- package/dist/multiscan.d.ts +4 -0
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +83 -39
- package/dist/multiscan.js.map +1 -1
- package/dist/opengrep-findings.d.ts +4 -2
- package/dist/opengrep-findings.d.ts.map +1 -1
- package/dist/opengrep-findings.js +39 -22
- package/dist/opengrep-findings.js.map +1 -1
- package/dist/private-finding-import.d.ts +8 -13
- package/dist/private-finding-import.d.ts.map +1 -1
- package/dist/private-finding-import.js +69 -129
- package/dist/private-finding-import.js.map +1 -1
- package/dist/project-config-schema.d.ts +2 -0
- package/dist/project-config-schema.d.ts.map +1 -1
- package/dist/project-config-schema.js +1 -0
- package/dist/project-config-schema.js.map +1 -1
- package/dist/project-config.d.ts +1 -0
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +56 -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.map +1 -1
- package/dist/provider-profile.js +4 -9
- package/dist/provider-profile.js.map +1 -1
- package/dist/publication.d.ts +1 -1
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.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.map +1 -1
- package/dist/remediation.js +3 -1
- package/dist/remediation.js.map +1 -1
- package/dist/runtime.d.ts +35 -7
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +782 -153
- package/dist/runtime.js.map +1 -1
- package/dist/saved-scan-bootstrap.d.ts +6 -1
- package/dist/saved-scan-bootstrap.d.ts.map +1 -1
- package/dist/saved-scan-bootstrap.js +267 -115
- package/dist/saved-scan-bootstrap.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 +20 -2
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +26 -5
- package/dist/scan-comparison.js.map +1 -1
- package/dist/scan-dashboard.d.ts +1 -0
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +18 -2
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-executor.d.ts.map +1 -1
- package/dist/scan-executor.js +4 -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 +25 -9
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/scan-logs.d.ts.map +1 -1
- package/dist/scan-logs.js +28 -4
- package/dist/scan-logs.js.map +1 -1
- package/dist/scan-settings.d.ts +1 -0
- package/dist/scan-settings.d.ts.map +1 -1
- package/dist/scan-settings.js +1 -0
- package/dist/scan-settings.js.map +1 -1
- package/dist/scanner-import.d.ts +5 -11
- package/dist/scanner-import.d.ts.map +1 -1
- package/dist/scanner-import.js +16 -89
- package/dist/scanner-import.js.map +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.map +1 -1
- package/dist/semgrep-findings.js +14 -48
- package/dist/semgrep-findings.js.map +1 -1
- package/dist/semgrep-platform-findings.d.ts +20 -70
- package/dist/semgrep-platform-findings.d.ts.map +1 -1
- package/dist/semgrep-platform-findings.js +116 -333
- package/dist/semgrep-platform-findings.js.map +1 -1
- package/dist/severity-review.d.ts.map +1 -1
- package/dist/severity-review.js +1 -0
- package/dist/severity-review.js.map +1 -1
- package/dist/snyk-findings.d.ts +2 -0
- package/dist/snyk-findings.d.ts.map +1 -1
- package/dist/snyk-findings.js +5 -8
- package/dist/snyk-findings.js.map +1 -1
- package/dist/snyk-rest-findings.d.ts +3 -20
- package/dist/snyk-rest-findings.d.ts.map +1 -1
- package/dist/snyk-rest-findings.js +45 -217
- package/dist/snyk-rest-findings.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 +28 -30
- 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 +129 -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/targets.d.ts +8 -1
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +103 -23
- package/dist/targets.js.map +1 -1
- package/dist/tenable-findings.d.ts +1 -4
- package/dist/tenable-findings.d.ts.map +1 -1
- package/dist/tenable-findings.js.map +1 -1
- package/dist/trivy-findings.d.ts.map +1 -1
- package/dist/trivy-findings.js +0 -11
- package/dist/trivy-findings.js.map +1 -1
- package/dist/trusted-executable.d.ts +7 -0
- package/dist/trusted-executable.d.ts.map +1 -1
- package/dist/trusted-executable.js +148 -37
- package/dist/trusted-executable.js.map +1 -1
- package/dist/value.js +3 -1
- package/dist/value.js.map +1 -1
- package/dist/veracode-findings.d.ts +1 -3
- package/dist/veracode-findings.d.ts.map +1 -1
- package/dist/veracode-findings.js +13 -38
- 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/wiz-findings.d.ts +2 -2
- package/dist/wiz-findings.d.ts.map +1 -1
- package/dist/wiz-findings.js +14 -92
- package/dist/wiz-findings.js.map +1 -1
- package/docs/classify-severity-records.md +30 -0
- package/docs/cli.md +537 -124
- package/docs/findings-service.md +22 -9
- package/docs/hosted-remediation.md +13 -4
- package/docs/sdk.md +918 -0
- package/package.json +15 -6
- package/schemas/external-findings.schema.json +2 -1
- package/schemas/project-config.schema.json +5 -0
- package/dist/hosted-scanner-v1.d.ts +0 -6
- package/dist/hosted-scanner-v1.d.ts.map +0 -1
- package/dist/hosted-scanner-v1.js +0 -60
- package/dist/hosted-scanner-v1.js.map +0 -1
- package/dist/reader-selection.d.ts +0 -15
- package/dist/reader-selection.d.ts.map +0 -1
- package/dist/reader-selection.js +0 -89
- package/dist/reader-selection.js.map +0 -1
- package/dist/semgrep-platform-v1.d.ts +0 -6
- package/dist/semgrep-platform-v1.d.ts.map +0 -1
- package/dist/semgrep-platform-v1.js +0 -83
- package/dist/semgrep-platform-v1.js.map +0 -1
- package/dist/snyk-rest-v1.d.ts +0 -28
- package/dist/snyk-rest-v1.d.ts.map +0 -1
- package/dist/snyk-rest-v1.js +0 -132
- package/dist/snyk-rest-v1.js.map +0 -1
|
@@ -38,9 +38,8 @@ def require_tokenless_scan_owner(
|
|
|
38
38
|
"SELECT thread_id FROM workspaces WHERE id = ?", (scan["workspace_id"],)
|
|
39
39
|
).fetchone()[0]
|
|
40
40
|
if owner is None:
|
|
41
|
-
# Only a completed import is intentionally ownerless among registered scans.
|
|
42
41
|
completed_import = scan["launch_kind"] == "import" and scan["status"] == "complete"
|
|
43
|
-
if
|
|
42
|
+
if not completed_import:
|
|
44
43
|
raise SystemExit("This scan is awaiting its owning Codex thread.")
|
|
45
44
|
elif owner != model_thread_id:
|
|
46
45
|
raise SystemExit("This scan requires its owning Codex thread.")
|
|
@@ -231,30 +230,61 @@ def mark_handoff_delivered(
|
|
|
231
230
|
raise SystemExit(
|
|
232
231
|
"Codex Security handoff delivery is owned by another continuation."
|
|
233
232
|
)
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
updated = connection.execute(
|
|
237
|
-
"""
|
|
238
|
-
UPDATE scans
|
|
239
|
-
SET handoff_status = 'delivered', handoff_claimed_at = NULL,
|
|
240
|
-
updated_at = ?
|
|
241
|
-
WHERE id = ? AND handoff_status = 'pending'
|
|
242
|
-
AND handoff_claim_token = ?
|
|
243
|
-
""",
|
|
244
|
-
(timestamp, scan["id"], claim_token),
|
|
245
|
-
)
|
|
246
|
-
if updated.rowcount != 1:
|
|
247
|
-
raise SystemExit("Codex Security handoff delivery could not be recorded.")
|
|
248
|
-
if scan["mode"] != "deep":
|
|
249
|
-
connection.execute(
|
|
233
|
+
else:
|
|
234
|
+
updated = connection.execute(
|
|
250
235
|
"""
|
|
251
|
-
UPDATE
|
|
252
|
-
SET
|
|
253
|
-
phase_progress_unit = 'checks',
|
|
254
|
-
preflight_checks_total = 0, preflight_checks_completed = 0,
|
|
236
|
+
UPDATE scans
|
|
237
|
+
SET handoff_status = 'delivered', handoff_claimed_at = NULL,
|
|
255
238
|
updated_at = ?
|
|
256
|
-
WHERE
|
|
239
|
+
WHERE id = ? AND handoff_status = 'pending'
|
|
240
|
+
AND handoff_claim_token = ?
|
|
257
241
|
""",
|
|
258
|
-
(timestamp, scan["id"]),
|
|
242
|
+
(timestamp, scan["id"], claim_token),
|
|
259
243
|
)
|
|
260
|
-
|
|
244
|
+
if updated.rowcount != 1:
|
|
245
|
+
raise SystemExit("Codex Security handoff delivery could not be recorded.")
|
|
246
|
+
if scan["mode"] != "deep":
|
|
247
|
+
connection.execute(
|
|
248
|
+
"""
|
|
249
|
+
UPDATE scan_progress
|
|
250
|
+
SET phase_items_total = 0, phase_items_completed = 0,
|
|
251
|
+
phase_progress_unit = 'checks',
|
|
252
|
+
preflight_checks_total = 0, preflight_checks_completed = 0,
|
|
253
|
+
updated_at = ?
|
|
254
|
+
WHERE scan_id = ?
|
|
255
|
+
""",
|
|
256
|
+
(timestamp, scan["id"]),
|
|
257
|
+
)
|
|
258
|
+
began_review = (
|
|
259
|
+
args.return_context
|
|
260
|
+
and thread_id is not None
|
|
261
|
+
and args.occurrence_id is None
|
|
262
|
+
and scan["mode"] == "standard"
|
|
263
|
+
and scan["status"] == "running"
|
|
264
|
+
and scan["canceled_at"] is None
|
|
265
|
+
and scan["phase"] == "preflight"
|
|
266
|
+
)
|
|
267
|
+
if began_review:
|
|
268
|
+
connection.execute(
|
|
269
|
+
"UPDATE scans SET phase = 'threat_model', updated_at = ? WHERE id = ?",
|
|
270
|
+
(timestamp, scan_id),
|
|
271
|
+
)
|
|
272
|
+
connection.execute(
|
|
273
|
+
"""UPDATE scan_progress SET phase_items_total = 0, phase_items_completed = 0,
|
|
274
|
+
phase_progress_unit = NULL, updated_at = ? WHERE scan_id = ?""",
|
|
275
|
+
(timestamp, scan_id),
|
|
276
|
+
)
|
|
277
|
+
if not args.return_context:
|
|
278
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
279
|
+
context = wb.get_scan(
|
|
280
|
+
connection,
|
|
281
|
+
argparse.Namespace(
|
|
282
|
+
scan_id=scan_id,
|
|
283
|
+
occurrence_id=args.occurrence_id,
|
|
284
|
+
model_thread_id=thread_id or "",
|
|
285
|
+
context_claim_token=claim_token,
|
|
286
|
+
),
|
|
287
|
+
)
|
|
288
|
+
if began_review:
|
|
289
|
+
context["beganStandardReview"] = True
|
|
290
|
+
return context
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import hashlib
|
|
5
6
|
import os
|
|
6
7
|
import sqlite3
|
|
7
8
|
import tempfile
|
|
@@ -35,18 +36,37 @@ def worker_usage_directory(scan_id: str) -> Path:
|
|
|
35
36
|
return state_dir() / "codex-home" / "worker-usage" / scan_id
|
|
36
37
|
|
|
37
38
|
|
|
39
|
+
def short_archive_prefix(original_name: str) -> str:
|
|
40
|
+
"""Bind a short archive name to the complete original filename."""
|
|
41
|
+
return f".previous-{hashlib.sha256(os.fsencode(original_name)).hexdigest()}-"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def archive_source_directory(archive: Path, source: Path) -> Path | None:
|
|
45
|
+
"""Return the original sibling when the archived name identifies it."""
|
|
46
|
+
if not source.is_relative_to(archive.parent):
|
|
47
|
+
return None
|
|
48
|
+
parts = source.relative_to(archive.parent).parts
|
|
49
|
+
if not parts or ".." in parts:
|
|
50
|
+
return None
|
|
51
|
+
name = parts[0]
|
|
52
|
+
if archive.name.startswith(f"{name}.previous-") or (
|
|
53
|
+
archive.name.startswith(".previous-")
|
|
54
|
+
and archive.name.startswith(short_archive_prefix(name))
|
|
55
|
+
):
|
|
56
|
+
return archive.parent / name
|
|
57
|
+
return None
|
|
58
|
+
|
|
59
|
+
|
|
38
60
|
def archived_deep_path(scan_dir: Path, value: str | None) -> str | None:
|
|
39
61
|
"""Resolve old archive rows that still name the original sibling output."""
|
|
40
62
|
if value is None or ".previous-" not in scan_dir.name:
|
|
41
63
|
return value
|
|
42
64
|
path = Path(value)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
parts = path.relative_to(scan_dir.parent).parts
|
|
46
|
-
if not parts or ".." in parts or not scan_dir.name.startswith(f"{parts[0]}.previous-"):
|
|
65
|
+
original = archive_source_directory(scan_dir, path)
|
|
66
|
+
if original is None:
|
|
47
67
|
return value
|
|
48
68
|
# Keep missing files inside the archive too. Never follow the replacement scan's output.
|
|
49
|
-
return str(scan_dir.
|
|
69
|
+
return str(scan_dir / path.relative_to(original))
|
|
50
70
|
|
|
51
71
|
|
|
52
72
|
def saved_deep_workers(connection: sqlite3.Connection, scan: sqlite3.Row) -> list[Any]:
|
|
@@ -222,11 +222,15 @@ def parse_args(description: str, *, inspection_only: bool = False) -> argparse.N
|
|
|
222
222
|
list_scans.add_argument("--status", choices=("running", "complete", "failed", "canceled"))
|
|
223
223
|
list_scans.add_argument("--mode", choices=MODES)
|
|
224
224
|
list_scans.add_argument("--repository")
|
|
225
|
+
list_scans.add_argument(
|
|
226
|
+
"--prefer-worktree", action="store_true", help="List scans from this checkout first."
|
|
227
|
+
)
|
|
225
228
|
list_scans.add_argument("--scan-root")
|
|
226
229
|
list_scans.add_argument("--offset", type=non_negative_int, default=0)
|
|
227
230
|
list_scans.add_argument("--limit", type=positive_int)
|
|
228
231
|
|
|
229
232
|
list_unmatched_scan_pairs = add_command("list-unmatched-scan-pairs", "--repository")
|
|
233
|
+
list_unmatched_scan_pairs.add_argument("--after-scan-id")
|
|
230
234
|
list_unmatched_scan_pairs.add_argument("--force", action="store_true")
|
|
231
235
|
|
|
232
236
|
register_cli_scan = add_command("register-cli-scan", "--scan-dir", "--repository")
|
|
@@ -242,7 +246,17 @@ def parse_args(description: str, *, inspection_only: bool = False) -> argparse.N
|
|
|
242
246
|
)
|
|
243
247
|
register_cli_scan.add_argument("--archived-scan-dir")
|
|
244
248
|
|
|
245
|
-
|
|
249
|
+
restore_cli_scan_archive = subparsers.add_parser("restore-cli-scan-archive")
|
|
250
|
+
restore_cli_scan_archive.add_argument("--scan-dir", required=True)
|
|
251
|
+
restore_cli_scan_archive.add_argument("--archived-scan-dir", required=True)
|
|
252
|
+
previous_scan = restore_cli_scan_archive.add_mutually_exclusive_group(required=True)
|
|
253
|
+
previous_scan.add_argument("--previous-scan-id")
|
|
254
|
+
previous_scan.add_argument("--previous-scan-absent", action="store_true")
|
|
255
|
+
|
|
256
|
+
set_scan_thread = subparsers.add_parser("set-scan-thread")
|
|
257
|
+
set_scan_thread.add_argument("--scan-id", required=True)
|
|
258
|
+
set_scan_thread.add_argument("--thread-id", required=True)
|
|
259
|
+
set_scan_thread.add_argument("--time-budget-started-at")
|
|
246
260
|
|
|
247
261
|
set_scan_cost_limit = add_command("set-scan-cost-limit", "--scan-id")
|
|
248
262
|
set_scan_cost_limit.add_argument("--max-cost-usd", required=True, type=float)
|
|
@@ -270,7 +284,9 @@ def parse_args(description: str, *, inspection_only: bool = False) -> argparse.N
|
|
|
270
284
|
list_global_findings.add_argument("--query")
|
|
271
285
|
list_global_findings.add_argument("--severity", choices=FINDING_SEVERITIES)
|
|
272
286
|
list_global_findings.add_argument("--status", choices=FINDING_STATUSES)
|
|
273
|
-
list_global_findings.
|
|
287
|
+
finding_repository = list_global_findings.add_mutually_exclusive_group()
|
|
288
|
+
finding_repository.add_argument("--target-id")
|
|
289
|
+
finding_repository.add_argument("--repository")
|
|
274
290
|
list_global_findings.add_argument("--offset", type=non_negative_int, default=0)
|
|
275
291
|
list_global_findings.add_argument("--limit", type=positive_int, default=FINDINGS_PAGE_MAX)
|
|
276
292
|
list_repositories = subparsers.add_parser("list-repositories")
|
|
@@ -288,6 +304,10 @@ def parse_args(description: str, *, inspection_only: bool = False) -> argparse.N
|
|
|
288
304
|
list_findings.add_argument("--limit", type=positive_int, default=FINDINGS_PAGE_MAX)
|
|
289
305
|
|
|
290
306
|
update_progress = add_command("update-progress", "--scan-id")
|
|
307
|
+
update_progress.add_argument("--model-update", action="store_true")
|
|
308
|
+
update_progress.add_argument(
|
|
309
|
+
"--refresh-scope-file-count", action="store_true", help=argparse.SUPPRESS
|
|
310
|
+
)
|
|
291
311
|
update_progress.add_argument("--model-thread-id")
|
|
292
312
|
update_progress.add_argument("--phase", choices=PHASES)
|
|
293
313
|
update_progress.add_argument("--phase-items-total", type=non_negative_int)
|
|
@@ -359,6 +379,8 @@ def parse_args(description: str, *, inspection_only: bool = False) -> argparse.N
|
|
|
359
379
|
|
|
360
380
|
mark_handoff_delivered = add_command("mark-handoff-delivered", "--scan-id", "--claim-token")
|
|
361
381
|
mark_handoff_delivered.add_argument("--thread-id")
|
|
382
|
+
mark_handoff_delivered.add_argument("--return-context", action="store_true")
|
|
383
|
+
mark_handoff_delivered.add_argument("--occurrence-id")
|
|
362
384
|
|
|
363
385
|
claim_handoff_delivery = add_command("claim-handoff-delivery", "--scan-id", "--claim-token")
|
|
364
386
|
claim_handoff_delivery.add_argument("--take-over-stale", action="store_true")
|