@openai/codex-security 0.1.23 → 0.1.25
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 +200 -23
- package/_bundled_plugin/.codex-plugin/plugin.json +1 -1
- package/_bundled_plugin/.mcp.json +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/references/scan-contract.md +10 -0
- package/_bundled_plugin/scripts/deep_scan_workbench.py +6 -1
- package/_bundled_plugin/scripts/finalize_scan_contract.py +27 -78
- package/_bundled_plugin/scripts/generate_in_scope_files.py +2 -8
- package/_bundled_plugin/scripts/generate_rank_input.py +1 -5
- package/_bundled_plugin/scripts/rank_preview.py +12 -1
- package/_bundled_plugin/scripts/report_projection.py +8 -14
- package/_bundled_plugin/scripts/validate_scan_contract.py +1 -3
- package/_bundled_plugin/scripts/windows_scan_local_files.py +5 -15
- package/_bundled_plugin/scripts/workbench_cli.py +14 -1
- package/_bundled_plugin/scripts/workbench_dashboard.py +41 -18
- package/_bundled_plugin/scripts/workbench_db.py +127 -541
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +31 -13
- package/_bundled_plugin/scripts/workbench_findings.py +8 -3
- package/_bundled_plugin/scripts/workbench_native_indexes.py +1 -2
- package/_bundled_plugin/scripts/workbench_publication.py +520 -0
- package/_bundled_plugin/scripts/workbench_remediation.py +37 -0
- package/_bundled_plugin/scripts/workbench_saved_results.py +298 -90
- package/_bundled_plugin/scripts/workbench_scan_history.py +375 -68
- package/_bundled_plugin/scripts/workbench_scan_usage.py +9 -33
- package/_bundled_plugin/scripts/workbench_schema.py +49 -21
- package/_bundled_plugin/scripts/workbench_target.py +96 -17
- package/_bundled_plugin/scripts/workbench_validation.py +1 -5
- package/_bundled_plugin/skills/assess-patch-risk/SKILL.md +1 -5
- package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +6 -1
- package/dist/api.d.ts +18 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +350 -28
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +35 -3
- package/dist/auth.js.map +1 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +118 -35
- package/dist/cli.js.map +1 -1
- package/dist/component-plan.d.ts.map +1 -1
- package/dist/component-plan.js +4 -2
- package/dist/component-plan.js.map +1 -1
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +21 -6
- package/dist/component-scan.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +46 -2
- package/dist/config.js.map +1 -1
- package/dist/cost.d.ts +1 -0
- package/dist/cost.d.ts.map +1 -1
- package/dist/cost.js +23 -11
- package/dist/cost.js.map +1 -1
- package/dist/deduplication/checkpointed-review.d.ts.map +1 -1
- package/dist/deduplication/checkpointed-review.js +2 -1
- package/dist/deduplication/checkpointed-review.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts +3 -0
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +122 -36
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/deduplication-prompts.d.ts +4 -3
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
- package/dist/deduplication/deduplication-prompts.js +18 -9
- package/dist/deduplication/deduplication-prompts.js.map +1 -1
- package/dist/deduplication/deduplication-reviewer.d.ts +2 -7
- package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
- package/dist/deduplication/deduplication-reviewer.js +46 -24
- package/dist/deduplication/deduplication-reviewer.js.map +1 -1
- package/dist/deduplication/deduplication.d.ts.map +1 -1
- package/dist/deduplication/deduplication.js +186 -23
- package/dist/deduplication/deduplication.js.map +1 -1
- package/dist/deduplication/scan.d.ts +9 -1
- 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-progress.d.ts +21 -0
- package/dist/deep-progress.d.ts.map +1 -0
- package/dist/deep-progress.js +108 -0
- package/dist/deep-progress.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mock-scan.d.ts +4 -0
- package/dist/mock-scan.d.ts.map +1 -0
- package/dist/mock-scan.js +210 -0
- package/dist/mock-scan.js.map +1 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +2 -2
- package/dist/publish.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +54 -14
- package/dist/runtime.js.map +1 -1
- package/dist/scan-activity.d.ts.map +1 -1
- package/dist/scan-activity.js +12 -2
- package/dist/scan-activity.js.map +1 -1
- package/dist/scan-comparison.d.ts +11 -2
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +237 -39
- package/dist/scan-comparison.js.map +1 -1
- package/dist/scan-dashboard.d.ts +3 -1
- package/dist/scan-dashboard.d.ts.map +1 -1
- package/dist/scan-dashboard.js +70 -3
- package/dist/scan-dashboard.js.map +1 -1
- package/dist/scan-history-renderer.d.ts.map +1 -1
- package/dist/scan-history-renderer.js +21 -0
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/server/api.d.ts +6 -0
- package/dist/server/api.d.ts.map +1 -0
- package/dist/server/api.js +4 -0
- package/dist/server/api.js.map +1 -0
- package/dist/server/dashboard/app.css +1 -1
- package/dist/server/embeddings.d.ts +2 -1
- package/dist/server/embeddings.d.ts.map +1 -1
- package/dist/server/embeddings.js +8 -3
- package/dist/server/embeddings.js.map +1 -1
- package/dist/server/index.js +2 -28
- package/dist/server/index.js.map +1 -1
- package/dist/server/serve.d.ts +2 -0
- package/dist/server/serve.d.ts.map +1 -0
- package/dist/server/serve.js +28 -0
- package/dist/server/serve.js.map +1 -0
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +3 -5
- package/dist/targets.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 +10 -5
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,KAAK,EACX,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,KAAK,EACX,MAAM,SAAS,CAAC;AAwCjB,OAAO,EAOL,KAAK,qBAAqB,EAE3B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAS9C,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAsD5C,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,gBAAgB,CAAC;IACzC,IAAI,EAAE,OAAO,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,kBAAkB,G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B,GAC9B,kBAAkB,CAOpB;AAeD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,EAAE,kBAAkB,EAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,EAC3B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,kBAAkB,CAAC,CAsC7B;AA2LD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAMhE;AA+BD,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,EACb,WAAW,GAAE,kBAAgC,GAC5C,MAAM,CAaR"}
|
package/dist/runtime.js
CHANGED
|
@@ -4,7 +4,7 @@ import { chmodSync, constants, existsSync, readdirSync, } from "node:fs";
|
|
|
4
4
|
import { chmod, cp, copyFile, link, lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, rmdir, stat, utimes, writeFile, } from "node:fs/promises";
|
|
5
5
|
import { homedir, tmpdir } from "node:os";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
|
-
import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep, } from "node:path";
|
|
7
|
+
import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep, win32, } from "node:path";
|
|
8
8
|
import { createInterface } from "node:readline";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import { promisify } from "node:util";
|
|
@@ -619,7 +619,12 @@ async function secureWindowsCredentialHome(path) {
|
|
|
619
619
|
" foreach ($entry in $entries) {",
|
|
620
620
|
" if (($entry.Attributes -band 1024) -and ($entry.LinkType -in @('SymbolicLink', 'Junction'))) { throw 'Windows credential home contains a symbolic link or junction' }",
|
|
621
621
|
" if ($entry.PSObject.TypeNames -notcontains 'System.IO.DirectoryInfo' -and $entry.PSObject.TypeNames -notcontains 'System.IO.FileInfo') { throw 'Windows credential home contains an unsafe entry' }",
|
|
622
|
-
" try { Write-CredentialAcl $entry.FullName } catch {
|
|
622
|
+
" try { Write-CredentialAcl $entry.FullName } catch {",
|
|
623
|
+
// A descendant can disappear inside Get-Acl after it was enumerated.
|
|
624
|
+
` if ($_.FullyQualifiedErrorId -eq 'System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.GetAclCommand' -or $_.FullyQualifiedErrorId -eq 'GetAcl_PathNotFound_Exception,Microsoft.PowerShell.Commands.GetAclCommand') { exit ${WINDOWS_CREDENTIAL_DESCENDANTS_CHANGED_EXIT_CODE} }`,
|
|
625
|
+
" if ($_.FullyQualifiedErrorId -like 'GetAcl_PathNotFound,*') { continue }",
|
|
626
|
+
" throw",
|
|
627
|
+
" }",
|
|
623
628
|
" if ($entry.PSIsContainer) { Read-CredentialDescendants $entry.FullName }",
|
|
624
629
|
" }",
|
|
625
630
|
"}",
|
|
@@ -1107,23 +1112,49 @@ export async function preparePersistentOutputRoot(stateDirectory, category, repo
|
|
|
1107
1112
|
}
|
|
1108
1113
|
return root;
|
|
1109
1114
|
}
|
|
1115
|
+
const workbenchComparisonSupport = new Map();
|
|
1110
1116
|
export async function runWorkbench(options, args, input) {
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
const result = await runCodexCommand({ command: options.python }, [
|
|
1114
|
-
"-I",
|
|
1115
|
-
"-X",
|
|
1116
|
-
"utf8",
|
|
1117
|
-
"-B",
|
|
1118
|
-
join(options.pluginRoot, "scripts", "workbench_db.py"),
|
|
1119
|
-
...args,
|
|
1120
|
-
], pluginHelperEnvironment(options.environment), input, options.signal);
|
|
1117
|
+
const script = join(options.pluginRoot, "scripts", "workbench_db.py");
|
|
1118
|
+
const run = async (arguments_, input) => {
|
|
1119
|
+
const result = await runCodexCommand({ command: options.python }, ["-I", "-X", "utf8", "-B", script, ...arguments_], pluginHelperEnvironment(options.environment), input, options.signal);
|
|
1121
1120
|
if (!result.success) {
|
|
1122
1121
|
throw new Error(result.stderr.trim() ||
|
|
1123
1122
|
result.stdout.trim() ||
|
|
1124
1123
|
`Workbench exited with status ${result.exitCode}.`);
|
|
1125
1124
|
}
|
|
1126
|
-
|
|
1125
|
+
return result.stdout;
|
|
1126
|
+
};
|
|
1127
|
+
let stdout;
|
|
1128
|
+
try {
|
|
1129
|
+
const arguments_ = [...args];
|
|
1130
|
+
const matchesStdinIndex = arguments_.indexOf("--matches-json-stdin");
|
|
1131
|
+
if (arguments_[0] === "save-scan-comparison" &&
|
|
1132
|
+
matchesStdinIndex !== -1 &&
|
|
1133
|
+
input !== undefined) {
|
|
1134
|
+
const key = JSON.stringify([options.python, script]);
|
|
1135
|
+
let support = workbenchComparisonSupport.get(key);
|
|
1136
|
+
if (support === undefined) {
|
|
1137
|
+
const help = await run(["save-scan-comparison", "--help"]);
|
|
1138
|
+
options.signal?.throwIfAborted();
|
|
1139
|
+
support = {
|
|
1140
|
+
stdin: help.includes("--matches-json-stdin"),
|
|
1141
|
+
related: help
|
|
1142
|
+
.replace(/\s+/gu, " ")
|
|
1143
|
+
.includes("Comparison payload supports related findings."),
|
|
1144
|
+
};
|
|
1145
|
+
workbenchComparisonSupport.set(key, support);
|
|
1146
|
+
}
|
|
1147
|
+
const comparison = JSON.parse(input);
|
|
1148
|
+
if (isRecord(comparison) && "related" in comparison && !support.related) {
|
|
1149
|
+
delete comparison["related"];
|
|
1150
|
+
input = JSON.stringify(comparison);
|
|
1151
|
+
}
|
|
1152
|
+
if (!support.stdin) {
|
|
1153
|
+
arguments_.splice(matchesStdinIndex, 1, "--matches-json", input);
|
|
1154
|
+
input = undefined;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
stdout = await run(arguments_, input);
|
|
1127
1158
|
}
|
|
1128
1159
|
catch (error) {
|
|
1129
1160
|
if (options.signal?.aborted)
|
|
@@ -1744,6 +1775,15 @@ export function resolveCodexCommand(environment = process.env) {
|
|
|
1744
1775
|
}
|
|
1745
1776
|
return { command };
|
|
1746
1777
|
}
|
|
1778
|
+
export function executablePathForSpawn(command) {
|
|
1779
|
+
if (process.platform !== "win32" || !win32.isAbsolute(command))
|
|
1780
|
+
return command;
|
|
1781
|
+
// Root-relative paths still depend on the child's drive and working directory.
|
|
1782
|
+
const root = win32.parse(command).root;
|
|
1783
|
+
return root === "\\" || root === "/"
|
|
1784
|
+
? command
|
|
1785
|
+
: win32.toNamespacedPath(command);
|
|
1786
|
+
}
|
|
1747
1787
|
export async function bootstrapPlugin(codexHome, pluginRoot, options = {}) {
|
|
1748
1788
|
const root = await realpath(pluginRoot);
|
|
1749
1789
|
const { name, version } = await pluginMetadata(root);
|
|
@@ -1898,7 +1938,7 @@ export async function cleanupSdkDirectory(path) {
|
|
|
1898
1938
|
await rm(path, { recursive: true, force: true });
|
|
1899
1939
|
}
|
|
1900
1940
|
export async function runCodexCommand(command, args, environment, input, signal) {
|
|
1901
|
-
const child = spawn(command.command, [...args], {
|
|
1941
|
+
const child = spawn(executablePathForSpawn(command.command), [...args], {
|
|
1902
1942
|
env: environment,
|
|
1903
1943
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1904
1944
|
windowsHide: true,
|