@openai/codex-security 0.1.7 → 0.1.8
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 +10 -3
- package/_bundled_plugin/mcp/server.mjs +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/preflight/capability-profiles.toml +2 -2
- package/_bundled_plugin/references/config-preflight.md +6 -6
- package/_bundled_plugin/references/desktop-config-preflight.md +11 -0
- package/_bundled_plugin/references/final-report.md +10 -14
- package/_bundled_plugin/references/scan-artifacts.md +17 -17
- package/_bundled_plugin/references/shared-hard-rules.md +2 -2
- package/_bundled_plugin/scripts/deep_scan_workbench.py +422 -48
- package/_bundled_plugin/scripts/generate_rank_input.py +91 -0
- package/_bundled_plugin/scripts/workbench_cli.py +1 -50
- package/_bundled_plugin/scripts/workbench_constants.py +0 -2
- package/_bundled_plugin/scripts/workbench_db.py +7 -289
- package/_bundled_plugin/scripts/workbench_progress.py +11 -0
- package/_bundled_plugin/scripts/workbench_scan_history.py +0 -54
- package/_bundled_plugin/scripts/workbench_target.py +2 -6
- package/_bundled_plugin/scripts/workbench_validation.py +0 -211
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +10 -10
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +25 -43
- package/_bundled_plugin/skills/finding-discovery/SKILL.md +2 -4
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +11 -23
- package/_bundled_plugin/skills/security-scan/SKILL.md +89 -26
- package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +25 -0
- package/_bundled_plugin/skills/security-scan/references/repository-wide-scan.md +11 -38
- package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +5 -6
- package/_bundled_plugin/skills/triage-finding/SKILL.md +6 -14
- package/_bundled_plugin/skills/validation/SKILL.md +9 -9
- package/dist/api.d.ts +2 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +56 -13
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +46 -5
- package/dist/cli.js.map +1 -1
- package/dist/multiscan.d.ts +5 -1
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +206 -26
- package/dist/multiscan.js.map +1 -1
- package/dist/runtime.d.ts +13 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +122 -92
- package/dist/runtime.js.map +1 -1
- package/package.json +2 -2
- package/_bundled_plugin/mcp/mcp-app.html.br +0 -0
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA2BA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG9D,OAAO,EAEL,aAAa,EAOd,MAAM,UAAU,CAAC;AAElB,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;AAgBrB,OAAO,EAUL,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EAElB,MAAM,sBAAsB,CAAC;AAa9B,OAAO,EAOL,KAAK,YAAY,EAElB,MAAM,cAAc,CAAC;AAqBtB,KAAK,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AACF,KAAK,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AA4BvC,QA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,EAAE,oBAAoB,EAC7B,QAAQ,CAAC,EAAE,QAAQ,GAAG,gBAAgB,GAAG,qBAAqB,GAC7D,UAAU,CAwFZ;AAwBD,qBAAa,QAAQ;;gBAcjB,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;IAI5B,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAejC,SAAS,IAAI,IAAI;IAgBjB,eAAe,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;CA2BhD"}
|
package/dist/cli.js
CHANGED
|
@@ -67,6 +67,8 @@ const VALUE_OPTIONS = new Set([
|
|
|
67
67
|
"--auth",
|
|
68
68
|
"--path",
|
|
69
69
|
"--knowledge-base",
|
|
70
|
+
"--scan-prompt-file",
|
|
71
|
+
"--post-scan-prompt-file",
|
|
70
72
|
"--diff",
|
|
71
73
|
"--head",
|
|
72
74
|
"--base",
|
|
@@ -136,6 +138,20 @@ const DEEP_SCAN_OPTION_SCHEMAS = {
|
|
|
136
138
|
.optional()
|
|
137
139
|
.describe("Maximum deep-scan discovery runs."),
|
|
138
140
|
};
|
|
141
|
+
async function readPromptFiles(directory, scanPromptFile, postScanPromptFile) {
|
|
142
|
+
const [scanPrompt, postScanPrompt] = await Promise.all([
|
|
143
|
+
scanPromptFile === undefined
|
|
144
|
+
? undefined
|
|
145
|
+
: readFile(resolve(directory, scanPromptFile), "utf8"),
|
|
146
|
+
postScanPromptFile === undefined
|
|
147
|
+
? undefined
|
|
148
|
+
: readFile(resolve(directory, postScanPromptFile), "utf8"),
|
|
149
|
+
]);
|
|
150
|
+
return {
|
|
151
|
+
...(scanPrompt?.trim() ? { scanPrompt } : {}),
|
|
152
|
+
...(postScanPrompt?.trim() ? { postScanPrompt } : {}),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
139
155
|
const DEFAULT_DEPENDENCIES = {
|
|
140
156
|
createSecurity: (config) => new CodexSecurity(config),
|
|
141
157
|
environment: process.env,
|
|
@@ -727,6 +743,12 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
727
743
|
.array(optionValue("--knowledge-base"))
|
|
728
744
|
.default([])
|
|
729
745
|
.describe("Add security-context files or directories; repeat for multiple paths."),
|
|
746
|
+
scanPromptFile: optionValue("--scan-prompt-file")
|
|
747
|
+
.optional()
|
|
748
|
+
.describe("Append scan instructions from FILE."),
|
|
749
|
+
postScanPromptFile: optionValue("--post-scan-prompt-file")
|
|
750
|
+
.optional()
|
|
751
|
+
.describe("Run instructions from FILE after a validated scan."),
|
|
730
752
|
diff: optionValue("--diff")
|
|
731
753
|
.optional()
|
|
732
754
|
.describe("Scan committed Git changes from BASE to --head."),
|
|
@@ -832,6 +854,8 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
832
854
|
repository: args.repository,
|
|
833
855
|
paths: options.path,
|
|
834
856
|
knowledgeBasePaths: options.knowledgeBase,
|
|
857
|
+
scanPromptFile: options.scanPromptFile,
|
|
858
|
+
postScanPromptFile: options.postScanPromptFile,
|
|
835
859
|
diff: options.diff,
|
|
836
860
|
workingTree: options.workingTree,
|
|
837
861
|
head: options.head,
|
|
@@ -968,6 +992,12 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
968
992
|
.enum(["standard", "deep"])
|
|
969
993
|
.default("standard")
|
|
970
994
|
.describe("Default scan mode for repositories without a CSV mode."),
|
|
995
|
+
scanPromptFile: optionValue("--scan-prompt-file")
|
|
996
|
+
.optional()
|
|
997
|
+
.describe("Append instructions from FILE to every scan."),
|
|
998
|
+
postScanPromptFile: optionValue("--post-scan-prompt-file")
|
|
999
|
+
.optional()
|
|
1000
|
+
.describe("Run FILE after each completed, validated scan."),
|
|
971
1001
|
model: optionValue("--model")
|
|
972
1002
|
.optional()
|
|
973
1003
|
.describe(`OpenAI model for each repository (default: ${DEFAULT_SCAN_MODEL_CONFIGURATION.model}).`),
|
|
@@ -1014,6 +1044,7 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1014
1044
|
dependencies.addSignalListener("SIGTERM", onTerminate);
|
|
1015
1045
|
try {
|
|
1016
1046
|
const currentDirectory = dependencies.currentDirectory();
|
|
1047
|
+
const prompts = await readPromptFiles(currentDirectory, options.scanPromptFile, options.postScanPromptFile);
|
|
1017
1048
|
let inputPath;
|
|
1018
1049
|
let outputDir;
|
|
1019
1050
|
let githubHost;
|
|
@@ -1025,14 +1056,18 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1025
1056
|
argument === "--effort" ||
|
|
1026
1057
|
argument === "--provider" ||
|
|
1027
1058
|
argument === "--codex" ||
|
|
1028
|
-
argument === "--knowledge-base"
|
|
1059
|
+
argument === "--knowledge-base" ||
|
|
1060
|
+
argument === "--scan-prompt-file" ||
|
|
1061
|
+
argument === "--post-scan-prompt-file") {
|
|
1029
1062
|
optionIndex += 2;
|
|
1030
1063
|
}
|
|
1031
1064
|
else if (argument.startsWith("--model=") ||
|
|
1032
1065
|
argument.startsWith("--effort=") ||
|
|
1033
1066
|
argument.startsWith("--provider=") ||
|
|
1034
1067
|
argument.startsWith("--codex=") ||
|
|
1035
|
-
argument.startsWith("--knowledge-base=")
|
|
1068
|
+
argument.startsWith("--knowledge-base=") ||
|
|
1069
|
+
argument.startsWith("--scan-prompt-file=") ||
|
|
1070
|
+
argument.startsWith("--post-scan-prompt-file=")) {
|
|
1036
1071
|
optionIndex += 1;
|
|
1037
1072
|
}
|
|
1038
1073
|
else {
|
|
@@ -1069,6 +1104,7 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1069
1104
|
mode: options.mode,
|
|
1070
1105
|
maxAttempts: options.maxAttempts,
|
|
1071
1106
|
knowledgeBasePaths: options.knowledgeBase,
|
|
1107
|
+
...prompts,
|
|
1072
1108
|
config: {
|
|
1073
1109
|
pluginPath: options.pluginPath,
|
|
1074
1110
|
pythonPath: options.python,
|
|
@@ -1076,11 +1112,14 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
|
|
|
1076
1112
|
},
|
|
1077
1113
|
createSecurity: dependencies.createSecurity,
|
|
1078
1114
|
signal: controller.signal,
|
|
1079
|
-
onProgress: ({ repository, status, attempt, error }) => {
|
|
1080
|
-
|
|
1115
|
+
onProgress: ({ repository, status, attempt, error, warning }) => {
|
|
1116
|
+
const detail = error ?? warning;
|
|
1117
|
+
errorOutput.write(`codex-security: ${repository} ${status} (attempt ${attempt})${detail === undefined ? "" : `: ${redactedErrorMessage(detail)}`}\n`);
|
|
1081
1118
|
},
|
|
1082
1119
|
});
|
|
1083
|
-
exitCode =
|
|
1120
|
+
exitCode =
|
|
1121
|
+
interruptedExitCode() ??
|
|
1122
|
+
(result.failed > 0 || result.incomplete > 0 ? 2 : 0);
|
|
1084
1123
|
return { ...result };
|
|
1085
1124
|
}
|
|
1086
1125
|
catch (error) {
|
|
@@ -2040,6 +2079,7 @@ async function runScan(arguments_, errorOutput, dependencies, interactive = true
|
|
|
2040
2079
|
try {
|
|
2041
2080
|
const repository = arguments_.repository ?? dependencies.currentDirectory();
|
|
2042
2081
|
const target = targetFromArguments(arguments_);
|
|
2082
|
+
const prompts = await readPromptFiles(dependencies.currentDirectory(), arguments_.scanPromptFile, arguments_.postScanPromptFile);
|
|
2043
2083
|
const config = {
|
|
2044
2084
|
pluginPath: arguments_.pluginPath,
|
|
2045
2085
|
pythonPath: arguments_.pythonPath,
|
|
@@ -2156,6 +2196,7 @@ async function runScan(arguments_, errorOutput, dependencies, interactive = true
|
|
|
2156
2196
|
auth,
|
|
2157
2197
|
target,
|
|
2158
2198
|
knowledgeBasePaths: arguments_.knowledgeBasePaths,
|
|
2199
|
+
...prompts,
|
|
2159
2200
|
mode: arguments_.mode,
|
|
2160
2201
|
workers: arguments_.workers,
|
|
2161
2202
|
subagents: arguments_.subagents,
|