@openai/codex-security 0.1.16 → 0.1.18
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 +228 -18
- package/_bundled_plugin/.app.json +1 -1
- package/_bundled_plugin/.mcp.json +10 -3
- 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/references/config-preflight.md +1 -1
- package/_bundled_plugin/references/core-scan.md +1 -1
- package/_bundled_plugin/references/final-report.md +4 -2
- package/_bundled_plugin/references/sarif-adapter.md +2 -0
- package/_bundled_plugin/references/scan-artifacts.md +1 -1
- package/_bundled_plugin/references/scan-contract.md +18 -7
- package/_bundled_plugin/schemas/scan-manifest.schema.json +2 -2
- package/_bundled_plugin/schemas/tools/scan-draft.schema.json +23 -0
- package/_bundled_plugin/scripts/deep_scan_workbench.py +122 -7
- package/_bundled_plugin/scripts/finalize_scan_contract.py +106 -38
- package/_bundled_plugin/scripts/generate_in_scope_files.py +20 -0
- package/_bundled_plugin/scripts/generate_rank_input.py +23 -7
- package/_bundled_plugin/scripts/launch_codex_security_mcp +32 -0
- package/_bundled_plugin/scripts/launch_codex_security_mcp.cmd +27 -0
- package/_bundled_plugin/scripts/report_projection.py +19 -8
- package/_bundled_plugin/scripts/workbench_cli.py +35 -15
- package/_bundled_plugin/scripts/workbench_db.py +184 -202
- package/_bundled_plugin/scripts/workbench_finding_index.py +101 -0
- package/_bundled_plugin/scripts/workbench_progress.py +6 -3
- package/_bundled_plugin/scripts/workbench_remediation.py +19 -0
- package/_bundled_plugin/scripts/workbench_saved_results.py +1289 -0
- package/_bundled_plugin/scripts/workbench_scan_history.py +17 -2
- package/_bundled_plugin/scripts/workbench_schema.py +28 -0
- package/_bundled_plugin/scripts/workbench_target.py +36 -5
- package/_bundled_plugin/scripts/workbench_validation.py +9 -0
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +4 -4
- package/_bundled_plugin/skills/fix-finding/SKILL.md +17 -1
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +1 -1
- package/_bundled_plugin/skills/security-scan/SKILL.md +1 -1
- package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +1 -1
- package/dist/api.d.ts +18 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +234 -18
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts +5 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +348 -43
- package/dist/cli.js.map +1 -1
- package/dist/component-plan.d.ts +15 -0
- package/dist/component-plan.d.ts.map +1 -0
- package/dist/component-plan.js +145 -0
- package/dist/component-plan.js.map +1 -0
- package/dist/component-scan.d.ts +83 -0
- package/dist/component-scan.d.ts.map +1 -0
- package/dist/component-scan.js +279 -0
- package/dist/component-scan.js.map +1 -0
- package/dist/contract.d.ts +8 -2
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +27 -8
- package/dist/contract.js.map +1 -1
- package/dist/cost-model.d.ts +20 -0
- package/dist/cost-model.d.ts.map +1 -0
- package/dist/cost-model.js +86 -0
- package/dist/cost-model.js.map +1 -0
- package/dist/cost.d.ts +2 -11
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +15 -98
- package/dist/cost.js.map +1 -1
- package/dist/custom-validation-prompt.d.ts +4 -0
- package/dist/custom-validation-prompt.d.ts.map +1 -0
- package/dist/custom-validation-prompt.js +94 -0
- package/dist/custom-validation-prompt.js.map +1 -0
- package/dist/custom-validation.d.ts +45 -0
- package/dist/custom-validation.d.ts.map +1 -0
- package/dist/custom-validation.js +292 -0
- package/dist/custom-validation.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +1 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/multiscan.d.ts +1 -0
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +53 -5
- package/dist/multiscan.js.map +1 -1
- package/dist/patch-tui.js +1 -1
- package/dist/patch-tui.js.map +1 -1
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +3 -4
- package/dist/publication.js.map +1 -1
- package/dist/runtime.d.ts +4 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +109 -38
- package/dist/runtime.js.map +1 -1
- package/dist/scan-comparison.d.ts +12 -5
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +72 -28
- package/dist/scan-comparison.js.map +1 -1
- package/dist/scan-dashboard.d.ts +9 -2
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +198 -3
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-logs.d.ts.map +1 -1
- package/dist/scan-logs.js +5 -21
- package/dist/scan-logs.js.map +1 -1
- package/dist/scan-sessions.d.ts +4 -0
- package/dist/scan-sessions.d.ts.map +1 -0
- package/dist/scan-sessions.js +35 -0
- package/dist/scan-sessions.js.map +1 -0
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +16 -1
- package/dist/targets.js.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -20
- package/dist/version.js.map +1 -1
- package/dist/windows-path.d.ts +3 -0
- package/dist/windows-path.d.ts.map +1 -0
- package/dist/windows-path.js +16 -0
- package/dist/windows-path.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 +12 -0
- package/dist/worker-progress.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""Persist normalized scan findings and their occurrences."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import sqlite3
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def index_findings(
|
|
12
|
+
connection: sqlite3.Connection,
|
|
13
|
+
scan_id: str,
|
|
14
|
+
document: dict[str, Any],
|
|
15
|
+
timestamp: str,
|
|
16
|
+
) -> None:
|
|
17
|
+
findings = document.get("findings")
|
|
18
|
+
if not isinstance(findings, list):
|
|
19
|
+
raise SystemExit("findings.json must contain a findings array.")
|
|
20
|
+
for finding in findings:
|
|
21
|
+
if not isinstance(finding, dict):
|
|
22
|
+
raise SystemExit("findings.json entries must be objects.")
|
|
23
|
+
identity = finding["identity"]
|
|
24
|
+
fingerprints = finding["fingerprints"]
|
|
25
|
+
severity = finding["severity"]
|
|
26
|
+
confidence = finding["confidence"]
|
|
27
|
+
connection.execute(
|
|
28
|
+
"""
|
|
29
|
+
INSERT INTO findings (
|
|
30
|
+
id, fingerprint, rule_id, identity_anchor, identity_instance, created_at, updated_at
|
|
31
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
32
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
33
|
+
fingerprint = excluded.fingerprint,
|
|
34
|
+
rule_id = excluded.rule_id,
|
|
35
|
+
identity_anchor = excluded.identity_anchor,
|
|
36
|
+
identity_instance = excluded.identity_instance,
|
|
37
|
+
updated_at = excluded.updated_at
|
|
38
|
+
""",
|
|
39
|
+
(
|
|
40
|
+
finding["findingId"],
|
|
41
|
+
fingerprints["primary"],
|
|
42
|
+
finding["ruleId"],
|
|
43
|
+
identity["anchor"],
|
|
44
|
+
identity.get("instance"),
|
|
45
|
+
timestamp,
|
|
46
|
+
timestamp,
|
|
47
|
+
),
|
|
48
|
+
)
|
|
49
|
+
connection.execute(
|
|
50
|
+
"""
|
|
51
|
+
INSERT INTO finding_occurrences (
|
|
52
|
+
id, finding_id, scan_id, title, summary, severity, confidence, remediation,
|
|
53
|
+
details_json, created_at
|
|
54
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
55
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
56
|
+
finding_id = excluded.finding_id,
|
|
57
|
+
scan_id = excluded.scan_id,
|
|
58
|
+
title = excluded.title,
|
|
59
|
+
summary = excluded.summary,
|
|
60
|
+
severity = excluded.severity,
|
|
61
|
+
confidence = excluded.confidence,
|
|
62
|
+
remediation = excluded.remediation,
|
|
63
|
+
details_json = excluded.details_json
|
|
64
|
+
""",
|
|
65
|
+
(
|
|
66
|
+
finding["occurrenceId"],
|
|
67
|
+
finding["findingId"],
|
|
68
|
+
scan_id,
|
|
69
|
+
finding["title"],
|
|
70
|
+
finding["summary"],
|
|
71
|
+
severity["level"],
|
|
72
|
+
confidence["level"],
|
|
73
|
+
finding["remediation"],
|
|
74
|
+
json.dumps(finding, allow_nan=False, sort_keys=True),
|
|
75
|
+
timestamp,
|
|
76
|
+
),
|
|
77
|
+
)
|
|
78
|
+
connection.execute(
|
|
79
|
+
"DELETE FROM finding_locations WHERE occurrence_id = ?",
|
|
80
|
+
(finding["occurrenceId"],),
|
|
81
|
+
)
|
|
82
|
+
for index, location in enumerate(finding["locations"]):
|
|
83
|
+
connection.execute(
|
|
84
|
+
"""
|
|
85
|
+
INSERT INTO finding_locations (
|
|
86
|
+
occurrence_id, relative_path, start_line, end_line, role, sort_order
|
|
87
|
+
) VALUES (?, ?, ?, ?, ?, ?)
|
|
88
|
+
""",
|
|
89
|
+
(
|
|
90
|
+
finding["occurrenceId"],
|
|
91
|
+
location["path"],
|
|
92
|
+
location["startLine"],
|
|
93
|
+
location.get("endLine", location["startLine"]),
|
|
94
|
+
location.get("role"),
|
|
95
|
+
index,
|
|
96
|
+
),
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if __name__ == "__main__":
|
|
101
|
+
argparse.ArgumentParser(description=__doc__).parse_args()
|
|
@@ -11,7 +11,7 @@ sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
|
11
11
|
from deep_scan_workbench import require_current_coordinator
|
|
12
12
|
from workbench.handoff import require_current_continuation
|
|
13
13
|
from workbench_constants import PHASES
|
|
14
|
-
from workbench_validation import optional_text, require_uuid,
|
|
14
|
+
from workbench_validation import optional_text, require_uuid, user_context_argument
|
|
15
15
|
|
|
16
16
|
MAX_PREFLIGHT_ISSUES = 32
|
|
17
17
|
|
|
@@ -83,7 +83,7 @@ def update_context(
|
|
|
83
83
|
scan_context: Callable[[sqlite3.Connection, str], dict[str, Any]],
|
|
84
84
|
) -> dict[str, Any]:
|
|
85
85
|
scan_id = require_uuid(args.scan_id, "scan-id")
|
|
86
|
-
context =
|
|
86
|
+
context = user_context_argument(args)
|
|
87
87
|
connection.execute("BEGIN IMMEDIATE")
|
|
88
88
|
try:
|
|
89
89
|
scan = require_scan(connection, scan_id)
|
|
@@ -164,7 +164,10 @@ def update_progress(
|
|
|
164
164
|
scan_id = require_uuid(args.scan_id, "scan-id")
|
|
165
165
|
model = optional_text(args.model, maximum=200)
|
|
166
166
|
reasoning_effort = optional_text(args.reasoning_effort, maximum=32)
|
|
167
|
-
|
|
167
|
+
preflight_issues = (
|
|
168
|
+
sys.stdin.read() if args.preflight_issues_json_stdin else args.preflight_issues_json
|
|
169
|
+
)
|
|
170
|
+
serialized_preflight_issues = preflight_issues_json(preflight_issues)
|
|
168
171
|
connection.execute("BEGIN IMMEDIATE")
|
|
169
172
|
try:
|
|
170
173
|
timestamp = now()
|
|
@@ -14,6 +14,25 @@ sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
|
14
14
|
from workbench_constants import CLAIM_LEASE_SECONDS, DELIVERED_ACTION_LEASE_SECONDS
|
|
15
15
|
from workbench_validation import require_occurrence, require_uuid
|
|
16
16
|
|
|
17
|
+
COMMANDS = {
|
|
18
|
+
"request-finding-remediation",
|
|
19
|
+
"request-finding-remediation-action",
|
|
20
|
+
"claim-finding-remediation-resend",
|
|
21
|
+
"mark-finding-remediation-delivered",
|
|
22
|
+
"release-finding-remediation-claim",
|
|
23
|
+
"cancel-finding-remediation-request",
|
|
24
|
+
"set-finding-remediation",
|
|
25
|
+
}
|
|
26
|
+
SCAN_STATUS_ERROR = "Remediation is available only for successfully completed scans."
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def require_available(connection: sqlite3.Connection, args: Any, require_scan: Any) -> None:
|
|
30
|
+
if args.command not in COMMANDS:
|
|
31
|
+
return
|
|
32
|
+
occurrence = require_occurrence(connection, args.occurrence_id)
|
|
33
|
+
if require_scan(connection, occurrence["scan_id"])["status"] != "complete":
|
|
34
|
+
raise SystemExit(SCAN_STATUS_ERROR)
|
|
35
|
+
|
|
17
36
|
|
|
18
37
|
def remediation_claim_is_active(remediation: sqlite3.Row) -> bool:
|
|
19
38
|
if remediation["pending_action_claim_token"] is None:
|