@openai/codex-security 0.1.21 → 0.1.23
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 +529 -0
- package/_bundled_plugin/.codex-plugin/plugin.json +1 -1
- 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 +2 -30
- package/_bundled_plugin/references/core-scan.md +1 -1
- package/_bundled_plugin/references/final-report.md +1 -1
- package/_bundled_plugin/references/finding-detail-fields.md +5 -10
- package/_bundled_plugin/references/sarif-adapter.md +1 -1
- package/_bundled_plugin/scripts/config_preflight.py +2 -8
- package/_bundled_plugin/scripts/finalize_scan_contract.py +114 -24
- package/_bundled_plugin/scripts/finding_preview.py +22 -4
- package/_bundled_plugin/scripts/generate_in_scope_files.py +27 -1
- package/_bundled_plugin/scripts/windows_scan_local_files.py +101 -7
- package/_bundled_plugin/scripts/workbench_cli.py +21 -1
- package/_bundled_plugin/scripts/workbench_dashboard.py +115 -0
- package/_bundled_plugin/scripts/workbench_db.py +29 -2
- package/_bundled_plugin/scripts/workbench_finding_index.py +42 -24
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +190 -0
- package/_bundled_plugin/scripts/workbench_findings.py +216 -0
- package/_bundled_plugin/scripts/workbench_saved_results.py +30 -5
- package/_bundled_plugin/scripts/workbench_schema.py +263 -58
- package/_bundled_plugin/scripts/workbench_target.py +22 -3
- package/_bundled_plugin/skills/track-findings/SKILL.md +2 -0
- package/dist/api.d.ts +2 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +115 -27
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +124 -58
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.js +5 -1
- package/dist/cloud-publish.js.map +1 -1
- package/dist/contract.d.ts +1 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +9 -0
- package/dist/contract.js.map +1 -1
- package/dist/custom-publish.d.ts +22 -0
- package/dist/custom-publish.d.ts.map +1 -0
- package/dist/custom-publish.js +47 -0
- package/dist/custom-publish.js.map +1 -0
- package/dist/custom-validation-prompt.js +1 -1
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/deduplication/checkpointed-review.d.ts +16 -0
- package/dist/deduplication/checkpointed-review.d.ts.map +1 -0
- package/dist/deduplication/checkpointed-review.js +76 -0
- package/dist/deduplication/checkpointed-review.js.map +1 -0
- package/dist/deduplication/codex-review.d.ts +21 -0
- package/dist/deduplication/codex-review.d.ts.map +1 -0
- package/dist/deduplication/codex-review.js +252 -0
- package/dist/deduplication/codex-review.js.map +1 -0
- package/dist/deduplication/deduplication-prompts.d.ts +8 -0
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -0
- package/dist/deduplication/deduplication-prompts.js +35 -0
- package/dist/deduplication/deduplication-prompts.js.map +1 -0
- package/dist/deduplication/deduplication-reviewer.d.ts +46 -0
- package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -0
- package/dist/deduplication/deduplication-reviewer.js +105 -0
- package/dist/deduplication/deduplication-reviewer.js.map +1 -0
- package/dist/deduplication/deduplication.d.ts +6 -0
- package/dist/deduplication/deduplication.d.ts.map +1 -0
- package/dist/deduplication/deduplication.js +85 -0
- package/dist/deduplication/deduplication.js.map +1 -0
- package/dist/deduplication/scan.d.ts +16 -0
- package/dist/deduplication/scan.d.ts.map +1 -0
- package/dist/deduplication/scan.js +101 -0
- package/dist/deduplication/scan.js.map +1 -0
- package/dist/finding-dedupe-groups.d.ts +7 -0
- package/dist/finding-dedupe-groups.d.ts.map +1 -0
- package/dist/finding-dedupe-groups.js +2 -0
- package/dist/finding-dedupe-groups.js.map +1 -0
- package/dist/finding-retrieval.d.ts +13 -0
- package/dist/finding-retrieval.d.ts.map +1 -0
- package/dist/finding-retrieval.js +2 -0
- package/dist/finding-retrieval.js.map +1 -0
- package/dist/finding-workflow.d.ts +53 -0
- package/dist/finding-workflow.d.ts.map +1 -0
- package/dist/finding-workflow.js +117 -0
- package/dist/finding-workflow.js.map +1 -0
- package/dist/findings-client.d.ts +15 -0
- package/dist/findings-client.d.ts.map +1 -0
- package/dist/findings-client.js +60 -0
- package/dist/findings-client.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/publication.js +28 -40
- package/dist/publication.js.map +1 -1
- package/dist/runtime.d.ts +5 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +113 -12
- package/dist/runtime.js.map +1 -1
- package/dist/saved-scan.d.ts +15 -0
- package/dist/saved-scan.d.ts.map +1 -0
- package/dist/saved-scan.js +68 -0
- package/dist/saved-scan.js.map +1 -0
- package/dist/scan-comparison.d.ts +3 -2
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +1 -1
- package/dist/scan-comparison.js.map +1 -1
- package/dist/server/dashboard/THIRD_PARTY_NOTICES.txt +276 -0
- package/dist/server/dashboard/app.css +2 -0
- package/dist/server/dashboard/app.js +66 -0
- package/dist/server/dashboard/index.html +18 -0
- package/dist/server/dashboard-types.d.ts +45 -0
- package/dist/server/dashboard-types.d.ts.map +1 -0
- package/dist/server/dashboard-types.js +2 -0
- package/dist/server/dashboard-types.js.map +1 -0
- package/dist/server/dashboard.d.ts +6 -0
- package/dist/server/dashboard.d.ts.map +1 -0
- package/dist/server/dashboard.js +45 -0
- package/dist/server/dashboard.js.map +1 -0
- package/dist/server/embeddings.d.ts +16 -0
- package/dist/server/embeddings.d.ts.map +1 -0
- package/dist/server/embeddings.js +114 -0
- package/dist/server/embeddings.js.map +1 -0
- package/dist/server/errors.d.ts +5 -0
- package/dist/server/errors.d.ts.map +1 -0
- package/dist/server/errors.js +8 -0
- package/dist/server/errors.js.map +1 -0
- package/dist/server/findings-service.d.ts +20 -0
- package/dist/server/findings-service.d.ts.map +1 -0
- package/dist/server/findings-service.js +31 -0
- package/dist/server/findings-service.js.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +32 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/routes.d.ts +6 -0
- package/dist/server/routes.d.ts.map +1 -0
- package/dist/server/routes.js +86 -0
- package/dist/server/routes.js.map +1 -0
- package/dist/server/server.d.ts +10 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/server.js +17 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/sqlite-store.d.ts +22 -0
- package/dist/server/sqlite-store.d.ts.map +1 -0
- package/dist/server/sqlite-store.js +82 -0
- package/dist/server/sqlite-store.js.map +1 -0
- package/dist/server/storage.d.ts +32 -0
- package/dist/server/storage.d.ts.map +1 -0
- package/dist/server/storage.js +2 -0
- package/dist/server/storage.js.map +1 -0
- package/dist/server/validation.d.ts +17 -0
- package/dist/server/validation.d.ts.map +1 -0
- package/dist/server/validation.js +53 -0
- package/dist/server/validation.js.map +1 -0
- package/dist/trusted-executable.d.ts.map +1 -1
- package/dist/trusted-executable.js +2 -1
- package/dist/trusted-executable.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +17 -5
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { CodexSecurity } from "./api.js";
|
|
3
|
+
import { publishScanToCustom } from "./custom-publish.js";
|
|
4
|
+
import { deduplicateScanInternal } from "./deduplication/scan.js";
|
|
3
5
|
import { publishFindingsCsvToCloud, publishScanToCloud } from "./cloud-publish.js";
|
|
4
6
|
import { type BulkScanDiscoveryDependencies, type BulkScanPrompt } from "./bulk-scan-discovery.js";
|
|
5
7
|
import { type CodexSecurityConfig, type ExternalModelProvider, type JsonObject } from "./config.js";
|
|
@@ -68,8 +70,10 @@ interface CliDependencies {
|
|
|
68
70
|
publishPrompt?: Pick<BulkScanPrompt, "isInteractive" | "select"> & Partial<Pick<BulkScanPrompt, "checkbox">>;
|
|
69
71
|
checkScanPublication?: typeof checkScanPublication;
|
|
70
72
|
publishScan?: typeof publishScan;
|
|
73
|
+
deduplicateScan?: typeof deduplicateScanInternal;
|
|
71
74
|
publishFindingsCsvToCloud?: typeof publishFindingsCsvToCloud;
|
|
72
75
|
publishScanToCloud?: typeof publishScanToCloud;
|
|
76
|
+
publishScanToCustom?: typeof publishScanToCustom;
|
|
73
77
|
confirmPatchReview?: (question: string) => Promise<boolean>;
|
|
74
78
|
patchEditor?: (repository: string, findings: readonly Finding[]) => Promise<PatchSelection | null>;
|
|
75
79
|
currentDirectory(): string;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAiDA,OAAO,EAEL,aAAa,EAUd,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EAEhB,MAAM,aAAa,CAAC;AAcrB,OAAO,EAEL,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAuB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EACL,oBAAoB,EAEpB,WAAW,EAIZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAYL,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AACtB,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AC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;CACvE,GACA,OAAO,CAAC;IACT,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC,CA6OD;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,UAAU,GAAG,OAAO,GAAG,YAAY,EAC5C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,MAAM,CAyBR;AAg1CD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,mBAAmB,EAC5B,QAAQ,CAAC,EAAE,QAAQ,GAAG,gBAAgB,GAAG,qBAAqB,GAC7D,UAAU,CAiFZ;AAwBD,qBAAa,QAAQ;;gBAkBjB,MAAM,GAAE,QAAyB,EACjC,YAAY,GAAE,IAAI,CAChB,eAAe,EACf,KAAK,GAAG,aAAa,GAAG,eAAe,CACjB,EACxB,WAAW,UAAO;IAQpB,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,cAAc,IAAI,MAAM,CAKlC;IAEM,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK5B,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAiBjC,SAAS,IAAI,IAAI;IAwCjB,eAAe,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;CAoChD"}
|
package/dist/cli.js
CHANGED
|
@@ -15,6 +15,9 @@ import { Cli, z } from "incur";
|
|
|
15
15
|
import { parse as parseToml } from "smol-toml";
|
|
16
16
|
import { classifyConnectionFailure, createSecurityInternal, listRepositoryFindings, SCAN_AUTH_MODES, scanAuthentication, } from "./api.js";
|
|
17
17
|
import { accountStatus } from "./auth.js";
|
|
18
|
+
import { publishScanToCustom } from "./custom-publish.js";
|
|
19
|
+
import { deduplicateScanInternal } from "./deduplication/scan.js";
|
|
20
|
+
import { resolveCompletedScan, resolveWorkflowScan, } from "./saved-scan.js";
|
|
18
21
|
import { publishFindingsCsvToCloud, publishScanToCloud, } from "./cloud-publish.js";
|
|
19
22
|
import { createBulkScanDiscoveryDependencies, runBulkScanWizard, } from "./bulk-scan-discovery.js";
|
|
20
23
|
import { DEFAULT_CODEX_CONFIG, EXTERNAL_CODEX_PROVIDERS, isExternalModelProvider, mergedCodexConfig, scanModelConfiguration, scanModelProvider, } from "./config.js";
|
|
@@ -76,6 +79,7 @@ const EXPORT_DEFAULT_OUTPUTS = {
|
|
|
76
79
|
sarif: "results.sarif",
|
|
77
80
|
};
|
|
78
81
|
const VALUE_OPTIONS = new Set([
|
|
82
|
+
"--workflow-id",
|
|
79
83
|
"--auth",
|
|
80
84
|
"--safety-identifier",
|
|
81
85
|
"--path",
|
|
@@ -126,6 +130,7 @@ const VALUE_OPTIONS = new Set([
|
|
|
126
130
|
"--scan-root",
|
|
127
131
|
"--reason",
|
|
128
132
|
"--to",
|
|
133
|
+
"--findings-url",
|
|
129
134
|
"--linear-team",
|
|
130
135
|
"--linear-api-key",
|
|
131
136
|
"--project",
|
|
@@ -1422,21 +1427,28 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1422
1427
|
.describe("Completed scan directory; omit to select a saved scan."),
|
|
1423
1428
|
}),
|
|
1424
1429
|
options: PUBLICATION_DESTINATION_OPTIONS.extend({
|
|
1430
|
+
workflowId: optionValue("--workflow-id")
|
|
1431
|
+
.optional()
|
|
1432
|
+
.describe("Resume the named local scan, custom publication, and dedupe workflow."),
|
|
1425
1433
|
scan: z
|
|
1426
1434
|
.array(optionValue("--scan"))
|
|
1427
1435
|
.default([])
|
|
1428
|
-
.describe("Saved scan ID, unique prefix, or latest;
|
|
1436
|
+
.describe("Saved scan ID, unique prefix, or latest; Linear and custom accept one scan."),
|
|
1429
1437
|
scanDir: z
|
|
1430
1438
|
.array(optionValue("--scan-dir"))
|
|
1431
1439
|
.default([])
|
|
1432
|
-
.describe("External completed scan directory;
|
|
1440
|
+
.describe("External completed scan directory; Linear and custom accept one scan."),
|
|
1433
1441
|
// Cloud remains an internal destination, omitted from public discovery.
|
|
1434
1442
|
to: z
|
|
1435
1443
|
.string()
|
|
1436
|
-
.refine((value) => value === "linear" || value === "cloud", {
|
|
1437
|
-
message: "Unsupported publication destination. Use --to linear.",
|
|
1444
|
+
.refine((value) => value === "linear" || value === "cloud" || value === "custom", {
|
|
1445
|
+
message: "Unsupported publication destination. Use --to linear or --to custom.",
|
|
1438
1446
|
})
|
|
1439
|
-
.describe("Publication destination (linear)."),
|
|
1447
|
+
.describe("Publication destination (linear or custom)."),
|
|
1448
|
+
findingsUrl: optionValue("--findings-url")
|
|
1449
|
+
.url()
|
|
1450
|
+
.optional()
|
|
1451
|
+
.describe("Findings API base URL; required with --to custom (for example http://localhost:3000)."),
|
|
1440
1452
|
dryRun: z
|
|
1441
1453
|
.boolean()
|
|
1442
1454
|
.default(false)
|
|
@@ -1529,7 +1541,7 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1529
1541
|
if (new Set(options.scan).size > 1 && options.to !== "cloud") {
|
|
1530
1542
|
throw new CodexSecurityError("Multiple scans are only supported with --to cloud.");
|
|
1531
1543
|
}
|
|
1532
|
-
if (options.to
|
|
1544
|
+
if (options.to !== "linear" &&
|
|
1533
1545
|
(options.skipExisting ||
|
|
1534
1546
|
[
|
|
1535
1547
|
options.linearTeam,
|
|
@@ -1538,12 +1550,21 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1538
1550
|
options.project,
|
|
1539
1551
|
options.linearAssignee,
|
|
1540
1552
|
].some((value) => value !== undefined))) {
|
|
1541
|
-
throw new CodexSecurityError("Cloud publication cannot be combined with Linear options
|
|
1553
|
+
throw new CodexSecurityError(`${options.to === "cloud" ? "Cloud" : "Custom"} publication cannot be combined with Linear options.`);
|
|
1554
|
+
}
|
|
1555
|
+
if (options.to === "custom" && options.findingsUrl === undefined) {
|
|
1556
|
+
throw new CodexSecurityError("Custom publication requires --findings-url, for example http://localhost:3000.");
|
|
1557
|
+
}
|
|
1558
|
+
if (options.to !== "custom" && options.findingsUrl !== undefined) {
|
|
1559
|
+
throw new CodexSecurityError("--findings-url is only supported with --to custom.");
|
|
1560
|
+
}
|
|
1561
|
+
if (options.workflowId !== undefined && options.to !== "custom") {
|
|
1562
|
+
throw new CodexSecurityError("--workflow-id is only supported with --to custom.");
|
|
1542
1563
|
}
|
|
1543
1564
|
const destination = options.to === "linear"
|
|
1544
1565
|
? publicationDestination({ ...options, to: "linear" }, dependencies.environment)
|
|
1545
1566
|
: undefined;
|
|
1546
|
-
if (options.to
|
|
1567
|
+
if (options.to !== "linear") {
|
|
1547
1568
|
dependencies.addSignalListener("SIGINT", onInterrupt);
|
|
1548
1569
|
dependencies.addSignalListener("SIGTERM", onTerminate);
|
|
1549
1570
|
observingSignals = true;
|
|
@@ -1559,11 +1580,14 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1559
1580
|
const selectedScans = directories.map((scanDir) => ({ scanDir }));
|
|
1560
1581
|
for (const requestedId of new Set(options.scan)) {
|
|
1561
1582
|
controller.signal.throwIfAborted();
|
|
1562
|
-
const scan = await
|
|
1583
|
+
const scan = await resolveCompletedScan(requestedId, dependencies);
|
|
1563
1584
|
if (!selectedScans.some(({ scanId }) => scanId === scan.scanId)) {
|
|
1564
1585
|
selectedScans.push(scan);
|
|
1565
1586
|
}
|
|
1566
1587
|
}
|
|
1588
|
+
if (options.workflowId !== undefined && selectedScans.length === 0) {
|
|
1589
|
+
selectedScans.push(await resolveWorkflowScan(options.workflowId, dependencies));
|
|
1590
|
+
}
|
|
1567
1591
|
let scanDir = selectedScans[0]?.scanDir;
|
|
1568
1592
|
let publicationRepository = scanDir === undefined ? "scan" : basename(scanDir);
|
|
1569
1593
|
if (scanDir === undefined) {
|
|
@@ -1772,6 +1796,21 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1772
1796
|
});
|
|
1773
1797
|
return { ...result };
|
|
1774
1798
|
}
|
|
1799
|
+
if (options.to === "custom") {
|
|
1800
|
+
const result = await (dependencies.publishScanToCustom ?? publishScanToCustom)(resolveCliPath(currentDirectory, scanDir), {
|
|
1801
|
+
findingsUrl: options.findingsUrl,
|
|
1802
|
+
...(options.workflowId === undefined
|
|
1803
|
+
? {}
|
|
1804
|
+
: { workflowId: options.workflowId }),
|
|
1805
|
+
dryRun: options.dryRun,
|
|
1806
|
+
signal: controller.signal,
|
|
1807
|
+
...(selectedScans[0]?.scanId === undefined
|
|
1808
|
+
? {}
|
|
1809
|
+
: { expectedScanId: selectedScans[0].scanId }),
|
|
1810
|
+
});
|
|
1811
|
+
controller.signal.throwIfAborted();
|
|
1812
|
+
return { ...result };
|
|
1813
|
+
}
|
|
1775
1814
|
const progress = new PublicationProgressPresenter(errorOutput, dependencies, publicationRepository);
|
|
1776
1815
|
presentation = progress;
|
|
1777
1816
|
dependencies.addSignalListener("SIGINT", onInterrupt);
|
|
@@ -1954,6 +1993,9 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1954
1993
|
}),
|
|
1955
1994
|
options: z
|
|
1956
1995
|
.object({
|
|
1996
|
+
workflowId: optionValue("--workflow-id")
|
|
1997
|
+
.optional()
|
|
1998
|
+
.describe("Reuse completed work in the named local findings workflow."),
|
|
1957
1999
|
auth: z
|
|
1958
2000
|
.enum(SCAN_AUTH_MODES)
|
|
1959
2001
|
.default("auto")
|
|
@@ -2102,6 +2144,7 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
2102
2144
|
}
|
|
2103
2145
|
const outcome = await runScan({
|
|
2104
2146
|
auth: options.auth,
|
|
2147
|
+
workflowId: options.workflowId,
|
|
2105
2148
|
safetyIdentifier: options.safetyIdentifier,
|
|
2106
2149
|
verbose: options.verbose,
|
|
2107
2150
|
repository: args.repository,
|
|
@@ -2220,6 +2263,75 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
2220
2263
|
.command(scanHistory)
|
|
2221
2264
|
.command(findingFeedback)
|
|
2222
2265
|
.command(publication)
|
|
2266
|
+
.command("dedupe", {
|
|
2267
|
+
description: "Review a saved scan with local Codex and save duplicate groups to the findings API.",
|
|
2268
|
+
destructive: true,
|
|
2269
|
+
mcp: false,
|
|
2270
|
+
options: z.object({
|
|
2271
|
+
workflowId: optionValue("--workflow-id")
|
|
2272
|
+
.optional()
|
|
2273
|
+
.describe("Resume the named local findings workflow; reuses its saved scan."),
|
|
2274
|
+
scan: optionValue("--scan")
|
|
2275
|
+
.optional()
|
|
2276
|
+
.describe("Saved scan ID, unique prefix, or latest."),
|
|
2277
|
+
allRepositories: z
|
|
2278
|
+
.boolean()
|
|
2279
|
+
.default(false)
|
|
2280
|
+
.describe("Search all repositories instead of only the saved scan's repository."),
|
|
2281
|
+
findingsUrl: z
|
|
2282
|
+
.string()
|
|
2283
|
+
.url()
|
|
2284
|
+
.describe("Findings API base URL; the scan's findings must already be indexed."),
|
|
2285
|
+
}),
|
|
2286
|
+
output: z
|
|
2287
|
+
.object({
|
|
2288
|
+
scanId: z.string(),
|
|
2289
|
+
uniqueFindingIds: z.array(z.string()),
|
|
2290
|
+
duplicateGroups: z.array(z.array(z.string())),
|
|
2291
|
+
deduplicationStatus: z.literal("completed"),
|
|
2292
|
+
})
|
|
2293
|
+
.optional(),
|
|
2294
|
+
async run({ options }) {
|
|
2295
|
+
const controller = new AbortController();
|
|
2296
|
+
const onInterrupt = () => controller.abort("SIGINT");
|
|
2297
|
+
const onTerminate = () => controller.abort("SIGTERM");
|
|
2298
|
+
dependencies.addSignalListener("SIGINT", onInterrupt);
|
|
2299
|
+
dependencies.addSignalListener("SIGTERM", onTerminate);
|
|
2300
|
+
try {
|
|
2301
|
+
const scanId = options.scan ??
|
|
2302
|
+
(options.workflowId === undefined
|
|
2303
|
+
? undefined
|
|
2304
|
+
: (await resolveWorkflowScan(options.workflowId, dependencies))
|
|
2305
|
+
.scanId);
|
|
2306
|
+
if (scanId === undefined)
|
|
2307
|
+
throw new CodexSecurityError("Deduplication requires --scan or --workflow-id.");
|
|
2308
|
+
return await (dependencies.deduplicateScan ?? deduplicateScanInternal)(scanId, {
|
|
2309
|
+
findingsUrl: options.findingsUrl,
|
|
2310
|
+
...(options.workflowId === undefined
|
|
2311
|
+
? {}
|
|
2312
|
+
: { workflowId: options.workflowId }),
|
|
2313
|
+
allRepositories: options.allRepositories,
|
|
2314
|
+
signal: controller.signal,
|
|
2315
|
+
}, {
|
|
2316
|
+
environment: dependencies.environment,
|
|
2317
|
+
currentDirectory: dependencies.currentDirectory,
|
|
2318
|
+
runWorkbench: dependencies.runWorkbench,
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
catch (error) {
|
|
2322
|
+
const signal = controller.signal.reason;
|
|
2323
|
+
errorOutput.write(`codex-security: ${signal === "SIGINT" || signal === "SIGTERM"
|
|
2324
|
+
? "Deduplication canceled. Findings are unchanged."
|
|
2325
|
+
: safeErrorMessage(error)}\n`);
|
|
2326
|
+
exitCode = signal === "SIGINT" ? 130 : signal === "SIGTERM" ? 143 : 2;
|
|
2327
|
+
return undefined;
|
|
2328
|
+
}
|
|
2329
|
+
finally {
|
|
2330
|
+
dependencies.removeSignalListener("SIGINT", onInterrupt);
|
|
2331
|
+
dependencies.removeSignalListener("SIGTERM", onTerminate);
|
|
2332
|
+
}
|
|
2333
|
+
},
|
|
2334
|
+
})
|
|
2223
2335
|
.command(imports)
|
|
2224
2336
|
.command("scan-components", {
|
|
2225
2337
|
description: "Run standard scans for project components and combine the results.",
|
|
@@ -3486,55 +3598,6 @@ async function* workbenchFindings(arguments_, dependencies) {
|
|
|
3486
3598
|
offset = typeof page.nextOffset === "number" ? page.nextOffset : undefined;
|
|
3487
3599
|
} while (offset !== undefined);
|
|
3488
3600
|
}
|
|
3489
|
-
async function resolvePublicationScan(requestedId, dependencies) {
|
|
3490
|
-
let scanId = requestedId;
|
|
3491
|
-
if (scanId === "latest") {
|
|
3492
|
-
const history = await dependencies.runWorkbench([
|
|
3493
|
-
"list-scans",
|
|
3494
|
-
"--repository",
|
|
3495
|
-
resolve(dependencies.currentDirectory()),
|
|
3496
|
-
"--status",
|
|
3497
|
-
"complete",
|
|
3498
|
-
]);
|
|
3499
|
-
const scans = history["scans"];
|
|
3500
|
-
const latest = Array.isArray(scans) ? scans[0] : undefined;
|
|
3501
|
-
if (latest === undefined ||
|
|
3502
|
-
!isJsonObject(latest) ||
|
|
3503
|
-
typeof latest["scanId"] !== "string") {
|
|
3504
|
-
throw new CodexSecurityError("No completed saved scan was found for this repository.");
|
|
3505
|
-
}
|
|
3506
|
-
scanId = latest["scanId"];
|
|
3507
|
-
}
|
|
3508
|
-
const context = await dependencies.runWorkbench([
|
|
3509
|
-
"get-scan",
|
|
3510
|
-
"--scan-id",
|
|
3511
|
-
scanId,
|
|
3512
|
-
]);
|
|
3513
|
-
const scan = context["scan"];
|
|
3514
|
-
if (scan === undefined ||
|
|
3515
|
-
!isJsonObject(scan) ||
|
|
3516
|
-
typeof scan["scanId"] !== "string") {
|
|
3517
|
-
throw new CodexSecurityError(`Could not read saved scan ${scanId}.`);
|
|
3518
|
-
}
|
|
3519
|
-
scanId = scan["scanId"];
|
|
3520
|
-
const progress = scan["progress"];
|
|
3521
|
-
if (progress === undefined ||
|
|
3522
|
-
!isJsonObject(progress) ||
|
|
3523
|
-
progress["status"] !== "complete") {
|
|
3524
|
-
throw new CodexSecurityError(`Scan ${scanId} is not complete.`);
|
|
3525
|
-
}
|
|
3526
|
-
const storedDirectory = scan["scanDir"];
|
|
3527
|
-
const scanDir = typeof storedDirectory === "string" && storedDirectory.length > 0
|
|
3528
|
-
? resolveCliPath(dependencies.currentDirectory(), storedDirectory)
|
|
3529
|
-
: undefined;
|
|
3530
|
-
const metadata = scanDir === undefined
|
|
3531
|
-
? undefined
|
|
3532
|
-
: await lstat(scanDir).catch(() => undefined);
|
|
3533
|
-
if (scanDir === undefined || metadata?.isDirectory() !== true) {
|
|
3534
|
-
throw new CodexSecurityError(`Artifacts for scan ${scanId} are unavailable. Restore the completed scan artifacts or run a new scan.`);
|
|
3535
|
-
}
|
|
3536
|
-
return { ...scan, scanId, scanDir };
|
|
3537
|
-
}
|
|
3538
3601
|
async function selectSavedFindings(identifiers, requestedScanId, severity, dependencies) {
|
|
3539
3602
|
if (identifiers.some((identifier) => !isFindingIdentifier(identifier))) {
|
|
3540
3603
|
throw new CodexSecurityError("Saved scan patching accepts only finding identifiers.");
|
|
@@ -4709,6 +4772,9 @@ async function executeScan(arguments_, errorOutput, dependencies, interactive =
|
|
|
4709
4772
|
}
|
|
4710
4773
|
security = dependencies.createSecurity(config);
|
|
4711
4774
|
const options = {
|
|
4775
|
+
...(arguments_.workflowId === undefined
|
|
4776
|
+
? {}
|
|
4777
|
+
: { workflowId: arguments_.workflowId }),
|
|
4712
4778
|
auth,
|
|
4713
4779
|
safetyIdentifier: arguments_.safetyIdentifier,
|
|
4714
4780
|
target,
|