@agenthead/security 0.0.0-stage → 0.3.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 +12 -2
- package/THIRD_PARTY_NOTICES.md +403 -0
- package/dist/adapters.d.ts +21 -0
- package/dist/adapters.js +230 -0
- package/dist/adapters.js.map +1 -0
- package/dist/audit.d.ts +29 -0
- package/dist/audit.js +126 -0
- package/dist/audit.js.map +1 -0
- package/dist/findings.d.ts +32 -0
- package/dist/findings.js +266 -0
- package/dist/findings.js.map +1 -0
- package/dist/fix.d.ts +17 -0
- package/dist/fix.js +432 -0
- package/dist/fix.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/runner.d.ts +32 -0
- package/dist/runner.js +189 -0
- package/dist/runner.js.map +1 -0
- package/dist/scope.d.ts +50 -0
- package/dist/scope.js +331 -0
- package/dist/scope.js.map +1 -0
- package/dist/security.d.ts +44 -0
- package/dist/security.js +440 -0
- package/dist/security.js.map +1 -0
- package/dist/tools.d.ts +15 -0
- package/dist/tools.js +100 -0
- package/dist/tools.js.map +1 -0
- package/dist/verification.d.ts +27 -0
- package/dist/verification.js +184 -0
- package/dist/verification.js.map +1 -0
- package/package.json +49 -4
package/dist/adapters.js
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { copyFileSync, lstatSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { SecretFilter } from "@agenthead/core";
|
|
4
|
+
import { parseGitleaks, parseOsv, parseSarif, parseSbom, parseTrivy, parseBandit, record, } from "./findings.js";
|
|
5
|
+
// First-party, deliberately small offline OSS-engine rules. No registry lookup.
|
|
6
|
+
const rules = `rules:
|
|
7
|
+
- id: agenthead.python.sql-concatenation
|
|
8
|
+
languages: [python]
|
|
9
|
+
severity: ERROR
|
|
10
|
+
message: Use SQL parameters instead of concatenating input into queries.
|
|
11
|
+
metadata:
|
|
12
|
+
cwe: CWE-89
|
|
13
|
+
patterns:
|
|
14
|
+
- pattern-either:
|
|
15
|
+
- pattern: $DB.execute($SQL + $INPUT, ...)
|
|
16
|
+
- pattern: $DB.execute(f"...{$INPUT}...", ...)
|
|
17
|
+
- id: agenthead.ts.sql-concatenation
|
|
18
|
+
languages: [typescript, javascript]
|
|
19
|
+
severity: ERROR
|
|
20
|
+
message: Use SQL parameters instead of concatenating input into queries.
|
|
21
|
+
metadata:
|
|
22
|
+
cwe: CWE-89
|
|
23
|
+
pattern: $DB.query($SQL + $INPUT, ...)
|
|
24
|
+
`;
|
|
25
|
+
export const adapters = {
|
|
26
|
+
trivy: {
|
|
27
|
+
tool: "trivy",
|
|
28
|
+
successCodes: [0],
|
|
29
|
+
argv: (w) => {
|
|
30
|
+
const cache = join(w.directory, "trivy-cache");
|
|
31
|
+
for (const file of ["db/trivy.db", "db/metadata.json"]) {
|
|
32
|
+
const source = `security-trivy-cache/${file}`;
|
|
33
|
+
if (!w.files.includes(source))
|
|
34
|
+
throw new Error("Trivy needs a local offline DB: provision security-trivy-cache/db/trivy.db and metadata.json inside scan scope; downloads are refused");
|
|
35
|
+
}
|
|
36
|
+
// Copy only known database files, never cache configuration or executable policies.
|
|
37
|
+
for (const dir of ["db", "java-db"]) {
|
|
38
|
+
mkdirSync(join(cache, dir), { recursive: true });
|
|
39
|
+
for (const file of [
|
|
40
|
+
dir === "db" ? "trivy.db" : "trivy-java.db",
|
|
41
|
+
"metadata.json",
|
|
42
|
+
]) {
|
|
43
|
+
const source = `security-trivy-cache/${dir}/${file}`;
|
|
44
|
+
if (w.files.includes(source))
|
|
45
|
+
copyFileSync(join(w.cwd, source), join(cache, dir, file));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const ignore = join(w.directory, "trivy-ignore");
|
|
49
|
+
writeFileSync(ignore, "");
|
|
50
|
+
return [
|
|
51
|
+
"fs",
|
|
52
|
+
"--format",
|
|
53
|
+
"json",
|
|
54
|
+
"--scanners",
|
|
55
|
+
"vuln,misconfig,secret",
|
|
56
|
+
"--offline-scan",
|
|
57
|
+
"--skip-db-update",
|
|
58
|
+
"--skip-java-db-update",
|
|
59
|
+
"--skip-check-update",
|
|
60
|
+
"--skip-version-check",
|
|
61
|
+
"--config",
|
|
62
|
+
w.config,
|
|
63
|
+
"--cache-dir",
|
|
64
|
+
cache,
|
|
65
|
+
"--ignorefile",
|
|
66
|
+
ignore,
|
|
67
|
+
"--secret-config",
|
|
68
|
+
w.config,
|
|
69
|
+
"--skip-dirs",
|
|
70
|
+
"security-trivy-cache",
|
|
71
|
+
".",
|
|
72
|
+
];
|
|
73
|
+
},
|
|
74
|
+
output: (_w, stdout) => stdout,
|
|
75
|
+
parse: parseTrivy,
|
|
76
|
+
},
|
|
77
|
+
bandit: {
|
|
78
|
+
tool: "bandit",
|
|
79
|
+
successCodes: [0, 1],
|
|
80
|
+
argv: (w) => ["-r", ".", "-f", "json", "-c", w.config],
|
|
81
|
+
output: (_w, stdout) => stdout,
|
|
82
|
+
parse: parseBandit,
|
|
83
|
+
},
|
|
84
|
+
gosec: {
|
|
85
|
+
tool: "gosec",
|
|
86
|
+
successCodes: [0, 1],
|
|
87
|
+
argv: (w) => [
|
|
88
|
+
"-fmt",
|
|
89
|
+
"sarif",
|
|
90
|
+
"-out",
|
|
91
|
+
join(w.directory, "gosec.sarif"),
|
|
92
|
+
"-stdout",
|
|
93
|
+
"-verbose",
|
|
94
|
+
"json",
|
|
95
|
+
"./...",
|
|
96
|
+
],
|
|
97
|
+
output: (w, _stdout, maxBytes) => {
|
|
98
|
+
const path = join(w.directory, "gosec.sarif");
|
|
99
|
+
if (!lstatSync(path).isFile() || lstatSync(path).size > maxBytes)
|
|
100
|
+
throw new Error("Scanner report output cap exceeded");
|
|
101
|
+
return readFileSync(path, "utf8");
|
|
102
|
+
},
|
|
103
|
+
validate: (stdout) => {
|
|
104
|
+
// SARIF omits Go compiler/package errors. Never use -no-fail, which hides them.
|
|
105
|
+
const doc = record(JSON.parse(stdout));
|
|
106
|
+
const errors = doc["Golang errors"];
|
|
107
|
+
if (!("Golang errors" in doc) ||
|
|
108
|
+
(errors !== null &&
|
|
109
|
+
(typeof errors !== "object" ||
|
|
110
|
+
Array.isArray(errors) ||
|
|
111
|
+
Object.keys(errors).length > 0)))
|
|
112
|
+
throw new Error("Gosec could not analyze all inputs");
|
|
113
|
+
},
|
|
114
|
+
parse: (text) => parseSarif(text, "gosec"),
|
|
115
|
+
},
|
|
116
|
+
semgrep: {
|
|
117
|
+
tool: "semgrep",
|
|
118
|
+
successCodes: [0, 1],
|
|
119
|
+
argv: (w, settings) => {
|
|
120
|
+
const config = join(w.directory, "rules.yaml");
|
|
121
|
+
writeFileSync(config, rules);
|
|
122
|
+
return [
|
|
123
|
+
"scan",
|
|
124
|
+
"--oss-only",
|
|
125
|
+
"--sarif",
|
|
126
|
+
"--metrics=off",
|
|
127
|
+
"--disable-version-check",
|
|
128
|
+
...(settings?.semgrep.configs.length
|
|
129
|
+
? settings.semgrep.configs
|
|
130
|
+
: [config]).flatMap((c) => ["--config", c === config ? c : join(w.cwd, c)]),
|
|
131
|
+
"--no-git-ignore",
|
|
132
|
+
".",
|
|
133
|
+
];
|
|
134
|
+
},
|
|
135
|
+
output: (_w, stdout) => stdout,
|
|
136
|
+
parse: (text) => parseSarif(text, "semgrep"),
|
|
137
|
+
},
|
|
138
|
+
gitleaks: {
|
|
139
|
+
tool: "gitleaks",
|
|
140
|
+
successCodes: [0, 1],
|
|
141
|
+
argv: (w) => [
|
|
142
|
+
"dir",
|
|
143
|
+
"--no-banner",
|
|
144
|
+
"--redact=100",
|
|
145
|
+
"--report-format",
|
|
146
|
+
"json",
|
|
147
|
+
"--report-path",
|
|
148
|
+
join(w.directory, "gitleaks.json"),
|
|
149
|
+
".",
|
|
150
|
+
],
|
|
151
|
+
output: (w, _stdout, maxBytes) => {
|
|
152
|
+
const path = join(w.directory, "gitleaks.json");
|
|
153
|
+
if (!lstatSync(path).isFile() || lstatSync(path).size > maxBytes)
|
|
154
|
+
throw new Error("Scanner report output cap exceeded");
|
|
155
|
+
return readFileSync(path, "utf8");
|
|
156
|
+
},
|
|
157
|
+
parse: parseGitleaks,
|
|
158
|
+
},
|
|
159
|
+
"osv-scanner": {
|
|
160
|
+
tool: "osv-scanner",
|
|
161
|
+
successCodes: [0, 1],
|
|
162
|
+
argv: () => [
|
|
163
|
+
"scan",
|
|
164
|
+
"source",
|
|
165
|
+
"--offline",
|
|
166
|
+
"--format=json",
|
|
167
|
+
"--recursive",
|
|
168
|
+
".",
|
|
169
|
+
],
|
|
170
|
+
output: (_w, stdout) => stdout,
|
|
171
|
+
parse: parseOsv,
|
|
172
|
+
},
|
|
173
|
+
syft: {
|
|
174
|
+
tool: "syft",
|
|
175
|
+
successCodes: [0],
|
|
176
|
+
argv: (w) => [
|
|
177
|
+
"scan",
|
|
178
|
+
"dir:.",
|
|
179
|
+
"--config",
|
|
180
|
+
w.config,
|
|
181
|
+
"-o",
|
|
182
|
+
"cyclonedx-json",
|
|
183
|
+
"--quiet",
|
|
184
|
+
],
|
|
185
|
+
output: (_w, stdout) => stdout,
|
|
186
|
+
parse: (text) => {
|
|
187
|
+
parseSbom(text);
|
|
188
|
+
return [];
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
/** Gitleaks may identify formats unknown to the core built-ins. Teach the existing
|
|
193
|
+
* filter the exact detected values before storing diagnostics or raw evidence. */
|
|
194
|
+
export function outputPatterns(tool, output) {
|
|
195
|
+
const patterns = [];
|
|
196
|
+
if (tool === "trivy") {
|
|
197
|
+
const doc = record(JSON.parse(output));
|
|
198
|
+
if (!Array.isArray(doc.Results))
|
|
199
|
+
throw new Error("Invalid Trivy results");
|
|
200
|
+
for (const result of doc.Results)
|
|
201
|
+
for (const secret of (record(result).Secrets ?? [])) {
|
|
202
|
+
const match = record(secret).Match;
|
|
203
|
+
if (typeof match === "string" && match)
|
|
204
|
+
patterns.push({
|
|
205
|
+
type: "scanner-secret",
|
|
206
|
+
pattern: new RegExp(match.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"),
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (tool === "gitleaks") {
|
|
211
|
+
const rows = JSON.parse(output);
|
|
212
|
+
if (Array.isArray(rows))
|
|
213
|
+
for (const value of rows)
|
|
214
|
+
for (const key of ["Secret", "Match"]) {
|
|
215
|
+
const secret = record(value)[key];
|
|
216
|
+
if (typeof secret === "string" &&
|
|
217
|
+
secret &&
|
|
218
|
+
!/^REDACTED|^\[REDACTED/.test(secret))
|
|
219
|
+
patterns.push({
|
|
220
|
+
type: "scanner-secret",
|
|
221
|
+
pattern: new RegExp(secret.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"),
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return patterns;
|
|
226
|
+
}
|
|
227
|
+
export function outputFilter(tool, output) {
|
|
228
|
+
return new SecretFilter({ patterns: outputPatterns(tool, output) });
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,SAAS,EACT,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,MAAM,GAEP,MAAM,eAAe,CAAC;AAKvB,gFAAgF;AAChF,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;CAkBb,CAAC;AAgBF,MAAM,C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CAAC;wBACZ,IAAI,EAAE,gBAAgB;wBACtB,OAAO,EAAE,IAAI,MAAM,CACjB,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,EAC5C,GAAG,CACJ;qBACF,CAAC,CAAC;YACP,CAAC;IACL,CAAC;IACD,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YACrB,KAAK,MAAM,KAAK,IAAI,IAAI;gBACtB,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;oBACtC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;oBAClC,IACE,OAAO,MAAM,KAAK,QAAQ;wBAC1B,MAAM;wBACN,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC;wBAErC,QAAQ,CAAC,IAAI,CAAC;4BACZ,IAAI,EAAE,gBAAgB;4BACtB,OAAO,EAAE,IAAI,MAAM,CACjB,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,EAC7C,GAAG,CACJ;yBACF,CAAC,CAAC;gBACP,CAAC;IACP,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,MAAc;IACvD,OAAO,IAAI,YAAY,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/audit.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type EvidenceStore } from "@agenthead/core";
|
|
2
|
+
import { type ScopeGuard } from "./scope.js";
|
|
3
|
+
export declare const auditTask = "security";
|
|
4
|
+
export interface AuditEvent {
|
|
5
|
+
action: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare function audit(store: EvidenceStore, action: string, data?: Record<string, unknown>): void;
|
|
9
|
+
export declare function events(store: EvidenceStore): AuditEvent[];
|
|
10
|
+
export interface ApprovalRequest {
|
|
11
|
+
id: string;
|
|
12
|
+
operation: string;
|
|
13
|
+
context: unknown;
|
|
14
|
+
binding: string;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
expiresAt: number;
|
|
17
|
+
scopeHash: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ApprovalOptions {
|
|
20
|
+
approve?: string;
|
|
21
|
+
onRequest?: (request: ApprovalRequest) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare class ApprovalRequired extends Error {
|
|
24
|
+
readonly request: ApprovalRequest;
|
|
25
|
+
name: string;
|
|
26
|
+
constructor(request: ApprovalRequest);
|
|
27
|
+
}
|
|
28
|
+
/** One-shot approval bound to the exact operation, scope, workspace and inputs. */
|
|
29
|
+
export declare function requireApproval(store: EvidenceStore, guard: ScopeGuard, operation: string, context: unknown, options?: ApprovalOptions): Promise<ApprovalRequest>;
|
package/dist/audit.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { SecretFilter } from "@agenthead/core";
|
|
3
|
+
import { digest } from "./findings.js";
|
|
4
|
+
import { scopeHash } from "./scope.js";
|
|
5
|
+
export const auditTask = "security";
|
|
6
|
+
export function audit(store, action, data = {}) {
|
|
7
|
+
data = { ...data, at: new Date().toISOString() };
|
|
8
|
+
store.securityAuditAppend({ ...data, action });
|
|
9
|
+
store.ledgerAdd({
|
|
10
|
+
task_id: auditTask,
|
|
11
|
+
kind: "fact",
|
|
12
|
+
provenance: "observed",
|
|
13
|
+
produced_by: "@agenthead/security",
|
|
14
|
+
text: JSON.stringify({ ...data, action }),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function events(store) {
|
|
18
|
+
return store.securityAuditEntries().map((value) => value);
|
|
19
|
+
}
|
|
20
|
+
export class ApprovalRequired extends Error {
|
|
21
|
+
request;
|
|
22
|
+
name = "ApprovalRequired";
|
|
23
|
+
constructor(request) {
|
|
24
|
+
super(`Human approval required for ${request.operation}. Run 'agenthead security approve ${request.id}' in your own terminal to review and authorise this request (stdin and stdout must both be interactive TTYs; enter the confirmation code shown on /dev/tty within 60 seconds; unknown, unauthorised, stale, mismatched, expired or consumed IDs are refused)`);
|
|
25
|
+
this.request = request;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** One-shot approval bound to the exact operation, scope, workspace and inputs. */
|
|
29
|
+
export async function requireApproval(store, guard, operation, context, options = {}) {
|
|
30
|
+
if (scopeHash(guard.root) !== guard.scopeHash)
|
|
31
|
+
throw new ApprovalRequired({
|
|
32
|
+
id: "stale-scope",
|
|
33
|
+
operation,
|
|
34
|
+
context: null,
|
|
35
|
+
binding: "",
|
|
36
|
+
createdAt: 0,
|
|
37
|
+
expiresAt: 0,
|
|
38
|
+
scopeHash: guard.scopeHash,
|
|
39
|
+
});
|
|
40
|
+
const binding = digest(JSON.stringify({
|
|
41
|
+
root: guard.boundary.root,
|
|
42
|
+
scope: guard.scope,
|
|
43
|
+
scopeHash: guard.scopeHash,
|
|
44
|
+
operation,
|
|
45
|
+
context,
|
|
46
|
+
}));
|
|
47
|
+
const safeContext = JSON.parse(new SecretFilter().redact(JSON.stringify(context ?? null)));
|
|
48
|
+
let request;
|
|
49
|
+
if (options.approve) {
|
|
50
|
+
const history = events(store);
|
|
51
|
+
const requestedIndex = history.findIndex((event) => event.action === "approval_requested" && event.id === options.approve);
|
|
52
|
+
const old = history[requestedIndex];
|
|
53
|
+
// Audit rows are ordered by their database sequence, not wall-clock time.
|
|
54
|
+
// A request ID alone is never authority to execute an operation.
|
|
55
|
+
const authorised = history
|
|
56
|
+
.slice(requestedIndex + 1)
|
|
57
|
+
.some((event) => event.action === "approval_authorised" &&
|
|
58
|
+
event.id === options.approve &&
|
|
59
|
+
event.binding === binding &&
|
|
60
|
+
event.command === "agenthead security approve");
|
|
61
|
+
if (!old ||
|
|
62
|
+
!authorised ||
|
|
63
|
+
old.binding !== binding ||
|
|
64
|
+
typeof old.expiresAt !== "number" ||
|
|
65
|
+
!Number.isFinite(old.expiresAt) ||
|
|
66
|
+
Date.now() >= old.expiresAt ||
|
|
67
|
+
history.some((event) => event.action === "approval_revoked" && event.id === options.approve) ||
|
|
68
|
+
history.some((event) => event.action === "approval_granted" && event.id === options.approve)) {
|
|
69
|
+
audit(store, "approval_denied", {
|
|
70
|
+
id: options.approve,
|
|
71
|
+
operation,
|
|
72
|
+
reason: "unknown, unauthorised, stale, mismatched, expired or consumed operation",
|
|
73
|
+
});
|
|
74
|
+
throw new ApprovalRequired({
|
|
75
|
+
id: options.approve,
|
|
76
|
+
operation,
|
|
77
|
+
context: safeContext,
|
|
78
|
+
binding,
|
|
79
|
+
createdAt: 0,
|
|
80
|
+
expiresAt: 0,
|
|
81
|
+
scopeHash: guard.scopeHash,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
request = {
|
|
85
|
+
id: options.approve,
|
|
86
|
+
operation,
|
|
87
|
+
context: safeContext,
|
|
88
|
+
binding,
|
|
89
|
+
createdAt: Number(old.createdAt),
|
|
90
|
+
expiresAt: Number(old.expiresAt),
|
|
91
|
+
scopeHash: guard.scopeHash,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
request = {
|
|
96
|
+
id: `security-${randomUUID()}`,
|
|
97
|
+
operation,
|
|
98
|
+
context: safeContext,
|
|
99
|
+
binding,
|
|
100
|
+
createdAt: Date.now(),
|
|
101
|
+
expiresAt: Date.now() + 15 * 60_000,
|
|
102
|
+
scopeHash: guard.scopeHash,
|
|
103
|
+
};
|
|
104
|
+
audit(store, "approval_requested", { ...request });
|
|
105
|
+
options.onRequest?.(request);
|
|
106
|
+
audit(store, "approval_denied", {
|
|
107
|
+
id: request.id,
|
|
108
|
+
operation,
|
|
109
|
+
reason: "awaiting human terminal authorisation",
|
|
110
|
+
});
|
|
111
|
+
throw new ApprovalRequired(request);
|
|
112
|
+
}
|
|
113
|
+
if (Date.now() >= request.expiresAt ||
|
|
114
|
+
scopeHash(guard.root) !== guard.scopeHash)
|
|
115
|
+
throw new ApprovalRequired(request);
|
|
116
|
+
// Unique database index makes concurrent/reentrant consumption fail closed.
|
|
117
|
+
audit(store, "approval_granted", {
|
|
118
|
+
id: request.id,
|
|
119
|
+
operation,
|
|
120
|
+
binding,
|
|
121
|
+
expiresAt: request.expiresAt,
|
|
122
|
+
provenance: "TTY-authorised operation-id flag",
|
|
123
|
+
});
|
|
124
|
+
return request;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAsB,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,SAAS,EAAmB,MAAM,YAAY,CAAC;AAExD,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AAKpC,MAAM,UAAU,KAAK,CACnB,KAAoB,EACpB,MAAc,EACd,OAAgC,EAAE;IAElC,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;IACjD,KAAK,CAAC,mBAAmB,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/C,KAAK,CAAC,SAAS,CAAC;QACd,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,UAAU;QACtB,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,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tC,CAAC;IACD,IACE,IAAI,CAAC,GAAG,EAAE,IAAI,OAAO,CAAC,SAAS;QAC/B,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,SAAS;QAEzC,MAAM,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC,4EAA4E;IAC5E,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE;QAC/B,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,SAAS;QACT,OAAO;QACP,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,kCAAkC;KAC/C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const severities: readonly ["critical", "high", "medium", "low", "info", "unknown"];
|
|
2
|
+
export type Severity = (typeof severities)[number];
|
|
3
|
+
export interface Finding {
|
|
4
|
+
id: string;
|
|
5
|
+
tool: string;
|
|
6
|
+
rule: string;
|
|
7
|
+
severity: Severity;
|
|
8
|
+
file: string | null;
|
|
9
|
+
startLine: number | null;
|
|
10
|
+
endLine: number | null;
|
|
11
|
+
message: string;
|
|
12
|
+
cwe: string[];
|
|
13
|
+
cve: string[];
|
|
14
|
+
fingerprint: string;
|
|
15
|
+
identity?: string;
|
|
16
|
+
evidenceId?: string;
|
|
17
|
+
state?: "open" | "fixed" | "suppressed";
|
|
18
|
+
}
|
|
19
|
+
export declare const digest: (value: string | Uint8Array) => string;
|
|
20
|
+
export declare function record(value: unknown): Record<string, unknown>;
|
|
21
|
+
export declare function severity(value: unknown): Severity;
|
|
22
|
+
export declare function finding(input: Omit<Finding, "id" | "fingerprint">): Finding;
|
|
23
|
+
/** SARIF 2.1.0, including artifact indexes and relative URI bases. No URI is fetched. */
|
|
24
|
+
export declare function parseSarif(text: string, toolOverride?: string): Finding[];
|
|
25
|
+
export declare function parseGitleaks(text: string): Finding[];
|
|
26
|
+
/** OSV-Scanner v2 JSON source/package/vulnerability records. */
|
|
27
|
+
export declare function parseOsv(text: string): Finding[];
|
|
28
|
+
export declare function parseSbom(text: string): unknown;
|
|
29
|
+
/** Trivy filesystem JSON: vulnerabilities, failed configuration checks and secrets. */
|
|
30
|
+
export declare function parseTrivy(text: string): Finding[];
|
|
31
|
+
/** Bandit JSON; analysis errors must never turn into a clean scan. */
|
|
32
|
+
export declare function parseBandit(text: string): Finding[];
|