@lornatang/dsh-codex-security 0.1.10 → 0.1.11
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/constants.js +1 -2
- package/lib/git.js +0 -21
- package/lib/index.js +0 -1
- package/lib/routes.js +0 -5
- package/lib/service.js +0 -2
- package/lib/types/constants.d.ts +1 -2
- package/lib/types/git.d.ts +0 -3
- package/lib/types/index.d.ts +1 -2
- package/lib/types/routes.d.ts +0 -2
- package/lib/types/service.d.ts +0 -1
- package/lib/types/util.d.ts +0 -5
- package/lib/util.js +1 -45
- package/package.json +1 -1
- package/references/core-scan.md +1 -1
- package/references/final-report.md +1 -1
- package/references/scan-contract.md +1 -1
- package/schemas/tools/scan-draft.schema.json +0 -766
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.11] - 2026-11-19
|
|
4
|
+
|
|
5
|
+
- Remove the unused scan-draft JSON schema and the three reference links that pointed at it; draft validation is unchanged and still enforced by the host.
|
|
6
|
+
- Delete dead helpers, imports and fields across the target reader, git helpers, constants, routes, service and store modules.
|
|
7
|
+
- Stop exporting symbols that nothing outside their module consumes.
|
|
8
|
+
|
|
3
9
|
## [0.1.10] - 2026-11-18
|
|
4
10
|
|
|
5
11
|
### Security
|
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ dsh plugin --profile <name> add @lornatang/dsh-codex-security
|
|
|
34
34
|
dsh plugin --profile <name> remove @lornatang/dsh-codex-security
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
For the GitHub 0.1.
|
|
37
|
+
For the GitHub 0.1.11 release, use `dsh plugin --profile <name> add https://github.com/Lornatang/dsh-codex-security/releases/download/v0.1.11/lornatang-dsh-codex-security-0.1.11.tgz`. The npm registry version may be older.
|
|
38
38
|
|
|
39
39
|
The `add` command composes the layer into the profile: the profile's `cordis.patch.yml` gains an insert entry, row id `codex-security`, whose `config` starts from the bundle defaults `maxFiles: 5000`, `maxFileBytes: 1048576`, and `defaultMode: standard`; every other field takes its default from `src/config.ts`. The package manifest points `dsh.bundle.patch` at that document. The `remove` command deletes the row and leaves scans already written under the profile data directory untouched.
|
|
40
40
|
|
package/README.zh.md
CHANGED
|
@@ -34,7 +34,7 @@ dsh plugin --profile <name> add @lornatang/dsh-codex-security
|
|
|
34
34
|
dsh plugin --profile <name> remove @lornatang/dsh-codex-security
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
安装 GitHub 上的 0.1.
|
|
37
|
+
安装 GitHub 上的 0.1.11 版本,请运行 `dsh plugin --profile <name> add https://github.com/Lornatang/dsh-codex-security/releases/download/v0.1.11/lornatang-dsh-codex-security-0.1.11.tgz`。npm 仓库中的版本可能较旧。
|
|
38
38
|
|
|
39
39
|
`add` 命令把这一层组合进 profile:profile 的 `cordis.patch.yml` 中新增一条 insert 条目,row id 为 `codex-security`,其 `config` 从本包默认值 `maxFiles: 5000`、`maxFileBytes: 1048576`、`defaultMode: standard` 开始;其余字段取 `src/config.ts` 中的默认值。包清单把 `dsh.bundle.patch` 指向该文档。`remove` 命令删除该条目,已经写入 profile 数据目录的扫描保持不变。
|
|
40
40
|
|
package/lib/constants.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export const PACKAGE_NAME = '@lornatang/dsh-codex-security';
|
|
2
2
|
export const PLUGIN_NAME = 'codex-security';
|
|
3
|
-
export const VERSION = '0.1.
|
|
3
|
+
export const VERSION = '0.1.11';
|
|
4
4
|
export const ROUTE_PREFIX = '/plugins/codex-security';
|
|
5
5
|
export const PRODUCER = { name: '@lornatang/dsh-codex-security', version: VERSION };
|
|
6
|
-
export const DEFAULT_EXCLUDES = ['.git/**', 'node_modules/**', 'dist/**', 'build/**', 'out/**', 'coverage/**', '.next/**', '.nuxt/**', 'vendor/**', 'target/**', '.venv/**', '__pycache__/**'];
|
|
7
6
|
export const SKILL_NAMES = ['security-scan', 'security-diff-scan', 'deep-security-scan', 'fix-finding', 'verify-fix', 'triage-finding', 'threat-model', 'track-findings', 'resolve-dependency-alert', 'vulnerability-writeup', 'assess-patch-risk', 'attack-path-analysis', 'define-security-policy', 'finding-discovery', 'propose-security-hardening', 'validation'];
|
|
8
7
|
export const TOOL_NAMES = [
|
|
9
8
|
'codex_security_inspect_setup', 'codex_security_inspect_target',
|
package/lib/git.js
CHANGED
|
@@ -2,7 +2,6 @@ import { execFile } from 'node:child_process';
|
|
|
2
2
|
import { promisify } from 'node:util';
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
import { createReadStream } from 'node:fs';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
5
|
const run = promisify(execFile);
|
|
7
6
|
const MAX_BUFFER = 64 * 1024 * 1024;
|
|
8
7
|
export async function git(root, args, timeoutMs = 60000, signal) {
|
|
@@ -20,9 +19,6 @@ export async function gitString(root, args, timeoutMs, signal) {
|
|
|
20
19
|
const result = await git(root, args, timeoutMs, signal);
|
|
21
20
|
return result.ok ? result.stdout.trim() : undefined;
|
|
22
21
|
}
|
|
23
|
-
export async function isGitRepo(root) {
|
|
24
|
-
return (await gitString(root, ['rev-parse', '--is-inside-work-tree'])) === 'true';
|
|
25
|
-
}
|
|
26
22
|
export async function repoRoot(path, signal) {
|
|
27
23
|
return gitString(path, ['rev-parse', '--show-toplevel'], undefined, signal);
|
|
28
24
|
}
|
|
@@ -115,23 +111,6 @@ export async function changedFiles(root, options) {
|
|
|
115
111
|
}
|
|
116
112
|
return files;
|
|
117
113
|
}
|
|
118
|
-
/** Digest of the working tree diff including untracked files, used for snapshot identity. */
|
|
119
|
-
export async function worktreeDigest(root) {
|
|
120
|
-
const hash = createHash('sha256');
|
|
121
|
-
const status = await git(root, ['status', '--porcelain=v1', '-z', '--untracked-files=all']);
|
|
122
|
-
hash.update('status\u0000' + (status.ok ? status.stdout : ''));
|
|
123
|
-
const diff = await git(root, ['diff', 'HEAD']);
|
|
124
|
-
hash.update('diff\u0000' + (diff.ok ? diff.stdout : diff.stderr));
|
|
125
|
-
const staged = await git(root, ['diff', '--cached']);
|
|
126
|
-
hash.update('staged\u0000' + (staged.ok ? staged.stdout : ''));
|
|
127
|
-
const untracked = await git(root, ['ls-files', '--others', '--exclude-standard', '-z']);
|
|
128
|
-
if (untracked.ok) {
|
|
129
|
-
const names = untracked.stdout.split('\u0000').filter(Boolean).sort();
|
|
130
|
-
for (const name of names)
|
|
131
|
-
hash.update('untracked\u0000' + name + '\u0000' + (await fileDigest(join(root, name)) ?? 'unavailable'));
|
|
132
|
-
}
|
|
133
|
-
return hash.digest('hex');
|
|
134
|
-
}
|
|
135
114
|
export async function fileDigest(path, signal) {
|
|
136
115
|
try {
|
|
137
116
|
const hash = createHash('sha256');
|
package/lib/index.js
CHANGED
|
@@ -13,7 +13,6 @@ export const name = PLUGIN_NAME;
|
|
|
13
13
|
export const inject = ['tools', 'skills'];
|
|
14
14
|
export { Config };
|
|
15
15
|
export const version = VERSION;
|
|
16
|
-
export const packageName = PACKAGE_NAME;
|
|
17
16
|
export { SecurityService };
|
|
18
17
|
function parseFrontmatter(text) {
|
|
19
18
|
if (!text.startsWith('---'))
|
package/lib/routes.js
CHANGED
|
@@ -39,10 +39,6 @@ function sendFile(res, content, mediaType, filename) {
|
|
|
39
39
|
res.setHeader('content-disposition', 'attachment; filename="' + filename + '"');
|
|
40
40
|
res.end(content);
|
|
41
41
|
}
|
|
42
|
-
function scanIdFromPath(pathname) {
|
|
43
|
-
const parts = pathname.split('/').filter(Boolean);
|
|
44
|
-
return parts.length >= 2 ? parts[1] : undefined;
|
|
45
|
-
}
|
|
46
42
|
/** Mutating HTTP routes must be same-origin JSON requests, never cross-site form posts. */
|
|
47
43
|
function requireJsonMutation(req) {
|
|
48
44
|
const contentType = String(req.headers['content-type'] ?? '').split(';')[0].trim().toLowerCase();
|
|
@@ -156,4 +152,3 @@ export function bindRoutes(ctx, service) {
|
|
|
156
152
|
const off = ctx.on?.('internal/service', () => { register(); });
|
|
157
153
|
return () => { off?.(); disposeRoute?.(); disposeRoute = undefined; };
|
|
158
154
|
}
|
|
159
|
-
export { scanIdFromPath };
|
package/lib/service.js
CHANGED
|
@@ -108,11 +108,9 @@ function validateThreatModel(value) {
|
|
|
108
108
|
export class SecurityService {
|
|
109
109
|
store;
|
|
110
110
|
config;
|
|
111
|
-
ctx;
|
|
112
111
|
scanLocks = new Map();
|
|
113
112
|
managedInvocations = new WeakSet();
|
|
114
113
|
constructor(ctx, options = {}) {
|
|
115
|
-
this.ctx = ctx;
|
|
116
114
|
this.config = { ...DEFAULT_CONFIG, ...(options.config ?? {}) };
|
|
117
115
|
const profile = ctx.get?.('profileContext') ?? (Object.hasOwn(ctx, 'profileContext') ? ctx.profileContext : undefined);
|
|
118
116
|
const patchPath = options.patchPath ?? profile?.patchPath;
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export declare const PACKAGE_NAME = "@lornatang/dsh-codex-security";
|
|
2
2
|
export declare const PLUGIN_NAME = "codex-security";
|
|
3
|
-
export declare const VERSION = "0.1.
|
|
3
|
+
export declare const VERSION = "0.1.11";
|
|
4
4
|
export declare const ROUTE_PREFIX = "/plugins/codex-security";
|
|
5
5
|
export declare const PRODUCER: {
|
|
6
6
|
name: string;
|
|
7
7
|
version: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const DEFAULT_EXCLUDES: string[];
|
|
10
9
|
export declare const SKILL_NAMES: string[];
|
|
11
10
|
export declare const TOOL_NAMES: string[];
|
package/lib/types/git.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export interface GitResult {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function git(root: string, args: string[], timeoutMs?: number, signal?: AbortSignal): Promise<GitResult>;
|
|
7
7
|
export declare function gitString(root: string, args: string[], timeoutMs?: number, signal?: AbortSignal): Promise<string | undefined>;
|
|
8
|
-
export declare function isGitRepo(root: string): Promise<boolean>;
|
|
9
8
|
export declare function repoRoot(path: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
10
9
|
export declare function headRevision(root: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
11
10
|
export declare function currentBranch(root: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
@@ -27,6 +26,4 @@ export declare function changedFiles(root: string, options: {
|
|
|
27
26
|
staged?: boolean;
|
|
28
27
|
workingTree?: boolean;
|
|
29
28
|
}): Promise<ChangedFile[]>;
|
|
30
|
-
/** Digest of the working tree diff including untracked files, used for snapshot identity. */
|
|
31
|
-
export declare function worktreeDigest(root: string): Promise<string>;
|
|
32
29
|
export declare function fileDigest(path: string, signal?: AbortSignal): Promise<string | undefined>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,8 +6,7 @@ import type { PluginContext } from './types.js';
|
|
|
6
6
|
export declare const name = "codex-security";
|
|
7
7
|
export declare const inject: string[];
|
|
8
8
|
export { Config };
|
|
9
|
-
export declare const version = "0.1.
|
|
10
|
-
export declare const packageName = "@lornatang/dsh-codex-security";
|
|
9
|
+
export declare const version = "0.1.11";
|
|
11
10
|
export { SecurityService };
|
|
12
11
|
export type { ConfigType };
|
|
13
12
|
export declare function loadBundledSkills(packageRoot: string): SkillRegistration[];
|
package/lib/types/routes.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import type { SecurityService } from './service.js';
|
|
3
3
|
import type { PluginContext } from './types.js';
|
|
4
|
-
declare function scanIdFromPath(pathname: string): string | undefined;
|
|
5
4
|
export declare function handleRequest(service: SecurityService, req: IncomingMessage, res: ServerResponse): Promise<void>;
|
|
6
5
|
export declare function bindRoutes(ctx: PluginContext, service: SecurityService): () => void;
|
|
7
|
-
export { scanIdFromPath };
|
package/lib/types/service.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export interface SecurityServiceOptions {
|
|
|
12
12
|
export declare class SecurityService {
|
|
13
13
|
readonly store: ScanStore;
|
|
14
14
|
readonly config: Config;
|
|
15
|
-
private readonly ctx;
|
|
16
15
|
private readonly scanLocks;
|
|
17
16
|
private readonly managedInvocations;
|
|
18
17
|
constructor(ctx: PluginContext, options?: SecurityServiceOptions);
|
package/lib/types/util.d.ts
CHANGED
|
@@ -3,18 +3,14 @@ export declare function sha256(value: string | Uint8Array): string;
|
|
|
3
3
|
export declare function stableTargetId(rootPath: string): string;
|
|
4
4
|
export declare function nowIso(): string;
|
|
5
5
|
export declare function newId(prefix: string, hexChars?: number): string;
|
|
6
|
-
export declare function shortId(value: string, length?: number): string;
|
|
7
6
|
export declare function ensureDir(path: string): Promise<void>;
|
|
8
7
|
export declare function writeFileAtomic(path: string, data: string | Uint8Array): Promise<void>;
|
|
9
|
-
/** Publish a complete file without ever replacing an existing destination. */
|
|
10
|
-
export declare function writeFileExclusive(path: string, data: string | Uint8Array): Promise<void>;
|
|
11
8
|
/** Resolve symlinked ancestors even when the final path does not yet exist. */
|
|
12
9
|
export declare function canonicalProspectivePath(path: string): Promise<string>;
|
|
13
10
|
export declare function writeJsonAtomic(path: string, value: unknown): Promise<void>;
|
|
14
11
|
export declare function readJson<T>(path: string): Promise<T | undefined>;
|
|
15
12
|
export declare function readText(path: string, limit?: number): Promise<string | undefined>;
|
|
16
13
|
export declare function readFullText(path: string): Promise<string | undefined>;
|
|
17
|
-
export declare function posixRelative(root: string, path: string): string;
|
|
18
14
|
/** Reject absolute paths, drive letters and .. segments; return a normalized posix relative path. */
|
|
19
15
|
export declare function sanitizeRelative(input: string): string;
|
|
20
16
|
export declare function isWithin(parent: string, child: string): boolean;
|
|
@@ -29,7 +25,6 @@ export declare function languageOf(path: string): string;
|
|
|
29
25
|
export declare function slugify(value: string, max?: number): string;
|
|
30
26
|
export declare function compareSeverity(a: string, b: string): number;
|
|
31
27
|
export declare function truncate(value: string, max: number): string;
|
|
32
|
-
export declare function formatBytes(value: number): string;
|
|
33
28
|
export declare function listFiles(root: string, options: {
|
|
34
29
|
maxFiles: number;
|
|
35
30
|
exclude: string[];
|
package/lib/util.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, randomBytes } from 'node:crypto';
|
|
2
|
-
import {
|
|
2
|
+
import { mkdir, open, readFile, readdir, realpath, rename, rm } from 'node:fs/promises';
|
|
3
3
|
import { basename, dirname, isAbsolute, join, normalize, relative, resolve, sep } from 'node:path';
|
|
4
4
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
5
5
|
export function sha256(value) {
|
|
@@ -15,9 +15,6 @@ export function nowIso() {
|
|
|
15
15
|
export function newId(prefix, hexChars = 24) {
|
|
16
16
|
return prefix + randomBytes(Math.ceil(hexChars / 2)).toString('hex').slice(0, hexChars);
|
|
17
17
|
}
|
|
18
|
-
export function shortId(value, length = 8) {
|
|
19
|
-
return value.slice(0, length);
|
|
20
|
-
}
|
|
21
18
|
export async function ensureDir(path) {
|
|
22
19
|
await mkdir(path, { recursive: true, mode: 0o700 });
|
|
23
20
|
}
|
|
@@ -53,37 +50,6 @@ export async function writeFileAtomic(path, data) {
|
|
|
53
50
|
throw error;
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
|
-
/** Publish a complete file without ever replacing an existing destination. */
|
|
57
|
-
export async function writeFileExclusive(path, data) {
|
|
58
|
-
const tmp = join(dirname(path), '.' + process.pid + '.' + randomBytes(12).toString('hex') + '.tmp');
|
|
59
|
-
const handle = await open(tmp, 'wx', 0o600);
|
|
60
|
-
try {
|
|
61
|
-
try {
|
|
62
|
-
await handle.writeFile(data);
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
await handle.close();
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
await link(tmp, path);
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
// Some writable filesystems do not support hard links.
|
|
72
|
-
if (!['EPERM', 'ENOTSUP', 'EOPNOTSUPP', 'ENOSYS'].includes(error.code ?? ''))
|
|
73
|
-
throw error;
|
|
74
|
-
const destination = await open(path, 'wx', 0o600);
|
|
75
|
-
try {
|
|
76
|
-
await destination.writeFile(data);
|
|
77
|
-
}
|
|
78
|
-
finally {
|
|
79
|
-
await destination.close();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
finally {
|
|
84
|
-
await rm(tmp, { force: true });
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
53
|
/** Resolve symlinked ancestors even when the final path does not yet exist. */
|
|
88
54
|
export async function canonicalProspectivePath(path) {
|
|
89
55
|
let current = resolve(path);
|
|
@@ -146,9 +112,6 @@ export async function readFullText(path) {
|
|
|
146
112
|
throw error;
|
|
147
113
|
}
|
|
148
114
|
}
|
|
149
|
-
export function posixRelative(root, path) {
|
|
150
|
-
return relative(root, path).split(sep).join('/');
|
|
151
|
-
}
|
|
152
115
|
/** Reject absolute paths, drive letters and .. segments; return a normalized posix relative path. */
|
|
153
116
|
export function sanitizeRelative(input) {
|
|
154
117
|
if (typeof input !== 'string' || input.length === 0)
|
|
@@ -373,13 +336,6 @@ export function compareSeverity(a, b) {
|
|
|
373
336
|
export function truncate(value, max) {
|
|
374
337
|
return value.length <= max ? value : value.slice(0, Math.max(0, max - 1)) + '\u2026';
|
|
375
338
|
}
|
|
376
|
-
export function formatBytes(value) {
|
|
377
|
-
if (value < 1024)
|
|
378
|
-
return value + ' B';
|
|
379
|
-
if (value < 1024 * 1024)
|
|
380
|
-
return (value / 1024).toFixed(1) + ' KB';
|
|
381
|
-
return (value / (1024 * 1024)).toFixed(1) + ' MB';
|
|
382
|
-
}
|
|
383
339
|
export async function listFiles(root, options) {
|
|
384
340
|
const files = [];
|
|
385
341
|
const excluded = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lornatang/dsh-codex-security",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Agent-native security review workbench for DeepSeek Harness, modeled on OpenAI codex-security: sealed scans, findings contract, deep-scan orchestration and SARIF/JSON export.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
package/references/core-scan.md
CHANGED
|
@@ -13,7 +13,7 @@ Include any caller-supplied rendered investigation time allowance unchanged amon
|
|
|
13
13
|
5. Delegate independent packet groups when parallel review is useful, within the caller's worker allowance. Point each worker to its readable copy of [the investigator brief](focused-investigator.md) and send its packets with the same authorized source and security context. For packets you handle in the parent, read the investigator brief and follow its investigation instructions yourself. Choose assignments by complexity and shared code rather than a fixed worker or file count. Supporting code may explain an in-scope finding, but its affected entry point, control, or operation must remain in scope.
|
|
14
14
|
6. Preserve returned candidates and counterevidence through the bound `record_codex_security_scan_draft` tool when available, before combining or validating them. Use `complete: false`, stable `candidateId` values, and `reviewState.deferred` entries with a reason and the original payload under `candidate`. Checkpoint validation decisions: accepted findings retain `provenance.candidateId`; rejections retain the candidate identity, original evidence, and source-backed counterevidence on a `rejected` coverage surface. Record reviewed surfaces, exclusions, and unresolved questions without creating extra receipts or claiming exhaustive coverage. Group observations only when they share the broken control and effective remediation, preserving affected routes, operations, and locations; a shared CWE alone is not a reason to merge.
|
|
15
15
|
7. Follow the caller’s validation handoff if supplied. Otherwise [validate each distinct candidate](validate-scan-findings.md) against the source.
|
|
16
|
-
8. Assemble `scope`, `threatModel`, `findings`, and `reviewState` following `final-report.md
|
|
16
|
+
8. Assemble `scope`, `threatModel`, `findings`, and `reviewState` following `final-report.md`. Follow `finding-detail-fields.md` for rich evidence and narrative fields. Preserve genuine findings, source provenance, supplied assumptions, exclusions, pending work, and uncertainty. Examples under `examples/completed-scan/` illustrate shape, not values to copy.
|
|
17
17
|
|
|
18
18
|
Keep discovery, validation, and attack-path reasoning within this one self-contained audit; do not invoke separate phase skills or add ranking phases, per-file ledgers, separate phase worker pools, or receipt files.
|
|
19
19
|
|
|
@@ -17,7 +17,7 @@ Completion validates existing artifacts; it does not perform missing phases or c
|
|
|
17
17
|
|
|
18
18
|
## Finding Semantics
|
|
19
19
|
|
|
20
|
-
Use `
|
|
20
|
+
Use `finding-detail-fields.md` for rich fields. Supply:
|
|
21
21
|
|
|
22
22
|
- An evidence-supported lowercase vulnerability-family `ruleId`, `taxonomy.category`, known `taxonomy.cwe` values (or `[]`), and genuine `provenance.source`. Use `local_plugin` only for findings this plugin discovered; preserve worker/source provenance and candidate identity.
|
|
23
23
|
- Verified source locations, including the broken control or sink and materially affected entry points or concrete implementations. Preserve independently vulnerable instances. Group observations only when they share the broken control and remediation, not merely a CWE.
|
|
@@ -183,7 +183,7 @@ These fields are optional for compatibility with existing v1 canonical artifacts
|
|
|
183
183
|
|
|
184
184
|
## Schemas
|
|
185
185
|
|
|
186
|
-
New completed findings must match the [
|
|
186
|
+
New completed findings must match the [findings schema](../schemas/findings.schema.json). Finalization rejects legacy field aliases, malformed optional details, and invalid semantic slugs instead of repairing them. Historical sealed reports are validated through an in-memory compatibility adapter; their saved bytes remain unchanged. Stopped-scan recovery still salvages saved evidence.
|
|
187
187
|
|
|
188
188
|
- [Scan manifest schema](../schemas/scan-manifest.schema.json)
|
|
189
189
|
- [Findings schema](../schemas/findings.schema.json)
|
|
@@ -1,766 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "codex-security://schemas/tools/scan-draft.schema.json",
|
|
4
|
-
"title": "Codex Security semantic scan draft",
|
|
5
|
-
"$ref": "#/$defs/scanDraftInput",
|
|
6
|
-
"$defs": {
|
|
7
|
-
"text": {
|
|
8
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
9
|
-
},
|
|
10
|
-
"textList": {
|
|
11
|
-
"type": "array",
|
|
12
|
-
"items": {
|
|
13
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"scanId": {
|
|
17
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/scanId"
|
|
18
|
-
},
|
|
19
|
-
"handoffClaimToken": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"pattern": "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|recovery_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
|
|
22
|
-
},
|
|
23
|
-
"repositoryPath": {
|
|
24
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/repositoryPath"
|
|
25
|
-
},
|
|
26
|
-
"location": {
|
|
27
|
-
"type": "object",
|
|
28
|
-
"properties": {
|
|
29
|
-
"path": {
|
|
30
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/repositoryPath"
|
|
31
|
-
},
|
|
32
|
-
"startLine": { "type": "integer", "minimum": 1 },
|
|
33
|
-
"endLine": { "type": "integer", "minimum": 1 },
|
|
34
|
-
"role": {
|
|
35
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"required": ["path", "startLine"],
|
|
39
|
-
"additionalProperties": true
|
|
40
|
-
},
|
|
41
|
-
"identity": {
|
|
42
|
-
"type": "object",
|
|
43
|
-
"properties": {
|
|
44
|
-
"anchor": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
|
|
45
|
-
"instance": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._/-]*$" }
|
|
46
|
-
},
|
|
47
|
-
"required": ["anchor"],
|
|
48
|
-
"additionalProperties": true
|
|
49
|
-
},
|
|
50
|
-
"severity": {
|
|
51
|
-
"type": "object",
|
|
52
|
-
"properties": {
|
|
53
|
-
"level": {
|
|
54
|
-
"enum": ["critical", "high", "medium", "low", "informational"]
|
|
55
|
-
},
|
|
56
|
-
"score": { "type": "number", "minimum": 0, "maximum": 10 },
|
|
57
|
-
"scoringSystem": {
|
|
58
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
59
|
-
},
|
|
60
|
-
"vector": {
|
|
61
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
62
|
-
},
|
|
63
|
-
"rationale": {
|
|
64
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
65
|
-
},
|
|
66
|
-
"changeConditions": {
|
|
67
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"required": ["level"],
|
|
71
|
-
"additionalProperties": true
|
|
72
|
-
},
|
|
73
|
-
"confidence": {
|
|
74
|
-
"type": "object",
|
|
75
|
-
"properties": {
|
|
76
|
-
"level": { "enum": ["high", "medium", "low"] },
|
|
77
|
-
"rationale": {
|
|
78
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"required": ["level", "rationale"],
|
|
82
|
-
"additionalProperties": true
|
|
83
|
-
},
|
|
84
|
-
"taxonomy": {
|
|
85
|
-
"type": "object",
|
|
86
|
-
"properties": {
|
|
87
|
-
"category": {
|
|
88
|
-
"description": "The actual primary broken security control, not a CWE identifier.",
|
|
89
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
90
|
-
},
|
|
91
|
-
"cwe": {
|
|
92
|
-
"description": "Copy the reviewed candidate's exact cwe_ids array. Use an empty array when no CWE is established; do not invent one.",
|
|
93
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"required": ["category", "cwe"],
|
|
97
|
-
"additionalProperties": true
|
|
98
|
-
},
|
|
99
|
-
"codeEvidence": {
|
|
100
|
-
"type": "object",
|
|
101
|
-
"properties": {
|
|
102
|
-
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
|
|
103
|
-
"label": {
|
|
104
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
105
|
-
},
|
|
106
|
-
"path": {
|
|
107
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/repositoryPath"
|
|
108
|
-
},
|
|
109
|
-
"startLine": { "type": "integer", "minimum": 1 },
|
|
110
|
-
"endLine": { "type": "integer", "minimum": 1 },
|
|
111
|
-
"language": {
|
|
112
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
113
|
-
},
|
|
114
|
-
"role": {
|
|
115
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
116
|
-
},
|
|
117
|
-
"code": {
|
|
118
|
-
"description": "The genuine, nonempty source snippet at this evidence location.",
|
|
119
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
120
|
-
},
|
|
121
|
-
"explanation": {
|
|
122
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"required": ["id", "label", "path", "startLine", "code", "explanation"],
|
|
126
|
-
"additionalProperties": true
|
|
127
|
-
},
|
|
128
|
-
"findingAssessment": {
|
|
129
|
-
"anyOf": [
|
|
130
|
-
{
|
|
131
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"type": "object",
|
|
135
|
-
"properties": {
|
|
136
|
-
"level": {
|
|
137
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
138
|
-
},
|
|
139
|
-
"rationale": {
|
|
140
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
141
|
-
},
|
|
142
|
-
"why": {
|
|
143
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
"additionalProperties": true
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
},
|
|
150
|
-
"textOrSummary": {
|
|
151
|
-
"anyOf": [
|
|
152
|
-
{
|
|
153
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"type": "object",
|
|
157
|
-
"properties": {
|
|
158
|
-
"summary": {
|
|
159
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
160
|
-
},
|
|
161
|
-
"source": {
|
|
162
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
163
|
-
},
|
|
164
|
-
"sink": {
|
|
165
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
166
|
-
},
|
|
167
|
-
"outcome": {
|
|
168
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
169
|
-
},
|
|
170
|
-
"transformations": {
|
|
171
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
172
|
-
},
|
|
173
|
-
"evidenceRefs": {
|
|
174
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
175
|
-
},
|
|
176
|
-
"evidence_refs": false
|
|
177
|
-
},
|
|
178
|
-
"additionalProperties": true
|
|
179
|
-
}
|
|
180
|
-
]
|
|
181
|
-
},
|
|
182
|
-
"findingReachability": {
|
|
183
|
-
"anyOf": [
|
|
184
|
-
{
|
|
185
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"type": "object",
|
|
189
|
-
"properties": {
|
|
190
|
-
"summary": {
|
|
191
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
192
|
-
},
|
|
193
|
-
"attacker": {
|
|
194
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
195
|
-
},
|
|
196
|
-
"entrypoint": {
|
|
197
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
198
|
-
},
|
|
199
|
-
"source": {
|
|
200
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
201
|
-
},
|
|
202
|
-
"sink": {
|
|
203
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
204
|
-
},
|
|
205
|
-
"outcome": {
|
|
206
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
207
|
-
},
|
|
208
|
-
"preconditions": {
|
|
209
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
210
|
-
},
|
|
211
|
-
"evidenceRefs": {
|
|
212
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
213
|
-
},
|
|
214
|
-
"evidence_refs": false
|
|
215
|
-
},
|
|
216
|
-
"additionalProperties": true
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
},
|
|
220
|
-
"findingValidation": {
|
|
221
|
-
"type": "object",
|
|
222
|
-
"properties": {
|
|
223
|
-
"assertions": {
|
|
224
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
225
|
-
},
|
|
226
|
-
"counterEvidence": {
|
|
227
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
228
|
-
},
|
|
229
|
-
"evidence": {
|
|
230
|
-
"anyOf": [
|
|
231
|
-
{
|
|
232
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
236
|
-
}
|
|
237
|
-
]
|
|
238
|
-
},
|
|
239
|
-
"evidenceRefs": {
|
|
240
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
241
|
-
},
|
|
242
|
-
"evidence_refs": false,
|
|
243
|
-
"limitations": {
|
|
244
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
245
|
-
},
|
|
246
|
-
"method": {
|
|
247
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
248
|
-
},
|
|
249
|
-
"status": {
|
|
250
|
-
"anyOf": [
|
|
251
|
-
{
|
|
252
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
253
|
-
},
|
|
254
|
-
{ "type": "null" }
|
|
255
|
-
]
|
|
256
|
-
},
|
|
257
|
-
"summary": {
|
|
258
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
259
|
-
},
|
|
260
|
-
"disposition": {
|
|
261
|
-
"anyOf": [
|
|
262
|
-
{
|
|
263
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
264
|
-
},
|
|
265
|
-
{ "type": "null" }
|
|
266
|
-
]
|
|
267
|
-
},
|
|
268
|
-
"result": {
|
|
269
|
-
"anyOf": [
|
|
270
|
-
{
|
|
271
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
272
|
-
},
|
|
273
|
-
{ "type": "null" }
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
"additionalProperties": true
|
|
278
|
-
},
|
|
279
|
-
"findingAttackPath": {
|
|
280
|
-
"type": "object",
|
|
281
|
-
"properties": {
|
|
282
|
-
"assumptions": {
|
|
283
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
284
|
-
},
|
|
285
|
-
"blindspots": {
|
|
286
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
287
|
-
},
|
|
288
|
-
"controls": {
|
|
289
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
290
|
-
},
|
|
291
|
-
"dataFlow": false,
|
|
292
|
-
"data_flow": false,
|
|
293
|
-
"dataflow": {
|
|
294
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textOrSummary"
|
|
295
|
-
},
|
|
296
|
-
"evidenceRefs": {
|
|
297
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
298
|
-
},
|
|
299
|
-
"evidence_refs": false,
|
|
300
|
-
"impact": {
|
|
301
|
-
"anyOf": [
|
|
302
|
-
{
|
|
303
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/findingAssessment"
|
|
304
|
-
},
|
|
305
|
-
{ "type": "null" }
|
|
306
|
-
]
|
|
307
|
-
},
|
|
308
|
-
"likelihood": {
|
|
309
|
-
"anyOf": [
|
|
310
|
-
{
|
|
311
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/findingAssessment"
|
|
312
|
-
},
|
|
313
|
-
{ "type": "null" }
|
|
314
|
-
]
|
|
315
|
-
},
|
|
316
|
-
"limitations": {
|
|
317
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
318
|
-
},
|
|
319
|
-
"preconditions": {
|
|
320
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
321
|
-
},
|
|
322
|
-
"reachability": {
|
|
323
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/findingReachability"
|
|
324
|
-
},
|
|
325
|
-
"steps": {
|
|
326
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
327
|
-
},
|
|
328
|
-
"summary": {
|
|
329
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
"additionalProperties": true
|
|
333
|
-
},
|
|
334
|
-
"finding": {
|
|
335
|
-
"type": "object",
|
|
336
|
-
"properties": {
|
|
337
|
-
"findingId": false,
|
|
338
|
-
"occurrenceId": false,
|
|
339
|
-
"fingerprints": false,
|
|
340
|
-
"ruleId": {
|
|
341
|
-
"type": "string",
|
|
342
|
-
"pattern": "^[a-z0-9][a-z0-9._/-]*$",
|
|
343
|
-
"description": "A stable lowercase vulnerability-family slug, such as prototype-pollution.json-patch; a CWE is taxonomy, not a rule ID."
|
|
344
|
-
},
|
|
345
|
-
"identity": {
|
|
346
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/identity"
|
|
347
|
-
},
|
|
348
|
-
"title": {
|
|
349
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
350
|
-
},
|
|
351
|
-
"summary": {
|
|
352
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
353
|
-
},
|
|
354
|
-
"severity": {
|
|
355
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/severity"
|
|
356
|
-
},
|
|
357
|
-
"confidence": {
|
|
358
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/confidence"
|
|
359
|
-
},
|
|
360
|
-
"taxonomy": {
|
|
361
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/taxonomy"
|
|
362
|
-
},
|
|
363
|
-
"locations": {
|
|
364
|
-
"minItems": 1,
|
|
365
|
-
"type": "array",
|
|
366
|
-
"items": {
|
|
367
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/location"
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
"writeup": {
|
|
371
|
-
"type": "object",
|
|
372
|
-
"properties": {
|
|
373
|
-
"reportPath": {
|
|
374
|
-
"type": "string",
|
|
375
|
-
"pattern": "^findings/([a-z0-9][a-z0-9._-]*)/\\1\\.md$"
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
"required": ["reportPath"],
|
|
379
|
-
"additionalProperties": true
|
|
380
|
-
},
|
|
381
|
-
"codeEvidence": {
|
|
382
|
-
"type": "array",
|
|
383
|
-
"items": {
|
|
384
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/codeEvidence"
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
"code_evidence": false,
|
|
388
|
-
"rootCause": {
|
|
389
|
-
"anyOf": [
|
|
390
|
-
{
|
|
391
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
"type": "object",
|
|
395
|
-
"properties": {
|
|
396
|
-
"summary": {
|
|
397
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
398
|
-
},
|
|
399
|
-
"code": false,
|
|
400
|
-
"language": false,
|
|
401
|
-
"evidenceRefs": {
|
|
402
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
403
|
-
},
|
|
404
|
-
"evidence_refs": false
|
|
405
|
-
},
|
|
406
|
-
"required": ["summary"],
|
|
407
|
-
"additionalProperties": true
|
|
408
|
-
}
|
|
409
|
-
]
|
|
410
|
-
},
|
|
411
|
-
"root_cause": false,
|
|
412
|
-
"remediation": {
|
|
413
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
414
|
-
},
|
|
415
|
-
"validation": {
|
|
416
|
-
"anyOf": [
|
|
417
|
-
{
|
|
418
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/findingValidation"
|
|
419
|
-
},
|
|
420
|
-
{ "type": "null" }
|
|
421
|
-
]
|
|
422
|
-
},
|
|
423
|
-
"attackPath": {
|
|
424
|
-
"anyOf": [
|
|
425
|
-
{
|
|
426
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/findingAttackPath"
|
|
427
|
-
},
|
|
428
|
-
{ "type": "null" }
|
|
429
|
-
]
|
|
430
|
-
},
|
|
431
|
-
"remediationTests": {
|
|
432
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
433
|
-
},
|
|
434
|
-
"preventiveControls": {
|
|
435
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
436
|
-
},
|
|
437
|
-
"provenance": {
|
|
438
|
-
"type": "object",
|
|
439
|
-
"properties": {
|
|
440
|
-
"sourceFindingIds": {
|
|
441
|
-
"type": "array",
|
|
442
|
-
"items": {
|
|
443
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
444
|
-
},
|
|
445
|
-
"uniqueItems": true,
|
|
446
|
-
"description": "IDs of the Standard scan findings grouped into this Deep scan finding."
|
|
447
|
-
},
|
|
448
|
-
"sourceFindings": {
|
|
449
|
-
"type": "array",
|
|
450
|
-
"items": {
|
|
451
|
-
"type": "object",
|
|
452
|
-
"properties": {
|
|
453
|
-
"id": {
|
|
454
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
455
|
-
},
|
|
456
|
-
"finding": {
|
|
457
|
-
"type": "object",
|
|
458
|
-
"properties": {},
|
|
459
|
-
"additionalProperties": true
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
"required": ["id", "finding"],
|
|
463
|
-
"additionalProperties": false
|
|
464
|
-
},
|
|
465
|
-
"description": "Original Standard scan findings retained by the host."
|
|
466
|
-
},
|
|
467
|
-
"source": {
|
|
468
|
-
"description": "The actual finding producer. Use local_plugin only for a finding discovered by this plugin.",
|
|
469
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
470
|
-
}
|
|
471
|
-
},
|
|
472
|
-
"required": ["source"],
|
|
473
|
-
"additionalProperties": true
|
|
474
|
-
},
|
|
475
|
-
"extensions": {
|
|
476
|
-
"type": "object",
|
|
477
|
-
"properties": {},
|
|
478
|
-
"additionalProperties": true
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
|
-
"required": [
|
|
482
|
-
"ruleId",
|
|
483
|
-
"title",
|
|
484
|
-
"summary",
|
|
485
|
-
"severity",
|
|
486
|
-
"confidence",
|
|
487
|
-
"taxonomy",
|
|
488
|
-
"locations",
|
|
489
|
-
"remediation",
|
|
490
|
-
"provenance"
|
|
491
|
-
],
|
|
492
|
-
"additionalProperties": true
|
|
493
|
-
},
|
|
494
|
-
"scope": {
|
|
495
|
-
"type": "object",
|
|
496
|
-
"properties": {
|
|
497
|
-
"includePaths": false,
|
|
498
|
-
"excludePaths": false,
|
|
499
|
-
"summary": {
|
|
500
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
501
|
-
},
|
|
502
|
-
"artifactsReviewed": {
|
|
503
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
504
|
-
},
|
|
505
|
-
"runtimeStatus": {
|
|
506
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
507
|
-
},
|
|
508
|
-
"validationMode": {
|
|
509
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
510
|
-
},
|
|
511
|
-
"context": {
|
|
512
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
513
|
-
},
|
|
514
|
-
"limitations": {
|
|
515
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
"additionalProperties": true
|
|
519
|
-
},
|
|
520
|
-
"threatModel": {
|
|
521
|
-
"anyOf": [
|
|
522
|
-
{
|
|
523
|
-
"type": "object",
|
|
524
|
-
"properties": {
|
|
525
|
-
"summary": {
|
|
526
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
527
|
-
},
|
|
528
|
-
"assets": {
|
|
529
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
530
|
-
},
|
|
531
|
-
"trustBoundaries": {
|
|
532
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
533
|
-
},
|
|
534
|
-
"attackerCapabilities": {
|
|
535
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
536
|
-
},
|
|
537
|
-
"securityObjectives": {
|
|
538
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
539
|
-
},
|
|
540
|
-
"assumptions": {
|
|
541
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
"required": ["summary"],
|
|
545
|
-
"additionalProperties": true
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
"type": "object",
|
|
549
|
-
"properties": {
|
|
550
|
-
"format": { "const": "markdown" },
|
|
551
|
-
"content": {
|
|
552
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
553
|
-
},
|
|
554
|
-
"scope": {
|
|
555
|
-
"type": "object",
|
|
556
|
-
"properties": {
|
|
557
|
-
"includePaths": {
|
|
558
|
-
"type": "array",
|
|
559
|
-
"items": { "type": "string", "minLength": 1 }
|
|
560
|
-
},
|
|
561
|
-
"excludePaths": {
|
|
562
|
-
"type": "array",
|
|
563
|
-
"items": { "type": "string", "minLength": 1 }
|
|
564
|
-
},
|
|
565
|
-
"summary": { "type": "string", "minLength": 1 }
|
|
566
|
-
},
|
|
567
|
-
"required": ["includePaths"],
|
|
568
|
-
"additionalProperties": true,
|
|
569
|
-
"description": "The modeled source scope, which may differ from the scan scope. Omit when unknown."
|
|
570
|
-
},
|
|
571
|
-
"origin": {
|
|
572
|
-
"enum": ["generated", "provided", "reconciled", "recovered"]
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
|
-
"required": ["format", "content"],
|
|
576
|
-
"additionalProperties": true
|
|
577
|
-
}
|
|
578
|
-
],
|
|
579
|
-
"description": "Retained threat-model content. Existing structured models remain supported; Markdown documents preserve their complete original body."
|
|
580
|
-
},
|
|
581
|
-
"surface": {
|
|
582
|
-
"type": "object",
|
|
583
|
-
"properties": {
|
|
584
|
-
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._/-]*$" },
|
|
585
|
-
"label": {
|
|
586
|
-
"description": "The meaningful name of the reviewed security surface.",
|
|
587
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
588
|
-
},
|
|
589
|
-
"disposition": {
|
|
590
|
-
"enum": [
|
|
591
|
-
"reported",
|
|
592
|
-
"no_issue_found",
|
|
593
|
-
"rejected",
|
|
594
|
-
"not_applicable",
|
|
595
|
-
"needs_follow_up"
|
|
596
|
-
],
|
|
597
|
-
"description": "The evidence-supported review result for this surface."
|
|
598
|
-
},
|
|
599
|
-
"receiptRefs": {
|
|
600
|
-
"type": "array",
|
|
601
|
-
"items": {
|
|
602
|
-
"type": "string",
|
|
603
|
-
"minLength": 1,
|
|
604
|
-
"pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)artifacts/.+$"
|
|
605
|
-
}
|
|
606
|
-
},
|
|
607
|
-
"riskArea": {
|
|
608
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
609
|
-
},
|
|
610
|
-
"notes": {
|
|
611
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
612
|
-
}
|
|
613
|
-
},
|
|
614
|
-
"required": ["label", "disposition"],
|
|
615
|
-
"additionalProperties": true
|
|
616
|
-
},
|
|
617
|
-
"reviewState": {
|
|
618
|
-
"type": "object",
|
|
619
|
-
"properties": {
|
|
620
|
-
"documentType": false,
|
|
621
|
-
"schemaVersion": false,
|
|
622
|
-
"scanId": false,
|
|
623
|
-
"mode": false,
|
|
624
|
-
"includePaths": false,
|
|
625
|
-
"excludePaths": false,
|
|
626
|
-
"receiptRefs": false,
|
|
627
|
-
"inventoryStrategy": false,
|
|
628
|
-
"surfaces": {
|
|
629
|
-
"type": "array",
|
|
630
|
-
"items": {
|
|
631
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/surface"
|
|
632
|
-
}
|
|
633
|
-
},
|
|
634
|
-
"explicitExclusions": {
|
|
635
|
-
"type": "array",
|
|
636
|
-
"items": {
|
|
637
|
-
"type": "object",
|
|
638
|
-
"properties": {
|
|
639
|
-
"pattern": {
|
|
640
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
641
|
-
},
|
|
642
|
-
"reason": {
|
|
643
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
644
|
-
}
|
|
645
|
-
},
|
|
646
|
-
"required": ["pattern", "reason"],
|
|
647
|
-
"additionalProperties": true
|
|
648
|
-
}
|
|
649
|
-
},
|
|
650
|
-
"deferred": {
|
|
651
|
-
"type": "array",
|
|
652
|
-
"items": {
|
|
653
|
-
"type": "object",
|
|
654
|
-
"properties": {
|
|
655
|
-
"id": {
|
|
656
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
657
|
-
},
|
|
658
|
-
"candidateId": {
|
|
659
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/candidateId"
|
|
660
|
-
},
|
|
661
|
-
"reason": {
|
|
662
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
663
|
-
},
|
|
664
|
-
"paths": {
|
|
665
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
666
|
-
},
|
|
667
|
-
"surfaceIds": {
|
|
668
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/textList"
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
"required": ["reason"],
|
|
672
|
-
"additionalProperties": true
|
|
673
|
-
},
|
|
674
|
-
"description": "Each supplied id identifies one task and must be unique within this draft. Reuse saved IDs in later updates."
|
|
675
|
-
},
|
|
676
|
-
"resolvedDeferred": {
|
|
677
|
-
"type": "array",
|
|
678
|
-
"items": {
|
|
679
|
-
"type": "object",
|
|
680
|
-
"properties": {
|
|
681
|
-
"id": {
|
|
682
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
683
|
-
},
|
|
684
|
-
"reason": {
|
|
685
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
686
|
-
}
|
|
687
|
-
},
|
|
688
|
-
"required": ["id", "reason"],
|
|
689
|
-
"additionalProperties": false
|
|
690
|
-
},
|
|
691
|
-
"description": "On final Standard or diff drafts, close generic tasks by saved ID and completion reason. Reuse saved surface IDs for updates. Candidate tasks need findings or dispositions; redundant closure entries for those outcomes are ignored."
|
|
692
|
-
},
|
|
693
|
-
"openQuestions": {
|
|
694
|
-
"type": "array",
|
|
695
|
-
"items": {
|
|
696
|
-
"anyOf": [
|
|
697
|
-
{
|
|
698
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
"type": "object",
|
|
702
|
-
"properties": {
|
|
703
|
-
"question": {
|
|
704
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
705
|
-
},
|
|
706
|
-
"followUpPrompt": {
|
|
707
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/nonEmptyText"
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
"required": ["question"],
|
|
711
|
-
"additionalProperties": true
|
|
712
|
-
}
|
|
713
|
-
]
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
},
|
|
717
|
-
"required": ["surfaces", "explicitExclusions", "deferred"],
|
|
718
|
-
"additionalProperties": true
|
|
719
|
-
},
|
|
720
|
-
"scanDraftInput": {
|
|
721
|
-
"type": "object",
|
|
722
|
-
"properties": {
|
|
723
|
-
"complete": {
|
|
724
|
-
"type": "boolean",
|
|
725
|
-
"description": "Set false to save progress without declaring this worker or parent audit finished. Omit or set true only for the terminal result. Put provisional candidates in reviewState.deferred, not findings."
|
|
726
|
-
},
|
|
727
|
-
"scanId": {
|
|
728
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/scanId"
|
|
729
|
-
},
|
|
730
|
-
"handoffClaimToken": {
|
|
731
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/handoffClaimToken"
|
|
732
|
-
},
|
|
733
|
-
"scope": {
|
|
734
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/scope"
|
|
735
|
-
},
|
|
736
|
-
"threatModel": {
|
|
737
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/threatModel"
|
|
738
|
-
},
|
|
739
|
-
"findings": {
|
|
740
|
-
"type": "array",
|
|
741
|
-
"items": {
|
|
742
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/finding"
|
|
743
|
-
}
|
|
744
|
-
},
|
|
745
|
-
"reviewState": {
|
|
746
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/reviewState"
|
|
747
|
-
}
|
|
748
|
-
},
|
|
749
|
-
"required": ["scanId", "findings", "reviewState"],
|
|
750
|
-
"additionalProperties": false
|
|
751
|
-
},
|
|
752
|
-
"completedScanInput": {
|
|
753
|
-
"type": "object",
|
|
754
|
-
"properties": {
|
|
755
|
-
"scanId": {
|
|
756
|
-
"$ref": "codex-security://schemas/definitions/artifact-common.schema.json#/$defs/scanId"
|
|
757
|
-
},
|
|
758
|
-
"handoffClaimToken": {
|
|
759
|
-
"$ref": "codex-security://schemas/tools/scan-draft.schema.json#/$defs/handoffClaimToken"
|
|
760
|
-
}
|
|
761
|
-
},
|
|
762
|
-
"required": ["scanId"],
|
|
763
|
-
"additionalProperties": false
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|