@openai/codex-security 0.2.0 → 0.3.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 +437 -2692
- package/_bundled_plugin/.app.json +5 -1
- package/_bundled_plugin/.codex-plugin/plugin.json +9 -5
- package/_bundled_plugin/.mcp.json +2 -0
- package/_bundled_plugin/examples/completed-scan/coverage.json +0 -1
- package/_bundled_plugin/examples/completed-scan/report.md +28 -26
- package/_bundled_plugin/examples/completed-scan/scan-manifest.json +1 -1
- package/_bundled_plugin/mcp/helpers.mjs +1 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/native/THIRD_PARTY_NOTICES.txt +6 -213
- 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/permission-profile-preflight.mjs +563 -0
- package/_bundled_plugin/mcp/server.mjs +1 -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/preflight/capability-profiles.toml +0 -13
- package/_bundled_plugin/references/artifact-storage.md +2 -2
- package/_bundled_plugin/references/config-preflight.md +0 -4
- package/_bundled_plugin/references/core-scan.md +21 -9
- package/_bundled_plugin/references/final-report.md +10 -12
- package/_bundled_plugin/references/finding-detail-fields.md +90 -80
- package/_bundled_plugin/references/sarif-adapter.md +1 -1
- package/_bundled_plugin/references/scan-artifacts.md +1 -2
- package/_bundled_plugin/references/scan-contract.md +9 -4
- package/_bundled_plugin/references/scan-prologue.md +12 -0
- package/_bundled_plugin/references/security-guidance.md +2 -2
- package/_bundled_plugin/references/standalone-validation.md +11 -0
- package/_bundled_plugin/references/threat-model.md +1 -1
- package/_bundled_plugin/schemas/coverage.schema.json +1 -47
- package/_bundled_plugin/schemas/definitions/artifact-common.schema.json +2 -24
- package/_bundled_plugin/schemas/definitions/discovery-candidate.schema.json +49 -25
- package/_bundled_plugin/schemas/findings.schema.json +71 -192
- package/_bundled_plugin/schemas/scan-manifest.schema.json +18 -45
- package/_bundled_plugin/schemas/tools/candidate-attack-paths.schema.json +91 -83
- package/_bundled_plugin/schemas/tools/candidate-validations.schema.json +35 -64
- package/_bundled_plugin/schemas/tools/deep-reducer.schema.json +5 -2
- package/_bundled_plugin/schemas/tools/discovery-candidates.schema.json +6 -55
- package/_bundled_plugin/schemas/tools/review-items.schema.json +2 -38
- package/_bundled_plugin/schemas/tools/scan-draft.schema.json +169 -294
- package/_bundled_plugin/scripts/codex_profile.mjs +239 -0
- package/_bundled_plugin/scripts/codex_session.mjs +53 -0
- package/_bundled_plugin/scripts/config_preflight.py +26 -62
- package/_bundled_plugin/scripts/deep_scan_config.py +9 -11
- package/_bundled_plugin/scripts/deep_scan_workbench.py +129 -150
- package/_bundled_plugin/scripts/finalize_scan_contract.py +315 -232
- package/_bundled_plugin/scripts/finding_preview.py +39 -9
- package/_bundled_plugin/scripts/generate_in_scope_files.py +27 -77
- package/_bundled_plugin/scripts/generate_rank_input.py +99 -829
- package/_bundled_plugin/scripts/launch_codex_security_mcp +35 -10
- package/_bundled_plugin/scripts/launch_codex_security_mcp.cmd +5 -5
- package/_bundled_plugin/scripts/rank_preview.py +42 -918
- package/_bundled_plugin/scripts/report_projection.py +117 -172
- package/_bundled_plugin/scripts/snapshot_sqlite.py +6 -1
- package/_bundled_plugin/scripts/threat_model_projection.py +4 -7
- package/_bundled_plugin/scripts/validate_scan_contract.py +4 -34
- package/_bundled_plugin/scripts/validate_tracking_source.py +3 -13
- package/_bundled_plugin/scripts/windows_scan_local_files.py +48 -3
- package/_bundled_plugin/scripts/workbench/handoff.py +25 -50
- package/_bundled_plugin/scripts/workbench/runtime_toml.py +22 -0
- package/_bundled_plugin/scripts/workbench/storage.py +10 -6
- package/_bundled_plugin/scripts/workbench_cli.py +94 -179
- package/_bundled_plugin/scripts/workbench_db.py +427 -463
- package/_bundled_plugin/scripts/workbench_feedback.py +6 -3
- package/_bundled_plugin/scripts/workbench_finding_index.py +19 -1
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +18 -4
- package/_bundled_plugin/scripts/workbench_local_dedupe.py +136 -0
- package/_bundled_plugin/scripts/workbench_native_indexes.py +27 -14
- package/_bundled_plugin/scripts/workbench_progress.py +14 -58
- package/_bundled_plugin/scripts/workbench_publication.py +33 -57
- package/_bundled_plugin/scripts/workbench_remediation.py +12 -0
- package/_bundled_plugin/scripts/workbench_saved_results.py +172 -49
- package/_bundled_plugin/scripts/workbench_scan_history.py +57 -57
- package/_bundled_plugin/scripts/workbench_scan_start.py +105 -41
- package/_bundled_plugin/scripts/workbench_scan_usage.py +23 -34
- package/_bundled_plugin/scripts/workbench_schema.py +37 -1151
- package/_bundled_plugin/scripts/workbench_source_excerpt.py +11 -1
- package/_bundled_plugin/scripts/workbench_target.py +430 -142
- package/_bundled_plugin/scripts/workbench_validation.py +16 -27
- package/_bundled_plugin/shared/workbench-history-repairs.json +218 -0
- package/_bundled_plugin/shared/workbench-migrations.json +397 -0
- package/_bundled_plugin/skills/assess-patch-risk/SKILL.md +15 -4
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +1 -0
- package/_bundled_plugin/skills/cloud-findings/SKILL.md +54 -0
- package/_bundled_plugin/skills/cloud-findings/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +3 -3
- package/_bundled_plugin/skills/deep-security-scan/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/finding-discovery/SKILL.md +3 -3
- package/_bundled_plugin/skills/propose-security-hardening/references/proposal-format.md +50 -20
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +8 -14
- package/_bundled_plugin/skills/security-diff-scan/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/security-scan/SKILL.md +22 -7
- package/_bundled_plugin/skills/security-scan/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +1 -1
- package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +13 -1
- package/_bundled_plugin/skills/threat-model/SKILL.md +1 -1
- package/_bundled_plugin/skills/track-findings/SKILL.md +46 -178
- package/_bundled_plugin/skills/track-findings/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/track-findings/references/github-security-advisories.md +16 -24
- package/_bundled_plugin/skills/track-findings/references/jira.md +15 -61
- package/_bundled_plugin/skills/triage-finding/SKILL.md +50 -289
- package/_bundled_plugin/skills/triage-finding/agents/openai.yaml +2 -2
- package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +23 -43
- package/_bundled_plugin/skills/triage-finding/references/triage-result-contract.md +7 -1
- package/bin/codex-security.mjs +9 -2
- package/dist/api.d.ts +60 -10
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +803 -380
- package/dist/api.js.map +1 -1
- package/dist/artifact-export.d.ts +1 -1
- package/dist/artifact-export.d.ts.map +1 -1
- package/dist/artifact-export.js +28 -13
- package/dist/artifact-export.js.map +1 -1
- package/dist/auth.d.ts +2 -6
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +19 -9
- package/dist/auth.js.map +1 -1
- package/dist/bulk-scan-discovery.d.ts.map +1 -1
- package/dist/bulk-scan-discovery.js +1 -0
- package/dist/bulk-scan-discovery.js.map +1 -1
- package/dist/classify-severity.d.ts +26 -9
- package/dist/classify-severity.d.ts.map +1 -1
- package/dist/classify-severity.js +13 -30
- package/dist/classify-severity.js.map +1 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +17 -13
- package/dist/cli-help.js.map +1 -1
- package/dist/cli-signals.d.ts +8 -0
- package/dist/cli-signals.d.ts.map +1 -0
- package/dist/cli-signals.js +28 -0
- package/dist/cli-signals.js.map +1 -0
- package/dist/cli.d.ts +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1087 -900
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +10 -9
- package/dist/cloud-publish.js.map +1 -1
- package/dist/codeowners.d.ts +19 -0
- package/dist/codeowners.d.ts.map +1 -0
- package/dist/codeowners.js +138 -0
- package/dist/codeowners.js.map +1 -0
- package/dist/codex-sdk-environment.d.ts +1 -0
- package/dist/codex-sdk-environment.d.ts.map +1 -1
- package/dist/codex-sdk-environment.js +40 -2
- package/dist/codex-sdk-environment.js.map +1 -1
- package/dist/component-plan.d.ts +2 -5
- package/dist/component-plan.d.ts.map +1 -1
- package/dist/component-plan.js +38 -30
- package/dist/component-plan.js.map +1 -1
- package/dist/component-scan.d.ts +6 -5
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +23 -35
- package/dist/component-scan.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +64 -74
- package/dist/config.js.map +1 -1
- package/dist/contract.d.ts +15 -3
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +87 -252
- package/dist/contract.js.map +1 -1
- package/dist/cost-model.d.ts +13 -6
- package/dist/cost-model.d.ts.map +1 -1
- package/dist/cost-model.js +14 -4
- package/dist/cost-model.js.map +1 -1
- package/dist/cost.d.ts +10 -2
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +102 -104
- package/dist/cost.js.map +1 -1
- package/dist/custom-validation-prompt.d.ts.map +1 -1
- package/dist/custom-validation-prompt.js +6 -5
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/custom-validation.d.ts +1 -2
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +9 -3
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/checkpointed-review.d.ts +4 -2
- package/dist/deduplication/checkpointed-review.d.ts.map +1 -1
- package/dist/deduplication/checkpointed-review.js +23 -9
- package/dist/deduplication/checkpointed-review.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts +7 -1
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +126 -17
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/deduplication-prompts.d.ts +5 -2
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
- package/dist/deduplication/deduplication-prompts.js +18 -4
- package/dist/deduplication/deduplication-prompts.js.map +1 -1
- package/dist/deduplication/deduplication-reviewer.d.ts +26 -4
- package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
- package/dist/deduplication/deduplication-reviewer.js +57 -47
- package/dist/deduplication/deduplication-reviewer.js.map +1 -1
- package/dist/deduplication/deduplication.d.ts.map +1 -1
- package/dist/deduplication/deduplication.js +19 -51
- package/dist/deduplication/deduplication.js.map +1 -1
- package/dist/deduplication/diagnostics.d.ts +17 -0
- package/dist/deduplication/diagnostics.d.ts.map +1 -0
- package/dist/deduplication/diagnostics.js +5 -0
- package/dist/deduplication/diagnostics.js.map +1 -0
- package/dist/deduplication/finding-schema.d.ts.map +1 -1
- package/dist/deduplication/finding-schema.js +7 -1
- package/dist/deduplication/finding-schema.js.map +1 -1
- package/dist/deduplication/local.d.ts +31 -0
- package/dist/deduplication/local.d.ts.map +1 -0
- package/dist/deduplication/local.js +166 -0
- package/dist/deduplication/local.js.map +1 -0
- package/dist/deduplication/records-protocol.d.ts.map +1 -1
- package/dist/deduplication/records-protocol.js +11 -24
- package/dist/deduplication/records-protocol.js.map +1 -1
- package/dist/deduplication/records.d.ts +186 -11
- package/dist/deduplication/records.d.ts.map +1 -1
- package/dist/deduplication/records.js +10 -18
- package/dist/deduplication/records.js.map +1 -1
- package/dist/deduplication/scan.d.ts +9 -3
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +158 -39
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/deep-config.d.ts +2 -1
- package/dist/deep-config.d.ts.map +1 -1
- package/dist/deep-config.js +4 -4
- package/dist/deep-config.js.map +1 -1
- package/dist/deep-progress.d.ts +2 -0
- package/dist/deep-progress.d.ts.map +1 -1
- package/dist/deep-progress.js +13 -10
- package/dist/deep-progress.js.map +1 -1
- package/dist/deep-scan.d.ts +20 -0
- package/dist/deep-scan.d.ts.map +1 -0
- package/dist/deep-scan.js +113 -0
- package/dist/deep-scan.js.map +1 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -0
- package/dist/errors.js.map +1 -1
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +53 -21
- package/dist/feedback.js.map +1 -1
- package/dist/finding-catalogue.d.ts.map +1 -1
- package/dist/finding-catalogue.js +4 -8
- package/dist/finding-catalogue.js.map +1 -1
- package/dist/finding-normalization.d.ts +5 -0
- package/dist/finding-normalization.d.ts.map +1 -0
- package/dist/finding-normalization.js +120 -0
- package/dist/finding-normalization.js.map +1 -0
- package/dist/finding-retrieval.d.ts +9 -0
- package/dist/finding-retrieval.d.ts.map +1 -1
- package/dist/finding-retrieval.js.map +1 -1
- package/dist/finding-workflow.d.ts +13 -8
- package/dist/finding-workflow.d.ts.map +1 -1
- package/dist/finding-workflow.js +14 -6
- package/dist/finding-workflow.js.map +1 -1
- package/dist/findings-client.d.ts +2 -1
- package/dist/findings-client.d.ts.map +1 -1
- package/dist/findings-client.js +36 -9
- package/dist/findings-client.js.map +1 -1
- package/dist/findings-errors.d.ts +16 -0
- package/dist/findings-errors.d.ts.map +1 -0
- package/dist/findings-errors.js +24 -0
- package/dist/findings-errors.js.map +1 -0
- package/dist/findings-import.d.ts +1 -1
- package/dist/findings-import.d.ts.map +1 -1
- package/dist/findings-import.js +12 -30
- package/dist/findings-import.js.map +1 -1
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +7 -1
- package/dist/github.js.map +1 -1
- package/dist/import-scan.d.ts.map +1 -1
- package/dist/import-scan.js +48 -38
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.d.ts +7 -1
- package/dist/knowledge-base.d.ts.map +1 -1
- package/dist/knowledge-base.js +114 -46
- package/dist/knowledge-base.js.map +1 -1
- package/dist/linear.d.ts.map +1 -1
- package/dist/linear.js +2 -7
- package/dist/linear.js.map +1 -1
- package/dist/mock-scan.d.ts.map +1 -1
- package/dist/mock-scan.js +0 -1
- package/dist/mock-scan.js.map +1 -1
- package/dist/models.d.ts +0 -2
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/multiscan.d.ts +9 -3
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +193 -126
- package/dist/multiscan.js.map +1 -1
- package/dist/owner-evidence.d.ts +10 -2
- package/dist/owner-evidence.d.ts.map +1 -1
- package/dist/owner-evidence.js +67 -8
- package/dist/owner-evidence.js.map +1 -1
- package/dist/patch-tui.d.ts.map +1 -1
- package/dist/patch-tui.js +3 -2
- package/dist/patch-tui.js.map +1 -1
- package/dist/project-config.js +3 -3
- package/dist/project-config.js.map +1 -1
- package/dist/provider-profile.d.ts +21 -0
- package/dist/provider-profile.d.ts.map +1 -0
- package/dist/provider-profile.js +133 -0
- package/dist/provider-profile.js.map +1 -0
- package/dist/publication-events.d.ts +6 -8
- package/dist/publication-events.d.ts.map +1 -1
- package/dist/publication-events.js +25 -50
- package/dist/publication-events.js.map +1 -1
- package/dist/publication-store.d.ts.map +1 -1
- package/dist/publication-store.js +40 -64
- package/dist/publication-store.js.map +1 -1
- package/dist/publication.d.ts +1 -2
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +2 -8
- package/dist/publication.js.map +1 -1
- package/dist/publish.d.ts +1 -5
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +109 -160
- package/dist/publish.js.map +1 -1
- package/dist/request-metadata.d.ts +9 -0
- package/dist/request-metadata.d.ts.map +1 -0
- package/dist/request-metadata.js +13 -0
- package/dist/request-metadata.js.map +1 -0
- package/dist/runtime.d.ts +15 -4
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +430 -138
- package/dist/runtime.js.map +1 -1
- package/dist/saved-scan-bootstrap.d.ts +14 -0
- package/dist/saved-scan-bootstrap.d.ts.map +1 -0
- package/dist/saved-scan-bootstrap.js +261 -0
- package/dist/saved-scan-bootstrap.js.map +1 -0
- package/dist/saved-scan.d.ts +1 -1
- package/dist/saved-scan.d.ts.map +1 -1
- package/dist/saved-scan.js +6 -12
- package/dist/saved-scan.js.map +1 -1
- package/dist/scan-activity.js +11 -8
- package/dist/scan-activity.js.map +1 -1
- package/dist/scan-comparison.d.ts +28 -15
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +276 -281
- package/dist/scan-comparison.js.map +1 -1
- package/dist/scan-dashboard.d.ts +3 -0
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +345 -77
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +54 -13
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/scan-inputs.d.ts +6 -0
- package/dist/scan-inputs.d.ts.map +1 -0
- package/dist/scan-inputs.js +71 -0
- package/dist/scan-inputs.js.map +1 -0
- package/dist/scan-logs.d.ts +2 -3
- package/dist/scan-logs.d.ts.map +1 -1
- package/dist/scan-logs.js +12 -6
- package/dist/scan-logs.js.map +1 -1
- package/dist/scan-sessions.d.ts +4 -0
- package/dist/scan-sessions.d.ts.map +1 -1
- package/dist/scan-sessions.js +17 -0
- package/dist/scan-sessions.js.map +1 -1
- package/dist/scan-skill-paths.d.ts +8 -0
- package/dist/scan-skill-paths.d.ts.map +1 -0
- package/dist/scan-skill-paths.js +47 -0
- package/dist/scan-skill-paths.js.map +1 -0
- package/dist/security-policy-cli.d.ts.map +1 -1
- package/dist/security-policy-cli.js +7 -27
- package/dist/security-policy-cli.js.map +1 -1
- package/dist/security-policy.d.ts +9 -5
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js +33 -14
- package/dist/security-policy.js.map +1 -1
- package/dist/server/api.d.ts +0 -1
- package/dist/server/api.d.ts.map +1 -1
- package/dist/server/api.js +0 -1
- package/dist/server/api.js.map +1 -1
- package/dist/server/embeddings.d.ts +3 -1
- package/dist/server/embeddings.d.ts.map +1 -1
- package/dist/server/embeddings.js +10 -3
- package/dist/server/embeddings.js.map +1 -1
- package/dist/server/errors.d.ts +5 -2
- package/dist/server/errors.d.ts.map +1 -1
- package/dist/server/errors.js +7 -0
- package/dist/server/errors.js.map +1 -1
- package/dist/server/sqlite-store.d.ts +0 -2
- package/dist/server/sqlite-store.d.ts.map +1 -1
- package/dist/server/sqlite-store.js +54 -44
- package/dist/server/sqlite-store.js.map +1 -1
- package/dist/server/storage.d.ts +0 -2
- package/dist/server/storage.d.ts.map +1 -1
- package/dist/server/storage.js.map +1 -1
- package/dist/severity-store.js +19 -24
- package/dist/severity-store.js.map +1 -1
- package/dist/standalone-validation-prompt.d.ts +2 -0
- package/dist/standalone-validation-prompt.d.ts.map +1 -0
- package/dist/standalone-validation-prompt.js +10 -0
- package/dist/standalone-validation-prompt.js.map +1 -0
- package/dist/suggest-owners.d.ts +4 -2
- package/dist/suggest-owners.d.ts.map +1 -1
- package/dist/suggest-owners.js +11 -5
- package/dist/suggest-owners.js.map +1 -1
- package/dist/targets.d.ts +11 -0
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +106 -47
- package/dist/targets.js.map +1 -1
- package/dist/trusted-executable.d.ts +2 -2
- package/dist/trusted-executable.d.ts.map +1 -1
- package/dist/trusted-executable.js +8 -6
- package/dist/trusted-executable.js.map +1 -1
- package/dist/value.js +7 -0
- package/dist/value.js.map +1 -1
- package/dist/version.js.map +1 -1
- package/dist/workbench-arguments.d.ts +3 -0
- package/dist/workbench-arguments.d.ts.map +1 -0
- package/dist/workbench-arguments.js +15 -0
- package/dist/workbench-arguments.js.map +1 -0
- package/dist/worker-progress.d.ts +1 -0
- package/dist/worker-progress.d.ts.map +1 -1
- package/dist/worker-progress.js +27 -12
- package/dist/worker-progress.js.map +1 -1
- package/docs/cli.md +1778 -0
- package/docs/findings-service.md +402 -0
- package/package.json +18 -19
- package/_bundled_plugin/schemas/tools/worker-threat-model.schema.json +0 -18
- package/_bundled_plugin/scripts/workbench_dashboard.py +0 -159
- package/_bundled_plugin/scripts/workbench_findings.py +0 -221
- package/_bundled_plugin/scripts/workbench_severity.py +0 -122
- package/_bundled_plugin/skills/assess-patch-risk/scripts/validate_patch_risk_assessment.py +0 -163
- package/dist/server/dashboard/THIRD_PARTY_NOTICES.txt +0 -276
- package/dist/server/dashboard/app.css +0 -2
- package/dist/server/dashboard/app.js +0 -66
- package/dist/server/dashboard/index.html +0 -18
- package/dist/server/dashboard-types.d.ts +0 -48
- package/dist/server/dashboard-types.d.ts.map +0 -1
- package/dist/server/dashboard-types.js +0 -2
- package/dist/server/dashboard-types.js.map +0 -1
- package/dist/server/dashboard.d.ts +0 -6
- package/dist/server/dashboard.d.ts.map +0 -1
- package/dist/server/dashboard.js +0 -59
- package/dist/server/dashboard.js.map +0 -1
- package/dist/server/index.d.ts +0 -2
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -6
- package/dist/server/index.js.map +0 -1
- package/dist/server/routes.d.ts +0 -7
- package/dist/server/routes.d.ts.map +0 -1
- package/dist/server/routes.js +0 -98
- package/dist/server/routes.js.map +0 -1
- package/dist/server/serve.d.ts +0 -2
- package/dist/server/serve.d.ts.map +0 -1
- package/dist/server/serve.js +0 -28
- package/dist/server/serve.js.map +0 -1
- package/dist/server/server.d.ts +0 -10
- package/dist/server/server.d.ts.map +0 -1
- package/dist/server/server.js +0 -16
- package/dist/server/server.js.map +0 -1
- package/dist/server/validation.d.ts +0 -17
- package/dist/server/validation.d.ts.map +0 -1
- package/dist/server/validation.js +0 -53
- package/dist/server/validation.js.map +0 -1
|
@@ -4,13 +4,16 @@ Windows does not implement Python's descriptor-relative ``dir_fd`` APIs or
|
|
|
4
4
|
``O_NOFOLLOW``. This module provides the three operations needed by the scan
|
|
5
5
|
finalizer without falling back to check-then-use path validation.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
and
|
|
9
|
-
open without ``FILE_SHARE_DELETE`` for the full
|
|
7
|
+
Scan-local reads, writes, and deletes open every directory with
|
|
8
|
+
``FILE_FLAG_OPEN_REPARSE_POINT`` and reject all reparse points, including junctions.
|
|
9
|
+
Directory handles remain open without ``FILE_SHARE_DELETE`` for the full
|
|
10
|
+
operation, which prevents an
|
|
10
11
|
already-validated ancestor from being renamed or replaced during a read,
|
|
11
12
|
write, or delete. Writes rename the exact temporary-file handle into place so
|
|
12
13
|
an attacker cannot substitute another file at the temporary name.
|
|
13
14
|
|
|
15
|
+
The snapshot helper copies junction metadata without opening the link target.
|
|
16
|
+
|
|
14
17
|
Importing this module and comparing streams work on every platform. Filesystem
|
|
15
18
|
operations raise ``WindowsScanLocalFileError`` outside Windows.
|
|
16
19
|
"""
|
|
@@ -202,6 +205,19 @@ if os.name == "nt":
|
|
|
202
205
|
]
|
|
203
206
|
_WriteFile.restype = wintypes.BOOL
|
|
204
207
|
|
|
208
|
+
_DeviceIoControl = _kernel32.DeviceIoControl
|
|
209
|
+
_DeviceIoControl.argtypes = [
|
|
210
|
+
wintypes.HANDLE,
|
|
211
|
+
wintypes.DWORD,
|
|
212
|
+
wintypes.LPVOID,
|
|
213
|
+
wintypes.DWORD,
|
|
214
|
+
wintypes.LPVOID,
|
|
215
|
+
wintypes.DWORD,
|
|
216
|
+
ctypes.POINTER(wintypes.DWORD),
|
|
217
|
+
wintypes.LPVOID,
|
|
218
|
+
]
|
|
219
|
+
_DeviceIoControl.restype = wintypes.BOOL
|
|
220
|
+
|
|
205
221
|
_FlushFileBuffers = _kernel32.FlushFileBuffers
|
|
206
222
|
_FlushFileBuffers.argtypes = [wintypes.HANDLE]
|
|
207
223
|
_FlushFileBuffers.restype = wintypes.BOOL
|
|
@@ -309,6 +325,34 @@ def _create_file(
|
|
|
309
325
|
return _OwnedHandle(int(handle))
|
|
310
326
|
|
|
311
327
|
|
|
328
|
+
def copy_directory_junction(source: Path, destination: Path) -> None:
|
|
329
|
+
"""Copy raw junction data to an empty directory without opening the link target."""
|
|
330
|
+
# MAXIMUM_REPARSE_DATA_BUFFER_SIZE, including the reparse data header.
|
|
331
|
+
data = ctypes.create_string_buffer(16 * 1024)
|
|
332
|
+
size = wintypes.DWORD()
|
|
333
|
+
for path, write in ((source, False), (destination, True)):
|
|
334
|
+
handle = _create_file(
|
|
335
|
+
path,
|
|
336
|
+
access=_GENERIC_WRITE if write else _FILE_READ_ATTRIBUTES,
|
|
337
|
+
share=_FILE_SHARE_READ | _FILE_SHARE_WRITE,
|
|
338
|
+
disposition=_OPEN_EXISTING,
|
|
339
|
+
flags=_FILE_FLAG_BACKUP_SEMANTICS | _FILE_FLAG_OPEN_REPARSE_POINT,
|
|
340
|
+
)
|
|
341
|
+
assert handle is not None
|
|
342
|
+
with handle:
|
|
343
|
+
if not _DeviceIoControl(
|
|
344
|
+
handle.value,
|
|
345
|
+
0x000900A4 if write else 0x000900A8, # FSCTL_SET/GET_REPARSE_POINT.
|
|
346
|
+
data if write else None,
|
|
347
|
+
size.value if write else 0,
|
|
348
|
+
None if write else data,
|
|
349
|
+
0 if write else len(data),
|
|
350
|
+
ctypes.byref(size),
|
|
351
|
+
None,
|
|
352
|
+
):
|
|
353
|
+
_raise_last_error("Copy directory junction", path)
|
|
354
|
+
|
|
355
|
+
|
|
312
356
|
def _attributes(handle: int) -> _FileAttributeTagInfo:
|
|
313
357
|
info = _FileAttributeTagInfo()
|
|
314
358
|
if not _GetFileInformationByHandleEx(
|
|
@@ -663,6 +707,7 @@ def atomic_write(
|
|
|
663
707
|
try:
|
|
664
708
|
_mark_handle_for_deletion(temp_handle.value)
|
|
665
709
|
except OSError:
|
|
710
|
+
# Cleanup must not replace the original write or rename failure.
|
|
666
711
|
pass
|
|
667
712
|
raise
|
|
668
713
|
|
|
@@ -4,7 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import argparse
|
|
6
6
|
import sqlite3
|
|
7
|
-
from collections.abc import Callable
|
|
8
7
|
from typing import Any
|
|
9
8
|
|
|
10
9
|
from workbench_validation import optional_text, require_uuid
|
|
@@ -51,21 +50,17 @@ def validate_handoff_delivery_thread(
|
|
|
51
50
|
|
|
52
51
|
|
|
53
52
|
def claim_handoff_delivery(
|
|
53
|
+
wb: Any,
|
|
54
54
|
connection: sqlite3.Connection,
|
|
55
55
|
args: argparse.Namespace,
|
|
56
|
-
*,
|
|
57
|
-
now: Callable[[], str],
|
|
58
|
-
require_scan: Callable[[sqlite3.Connection, str], sqlite3.Row],
|
|
59
|
-
stale_claim_before: Callable[[], str],
|
|
60
|
-
workspace_state: Callable[[sqlite3.Connection, str], dict[str, Any]],
|
|
61
56
|
) -> dict[str, Any]:
|
|
62
57
|
scan_id = require_uuid(args.scan_id, "scan-id")
|
|
63
58
|
claim_token = require_handoff_claim_token(args.claim_token)
|
|
64
|
-
timestamp = now()
|
|
59
|
+
timestamp = wb.now()
|
|
65
60
|
with connection:
|
|
66
|
-
scan = require_scan(connection, scan_id)
|
|
61
|
+
scan = wb.require_scan(connection, scan_id)
|
|
67
62
|
if scan["handoff_status"] != "pending" or scan["handoff_claim_token"] == claim_token:
|
|
68
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
63
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
69
64
|
updated = connection.execute(
|
|
70
65
|
"""
|
|
71
66
|
UPDATE scans
|
|
@@ -94,27 +89,24 @@ def claim_handoff_delivery(
|
|
|
94
89
|
timestamp,
|
|
95
90
|
scan["id"],
|
|
96
91
|
int(args.take_over_stale),
|
|
97
|
-
stale_claim_before(),
|
|
92
|
+
wb.stale_claim_before(),
|
|
98
93
|
),
|
|
99
94
|
)
|
|
100
95
|
if updated.rowcount != 1:
|
|
101
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
102
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
96
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
97
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
103
98
|
|
|
104
99
|
|
|
105
100
|
def release_handoff_delivery(
|
|
101
|
+
wb: Any,
|
|
106
102
|
connection: sqlite3.Connection,
|
|
107
103
|
args: argparse.Namespace,
|
|
108
|
-
*,
|
|
109
|
-
now: Callable[[], str],
|
|
110
|
-
require_scan: Callable[[sqlite3.Connection, str], sqlite3.Row],
|
|
111
|
-
workspace_state: Callable[[sqlite3.Connection, str], dict[str, Any]],
|
|
112
104
|
) -> dict[str, Any]:
|
|
113
105
|
scan_id = require_uuid(args.scan_id, "scan-id")
|
|
114
106
|
claim_token = require_handoff_claim_token(args.claim_token)
|
|
115
|
-
timestamp = now()
|
|
107
|
+
timestamp = wb.now()
|
|
116
108
|
with connection:
|
|
117
|
-
scan = require_scan(connection, scan_id)
|
|
109
|
+
scan = wb.require_scan(connection, scan_id)
|
|
118
110
|
connection.execute(
|
|
119
111
|
"""
|
|
120
112
|
UPDATE scans
|
|
@@ -126,16 +118,13 @@ def release_handoff_delivery(
|
|
|
126
118
|
""",
|
|
127
119
|
(timestamp, scan["id"], claim_token),
|
|
128
120
|
)
|
|
129
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
121
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
130
122
|
|
|
131
123
|
|
|
132
124
|
def attach_scan_continuation_thread(
|
|
125
|
+
wb: Any,
|
|
133
126
|
connection: sqlite3.Connection,
|
|
134
127
|
args: argparse.Namespace,
|
|
135
|
-
*,
|
|
136
|
-
now: Callable[[], str],
|
|
137
|
-
require_scan: Callable[[sqlite3.Connection, str], sqlite3.Row],
|
|
138
|
-
workspace_state: Callable[[sqlite3.Connection, str], dict[str, Any]],
|
|
139
128
|
) -> dict[str, Any]:
|
|
140
129
|
scan_id = require_uuid(args.scan_id, "scan-id")
|
|
141
130
|
claim_token = require_handoff_claim_token(args.claim_token)
|
|
@@ -143,9 +132,9 @@ def attach_scan_continuation_thread(
|
|
|
143
132
|
if thread_id is None:
|
|
144
133
|
raise SystemExit("Codex Security continuation thread ID is required.")
|
|
145
134
|
connection.execute("BEGIN IMMEDIATE")
|
|
146
|
-
|
|
147
|
-
timestamp = now()
|
|
148
|
-
scan = require_scan(connection, scan_id)
|
|
135
|
+
with connection:
|
|
136
|
+
timestamp = wb.now()
|
|
137
|
+
scan = wb.require_scan(connection, scan_id)
|
|
149
138
|
if scan["handoff_claim_token"] != claim_token:
|
|
150
139
|
raise SystemExit("Codex Security continuation thread claim token does not match.")
|
|
151
140
|
if scan["continuation_thread_id"] is not None:
|
|
@@ -154,8 +143,8 @@ def attach_scan_continuation_thread(
|
|
|
154
143
|
"Codex Security scan continuation is owned by another continuation."
|
|
155
144
|
)
|
|
156
145
|
connection.commit()
|
|
157
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
158
|
-
|
|
146
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
147
|
+
connection.execute(
|
|
159
148
|
"""
|
|
160
149
|
UPDATE scans
|
|
161
150
|
SET continuation_thread_id = ?,
|
|
@@ -168,33 +157,23 @@ def attach_scan_continuation_thread(
|
|
|
168
157
|
""",
|
|
169
158
|
(thread_id, thread_id, timestamp, scan["id"], claim_token),
|
|
170
159
|
)
|
|
171
|
-
|
|
172
|
-
raise SystemExit("Codex Security continuation thread could not be attached.")
|
|
173
|
-
connection.commit()
|
|
174
|
-
except BaseException:
|
|
175
|
-
connection.rollback()
|
|
176
|
-
raise
|
|
177
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
160
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
178
161
|
|
|
179
162
|
|
|
180
163
|
def mark_handoff_delivered(
|
|
164
|
+
wb: Any,
|
|
181
165
|
connection: sqlite3.Connection,
|
|
182
166
|
args: argparse.Namespace,
|
|
183
|
-
*,
|
|
184
|
-
now: Callable[[], str],
|
|
185
|
-
require_scan: Callable[[sqlite3.Connection, str], sqlite3.Row],
|
|
186
|
-
require_workspace: Callable[[sqlite3.Connection, str], sqlite3.Row],
|
|
187
|
-
workspace_state: Callable[[sqlite3.Connection, str], dict[str, Any]],
|
|
188
167
|
) -> dict[str, Any]:
|
|
189
168
|
scan_id = require_uuid(args.scan_id, "scan-id")
|
|
190
169
|
claim_token = require_handoff_claim_token(args.claim_token)
|
|
191
170
|
thread_id = optional_text(args.thread_id, maximum=512)
|
|
192
171
|
connection.execute("BEGIN IMMEDIATE")
|
|
193
|
-
|
|
194
|
-
timestamp = now()
|
|
195
|
-
scan = require_scan(connection, scan_id)
|
|
172
|
+
with connection:
|
|
173
|
+
timestamp = wb.now()
|
|
174
|
+
scan = wb.require_scan(connection, scan_id)
|
|
196
175
|
if thread_id is not None:
|
|
197
|
-
workspace = require_workspace(connection, scan["workspace_id"])
|
|
176
|
+
workspace = wb.require_workspace(connection, scan["workspace_id"])
|
|
198
177
|
validate_handoff_delivery_thread(
|
|
199
178
|
scan["continuation_thread_id"] or workspace["thread_id"],
|
|
200
179
|
thread_id,
|
|
@@ -206,7 +185,7 @@ def mark_handoff_delivered(
|
|
|
206
185
|
"Codex Security handoff delivery is owned by another continuation."
|
|
207
186
|
)
|
|
208
187
|
connection.commit()
|
|
209
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
188
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
210
189
|
updated = connection.execute(
|
|
211
190
|
"""
|
|
212
191
|
UPDATE scans
|
|
@@ -231,8 +210,4 @@ def mark_handoff_delivered(
|
|
|
231
210
|
""",
|
|
232
211
|
(timestamp, scan["id"]),
|
|
233
212
|
)
|
|
234
|
-
|
|
235
|
-
except BaseException:
|
|
236
|
-
connection.rollback()
|
|
237
|
-
raise
|
|
238
|
-
return workspace_state(connection, scan["workspace_id"])
|
|
213
|
+
return wb.workspace_state(connection, scan["workspace_id"])
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Load TOML using the supported Python runtime."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
__all__ = ["tomllib"]
|
|
6
|
+
|
|
7
|
+
if sys.version_info < (3, 10):
|
|
8
|
+
raise SystemExit(
|
|
9
|
+
"Codex Security requires Python 3.10 or later. Update the Codex managed runtime "
|
|
10
|
+
"or set PYTHON to a supported interpreter, then restart Codex."
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
import tomllib as tomllib
|
|
15
|
+
except ModuleNotFoundError: # Python 3.10
|
|
16
|
+
try:
|
|
17
|
+
import tomli as tomllib
|
|
18
|
+
except ModuleNotFoundError as exc:
|
|
19
|
+
raise SystemExit(
|
|
20
|
+
"Codex Security requires tomli with Python 3.10. Install tomli for the selected "
|
|
21
|
+
"interpreter or set PYTHON to Python 3.11 or later, then restart Codex."
|
|
22
|
+
) from exc
|
|
@@ -6,12 +6,16 @@ import os
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def state_dir() -> Path:
|
|
10
|
-
|
|
11
|
-
if
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
def state_dir(*, canonical: bool = True) -> Path:
|
|
10
|
+
configured = os.environ.get("CODEX_SECURITY_STATE_DIR")
|
|
11
|
+
if configured:
|
|
12
|
+
path = Path(configured).expanduser()
|
|
13
|
+
else:
|
|
14
|
+
codex_home = Path(
|
|
15
|
+
os.environ["CODEX_HOME"] if os.environ.get("CODEX_HOME", "").strip() else "~/.codex"
|
|
16
|
+
).expanduser()
|
|
17
|
+
path = codex_home / "state" / "plugins" / "codex-security"
|
|
18
|
+
return path.resolve() if canonical else path.absolute()
|
|
15
19
|
|
|
16
20
|
|
|
17
21
|
def resolve_scan_root(scan_root: str | None) -> Path:
|