Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/typescript/_bundled_plugin/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codex-security",
"version": "0.1.37",
"version": "0.1.39",
"description": "Codex Security workflows for security scans, analysis, and investigation.",
"author": {
"name": "OpenAI"
Expand Down
5 changes: 4 additions & 1 deletion sdk/typescript/_bundled_plugin/scripts/workbench_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ def parse_args(description: str) -> argparse.Namespace:
compare_scans.add_argument("--include-matching-inputs", action="store_true")
compare_scans.add_argument("--require-matches", action="store_true")

save_scan_comparison = subparsers.add_parser("save-scan-comparison")
save_scan_comparison = subparsers.add_parser(
"save-scan-comparison",
description="Comparison payload supports related findings.",
)
save_scan_comparison.add_argument("--before-scan-id", required=True)
save_scan_comparison.add_argument("--after-scan-id", required=True)
matches = save_scan_comparison.add_mutually_exclusive_group(required=True)
Expand Down
20 changes: 18 additions & 2 deletions sdk/typescript/_bundled_plugin/scripts/workbench_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3188,9 +3188,15 @@ def list_findings(connection: sqlite3.Connection, args: argparse.Namespace) -> d
values,
).fetchone()[0]
next_offset = args.offset + len(rows)
relations = scan_history.finding_relations(
connection, scan["id"], (row["id"] for row in rows)
)
return {
"findingsPage": {
"findings": [finding_result(connection, scan, row) for row in rows],
"findings": [
finding_result(connection, scan, row, related=relations.get(row["id"], []))
for row in rows
],
"limit": limit,
"nextOffset": next_offset if next_offset < total else None,
"offset": args.offset,
Expand Down Expand Up @@ -3282,14 +3288,20 @@ def scan_result(
"completed": independent_reviews["completed"],
"consolidating": independent_reviews["consolidating"],
}
relations = scan_history.finding_relations(
connection, scan["id"], (row["id"] for row in occurrence_rows)
)
return {
"artifacts": artifacts,
"canceledAt": scan["canceled_at"],
**scan_usage.stored_scan_cost_fields(scan["cost_json"]),
"contract": scan_contract(scan),
"continuationThreadId": scan["continuation_thread_id"],
"failureMessage": scan["failure_message"],
"findings": [finding_result(connection, scan, row) for row in occurrence_rows],
"findings": [
finding_result(connection, scan, row, related=relations.get(row["id"], []))
for row in occurrence_rows
],
"findingCount": finding_count,
"findingsTruncated": finding_count > len(occurrence_rows),
"severityCounts": severity_counts,
Expand Down Expand Up @@ -3436,6 +3448,8 @@ def finding_result(
connection: sqlite3.Connection,
scan: sqlite3.Row,
occurrence: sqlite3.Row,
*,
related: list[dict[str, Any]],
) -> dict[str, Any]:
details = bounded_finding_details(read_finding_details(occurrence["details_json"]))
confidence = details.get("confidence")
Expand Down Expand Up @@ -3500,6 +3514,8 @@ def finding_result(
result["matches"] = matches
result["knownSince"] = known_since
result["knownScanIds"] = known_scan_ids
if related:
result["related"] = related
Comment thread
mldangelo-oai marked this conversation as resolved.
result.pop("artifactPaths", None)
source_excerpt = finding_source_excerpt(scan, target, locations)
if source_excerpt:
Expand Down
Loading
Loading