@openai/codex-security 0.1.0
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/LICENSE +201 -0
- package/README.md +306 -0
- package/_bundled_plugin/.app.json +20 -0
- package/_bundled_plugin/.codex-plugin/plugin.json +41 -0
- package/_bundled_plugin/.mcp.json +20 -0
- package/_bundled_plugin/assets/logo.png +0 -0
- package/_bundled_plugin/examples/completed-scan/coverage.json +22 -0
- package/_bundled_plugin/examples/completed-scan/findings.json +51 -0
- package/_bundled_plugin/examples/completed-scan/scan-manifest.json +43 -0
- package/_bundled_plugin/mcp/mcp-app.html.br +0 -0
- package/_bundled_plugin/mcp/server.mjs +24 -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/preflight/capability-profiles.toml +179 -0
- package/_bundled_plugin/references/config-preflight.md +115 -0
- package/_bundled_plugin/references/final-report.md +205 -0
- package/_bundled_plugin/references/finding-detail-fields.md +162 -0
- package/_bundled_plugin/references/sarif-adapter.md +26 -0
- package/_bundled_plugin/references/scan-artifacts.md +116 -0
- package/_bundled_plugin/references/scan-contract.md +164 -0
- package/_bundled_plugin/references/security-guidance.md +15 -0
- package/_bundled_plugin/references/shared-hard-rules.md +15 -0
- package/_bundled_plugin/references/static-finding-assessment.md +75 -0
- package/_bundled_plugin/schemas/coverage.schema.json +228 -0
- package/_bundled_plugin/schemas/findings.schema.json +359 -0
- package/_bundled_plugin/schemas/scan-manifest.schema.json +332 -0
- package/_bundled_plugin/scripts/config_preflight.py +901 -0
- package/_bundled_plugin/scripts/deep_scan_config.py +108 -0
- package/_bundled_plugin/scripts/deep_scan_workbench.py +1547 -0
- package/_bundled_plugin/scripts/filesystem_identity.py +30 -0
- package/_bundled_plugin/scripts/finalize_scan_contract.py +2208 -0
- package/_bundled_plugin/scripts/finding_preview.py +270 -0
- package/_bundled_plugin/scripts/generate_rank_input.py +1013 -0
- package/_bundled_plugin/scripts/normalize_candidates.py +320 -0
- package/_bundled_plugin/scripts/rank_preview.py +968 -0
- package/_bundled_plugin/scripts/report_projection.py +844 -0
- package/_bundled_plugin/scripts/resolve_security_md.py +158 -0
- package/_bundled_plugin/scripts/snapshot_sqlite.py +26 -0
- package/_bundled_plugin/scripts/validate_report_format.py +138 -0
- package/_bundled_plugin/scripts/validate_scan_contract.py +108 -0
- package/_bundled_plugin/scripts/validate_tracking_source.py +92 -0
- package/_bundled_plugin/scripts/windows_scan_local_files.py +612 -0
- package/_bundled_plugin/scripts/workbench/__init__.py +1 -0
- package/_bundled_plugin/scripts/workbench/handoff.py +238 -0
- package/_bundled_plugin/scripts/workbench_cli.py +325 -0
- package/_bundled_plugin/scripts/workbench_constants.py +81 -0
- package/_bundled_plugin/scripts/workbench_db.py +3728 -0
- package/_bundled_plugin/scripts/workbench_native_indexes.py +242 -0
- package/_bundled_plugin/scripts/workbench_progress.py +226 -0
- package/_bundled_plugin/scripts/workbench_remediation.py +125 -0
- package/_bundled_plugin/scripts/workbench_scan_history.py +829 -0
- package/_bundled_plugin/scripts/workbench_scan_start.py +149 -0
- package/_bundled_plugin/scripts/workbench_schema.py +714 -0
- package/_bundled_plugin/scripts/workbench_source_excerpt.py +99 -0
- package/_bundled_plugin/scripts/workbench_target.py +469 -0
- package/_bundled_plugin/scripts/workbench_target_state.py +63 -0
- package/_bundled_plugin/scripts/workbench_validation.py +294 -0
- package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +117 -0
- package/_bundled_plugin/skills/attack-path-analysis/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/attack-path-analysis/references/attack-path-facts.md +76 -0
- package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +153 -0
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +166 -0
- package/_bundled_plugin/skills/deep-security-scan/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/define-security-policy/SKILL.md +93 -0
- package/_bundled_plugin/skills/define-security-policy/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/finding-discovery/SKILL.md +155 -0
- package/_bundled_plugin/skills/finding-discovery/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/fix-finding/SKILL.md +112 -0
- package/_bundled_plugin/skills/fix-finding/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/propose-security-hardening/SKILL.md +240 -0
- package/_bundled_plugin/skills/propose-security-hardening/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/propose-security-hardening/references/proposal-format.md +424 -0
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +167 -0
- package/_bundled_plugin/skills/security-diff-scan/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/security-scan/SKILL.md +42 -0
- package/_bundled_plugin/skills/security-scan/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/security-scan/references/repository-wide-scan.md +48 -0
- package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +85 -0
- package/_bundled_plugin/skills/threat-model/SKILL.md +59 -0
- package/_bundled_plugin/skills/threat-model/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/threat-model/references/threat-model-guidance.md +48 -0
- package/_bundled_plugin/skills/track-findings/SKILL.md +222 -0
- package/_bundled_plugin/skills/track-findings/agents/openai.yaml +6 -0
- package/_bundled_plugin/skills/track-findings/references/github-security-advisories.md +54 -0
- package/_bundled_plugin/skills/track-findings/references/jira.md +77 -0
- package/_bundled_plugin/skills/triage-finding/SKILL.md +342 -0
- package/_bundled_plugin/skills/triage-finding/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/triage-finding/references/github-rest-intake.md +168 -0
- package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +62 -0
- package/_bundled_plugin/skills/triage-finding/references/triage-result-contract.md +108 -0
- package/_bundled_plugin/skills/validation/SKILL.md +110 -0
- package/_bundled_plugin/skills/validation/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/validation/references/validation-guidance.md +122 -0
- package/_bundled_plugin/skills/vulnerability-writeup/SKILL.md +263 -0
- package/_bundled_plugin/skills/vulnerability-writeup/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/vulnerability-writeup/references/report-format.md +104 -0
- package/bin/codex-security.mjs +26 -0
- package/dist/api.d.ts +112 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +1051 -0
- package/dist/api.js.map +1 -0
- package/dist/auth.d.ts +29 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +246 -0
- package/dist/auth.js.map +1 -0
- package/dist/bulk-scan-discovery.d.ts +35 -0
- package/dist/bulk-scan-discovery.d.ts.map +1 -0
- package/dist/bulk-scan-discovery.js +217 -0
- package/dist/bulk-scan-discovery.js.map +1 -0
- package/dist/cli.d.ts +67 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2128 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +199 -0
- package/dist/config.js.map +1 -0
- package/dist/contract.d.ts +21 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +848 -0
- package/dist/contract.js.map +1 -0
- package/dist/cost.d.ts +30 -0
- package/dist/cost.d.ts.map +1 -0
- package/dist/cost.js +280 -0
- package/dist/cost.js.map +1 -0
- package/dist/errors.d.ts +38 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +52 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge-base.d.ts +7 -0
- package/dist/knowledge-base.d.ts.map +1 -0
- package/dist/knowledge-base.js +181 -0
- package/dist/knowledge-base.js.map +1 -0
- package/dist/models.d.ts +231 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +3 -0
- package/dist/models.js.map +1 -0
- package/dist/multiscan.d.ts +30 -0
- package/dist/multiscan.d.ts.map +1 -0
- package/dist/multiscan.js +397 -0
- package/dist/multiscan.js.map +1 -0
- package/dist/result.d.ts +39 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +71 -0
- package/dist/result.js.map +1 -0
- package/dist/runtime.d.ts +69 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +997 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scan-comparison.d.ts +42 -0
- package/dist/scan-comparison.d.ts.map +1 -0
- package/dist/scan-comparison.js +153 -0
- package/dist/scan-comparison.js.map +1 -0
- package/dist/scan-history-renderer.d.ts +13 -0
- package/dist/scan-history-renderer.d.ts.map +1 -0
- package/dist/scan-history-renderer.js +297 -0
- package/dist/scan-history-renderer.js.map +1 -0
- package/dist/targets.d.ts +39 -0
- package/dist/targets.d.ts.map +1 -0
- package/dist/targets.js +295 -0
- package/dist/targets.js.map +1 -0
- package/dist/trusted-executable.d.ts +6 -0
- package/dist/trusted-executable.d.ts.map +1 -0
- package/dist/trusted-executable.js +77 -0
- package/dist/trusted-executable.js.map +1 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +42 -0
- package/dist/version.js.map +1 -0
- package/dist/worker-progress.d.ts +13 -0
- package/dist/worker-progress.d.ts.map +1 -0
- package/dist/worker-progress.js +113 -0
- package/dist/worker-progress.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-progress.js","sourceRoot":"","sources":["../src/worker-progress.ts"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,CAAC;AAC1C,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,oBAAoB,GAAG,+BAA+B,CAAC;AAC7D,MAAM,iBAAiB,GAAG,8CAA8C,CAAC;AACzE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,SAAS;IACT,aAAa;IACb,YAAY;IACZ,aAAa;CACd,CAAC,CAAC;A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,CAAC,SAAS,CAAC,EACvC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,OAAO,CAAC,OAAO,CAAoB;QAC1C,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC;QAC3B,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC;KAC5B,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;QAC3B,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,gBAAgB,CAC1B,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["const MAX_WORKER_STATUS_BYTES = 64 * 1024;\nconst MAX_WORKER_COUNT = 1024;\nconst WORKER_STATUS_PREFIX = \"CODEX_SECURITY_WORKER_STATUS \";\nconst PREFLIGHT_COMMAND = /(?:^|[\\\\/])config_preflight\\.py(?=$|[\"'\\s])/u;\nconst WORKER_PHASES = new Set([\n \"ranking\",\n \"file_review\",\n \"validation\",\n \"attack_path\",\n]);\n\nexport type ScanWorkerPhase =\n | \"ranking\"\n | \"file_review\"\n | \"validation\"\n | \"attack_path\";\n\nexport type ScanWorkerStatus =\n | {\n kind: \"preflight\";\n delegation: \"available\" | \"unavailable\" | \"unknown\";\n configuredSlots: number | null;\n }\n | {\n kind: \"dispatch\";\n phase: ScanWorkerPhase;\n planned: number;\n started: number;\n };\n\nexport function workerStatusFromEvent(\n event: Readonly<Record<string, unknown>>,\n): ScanWorkerStatus | null {\n if (event[\"type\"] !== \"item.completed\" || !isRecord(event[\"item\"])) {\n return null;\n }\n const item = event[\"item\"];\n if (item[\"type\"] === \"command_execution\") return preflightStatus(item);\n if (item[\"type\"] === \"agent_message\") return dispatchStatus(item);\n return null;\n}\n\nfunction preflightStatus(\n item: Readonly<Record<string, unknown>>,\n): ScanWorkerStatus | null {\n if (\n typeof item[\"command\"] !== \"string\" ||\n !PREFLIGHT_COMMAND.test(item[\"command\"]) ||\n typeof item[\"aggregated_output\"] !== \"string\" ||\n Buffer.byteLength(item[\"aggregated_output\"], \"utf8\") >\n MAX_WORKER_STATUS_BYTES\n ) {\n return null;\n }\n let payload: unknown;\n try {\n payload = JSON.parse(item[\"aggregated_output\"]);\n } catch {\n return null;\n }\n if (\n !isRecord(payload) ||\n (payload[\"profile\"] !== \"security_scan\" &&\n payload[\"profile\"] !== \"security_diff_scan\") ||\n !Array.isArray(payload[\"results\"])\n ) {\n return null;\n }\n const results = payload[\"results\"];\n const delegated = results.filter(\n (result): result is Record<string, unknown> =>\n isRecord(result) && result[\"capability\"] === \"delegated_workers\",\n );\n const delegatedResult = delegated[0];\n if (delegated.length !== 1 || delegatedResult === undefined) return null;\n const delegation =\n delegatedResult[\"status\"] === \"pass\"\n ? \"available\"\n : delegatedResult[\"status\"] === \"fail\"\n ? \"unavailable\"\n : delegatedResult[\"status\"] === \"unknown\"\n ? \"unknown\"\n : null;\n if (delegation === null) return null;\n const capacity = results.filter(\n (result): result is Record<string, unknown> =>\n isRecord(result) &&\n typeof result[\"capability\"] === \"string\" &&\n result[\"capability\"].startsWith(\"usable_worker_slots_\"),\n );\n if (capacity.length > 1) return null;\n const capacityResult = capacity[0];\n const configuredSlots =\n capacity.length === 1 &&\n capacityResult !== undefined &&\n isWorkerCount(capacityResult[\"actual\"])\n ? capacityResult[\"actual\"]\n : null;\n return { kind: \"preflight\", delegation, configuredSlots };\n}\n\nfunction dispatchStatus(\n item: Readonly<Record<string, unknown>>,\n): ScanWorkerStatus | null {\n if (\n typeof item[\"text\"] !== \"string\" ||\n Buffer.byteLength(item[\"text\"], \"utf8\") > MAX_WORKER_STATUS_BYTES\n ) {\n return null;\n }\n const markers = item[\"text\"]\n .split(/\\r?\\n/u)\n .filter((line) => line.startsWith(WORKER_STATUS_PREFIX));\n const marker = markers[0];\n if (markers.length !== 1 || marker === undefined) return null;\n let payload: unknown;\n try {\n payload = JSON.parse(marker.slice(WORKER_STATUS_PREFIX.length));\n } catch {\n return null;\n }\n if (\n !isRecord(payload) ||\n Object.keys(payload).length !== 3 ||\n typeof payload[\"phase\"] !== \"string\" ||\n !WORKER_PHASES.has(payload[\"phase\"]) ||\n !isWorkerCount(payload[\"planned\"]) ||\n !isWorkerCount(payload[\"started\"]) ||\n payload[\"started\"] > payload[\"planned\"]\n ) {\n return null;\n }\n return {\n kind: \"dispatch\",\n phase: payload[\"phase\"] as ScanWorkerPhase,\n planned: payload[\"planned\"],\n started: payload[\"started\"],\n };\n}\n\nfunction isWorkerCount(value: unknown): value is number {\n return (\n typeof value === \"number\" &&\n Number.isSafeInteger(value) &&\n value >= 0 &&\n value <= MAX_WORKER_COUNT\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openai/codex-security",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript SDK and CLI for Codex Security",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "OpenAI",
|
|
7
|
+
"homepage": "https://developers.openai.com/codex/security",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/openai/codex-security.git",
|
|
11
|
+
"directory": "sdk/typescript"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/openai/codex-security/issues",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=22"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"bin": {
|
|
28
|
+
"codex-security": "./bin/codex-security.mjs"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin",
|
|
32
|
+
"dist",
|
|
33
|
+
"_bundled_plugin",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"README.md"
|
|
36
|
+
],
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@inquirer/prompts": "8.3.0",
|
|
42
|
+
"@octokit/core": "7.0.6",
|
|
43
|
+
"@openai/codex": "0.144.6",
|
|
44
|
+
"@openai/codex-sdk": "0.144.6",
|
|
45
|
+
"ajv": "8.20.0",
|
|
46
|
+
"extract-zip": "2.0.1",
|
|
47
|
+
"fast-uri": "3.1.4",
|
|
48
|
+
"fflate": "0.8.2",
|
|
49
|
+
"incur": "0.4.13",
|
|
50
|
+
"papaparse": "5.5.3",
|
|
51
|
+
"pdfjs-dist": "5.6.205",
|
|
52
|
+
"smol-toml": "1.6.1"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/bun": "1.3.13",
|
|
56
|
+
"@types/node": "22.19.17",
|
|
57
|
+
"@types/papaparse": "5.3.15",
|
|
58
|
+
"json-schema-to-typescript": "15.0.4",
|
|
59
|
+
"prettier": "3.2.5",
|
|
60
|
+
"typescript": "5.7.3"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
64
|
+
"build": "pnpm run clean && tsc -p tsconfig.build.json",
|
|
65
|
+
"check:package": "node scripts/check-package.mjs",
|
|
66
|
+
"format": "prettier --check --ignore-path .gitignore --ignore-path .prettierignore \"**/*.{cjs,mjs,js,ts,json,md}\"",
|
|
67
|
+
"generate:models": "node scripts/generate-models.cjs",
|
|
68
|
+
"generate:models:check": "node scripts/generate-models.cjs --check",
|
|
69
|
+
"lint": "tsc --noEmit",
|
|
70
|
+
"test": "bun test --timeout 30000 ./tests-ts",
|
|
71
|
+
"test:package": "node scripts/smoke-package.mjs",
|
|
72
|
+
"types": "pnpm run generate:models:check && tsc --noEmit"
|
|
73
|
+
}
|
|
74
|
+
}
|