@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
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { CodexSecurity } from "./api.js";
|
|
2
|
+
export { estimateScanCost } from "./cost.js";
|
|
3
|
+
export type { ScanCost } from "./cost.js";
|
|
4
|
+
export type { CodexSecurityMetadata, ScanAuthentication, ScanOptions, ScanPreflight, ScanReconnectDetails, } from "./api.js";
|
|
5
|
+
export type { ScanWorkerPhase, ScanWorkerStatus } from "./worker-progress.js";
|
|
6
|
+
export { CodexLoginHandle } from "./auth.js";
|
|
7
|
+
export type { AccountStatus, LoginResult } from "./auth.js";
|
|
8
|
+
export { AuthenticationRequiredError, CodexSecurityError, ConfigurationError, ContractValidationError, IncompleteScanError, InvalidTargetError, OutputDirectoryError, OutputInsideProtectedRootError, PluginBootstrapError, PluginPythonUnavailableError, ScanCostLimitExceededError, ScanInterruptedError, } from "./errors.js";
|
|
9
|
+
export type { ProtectedScanPathKind } from "./errors.js";
|
|
10
|
+
export { DEFAULT_CODEX_CONFIG, mergedCodexConfig, writeCodexConfig, } from "./config.js";
|
|
11
|
+
export type { CodexSecurityConfig, JsonObject, JsonValue } from "./config.js";
|
|
12
|
+
export { loadContract, requireScanFile } from "./contract.js";
|
|
13
|
+
export type { LoadedContract, ScanExpectation } from "./contract.js";
|
|
14
|
+
export type * from "./models.js";
|
|
15
|
+
export { ScanResult } from "./result.js";
|
|
16
|
+
export type { ScanResultOptions, TurnResultMetadata } from "./result.js";
|
|
17
|
+
export { bootstrapPlugin, bundledPluginRoot, cleanupSdkDirectory, createIsolatedHome, createMarketplace, extractPluginZip, importAmbientAuth, MARKETPLACE_NAME, pluginExecutionEnvironment, pluginMetadata, PLUGIN_NAME, prepareOutputDir, resolveCodexCommand, resolvePluginPath, resolvePluginPython, validateOutputDir, } from "./runtime.js";
|
|
18
|
+
export type { CodexCommand, PluginInstall, PluginPythonOptions, ProcessEnvironment, } from "./runtime.js";
|
|
19
|
+
export { DiffTarget, normalizeRepository, normalizeTarget, repositoryRevision, validateMode, } from "./targets.js";
|
|
20
|
+
export type { NormalizedTarget, ScanMode, ScanTarget } from "./targets.js";
|
|
21
|
+
export { BUNDLED_PLUGIN_VERSION, VERSION } from "./version.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,QAAQ,E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CAAC;AACtB,YAAY,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { CodexSecurity } from "./api.js";
|
|
2
|
+
export { estimateScanCost } from "./cost.js";
|
|
3
|
+
export { CodexLoginHandle } from "./auth.js";
|
|
4
|
+
export { AuthenticationRequiredError, CodexSecurityError, ConfigurationError, ContractValidationError, IncompleteScanError, InvalidTargetError, OutputDirectoryError, OutputInsideProtectedRootError, PluginBootstrapError, PluginPythonUnavailableError, ScanCostLimitExceededError, ScanInterruptedError, } from "./errors.js";
|
|
5
|
+
export { DEFAULT_CODEX_CONFIG, mergedCodexConfig, writeCodexConfig, } from "./config.js";
|
|
6
|
+
export { loadContract, requireScanFile } from "./contract.js";
|
|
7
|
+
export { ScanResult } from "./result.js";
|
|
8
|
+
export { bootstrapPlugin, bundledPluginRoot, cleanupSdkDirectory, createIsolatedHome, createMarketplace, extractPluginZip, importAmbientAuth, MARKETPLACE_NAME, pluginExecutionEnvironment, pluginMetadata, PLUGIN_NAME, prepareOutputDir, resolveCodexCommand, resolvePluginPath, resolvePluginPython, validateOutputDir, } from "./runtime.js";
|
|
9
|
+
export { DiffTarget, normalizeRepository, normalizeTarget, repositoryRevision, validateMode, } from "./targets.js";
|
|
10
|
+
export { BUNDLED_PLUGIN_VERSION, VERSION } from "./version.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAU7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,8BAA8B,EAC9B,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAOtB,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { CodexSecurity } from \"./api.js\";\nexport { estimateScanCost } from \"./cost.js\";\nexport type { ScanCost } from \"./cost.js\";\nexport type {\n CodexSecurityMetadata,\n ScanAuthentication,\n ScanOptions,\n ScanPreflight,\n ScanReconnectDetails,\n} from \"./api.js\";\nexport type { ScanWorkerPhase, ScanWorkerStatus } from \"./worker-progress.js\";\nexport { CodexLoginHandle } from \"./auth.js\";\nexport type { AccountStatus, LoginResult } from \"./auth.js\";\n\nexport {\n AuthenticationRequiredError,\n CodexSecurityError,\n ConfigurationError,\n ContractValidationError,\n IncompleteScanError,\n InvalidTargetError,\n OutputDirectoryError,\n OutputInsideProtectedRootError,\n PluginBootstrapError,\n PluginPythonUnavailableError,\n ScanCostLimitExceededError,\n ScanInterruptedError,\n} from \"./errors.js\";\nexport type { ProtectedScanPathKind } from \"./errors.js\";\nexport {\n DEFAULT_CODEX_CONFIG,\n mergedCodexConfig,\n writeCodexConfig,\n} from \"./config.js\";\nexport type { CodexSecurityConfig, JsonObject, JsonValue } from \"./config.js\";\nexport { loadContract, requireScanFile } from \"./contract.js\";\nexport type { LoadedContract, ScanExpectation } from \"./contract.js\";\nexport type * from \"./models.js\";\nexport { ScanResult } from \"./result.js\";\nexport type { ScanResultOptions, TurnResultMetadata } from \"./result.js\";\nexport {\n bootstrapPlugin,\n bundledPluginRoot,\n cleanupSdkDirectory,\n createIsolatedHome,\n createMarketplace,\n extractPluginZip,\n importAmbientAuth,\n MARKETPLACE_NAME,\n pluginExecutionEnvironment,\n pluginMetadata,\n PLUGIN_NAME,\n prepareOutputDir,\n resolveCodexCommand,\n resolvePluginPath,\n resolvePluginPython,\n validateOutputDir,\n} from \"./runtime.js\";\nexport type {\n CodexCommand,\n PluginInstall,\n PluginPythonOptions,\n ProcessEnvironment,\n} from \"./runtime.js\";\nexport {\n DiffTarget,\n normalizeRepository,\n normalizeTarget,\n repositoryRevision,\n validateMode,\n} from \"./targets.js\";\nexport type { NormalizedTarget, ScanMode, ScanTarget } from \"./targets.js\";\nexport { BUNDLED_PLUGIN_VERSION, VERSION } from \"./version.js\";\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface PreparedKnowledgeBase {
|
|
2
|
+
path: string;
|
|
3
|
+
sources: string[];
|
|
4
|
+
cleanup(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare function prepareKnowledgeBase(paths: readonly string[], signal?: AbortSignal): Promise<PreparedKnowledgeBase>;
|
|
7
|
+
//# sourceMappingURL=knowledge-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-base.d.ts","sourceRoot":"","sources":["../src/knowledge-base.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAgFhC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { constants } from "node:fs";
|
|
2
|
+
import { lstat, mkdtemp, readFile, readdir, realpath, rm, writeFile, } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { basename, extname, join, resolve } from "node:path";
|
|
5
|
+
import { unzipSync } from "fflate";
|
|
6
|
+
const SUPPORTED_EXTENSIONS = new Set([
|
|
7
|
+
".md",
|
|
8
|
+
".markdown",
|
|
9
|
+
".txt",
|
|
10
|
+
".pdf",
|
|
11
|
+
".docx",
|
|
12
|
+
]);
|
|
13
|
+
export async function prepareKnowledgeBase(paths, signal) {
|
|
14
|
+
const sources = new Set();
|
|
15
|
+
const documents = new Set();
|
|
16
|
+
for (const requested of paths) {
|
|
17
|
+
signal?.throwIfAborted();
|
|
18
|
+
if (!requested.trim())
|
|
19
|
+
throw new Error("Knowledge base paths cannot be empty.");
|
|
20
|
+
const path = resolve(requested);
|
|
21
|
+
const metadata = await lstat(path);
|
|
22
|
+
if (metadata.isSymbolicLink()) {
|
|
23
|
+
throw new Error(`Knowledge base paths cannot be symbolic links: ${path}`);
|
|
24
|
+
}
|
|
25
|
+
if (!metadata.isFile() && !metadata.isDirectory()) {
|
|
26
|
+
throw new Error(`Knowledge base path is not a file or directory: ${path}`);
|
|
27
|
+
}
|
|
28
|
+
const source = await realpath(path);
|
|
29
|
+
const selected = metadata.isDirectory() ? await discover(source) : [source];
|
|
30
|
+
if (selected.length === 0) {
|
|
31
|
+
throw new Error(`Knowledge base directory contains no supported documents: ${path}`);
|
|
32
|
+
}
|
|
33
|
+
for (const document of selected) {
|
|
34
|
+
if (!SUPPORTED_EXTENSIONS.has(extname(document).toLowerCase())) {
|
|
35
|
+
throw new Error(`Unsupported knowledge base document: ${document}`);
|
|
36
|
+
}
|
|
37
|
+
documents.add(document);
|
|
38
|
+
}
|
|
39
|
+
sources.add(source);
|
|
40
|
+
}
|
|
41
|
+
const path = await mkdtemp(join(tmpdir(), "codex-security-knowledge-"));
|
|
42
|
+
try {
|
|
43
|
+
let index = 0;
|
|
44
|
+
for (const document of documents) {
|
|
45
|
+
signal?.throwIfAborted();
|
|
46
|
+
const metadata = await lstat(document);
|
|
47
|
+
if (process.platform !== "win32" && (metadata.mode & 0o444) === 0) {
|
|
48
|
+
throw new Error(`Knowledge base document is not readable: ${document}`);
|
|
49
|
+
}
|
|
50
|
+
const bytes = await readFile(document, {
|
|
51
|
+
flag: constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0),
|
|
52
|
+
signal,
|
|
53
|
+
});
|
|
54
|
+
const extension = extname(document).toLowerCase();
|
|
55
|
+
const text = extension === ".pdf"
|
|
56
|
+
? await extractPdf(document, bytes)
|
|
57
|
+
: extension === ".docx"
|
|
58
|
+
? extractDocx(document, bytes)
|
|
59
|
+
: decodeText(document, bytes);
|
|
60
|
+
if ((extension === ".pdf" || extension === ".docx") && !text.trim()) {
|
|
61
|
+
throw new Error(`Knowledge base document contains no extractable text: ${document}`);
|
|
62
|
+
}
|
|
63
|
+
await writeFile(join(path, `${index++}-${basename(document)}.txt`), text, {
|
|
64
|
+
encoding: "utf8",
|
|
65
|
+
mode: 0o600,
|
|
66
|
+
signal,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
await rm(path, { recursive: true, force: true });
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
path,
|
|
76
|
+
sources: [...sources],
|
|
77
|
+
cleanup: () => rm(path, { recursive: true, force: true }),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async function discover(directory) {
|
|
81
|
+
const documents = [];
|
|
82
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
83
|
+
for (const entry of entries) {
|
|
84
|
+
const path = join(directory, entry.name);
|
|
85
|
+
if (entry.isSymbolicLink())
|
|
86
|
+
continue;
|
|
87
|
+
if (entry.isDirectory()) {
|
|
88
|
+
documents.push(...(await discover(path)));
|
|
89
|
+
}
|
|
90
|
+
else if (entry.isFile() &&
|
|
91
|
+
SUPPORTED_EXTENSIONS.has(extname(path).toLowerCase())) {
|
|
92
|
+
documents.push(path);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return documents;
|
|
96
|
+
}
|
|
97
|
+
function decodeText(path, bytes) {
|
|
98
|
+
try {
|
|
99
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
throw new Error(`Knowledge base document is not valid UTF-8: ${path}`, {
|
|
103
|
+
cause: error,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function extractPdf(path, bytes) {
|
|
108
|
+
try {
|
|
109
|
+
const { getDocument, VerbosityLevel } = await import("pdfjs-dist/legacy/build/pdf.mjs");
|
|
110
|
+
const document = await getDocument({
|
|
111
|
+
data: new Uint8Array(bytes),
|
|
112
|
+
isEvalSupported: false,
|
|
113
|
+
stopAtErrors: true,
|
|
114
|
+
verbosity: VerbosityLevel.ERRORS,
|
|
115
|
+
}).promise;
|
|
116
|
+
try {
|
|
117
|
+
const pages = [];
|
|
118
|
+
for (let number = 1; number <= document.numPages; number++) {
|
|
119
|
+
const content = await (await document.getPage(number)).getTextContent();
|
|
120
|
+
pages.push(content.items
|
|
121
|
+
.map((item) => ("str" in item ? item.str : ""))
|
|
122
|
+
.join(" "));
|
|
123
|
+
}
|
|
124
|
+
return pages.join("\n");
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
await document.destroy();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
throw new Error(`Cannot extract text from knowledge base PDF: ${path}`, {
|
|
132
|
+
cause: error,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function extractDocx(path, bytes) {
|
|
137
|
+
try {
|
|
138
|
+
const files = unzipSync(bytes, {
|
|
139
|
+
filter: (file) => {
|
|
140
|
+
if (file.name !== "word/document.xml")
|
|
141
|
+
return false;
|
|
142
|
+
if (file.originalSize > 25 * 1024 * 1024) {
|
|
143
|
+
throw new Error("DOCX document text exceeds 25 MB.");
|
|
144
|
+
}
|
|
145
|
+
return true;
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
const document = files["word/document.xml"];
|
|
149
|
+
if (document === undefined)
|
|
150
|
+
throw new Error("Missing word/document.xml.");
|
|
151
|
+
const xml = decodeText(path, document);
|
|
152
|
+
if (!/<(?:\w+:)?document\b[^>]*>[\s\S]*<\/(?:\w+:)?document\s*>/u.test(xml)) {
|
|
153
|
+
throw new Error("Malformed word/document.xml.");
|
|
154
|
+
}
|
|
155
|
+
return decodeXml(xml
|
|
156
|
+
.replace(/<\/(?:\w+:)?p\s*>/gu, "\n")
|
|
157
|
+
.replace(/<(?:\w+:)?tab\b[^>]*\/>/gu, "\t")
|
|
158
|
+
.replace(/<[^>]+>/gu, ""));
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
throw new Error(`Cannot extract text from knowledge base DOCX: ${path}`, {
|
|
162
|
+
cause: error,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function decodeXml(value) {
|
|
167
|
+
const entities = {
|
|
168
|
+
amp: "&",
|
|
169
|
+
lt: "<",
|
|
170
|
+
gt: ">",
|
|
171
|
+
quot: '"',
|
|
172
|
+
apos: "'",
|
|
173
|
+
};
|
|
174
|
+
return value.replace(/&(amp|lt|gt|quot|apos|#\d+|#x[\da-f]+);/giu, (entity, name) => {
|
|
175
|
+
if (!name.startsWith("#"))
|
|
176
|
+
return entities[name.toLowerCase()] ?? entity;
|
|
177
|
+
const hexadecimal = name[1]?.toLowerCase() === "x";
|
|
178
|
+
return String.fromCodePoint(Number.parseInt(name.slice(hexadecimal ? 2 : 1), hexadecimal ? 16 : 10));
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=knowledge-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-base.js","sourceRoot":"","sources":["../src/knowledge-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,EAAE,EACF,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC;IACnC,KAAK;IACL,WAAW;IACX,MAAM;IACN,MAAM;IACN,OAAO;CACR,CAAC,CAAC;AAQH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAwB,EACxB,MAAoB;IAEpB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,SAAS,GAAG,IAAI,GAAG,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EAAE,IAAI,CAAC;aAC1C,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAC5B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,iDAAiD,IAAI,EAAE,EAAE;YACvE,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,QAAQ,GAA2B;QACvC,GAAG,EAAE,GAAG;QACR,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,GAAG;QACT,IAAI,EAAE,GAAG;KACV,CAAC;IACF,OAAO,KAAK,CAAC,OAAO,CAClB,4CAA4C,EAC5C,CAAC,MAAM,EAAE,IAAY,EAAE,EAAE;QACvB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,MAAM,CAAC;QACzE,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,GAAG,CAAC;QACnD,OAAO,MAAM,CAAC,aAAa,CACzB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACxE,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { constants } from \"node:fs\";\nimport {\n lstat,\n mkdtemp,\n readFile,\n readdir,\n realpath,\n rm,\n writeFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { basename, extname, join, resolve } from \"node:path\";\nimport { unzipSync } from \"fflate\";\n\nconst SUPPORTED_EXTENSIONS = new Set([\n \".md\",\n \".markdown\",\n \".txt\",\n \".pdf\",\n \".docx\",\n]);\n\nexport interface PreparedKnowledgeBase {\n path: string;\n sources: string[];\n cleanup(): Promise<void>;\n}\n\nexport async function prepareKnowledgeBase(\n paths: readonly string[],\n signal?: AbortSignal,\n): Promise<PreparedKnowledgeBase> {\n const sources = new Set<string>();\n const documents = new Set<string>();\n\n for (const requested of paths) {\n signal?.throwIfAborted();\n if (!requested.trim())\n throw new Error(\"Knowledge base paths cannot be empty.\");\n const path = resolve(requested);\n const metadata = await lstat(path);\n if (metadata.isSymbolicLink()) {\n throw new Error(`Knowledge base paths cannot be symbolic links: ${path}`);\n }\n if (!metadata.isFile() && !metadata.isDirectory()) {\n throw new Error(\n `Knowledge base path is not a file or directory: ${path}`,\n );\n }\n\n const source = await realpath(path);\n const selected = metadata.isDirectory() ? await discover(source) : [source];\n if (selected.length === 0) {\n throw new Error(\n `Knowledge base directory contains no supported documents: ${path}`,\n );\n }\n for (const document of selected) {\n if (!SUPPORTED_EXTENSIONS.has(extname(document).toLowerCase())) {\n throw new Error(`Unsupported knowledge base document: ${document}`);\n }\n documents.add(document);\n }\n sources.add(source);\n }\n\n const path = await mkdtemp(join(tmpdir(), \"codex-security-knowledge-\"));\n try {\n let index = 0;\n for (const document of documents) {\n signal?.throwIfAborted();\n const metadata = await lstat(document);\n if (process.platform !== \"win32\" && (metadata.mode & 0o444) === 0) {\n throw new Error(`Knowledge base document is not readable: ${document}`);\n }\n const bytes = await readFile(document, {\n flag: constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0),\n signal,\n });\n const extension = extname(document).toLowerCase();\n const text =\n extension === \".pdf\"\n ? await extractPdf(document, bytes)\n : extension === \".docx\"\n ? extractDocx(document, bytes)\n : decodeText(document, bytes);\n if ((extension === \".pdf\" || extension === \".docx\") && !text.trim()) {\n throw new Error(\n `Knowledge base document contains no extractable text: ${document}`,\n );\n }\n await writeFile(\n join(path, `${index++}-${basename(document)}.txt`),\n text,\n {\n encoding: \"utf8\",\n mode: 0o600,\n signal,\n },\n );\n }\n } catch (error) {\n await rm(path, { recursive: true, force: true });\n throw error;\n }\n\n return {\n path,\n sources: [...sources],\n cleanup: () => rm(path, { recursive: true, force: true }),\n };\n}\n\nasync function discover(directory: string): Promise<string[]> {\n const documents: string[] = [];\n const entries = await readdir(directory, { withFileTypes: true });\n for (const entry of entries) {\n const path = join(directory, entry.name);\n if (entry.isSymbolicLink()) continue;\n if (entry.isDirectory()) {\n documents.push(...(await discover(path)));\n } else if (\n entry.isFile() &&\n SUPPORTED_EXTENSIONS.has(extname(path).toLowerCase())\n ) {\n documents.push(path);\n }\n }\n return documents;\n}\n\nfunction decodeText(path: string, bytes: Uint8Array): string {\n try {\n return new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes);\n } catch (error) {\n throw new Error(`Knowledge base document is not valid UTF-8: ${path}`, {\n cause: error,\n });\n }\n}\n\nasync function extractPdf(path: string, bytes: Uint8Array): Promise<string> {\n try {\n const { getDocument, VerbosityLevel } = await import(\n \"pdfjs-dist/legacy/build/pdf.mjs\"\n );\n const document = await getDocument({\n data: new Uint8Array(bytes),\n isEvalSupported: false,\n stopAtErrors: true,\n verbosity: VerbosityLevel.ERRORS,\n }).promise;\n try {\n const pages: string[] = [];\n for (let number = 1; number <= document.numPages; number++) {\n const content = await (await document.getPage(number)).getTextContent();\n pages.push(\n content.items\n .map((item) => (\"str\" in item ? item.str : \"\"))\n .join(\" \"),\n );\n }\n return pages.join(\"\\n\");\n } finally {\n await document.destroy();\n }\n } catch (error) {\n throw new Error(`Cannot extract text from knowledge base PDF: ${path}`, {\n cause: error,\n });\n }\n}\n\nfunction extractDocx(path: string, bytes: Uint8Array): string {\n try {\n const files = unzipSync(bytes, {\n filter: (file) => {\n if (file.name !== \"word/document.xml\") return false;\n if (file.originalSize > 25 * 1024 * 1024) {\n throw new Error(\"DOCX document text exceeds 25 MB.\");\n }\n return true;\n },\n });\n const document = files[\"word/document.xml\"];\n if (document === undefined) throw new Error(\"Missing word/document.xml.\");\n const xml = decodeText(path, document);\n if (\n !/<(?:\\w+:)?document\\b[^>]*>[\\s\\S]*<\\/(?:\\w+:)?document\\s*>/u.test(xml)\n ) {\n throw new Error(\"Malformed word/document.xml.\");\n }\n return decodeXml(\n xml\n .replace(/<\\/(?:\\w+:)?p\\s*>/gu, \"\\n\")\n .replace(/<(?:\\w+:)?tab\\b[^>]*\\/>/gu, \"\\t\")\n .replace(/<[^>]+>/gu, \"\"),\n );\n } catch (error) {\n throw new Error(`Cannot extract text from knowledge base DOCX: ${path}`, {\n cause: error,\n });\n }\n}\n\nfunction decodeXml(value: string): string {\n const entities: Record<string, string> = {\n amp: \"&\",\n lt: \"<\",\n gt: \">\",\n quot: '\"',\n apos: \"'\",\n };\n return value.replace(\n /&(amp|lt|gt|quot|apos|#\\d+|#x[\\da-f]+);/giu,\n (entity, name: string) => {\n if (!name.startsWith(\"#\")) return entities[name.toLowerCase()] ?? entity;\n const hexadecimal = name[1]?.toLowerCase() === \"x\";\n return String.fromCodePoint(\n Number.parseInt(name.slice(hexadecimal ? 2 : 1), hexadecimal ? 16 : 10),\n );\n },\n );\n}\n"]}
|
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
export interface ScanManifest {
|
|
2
|
+
documentType: "codex-security.scan-manifest";
|
|
3
|
+
schemaVersion: "1.0";
|
|
4
|
+
scan: {
|
|
5
|
+
id: string;
|
|
6
|
+
producer: {
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
status: "completed";
|
|
12
|
+
startedAt: string;
|
|
13
|
+
completedAt: string;
|
|
14
|
+
sealedAt: string;
|
|
15
|
+
target: {
|
|
16
|
+
kind: "git_revision" | "git_worktree" | "git_diff" | "directory_snapshot";
|
|
17
|
+
targetId: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
remote?: string;
|
|
20
|
+
revision?: string;
|
|
21
|
+
baseRevision?: string;
|
|
22
|
+
headRevision?: string;
|
|
23
|
+
snapshotDigest?: string;
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
scope: {
|
|
27
|
+
includePaths: string[];
|
|
28
|
+
excludePaths: string[];
|
|
29
|
+
summary?: string;
|
|
30
|
+
artifactsReviewed?: string[];
|
|
31
|
+
runtimeStatus?: string;
|
|
32
|
+
validationMode?: string;
|
|
33
|
+
context?: string;
|
|
34
|
+
limitations?: string[];
|
|
35
|
+
[k: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
threatModel?: {
|
|
38
|
+
summary: string;
|
|
39
|
+
assets?: string[];
|
|
40
|
+
trustBoundaries?: string[];
|
|
41
|
+
attackerCapabilities?: string[];
|
|
42
|
+
securityObjectives?: string[];
|
|
43
|
+
assumptions?: string[];
|
|
44
|
+
[k: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
hardening?: {
|
|
47
|
+
portfolioPath: "hardening/hardening.md";
|
|
48
|
+
[k: string]: unknown;
|
|
49
|
+
};
|
|
50
|
+
coverageRef: "coverage.json";
|
|
51
|
+
findingsRef: "findings.json";
|
|
52
|
+
/**
|
|
53
|
+
* @minItems 1
|
|
54
|
+
*/
|
|
55
|
+
artifacts: {
|
|
56
|
+
path: string;
|
|
57
|
+
sha256: string;
|
|
58
|
+
mediaType: string;
|
|
59
|
+
[k: string]: unknown;
|
|
60
|
+
}[];
|
|
61
|
+
[k: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
[k: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
export interface FindingsDocument {
|
|
66
|
+
documentType: "codex-security.findings";
|
|
67
|
+
schemaVersion: "1.0";
|
|
68
|
+
scanId: string;
|
|
69
|
+
findings: {
|
|
70
|
+
findingId: string;
|
|
71
|
+
occurrenceId: string;
|
|
72
|
+
ruleId: string;
|
|
73
|
+
identity: {
|
|
74
|
+
anchor: string;
|
|
75
|
+
instance?: string;
|
|
76
|
+
[k: string]: unknown;
|
|
77
|
+
};
|
|
78
|
+
fingerprints: {
|
|
79
|
+
algorithm: "codex-security/v1";
|
|
80
|
+
primary: string;
|
|
81
|
+
[k: string]: unknown;
|
|
82
|
+
};
|
|
83
|
+
title: string;
|
|
84
|
+
summary: string;
|
|
85
|
+
severity: {
|
|
86
|
+
level: "critical" | "high" | "medium" | "low" | "informational";
|
|
87
|
+
score?: number;
|
|
88
|
+
scoringSystem?: string;
|
|
89
|
+
vector?: string;
|
|
90
|
+
rationale?: string;
|
|
91
|
+
changeConditions?: string;
|
|
92
|
+
[k: string]: unknown;
|
|
93
|
+
};
|
|
94
|
+
confidence: {
|
|
95
|
+
level: "high" | "medium" | "low";
|
|
96
|
+
rationale: string;
|
|
97
|
+
[k: string]: unknown;
|
|
98
|
+
};
|
|
99
|
+
taxonomy: {
|
|
100
|
+
category: string;
|
|
101
|
+
cwe: string[];
|
|
102
|
+
[k: string]: unknown;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* @minItems 1
|
|
106
|
+
*/
|
|
107
|
+
locations: {
|
|
108
|
+
path: string;
|
|
109
|
+
startLine: number;
|
|
110
|
+
endLine?: number;
|
|
111
|
+
role?: string;
|
|
112
|
+
[k: string]: unknown;
|
|
113
|
+
}[];
|
|
114
|
+
writeup?: {
|
|
115
|
+
reportPath: string;
|
|
116
|
+
[k: string]: unknown;
|
|
117
|
+
};
|
|
118
|
+
codeEvidence?: {
|
|
119
|
+
id: string;
|
|
120
|
+
label: string;
|
|
121
|
+
path: string;
|
|
122
|
+
startLine: number;
|
|
123
|
+
endLine?: number;
|
|
124
|
+
language?: string;
|
|
125
|
+
role?: string;
|
|
126
|
+
code: string;
|
|
127
|
+
explanation: string;
|
|
128
|
+
[k: string]: unknown;
|
|
129
|
+
}[];
|
|
130
|
+
rootCause?: {
|
|
131
|
+
summary: string;
|
|
132
|
+
evidenceRefs?: string[];
|
|
133
|
+
code?: string;
|
|
134
|
+
language?: string;
|
|
135
|
+
[k: string]: unknown;
|
|
136
|
+
} | string;
|
|
137
|
+
remediation: string;
|
|
138
|
+
validation?: {
|
|
139
|
+
[k: string]: unknown;
|
|
140
|
+
} | null;
|
|
141
|
+
attackPath?: {
|
|
142
|
+
[k: string]: unknown;
|
|
143
|
+
} | null;
|
|
144
|
+
remediationTests?: string[];
|
|
145
|
+
preventiveControls?: string[];
|
|
146
|
+
provenance: {
|
|
147
|
+
source: string;
|
|
148
|
+
[k: string]: unknown;
|
|
149
|
+
};
|
|
150
|
+
extensions?: {
|
|
151
|
+
candidateId?: string;
|
|
152
|
+
ledgerRowId?: string;
|
|
153
|
+
reportId?: string;
|
|
154
|
+
[k: string]: unknown;
|
|
155
|
+
};
|
|
156
|
+
[k: string]: unknown;
|
|
157
|
+
}[];
|
|
158
|
+
[k: string]: unknown;
|
|
159
|
+
}
|
|
160
|
+
export interface CoverageDocument {
|
|
161
|
+
documentType: "codex-security.coverage";
|
|
162
|
+
schemaVersion: "1.0";
|
|
163
|
+
scanId: string;
|
|
164
|
+
mode: "repository" | "scoped_path" | "diff" | "commit" | "branch_diff" | "working_tree" | "deep_repository";
|
|
165
|
+
completeness: "complete" | "partial" | "unknown";
|
|
166
|
+
inventoryStrategy: "repository" | "scoped_path" | "diff" | "directory" | "custom";
|
|
167
|
+
includePaths: string[];
|
|
168
|
+
excludePaths: string[];
|
|
169
|
+
surfaces: {
|
|
170
|
+
id: string;
|
|
171
|
+
label: string;
|
|
172
|
+
disposition: "reported" | "no_issue_found" | "rejected" | "not_applicable" | "needs_follow_up";
|
|
173
|
+
receiptRefs: string[];
|
|
174
|
+
riskArea?: string;
|
|
175
|
+
notes?: string;
|
|
176
|
+
[k: string]: unknown;
|
|
177
|
+
}[];
|
|
178
|
+
explicitExclusions: {
|
|
179
|
+
pattern: string;
|
|
180
|
+
reason: string;
|
|
181
|
+
[k: string]: unknown;
|
|
182
|
+
}[];
|
|
183
|
+
deferred: {
|
|
184
|
+
id: string;
|
|
185
|
+
reason: string;
|
|
186
|
+
paths?: string[];
|
|
187
|
+
surfaceIds?: string[];
|
|
188
|
+
[k: string]: unknown;
|
|
189
|
+
}[];
|
|
190
|
+
openQuestions?: {
|
|
191
|
+
question: string;
|
|
192
|
+
followUpPrompt?: string;
|
|
193
|
+
[k: string]: unknown;
|
|
194
|
+
}[];
|
|
195
|
+
[k: string]: unknown;
|
|
196
|
+
}
|
|
197
|
+
export type ContractObject = Record<string, unknown>;
|
|
198
|
+
export type ScanRecord = ScanManifest["scan"];
|
|
199
|
+
export type ScanProducer = ScanRecord["producer"];
|
|
200
|
+
export type ScanTargetRecord = ScanRecord["target"];
|
|
201
|
+
export type TargetKind = ScanTargetRecord["kind"];
|
|
202
|
+
export type ScanScope = ScanRecord["scope"];
|
|
203
|
+
export type ThreatModel = NonNullable<ScanRecord["threatModel"]>;
|
|
204
|
+
export type ScanHardening = NonNullable<ScanRecord["hardening"]>;
|
|
205
|
+
export type ScanArtifact = ScanRecord["artifacts"][number];
|
|
206
|
+
export type Finding = FindingsDocument["findings"][number];
|
|
207
|
+
export type FindingIdentity = Finding["identity"];
|
|
208
|
+
export type FindingFingerprints = Finding["fingerprints"];
|
|
209
|
+
export type FindingSeverity = Finding["severity"];
|
|
210
|
+
export type SeverityLevel = FindingSeverity["level"];
|
|
211
|
+
export type FindingConfidence = Finding["confidence"];
|
|
212
|
+
export type ConfidenceLevel = FindingConfidence["level"];
|
|
213
|
+
export type FindingTaxonomy = Finding["taxonomy"];
|
|
214
|
+
export type FindingLocation = Finding["locations"][number];
|
|
215
|
+
export type FindingWriteup = NonNullable<Finding["writeup"]>;
|
|
216
|
+
export type FindingCodeEvidence = NonNullable<Finding["codeEvidence"]>[number];
|
|
217
|
+
export type FindingRootCause = Extract<Finding["rootCause"], object>;
|
|
218
|
+
export type FindingValidation = NonNullable<Finding["validation"]>;
|
|
219
|
+
export type FindingAttackPath = NonNullable<Finding["attackPath"]>;
|
|
220
|
+
export type AttackPathDataflow = ContractObject;
|
|
221
|
+
export type AttackPathReachability = ContractObject;
|
|
222
|
+
export type FindingProvenance = Finding["provenance"];
|
|
223
|
+
export type CoverageMode = CoverageDocument["mode"];
|
|
224
|
+
export type CoverageCompleteness = CoverageDocument["completeness"];
|
|
225
|
+
export type InventoryStrategy = CoverageDocument["inventoryStrategy"];
|
|
226
|
+
export type CoverageSurface = CoverageDocument["surfaces"][number];
|
|
227
|
+
export type SurfaceDisposition = CoverageSurface["disposition"];
|
|
228
|
+
export type ExplicitExclusion = CoverageDocument["explicitExclusions"][number];
|
|
229
|
+
export type DeferredCoverage = CoverageDocument["deferred"][number];
|
|
230
|
+
export type CoverageOpenQuestion = NonNullable<CoverageDocument["openQuestions"]>[number];
|
|
231
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,8BAA8B,CAAC;IAC7C,aAAa,EAAE,KAAK,CAAC;IACrB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;SACtB,CAAC;QACF,MAAM,EAAE,WAAW,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE;YACN,IAAI,EAAE,cAAc,GAAG,cAAc,GAAG,UAAU,GAAG,oBAAoB,CAAC;YAC1E,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,MAAM,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,cAAc,CAAC,EAAE,MAAM,CAAC;YACxB,CAAC,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MAAM,iBAAiB,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAC5C,gBAAgB,CAAC,eAAe,CAAC,CAClC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/models.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,yEAAyE","sourcesContent":["/* Generated from the plugin JSON Schemas. Run `pnpm generate:models`. */\n\nexport interface ScanManifest {\n documentType: \"codex-security.scan-manifest\";\n schemaVersion: \"1.0\";\n scan: {\n id: string;\n producer: {\n name: string;\n version: string;\n [k: string]: unknown;\n };\n status: \"completed\";\n startedAt: string;\n completedAt: string;\n sealedAt: string;\n target: {\n kind: \"git_revision\" | \"git_worktree\" | \"git_diff\" | \"directory_snapshot\";\n targetId: string;\n displayName: string;\n remote?: string;\n revision?: string;\n baseRevision?: string;\n headRevision?: string;\n snapshotDigest?: string;\n [k: string]: unknown;\n };\n scope: {\n includePaths: string[];\n excludePaths: string[];\n summary?: string;\n artifactsReviewed?: string[];\n runtimeStatus?: string;\n validationMode?: string;\n context?: string;\n limitations?: string[];\n [k: string]: unknown;\n };\n threatModel?: {\n summary: string;\n assets?: string[];\n trustBoundaries?: string[];\n attackerCapabilities?: string[];\n securityObjectives?: string[];\n assumptions?: string[];\n [k: string]: unknown;\n };\n hardening?: {\n portfolioPath: \"hardening/hardening.md\";\n [k: string]: unknown;\n };\n coverageRef: \"coverage.json\";\n findingsRef: \"findings.json\";\n /**\n * @minItems 1\n */\n artifacts: {\n path: string;\n sha256: string;\n mediaType: string;\n [k: string]: unknown;\n }[];\n [k: string]: unknown;\n };\n [k: string]: unknown;\n}\n\nexport interface FindingsDocument {\n documentType: \"codex-security.findings\";\n schemaVersion: \"1.0\";\n scanId: string;\n findings: {\n findingId: string;\n occurrenceId: string;\n ruleId: string;\n identity: {\n anchor: string;\n instance?: string;\n [k: string]: unknown;\n };\n fingerprints: {\n algorithm: \"codex-security/v1\";\n primary: string;\n [k: string]: unknown;\n };\n title: string;\n summary: string;\n severity: {\n level: \"critical\" | \"high\" | \"medium\" | \"low\" | \"informational\";\n score?: number;\n scoringSystem?: string;\n vector?: string;\n rationale?: string;\n changeConditions?: string;\n [k: string]: unknown;\n };\n confidence: {\n level: \"high\" | \"medium\" | \"low\";\n rationale: string;\n [k: string]: unknown;\n };\n taxonomy: {\n category: string;\n cwe: string[];\n [k: string]: unknown;\n };\n /**\n * @minItems 1\n */\n locations: {\n path: string;\n startLine: number;\n endLine?: number;\n role?: string;\n [k: string]: unknown;\n }[];\n writeup?: {\n reportPath: string;\n [k: string]: unknown;\n };\n codeEvidence?: {\n id: string;\n label: string;\n path: string;\n startLine: number;\n endLine?: number;\n language?: string;\n role?: string;\n code: string;\n explanation: string;\n [k: string]: unknown;\n }[];\n rootCause?:\n | {\n summary: string;\n evidenceRefs?: string[];\n code?: string;\n language?: string;\n [k: string]: unknown;\n }\n | string;\n remediation: string;\n validation?: {\n [k: string]: unknown;\n } | null;\n attackPath?: {\n [k: string]: unknown;\n } | null;\n remediationTests?: string[];\n preventiveControls?: string[];\n provenance: {\n source: string;\n [k: string]: unknown;\n };\n extensions?: {\n candidateId?: string;\n ledgerRowId?: string;\n reportId?: string;\n [k: string]: unknown;\n };\n [k: string]: unknown;\n }[];\n [k: string]: unknown;\n}\n\nexport interface CoverageDocument {\n documentType: \"codex-security.coverage\";\n schemaVersion: \"1.0\";\n scanId: string;\n mode:\n | \"repository\"\n | \"scoped_path\"\n | \"diff\"\n | \"commit\"\n | \"branch_diff\"\n | \"working_tree\"\n | \"deep_repository\";\n completeness: \"complete\" | \"partial\" | \"unknown\";\n inventoryStrategy:\n | \"repository\"\n | \"scoped_path\"\n | \"diff\"\n | \"directory\"\n | \"custom\";\n includePaths: string[];\n excludePaths: string[];\n surfaces: {\n id: string;\n label: string;\n disposition:\n | \"reported\"\n | \"no_issue_found\"\n | \"rejected\"\n | \"not_applicable\"\n | \"needs_follow_up\";\n receiptRefs: string[];\n riskArea?: string;\n notes?: string;\n [k: string]: unknown;\n }[];\n explicitExclusions: {\n pattern: string;\n reason: string;\n [k: string]: unknown;\n }[];\n deferred: {\n id: string;\n reason: string;\n paths?: string[];\n surfaceIds?: string[];\n [k: string]: unknown;\n }[];\n openQuestions?: {\n question: string;\n followUpPrompt?: string;\n [k: string]: unknown;\n }[];\n [k: string]: unknown;\n}\n\nexport type ContractObject = Record<string, unknown>;\n\nexport type ScanRecord = ScanManifest[\"scan\"];\n\nexport type ScanProducer = ScanRecord[\"producer\"];\n\nexport type ScanTargetRecord = ScanRecord[\"target\"];\n\nexport type TargetKind = ScanTargetRecord[\"kind\"];\n\nexport type ScanScope = ScanRecord[\"scope\"];\n\nexport type ThreatModel = NonNullable<ScanRecord[\"threatModel\"]>;\n\nexport type ScanHardening = NonNullable<ScanRecord[\"hardening\"]>;\n\nexport type ScanArtifact = ScanRecord[\"artifacts\"][number];\n\nexport type Finding = FindingsDocument[\"findings\"][number];\n\nexport type FindingIdentity = Finding[\"identity\"];\n\nexport type FindingFingerprints = Finding[\"fingerprints\"];\n\nexport type FindingSeverity = Finding[\"severity\"];\n\nexport type SeverityLevel = FindingSeverity[\"level\"];\n\nexport type FindingConfidence = Finding[\"confidence\"];\n\nexport type ConfidenceLevel = FindingConfidence[\"level\"];\n\nexport type FindingTaxonomy = Finding[\"taxonomy\"];\n\nexport type FindingLocation = Finding[\"locations\"][number];\n\nexport type FindingWriteup = NonNullable<Finding[\"writeup\"]>;\n\nexport type FindingCodeEvidence = NonNullable<Finding[\"codeEvidence\"]>[number];\n\nexport type FindingRootCause = Extract<Finding[\"rootCause\"], object>;\n\nexport type FindingValidation = NonNullable<Finding[\"validation\"]>;\n\nexport type FindingAttackPath = NonNullable<Finding[\"attackPath\"]>;\n\nexport type AttackPathDataflow = ContractObject;\n\nexport type AttackPathReachability = ContractObject;\n\nexport type FindingProvenance = Finding[\"provenance\"];\n\nexport type CoverageMode = CoverageDocument[\"mode\"];\n\nexport type CoverageCompleteness = CoverageDocument[\"completeness\"];\n\nexport type InventoryStrategy = CoverageDocument[\"inventoryStrategy\"];\n\nexport type CoverageSurface = CoverageDocument[\"surfaces\"][number];\n\nexport type SurfaceDisposition = CoverageSurface[\"disposition\"];\n\nexport type ExplicitExclusion = CoverageDocument[\"explicitExclusions\"][number];\n\nexport type DeferredCoverage = CoverageDocument[\"deferred\"][number];\n\nexport type CoverageOpenQuestion = NonNullable<\n CoverageDocument[\"openQuestions\"]\n>[number];\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CodexSecurity } from "./api.js";
|
|
2
|
+
import type { CodexSecurityConfig } from "./config.js";
|
|
3
|
+
import type { ScanMode } from "./targets.js";
|
|
4
|
+
export interface MultiscanOptions {
|
|
5
|
+
inputPath: string;
|
|
6
|
+
outputDir: string;
|
|
7
|
+
githubHost?: string;
|
|
8
|
+
workers: number;
|
|
9
|
+
mode: ScanMode;
|
|
10
|
+
maxAttempts: number;
|
|
11
|
+
config: CodexSecurityConfig;
|
|
12
|
+
createSecurity(config: CodexSecurityConfig): Pick<CodexSecurity, "run" | "close">;
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
onProgress?(event: {
|
|
15
|
+
repository: string;
|
|
16
|
+
status: "started" | "completed" | "failed";
|
|
17
|
+
attempt: number;
|
|
18
|
+
error?: string;
|
|
19
|
+
}): void;
|
|
20
|
+
}
|
|
21
|
+
export interface MultiscanResult {
|
|
22
|
+
total: number;
|
|
23
|
+
completed: number;
|
|
24
|
+
failed: number;
|
|
25
|
+
skipped: number;
|
|
26
|
+
resultsPath: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function runMultiscan(options: MultiscanOptions): Promise<MultiscanResult>;
|
|
29
|
+
export declare function buildGitHubCredentialArgs(host: string | undefined): string[];
|
|
30
|
+
//# sourceMappingURL=multiscan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiscan.d.ts","sourceRoot":"","sources":["../src/multiscan.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA2B7C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,CACZ,MAAM,EAAE,mBAAmB,GAC1B,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,CAAC,KAAK,EAAE;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;QAC3C,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,E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