@crimson-crawler/crimson-crawler-client 4.1.1 → 5.0.1
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/NOTICE +21 -0
- package/README.md +198 -94
- package/dist/.package-build.json +1 -1
- package/dist/_generated/index.cjs +54 -34
- package/dist/_generated/index.d.cts +2 -2
- package/dist/_generated/index.d.ts +2 -2
- package/dist/_generated/index.js +1 -1
- package/dist/_generated/sdk.gen.cjs +54 -34
- package/dist/_generated/sdk.gen.d.cts +402 -173
- package/dist/_generated/sdk.gen.d.ts +402 -173
- package/dist/_generated/sdk.gen.js +1 -1
- package/dist/_generated/types.gen.d.cts +14117 -3953
- package/dist/_generated/types.gen.d.ts +14117 -3953
- package/dist/{chunk-4HSWOQA6.cjs → chunk-ASYQPVBW.cjs} +46 -0
- package/dist/{chunk-C53EHGN4.js → chunk-EZD3XBDV.js} +86 -65
- package/dist/{chunk-2X3CCE46.js → chunk-MHC5LRPW.js} +42 -1
- package/dist/{chunk-4PCL3ANB.cjs → chunk-TAMKRTM6.cjs} +87 -64
- package/dist/index.cjs +900 -175
- package/dist/index.d.cts +558 -99
- package/dist/index.d.ts +558 -99
- package/dist/index.js +851 -130
- package/dist/presets-cAYp-Cru.d.cts +122 -0
- package/dist/presets-cAYp-Cru.d.ts +122 -0
- package/dist/presets.cjs +27 -19
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/package.json +9 -5
- package/dist/presets-BMN8jy08.d.cts +0 -110
- package/dist/presets-BMN8jy08.d.ts +0 -110
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { b as Client } from './types.gen-ObPczyUH.cjs';
|
|
2
|
-
import { EnrichCveResponse, EnrichIocResponse, EnrichCweResponse, EnrichTechniqueResponse, EnrichProductResponse, EnrichPackageResponse, SearchCtiResponse, EnrichAtlasResponse, EnrichCampaignResponse, EnrichCapecResponse, EnrichDefendResponse, EnrichDisarmResponse, EnrichGroupResponse, EnrichLocationResponse, EnrichSectorResponse, EnrichSoftwareResponse, EnrichBatchRequest, EnrichBatchResponse, EnrichPocSourceResponse, AssessGroupExposureResponse, AssessIocPortfolioRequest, AssessIocPortfolioResponse, AssessTechniqueCoverageResponse, ArtifactEnrichmentStakeholder, AssessVulnerabilityExposureResponse, SearchCtiRequest, SearchCveRequest, SearchCveResponse, SearchD3FendRequest, SearchD3FendResponse, SearchKevRequest, SearchKevResponse, SearchKnowledgebaseRequest, SearchKnowledgebaseResponse, SearchMispResponse, SearchPocResponse, SearchVendorResponse, ArtifactEnrichmentDocRequest, ArtifactEnrichResponse, ArtifactEnrichStatusResponse, InventoryAsset, InventoryEnrichResponse, InventoryEnrichStatusResponse } from './_generated/types.gen.cjs';
|
|
3
|
-
export { p as presets } from './presets-
|
|
2
|
+
import { EnrichCveResponse, EnrichIocResponse, EnrichCweResponse, EnrichTechniqueResponse, EnrichProductResponse, EnrichPackageResponse, SearchCtiResponse, EnrichAtlasResponse, EnrichCampaignResponse, EnrichCapecResponse, EnrichCloakResponse, EnrichDefendResponse, EnrichDisarmResponse, EnrichF3Response, EnrichGroupResponse, EnrichLocationResponse, EnrichSectorResponse, EnrichSoftwareResponse, EnrichBatchRequest, EnrichBatchResponse, EnrichPocSourceResponse, AssessGroupExposureResponse, AssessIocPortfolioRequest, AssessIocPortfolioResponse, AssessTechniqueCoverageResponse, ArtifactEnrichmentStakeholder, AssessVulnerabilityExposureResponse, SearchCtiRequest, SearchCveRequest, SearchCveResponse, SearchD3FendRequest, SearchD3FendResponse, SearchKevRequest, SearchKevResponse, SearchCsafResponse, SearchKnowledgebaseRequest, SearchKnowledgebaseResponse, SearchMispResponse, SearchPocResponse, SearchVendorResponse, ArtifactEnrichmentDocRequest, ArtifactEnrichResponse, ArtifactEnrichStatusResponse, InventoryAsset, InventoryEnrichResponse, InventoryEnrichStatusResponse, EventEnrichResponse, EventEnrichStatusResponse } from './_generated/types.gen.cjs';
|
|
3
|
+
export { p as presets } from './presets-cAYp-Cru.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* tlp.ts — TLP 2.0 marking values for the export surfaces (#374).
|
|
7
|
+
*
|
|
8
|
+
* One value set shared by the Artifact Manager / Report Generator surfaces and the
|
|
9
|
+
* `/v1/artifact-enrich` engine. Case-sensitive: the five CISA TLP 2.0 markings. Every storage
|
|
10
|
+
* artifact now carries its own `tlp` (contract #374), so `undefined` (the default on every method
|
|
11
|
+
* here) omits the parameter: list methods return all markings, new artifacts default to `AMBER`,
|
|
12
|
+
* and stored-artifact exports use the artifact's own TLP. Nothing defaults to `CLEAR`, because no
|
|
13
|
+
* deterministic signal proves an input is public reference data.
|
|
14
|
+
*/
|
|
15
|
+
declare const TLP_VALUES: readonly ["CLEAR", "GREEN", "AMBER", "AMBER+STRICT", "RED"];
|
|
16
|
+
type Tlp = (typeof TLP_VALUES)[number];
|
|
17
|
+
declare const TLP_INVALID_MESSAGE: string;
|
|
18
|
+
/** Validate a wire `tlp` argument, or `undefined` to omit it (server default: AMBER, or the
|
|
19
|
+
* artifact's own stored TLP on a stored-artifact export). Throws a `RangeError` — the SDK's
|
|
20
|
+
* argument-validation error — BEFORE any request is made. */
|
|
21
|
+
declare function validateTlp(value: string | undefined): Tlp | undefined;
|
|
4
22
|
|
|
5
23
|
/**
|
|
6
24
|
* Report Generator API — key-authed access to the Report Generator.
|
|
@@ -13,11 +31,12 @@ export { p as presets } from './presets-BMN8jy08.cjs';
|
|
|
13
31
|
*
|
|
14
32
|
* Same API key, same base URL, same retry/timeout fetch as every other call — **Report Generator calls
|
|
15
33
|
* never count toward your API usage** (including the LLM generation). Reports are stored as
|
|
16
|
-
* `kind=report` artifacts
|
|
17
|
-
*
|
|
34
|
+
* `kind=report` artifacts. Every report, API-generated or built in the browser editor, exports as `html`
|
|
35
|
+
* or `md` here (charts come out as tables of their numbers); PDF/DOCX are exported from the editor.
|
|
18
36
|
*
|
|
19
37
|
* Exposed as `client.aiReports` (mirrors the Python `AiReportsAPI`).
|
|
20
38
|
*/
|
|
39
|
+
|
|
21
40
|
/** A fetch-like function — the CrawlerClient hands in its retry/timeout wrapper. */
|
|
22
41
|
type AiReportsFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
23
42
|
/**
|
|
@@ -47,11 +66,17 @@ declare class AiReportsApi {
|
|
|
47
66
|
* Create a DRAFT report from a template + source artifacts. Renders the scaffold (static +
|
|
48
67
|
* deterministic data sections) and returns the list of AI sections still to fill.
|
|
49
68
|
*
|
|
50
|
-
*
|
|
69
|
+
* `tlp` is an optional TLP 2.0 marking stored on the report exactly (`CLEAR` / `GREEN` / `AMBER` /
|
|
70
|
+
* `AMBER+STRICT` / `RED`). Omit it to use your default report TLP (the Report Generator's
|
|
71
|
+
* Settings), raised to the most restrictive source marking. An invalid value throws `RangeError`
|
|
72
|
+
* before any request.
|
|
73
|
+
*
|
|
74
|
+
* Resolves `{ id, name, html, ai_sections: [{section_type, label, ...}], skipped: [...], tlp }`.
|
|
51
75
|
*/
|
|
52
76
|
createDraft(template: string, options?: {
|
|
53
77
|
sourceIds?: string[];
|
|
54
78
|
name?: string;
|
|
79
|
+
tlp?: Tlp;
|
|
55
80
|
}): Promise<Record<string, unknown>>;
|
|
56
81
|
/**
|
|
57
82
|
* Generate ONE grounded AI section of a draft (omit `sectionType` to fill the next pending one).
|
|
@@ -77,24 +102,40 @@ declare class AiReportsApi {
|
|
|
77
102
|
/**
|
|
78
103
|
* Export a report as `html` or `md`. The body IS the export file.
|
|
79
104
|
*
|
|
105
|
+
* `options.tlp` sets the TLP 2.0 marking written into the document (`CLEAR` / `GREEN` / `AMBER` /
|
|
106
|
+
* `AMBER+STRICT` / `RED`), overriding the report's stored TLP; omit it to stamp the report's own
|
|
107
|
+
* stored TLP. An invalid value throws a `RangeError` before any request.
|
|
108
|
+
*
|
|
80
109
|
* Resolves `{ content, bytes, filename, contentType }`. `filename` is a sanitized basename from
|
|
81
|
-
* `Content-Disposition`. PDF/DOCX are browser-editor-only
|
|
110
|
+
* `Content-Disposition`. PDF/DOCX are browser-editor-only. Reports built in the browser export here too.
|
|
82
111
|
*/
|
|
83
|
-
exportReport(reportId: string, fmt?: "html" | "md"
|
|
112
|
+
exportReport(reportId: string, fmt?: "html" | "md", options?: {
|
|
113
|
+
tlp?: Tlp;
|
|
114
|
+
}): Promise<Record<string, unknown>>;
|
|
84
115
|
/**
|
|
85
116
|
* Generate a report end-to-end: create the draft, fill every AI section, return the finished
|
|
86
|
-
* report. The convenience over `createDraft` + `fillSection
|
|
117
|
+
* report. The convenience over `createDraft` + `fillSection`; `options.tlp` is passed to
|
|
118
|
+
* `createDraft` (an exact marking; omit it for your default raised by the sources).
|
|
87
119
|
*
|
|
88
|
-
*
|
|
120
|
+
* Report sections run on the account's own AI provider (bring-your-own-key, saved in portal
|
|
121
|
+
* API Dashboard → AI Provider). If a section's model call fails (502), generation stops there and
|
|
122
|
+
* returns what filled so far:
|
|
89
123
|
* the report keeps the sections completed before the failure, the failed section is recorded in
|
|
90
124
|
* `sections` as `{ error: "generation failed", status: 502 }`, and that section plus any after it
|
|
91
125
|
* stay unfilled cards. Re-run `generateReport` or fill the rest individually with `fillSection`.
|
|
92
126
|
*
|
|
127
|
+
* No AI key at all (402) stops the loop the same way, recorded as
|
|
128
|
+
* `{ error: "no AI provider", status: 402 }` — add a key, then fill the rest with `fillSection`. A
|
|
129
|
+
* spent daily allowance on the built-in AI (429) is recorded as `{ error: "quota exhausted", status: 429 }`
|
|
130
|
+
* (your own key has no limit), and a gateway rate limit as `{ error: "rate limited", status: 429 }`.
|
|
131
|
+
* Draft creation never calls a model.
|
|
132
|
+
*
|
|
93
133
|
* Resolves `{ report, sections: [<fill result per section>], skipped: [...] }`.
|
|
94
134
|
*/
|
|
95
135
|
generateReport(template: string, options?: {
|
|
96
136
|
sourceIds?: string[];
|
|
97
137
|
name?: string;
|
|
138
|
+
tlp?: Tlp;
|
|
98
139
|
}): Promise<Record<string, unknown>>;
|
|
99
140
|
}
|
|
100
141
|
|
|
@@ -111,12 +152,15 @@ declare class AiReportsApi {
|
|
|
111
152
|
* but **artifactManager calls never count toward your API usage** (account
|
|
112
153
|
* self-service over your own data, not enrichment compute).
|
|
113
154
|
*/
|
|
155
|
+
|
|
114
156
|
/** A fetch-like function — the CrawlerClient hands in its retry/timeout wrapper. */
|
|
115
157
|
type ArtifactManagerFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
116
158
|
interface ArtifactManagerArtifact {
|
|
117
159
|
id: string;
|
|
118
160
|
kind: "input" | "artifact_enrichment" | "report" | "inventory_enrichment" | "inventory_asset";
|
|
119
161
|
name: string;
|
|
162
|
+
/** The artifact's own TLP 2.0 marking. Never null (legacy rows read `"AMBER"`). */
|
|
163
|
+
tlp: Tlp;
|
|
120
164
|
mime?: string | null;
|
|
121
165
|
format?: string | null;
|
|
122
166
|
content?: string | null;
|
|
@@ -140,6 +184,8 @@ interface ArtifactManagerRawArtifact {
|
|
|
140
184
|
name: string;
|
|
141
185
|
format: string;
|
|
142
186
|
mime: string;
|
|
187
|
+
/** The artifact's own TLP 2.0 marking (from the `X-Artifact-Tlp` header). */
|
|
188
|
+
tlp: string;
|
|
143
189
|
created_at: string;
|
|
144
190
|
}
|
|
145
191
|
interface ArtifactManagerExport {
|
|
@@ -158,6 +204,13 @@ interface ArtifactManagerRating {
|
|
|
158
204
|
down: number;
|
|
159
205
|
};
|
|
160
206
|
}
|
|
207
|
+
/** The default TLP 2.0 marking a NEW enrichment starts from — two independent values, `AMBER` when unset. */
|
|
208
|
+
interface EnricherSettings {
|
|
209
|
+
/** Artifact Enricher runs. */
|
|
210
|
+
artifact_tlp: Tlp;
|
|
211
|
+
/** Inventory Enricher runs. */
|
|
212
|
+
inventory_tlp: Tlp;
|
|
213
|
+
}
|
|
161
214
|
/**
|
|
162
215
|
* Client for the key-authed Artifact Manager API (Artifact Manager).
|
|
163
216
|
*
|
|
@@ -176,19 +229,24 @@ declare class ArtifactManagerApi {
|
|
|
176
229
|
* List your artifacts (newest first, no content).
|
|
177
230
|
*
|
|
178
231
|
* @param options `kind` (input|enrichment|report) · `folder` (UUID or `"__root__"`)
|
|
179
|
-
* · `since`/`until` (ISO `created_at` window)
|
|
232
|
+
* · `since`/`until` (ISO `created_at` window) · `search` (names and contents, like the portal's search box)
|
|
233
|
+
* · `tlp` (filter by exact TLP 2.0 marking; each returned artifact carries its own `tlp`).
|
|
180
234
|
*/
|
|
181
235
|
listArtifacts(options?: {
|
|
182
236
|
kind?: "input" | "artifact_enrichment" | "report" | "inventory_enrichment" | "inventory_asset";
|
|
183
237
|
folder?: string;
|
|
184
238
|
since?: string;
|
|
185
239
|
until?: string;
|
|
240
|
+
search?: string;
|
|
241
|
+
/** Filter by exact TLP 2.0 marking. An invalid value throws a `RangeError` before any request. */
|
|
242
|
+
tlp?: Tlp;
|
|
186
243
|
}): Promise<ArtifactManagerArtifact[]>;
|
|
187
244
|
/**
|
|
188
245
|
* Upload input artifacts (max 20/call, ≤10 MB content each).
|
|
189
246
|
*
|
|
190
247
|
* @param artifacts Each `{ name, content, format: "paste"|"file", mime? }`.
|
|
191
|
-
* @param options File into an existing `folderId`, or create one via `newFolderName
|
|
248
|
+
* @param options File into an existing `folderId`, or create one via `newFolderName`; `tlp` marks
|
|
249
|
+
* EVERY artifact in the batch (default `AMBER`).
|
|
192
250
|
* @returns `{ ids, folderId }` — the new artifact ids.
|
|
193
251
|
*/
|
|
194
252
|
uploadArtifacts(artifacts: Array<{
|
|
@@ -199,6 +257,7 @@ declare class ArtifactManagerApi {
|
|
|
199
257
|
}>, options?: {
|
|
200
258
|
folderId?: string;
|
|
201
259
|
newFolderName?: string;
|
|
260
|
+
tlp?: Tlp;
|
|
202
261
|
}): Promise<{
|
|
203
262
|
ids: string[];
|
|
204
263
|
folderId: string | null;
|
|
@@ -211,15 +270,17 @@ declare class ArtifactManagerApi {
|
|
|
211
270
|
*/
|
|
212
271
|
getArtifactRaw(artifactId: string): Promise<ArtifactManagerRawArtifact>;
|
|
213
272
|
/**
|
|
214
|
-
* Partial update: rename, star/unstar, and/or
|
|
273
|
+
* Partial update: rename, star/unstar, move between folders, and/or set the TLP marking.
|
|
215
274
|
*
|
|
216
275
|
* `folderId: null` moves the artifact back to root; omit it to leave the
|
|
217
|
-
* folder unchanged.
|
|
276
|
+
* folder unchanged. A call that sets only `tlp` is valid; an invalid value
|
|
277
|
+
* throws a `RangeError` before any request.
|
|
218
278
|
*/
|
|
219
279
|
updateArtifact(artifactId: string, update: {
|
|
220
280
|
name?: string;
|
|
221
281
|
favorite?: boolean;
|
|
222
282
|
folderId?: string | null;
|
|
283
|
+
tlp?: Tlp;
|
|
223
284
|
}): Promise<ArtifactManagerArtifact>;
|
|
224
285
|
/** Delete one artifact. Resolves `true` on success (404 throws). */
|
|
225
286
|
deleteArtifact(artifactId: string): Promise<boolean>;
|
|
@@ -254,8 +315,12 @@ declare class ArtifactManagerApi {
|
|
|
254
315
|
bulkSetFavorite(artifactIds: string[], favorite: boolean): Promise<number>;
|
|
255
316
|
/** Bundle an explicit set of your artifacts into one `.zip` (the bulk "Download .zip"). Enrichments
|
|
256
317
|
* contribute their machine exports under a per-enrichment subfolder; every other kind contributes its raw
|
|
257
|
-
* deliverable. Returns the raw `.zip` bytes.
|
|
258
|
-
|
|
318
|
+
* deliverable. Returns the raw `.zip` bytes. `options.tlp` marks every wrapped export, overriding each
|
|
319
|
+
* artifact's own stored TLP; omit it to mark each with that artifact's own TLP.
|
|
320
|
+
* See {@link downloadFolder} for the whole-folder twin. */
|
|
321
|
+
downloadBundle(artifactIds: string[], options?: {
|
|
322
|
+
tlp?: Tlp;
|
|
323
|
+
}): Promise<Uint8Array>;
|
|
259
324
|
/** Your thumbs rating on an enrichment + the aggregate counts. */
|
|
260
325
|
getRating(enrichmentId: string): Promise<ArtifactManagerRating>;
|
|
261
326
|
/** Rate an enrichment `"up"`/`"down"`, or clear your rating with `null`. */
|
|
@@ -263,13 +328,23 @@ declare class ArtifactManagerApi {
|
|
|
263
328
|
/** A saved enrichment's machine-export formats (`stix`, `misp`, `csaf`, `vex`, `csv`, …). */
|
|
264
329
|
listExports(enrichmentId: string): Promise<string[]>;
|
|
265
330
|
/** Download one export. The body is the export file; `filename` is a sanitized basename from
|
|
266
|
-
* `Content-Disposition`. Text formats land in `content`; binary XLSX formats in `bytes`.
|
|
267
|
-
|
|
331
|
+
* `Content-Disposition`. Text formats land in `content`; binary XLSX formats in `bytes`.
|
|
332
|
+
*
|
|
333
|
+
* `options.tlp` sets the TLP 2.0 marking written into the export (`CLEAR` / `GREEN` / `AMBER` /
|
|
334
|
+
* `AMBER+STRICT` / `RED`), overriding the artifact's stored TLP; omit it to stamp the artifact's
|
|
335
|
+
* own stored TLP. Formats with no marking slot — OpenVEX, CSV and the
|
|
336
|
+
* DISA eMASS worksheet — ignore it. An invalid value throws a `RangeError` before any request. */
|
|
337
|
+
getExport(enrichmentId: string, format: string, options?: {
|
|
338
|
+
tlp?: Tlp;
|
|
339
|
+
}): Promise<ArtifactManagerExport>;
|
|
268
340
|
/** Download EVERY machine export of a saved artifact as one `.zip` (one file per format —
|
|
269
341
|
* `stix.json`, `vex.json`, `emass.xlsx`, …). The bulk twin of {@link getExport}, matching the export
|
|
270
342
|
* panel's "Download all (.zip)" button. Works for any saved enrichment / inventory-enrichment /
|
|
271
|
-
* inventory id. Returns the raw `.zip` bytes.
|
|
272
|
-
|
|
343
|
+
* inventory id. Returns the raw `.zip` bytes. `options.tlp` marks each export, overriding the
|
|
344
|
+
* artifact's stored TLP; omit it to stamp each with the artifact's own stored TLP. */
|
|
345
|
+
downloadAllExports(enrichmentId: string, options?: {
|
|
346
|
+
tlp?: Tlp;
|
|
347
|
+
}): Promise<Uint8Array>;
|
|
273
348
|
/**
|
|
274
349
|
* Difference matrix across 2–12 of your saved enrichments (oldest → newest). Each
|
|
275
350
|
* row is one finding's trajectory: new / resolved / changed / persistent.
|
|
@@ -285,12 +360,32 @@ declare class ArtifactManagerApi {
|
|
|
285
360
|
deleteFolder(folderId: string): Promise<boolean>;
|
|
286
361
|
/** Download every artifact filed under a folder as one `<folder>.zip` (the folder "Download .zip").
|
|
287
362
|
* Enrichments contribute their machine exports under a per-enrichment subfolder; every other kind
|
|
288
|
-
* contributes its raw deliverable. Returns the raw `.zip` bytes.
|
|
289
|
-
|
|
363
|
+
* contributes its raw deliverable. Returns the raw `.zip` bytes. `options.tlp` marks every wrapped
|
|
364
|
+
* export, overriding each artifact's own stored TLP; omit it to mark each with that artifact's own
|
|
365
|
+
* stored TLP. */
|
|
366
|
+
downloadFolder(folderId: string, options?: {
|
|
367
|
+
tlp?: Tlp;
|
|
368
|
+
}): Promise<Uint8Array>;
|
|
369
|
+
/** Your default TLP 2.0 marking for NEW enrichments, as two independent values —
|
|
370
|
+
* `AMBER` for either one you have not set. The Artifact Enricher page's Settings
|
|
371
|
+
* button edits the same two values. */
|
|
372
|
+
getEnricherSettings(): Promise<EnricherSettings>;
|
|
373
|
+
/** Set the default marking a NEW enrichment starts from. Pass one or both — only what
|
|
374
|
+
* you pass is written, and the stored pair is returned. An invalid value throws
|
|
375
|
+
* before any request; passing neither throws too.
|
|
376
|
+
*
|
|
377
|
+
* The value is a BASELINE, not an override: an enrichment saved afterwards is marked
|
|
378
|
+
* with the most restrictive of the setting and the artifacts it was built from, so a
|
|
379
|
+
* more restrictive source still wins. An explicit `tlp` on `client.enricher.enrich(...)`
|
|
380
|
+
* overrides `artifact_tlp` for that run's exports. */
|
|
381
|
+
setEnricherSettings(options: {
|
|
382
|
+
artifactTlp?: Tlp;
|
|
383
|
+
inventoryTlp?: Tlp;
|
|
384
|
+
}): Promise<EnricherSettings>;
|
|
290
385
|
}
|
|
291
386
|
|
|
292
387
|
/**
|
|
293
|
-
* Shared submit→poll core for the
|
|
388
|
+
* Shared submit→poll core for the three async-enrichment engines (Enricher + Inventory + Event).
|
|
294
389
|
*
|
|
295
390
|
* Both `client.enricher.enrich` and `client.inventoryManager.enrichInventory` submit a job to a
|
|
296
391
|
* `/v1/*-enrich` engine and poll `GET /v1/*-enrich/{id}` until it finishes. The loop lives here so the
|
|
@@ -323,10 +418,13 @@ type InventoryManagerFetch = (input: RequestInfo | URL, init?: RequestInit) => P
|
|
|
323
418
|
interface InventoryOptions {
|
|
324
419
|
description?: string;
|
|
325
420
|
/** Asset inventory — each `{ product, vendor?, versions?, ecosystem?, category?, criticality?,
|
|
326
|
-
* notes?, exposure?, environment?, owner?, tags? }
|
|
421
|
+
* notes?, exposure?, environment?, owner?, tags? }`, optionally plus its OT context
|
|
422
|
+
* `{ asset_class?, purdue_level?, protocols?, firmware_version?, hardware_version?, safety_critical? }`
|
|
423
|
+
* (all caller-supplied, never inferred). */
|
|
327
424
|
items?: Array<Record<string, unknown>>;
|
|
328
425
|
monitoring?: boolean;
|
|
329
|
-
/** Attached reference-artifact ids (the inventory's context window).
|
|
426
|
+
/** Attached reference-artifact ids (the inventory's context window). Each NEWLY attached artifact takes
|
|
427
|
+
* the inventory's own TLP 2.0 marking. */
|
|
330
428
|
linkedArtifactIds?: string[];
|
|
331
429
|
}
|
|
332
430
|
/** An attachment requested for enrichment but omitted from its evidence context. */
|
|
@@ -334,6 +432,44 @@ interface AttachmentOmission {
|
|
|
334
432
|
attachment_id: string;
|
|
335
433
|
reason: string;
|
|
336
434
|
}
|
|
435
|
+
/** Filters for `getHistory` / `iterHistory`. Unset fields are omitted so the server applies its defaults. */
|
|
436
|
+
interface HistoryOptions {
|
|
437
|
+
/** Event types to keep (`assets_changed`, `renamed`, `enrichment_saved`, …): a list or a comma string. */
|
|
438
|
+
types?: string[] | string;
|
|
439
|
+
/** Search text matched against each event summary. */
|
|
440
|
+
q?: string;
|
|
441
|
+
/** ISO date lower bound. */
|
|
442
|
+
since?: string;
|
|
443
|
+
/** ISO date upper bound. */
|
|
444
|
+
until?: string;
|
|
445
|
+
/** Who acted: `you`, `daily monitor` or `api`. */
|
|
446
|
+
actor?: string;
|
|
447
|
+
/** Page size, 1–200 (server default 50). */
|
|
448
|
+
limit?: number;
|
|
449
|
+
/** Opaque cursor from a previous page's `next_cursor`. */
|
|
450
|
+
cursor?: string;
|
|
451
|
+
}
|
|
452
|
+
/** One change-history row. `ref` names the artifact, report or enrichment it points at. */
|
|
453
|
+
interface HistoryItem {
|
|
454
|
+
id: string;
|
|
455
|
+
type: string;
|
|
456
|
+
at: string;
|
|
457
|
+
actor: "you" | "daily monitor" | "api";
|
|
458
|
+
surface: "web" | "api" | "mcp" | "monitor";
|
|
459
|
+
summary: string;
|
|
460
|
+
detail: Record<string, unknown> | null;
|
|
461
|
+
ref: {
|
|
462
|
+
kind: string;
|
|
463
|
+
id: string;
|
|
464
|
+
name: string;
|
|
465
|
+
deleted: boolean;
|
|
466
|
+
} | null;
|
|
467
|
+
}
|
|
468
|
+
/** One page of change history. */
|
|
469
|
+
interface HistoryPage {
|
|
470
|
+
items: HistoryItem[];
|
|
471
|
+
next_cursor: string | null;
|
|
472
|
+
}
|
|
337
473
|
/**
|
|
338
474
|
* Client for the key-authed Inventory Manager API.
|
|
339
475
|
*
|
|
@@ -376,21 +512,33 @@ declare class InventoryManagerApi {
|
|
|
376
512
|
* object (`columns`, `rows`, `counts`).
|
|
377
513
|
*/
|
|
378
514
|
compareEnrichments(enrichmentIds: string[]): Promise<Record<string, unknown>>;
|
|
515
|
+
/**
|
|
516
|
+
* One page of an inventory's change history, newest first. Covers asset, attachment, TLP, rename,
|
|
517
|
+
* settings and VEX changes, saved enrichments and generated reports. Exports and Copy for AI are
|
|
518
|
+
* not logged. Pass `cursor` from a previous page's `next_cursor` to continue.
|
|
519
|
+
*/
|
|
520
|
+
getHistory(inventoryId: string, opts?: HistoryOptions): Promise<HistoryPage>;
|
|
521
|
+
/** Yield every history item newest first, following `next_cursor` across pages until exhausted. */
|
|
522
|
+
iterHistory(inventoryId: string, opts?: Omit<HistoryOptions, "cursor">): AsyncGenerator<HistoryItem>;
|
|
379
523
|
/**
|
|
380
524
|
* Create an Inventory Manager inventory (a continuously-monitored context window).
|
|
381
525
|
*
|
|
382
526
|
* @param inventoryName The inventory's display name.
|
|
383
527
|
* @param options `description`, `items` (asset inventory — each `{ product, vendor?, versions?,
|
|
384
528
|
* ecosystem?, category?, criticality?, notes? }`), `monitoring` (always full depth — no fast/lite
|
|
385
|
-
* mode), `linkedArtifactIds
|
|
386
|
-
* @returns `{ id, item_count }
|
|
529
|
+
* mode), `linkedArtifactIds` (each takes the new inventory's own TLP 2.0 marking).
|
|
530
|
+
* @returns `{ id, item_count }`, plus `attachment_tlp` / `attachment_tlp_ids` when
|
|
531
|
+
* `linkedArtifactIds` were passed (the marking carried onto them).
|
|
387
532
|
*/
|
|
388
533
|
createInventory(inventoryName: string, options?: InventoryOptions): Promise<Record<string, unknown>>;
|
|
389
534
|
/**
|
|
390
535
|
* Update an inventory's definition (name, description, inventory, monitoring, attachments).
|
|
391
536
|
* This is a **partial merge** (PATCH): only the fields you pass change — omitted fields are PRESERVED,
|
|
392
537
|
* including the asset-group metadata and daily-report config this method doesn't expose. `inventoryName`
|
|
393
|
-
* is still required by the API.
|
|
538
|
+
* is still required by the API. Any artifact newly added through `linkedArtifactIds` takes the
|
|
539
|
+
* inventory's own TLP 2.0 marking (already-attached artifacts are left alone). Resolves
|
|
540
|
+
* `{ id, item_count }`, plus `attachment_tlp` / `attachment_tlp_ids` (the marking carried onto newly
|
|
541
|
+
* attached artifacts).
|
|
394
542
|
*/
|
|
395
543
|
updateInventory(inventoryId: string, options: InventoryOptions & {
|
|
396
544
|
inventoryName: string;
|
|
@@ -400,10 +548,14 @@ declare class InventoryManagerApi {
|
|
|
400
548
|
*
|
|
401
549
|
* @param options `format` — one of `json` (asset JSON), `sbom` (CycloneDX / SPDX SBOM), `csv`,
|
|
402
550
|
* `nmap` (nmap `-sV` XML), `list` (CPE / purl list), `grype`, `trivy` (SCA JSON), `depcheck`
|
|
403
|
-
* (OWASP Dependency-Check JSON), `nessus` (`.nessus` XML), `gvm` (OpenVAS / Greenbone XML)
|
|
404
|
-
* `
|
|
405
|
-
*
|
|
406
|
-
*
|
|
551
|
+
* (OWASP Dependency-Check JSON), `nessus` (`.nessus` XML), `gvm` (OpenVAS / Greenbone XML),
|
|
552
|
+
* `vex` (a VEX suppression overlay — OpenVEX 0.2.0 / CSAF 2.0 VEX JSON; attaches to the
|
|
553
|
+
* inventory named by `inventoryId`, or creates a bare inventory holding it — imports NO assets);
|
|
554
|
+
* `content` — the file's text (or `Uint8Array` for the binary `xlsx`); optional
|
|
555
|
+
* `inventoryName` / `description` (override anything the file carries).
|
|
556
|
+
* @returns `{ id, item_count, imported, format, truncated?, dropped? }` — `dropped` (SBOM imports
|
|
557
|
+
* only) counts dependency edges the parser could not retain (#334). `format:'vex'` returns
|
|
558
|
+
* `{ id, imported:0, format:'vex', statements }` instead.
|
|
407
559
|
*/
|
|
408
560
|
importInventory(options: {
|
|
409
561
|
format: string;
|
|
@@ -424,7 +576,7 @@ declare class InventoryManagerApi {
|
|
|
424
576
|
* override. A binary `xlsx` source can't be sniffed, so it needs `format: "xlsx"` + `Uint8Array` content
|
|
425
577
|
* (base64-encoded on the wire). A source that fails to parse is ISOLATED (it appears in `per_source` with
|
|
426
578
|
* its `error`, contributing nothing — never failing the whole call).
|
|
427
|
-
* @returns `{ items, count, asset_groups, truncated?, per_source: [{ label, contributed, truncated?, error? }] }`.
|
|
579
|
+
* @returns `{ items, count, asset_groups, truncated?, dropped?, per_source: [{ label, contributed, truncated?, dropped?, error? }] }`.
|
|
428
580
|
*/
|
|
429
581
|
parseMulti(sources: Array<{
|
|
430
582
|
content: string | Uint8Array;
|
|
@@ -461,10 +613,13 @@ declare class InventoryManagerApi {
|
|
|
461
613
|
* Apply a recommended upgrade — set the matched asset's version to the published fix the Inventory
|
|
462
614
|
* Enricher surfaced (`recommended_fix_version` / `recommended_fix_version_kev`), PRESERVING everything
|
|
463
615
|
* else on the inventory. Match is by `product` (case-insensitive; `vendor` disambiguates duplicate
|
|
464
|
-
* product names).
|
|
465
|
-
*
|
|
616
|
+
* product names). This rewrites **every** asset carrying that product — pass `group` to scope the fix
|
|
617
|
+
* to one host/asset group (`group` is the asset's own grouping, which host-derived imports set per
|
|
618
|
+
* host). Writes the inventory only — it does NOT re-enrich (the next enrichment / daily monitor
|
|
619
|
+
* confirms the CVEs cleared). Resolves `{ id, product, version, applied, item_count }` (404 when no
|
|
620
|
+
* asset matches, or none matches within `group`).
|
|
466
621
|
*/
|
|
467
|
-
applyAssetFix(inventoryId: string, product: string, version: string, vendor?: string): Promise<Record<string, unknown>>;
|
|
622
|
+
applyAssetFix(inventoryId: string, product: string, version: string, vendor?: string, group?: string): Promise<Record<string, unknown>>;
|
|
468
623
|
/** List an inventory's asset-inventory export formats (`json` / `csv` / `cyclonedx` / `spdx`). */
|
|
469
624
|
listExportFormats(inventoryId: string): Promise<Record<string, unknown>[]>;
|
|
470
625
|
/**
|
|
@@ -474,13 +629,22 @@ declare class InventoryManagerApi {
|
|
|
474
629
|
*
|
|
475
630
|
* @param inventoryId The inventory id.
|
|
476
631
|
* @param format `json` / `csv` / `list` (CPE/purl) / `cyclonedx` / `spdx` (3.0.1) / `spdx2` (SPDX 2.3)
|
|
477
|
-
* / `workbook` (binary Excel .xlsx). `json` / `csv` / `list` round-trip
|
|
478
|
-
* {@link importInventory}. Defaults to `json`.
|
|
479
|
-
|
|
480
|
-
|
|
632
|
+
* / `workbook` (binary Excel .xlsx) / `all` (.zip of every format). `json` / `csv` / `list` round-trip
|
|
633
|
+
* back through {@link importInventory}. Defaults to `json`.
|
|
634
|
+
* @param options.tlp The TLP 2.0 marking written into the asset-inventory formats that have a slot
|
|
635
|
+
* (`cyclonedx` / `spdx` / `spdx2` / `workbook`; `CLEAR` / `GREEN` / `AMBER` / `AMBER+STRICT` / `RED`),
|
|
636
|
+
* overriding the inventory's stored TLP; omit it to stamp the inventory's own stored TLP.
|
|
637
|
+
* `json` / `csv` / `list` have no marking slot and ignore it. An invalid value
|
|
638
|
+
* throws a `RangeError` before any request.
|
|
639
|
+
*/
|
|
640
|
+
exportInventory(inventoryId: string, format?: string, options?: {
|
|
641
|
+
tlp?: Tlp;
|
|
642
|
+
}): Promise<string | Uint8Array>;
|
|
481
643
|
/** Delete an inventory. Resolves `true` on success (404 throws). */
|
|
482
644
|
deleteInventory(inventoryId: string): Promise<boolean>;
|
|
483
|
-
/** Link an existing artifact to an inventory.
|
|
645
|
+
/** Link an existing artifact to an inventory. The newly attached artifact takes the INVENTORY's own
|
|
646
|
+
* TLP 2.0 marking (it can raise or lower the artifact's marking). Resolves to
|
|
647
|
+
* `{ ok, linked, already, attachment_tlp, attachment_tlp_ids }`. */
|
|
484
648
|
attachToInventory(inventoryId: string, artifactId: string): Promise<Record<string, unknown>>;
|
|
485
649
|
/** Remove one attached artifact from an inventory (the inverse of {@link attachToInventory}).
|
|
486
650
|
* Atomic server-side operation that preserves every other field; idempotent. Resolves
|
|
@@ -490,11 +654,13 @@ declare class InventoryManagerApi {
|
|
|
490
654
|
* REPLACE an inventory's attached reference artifacts in one call (the bulk twin of
|
|
491
655
|
* {@link attachToInventory}), PRESERVING its inventory / monitoring / alert-prefs. Only attachable
|
|
492
656
|
* kinds (`input` / `enrichment` / `report`) are kept; inventories and inventory enrichments are skipped. Deduped +
|
|
493
|
-
* capped at 100.
|
|
657
|
+
* capped at 100. Each newly attached artifact takes the inventory's own TLP 2.0 marking. Resolves
|
|
658
|
+
* `{ id, linked_count, attached, skipped, mode, attachment_tlp, attachment_tlp_ids }`.
|
|
494
659
|
*/
|
|
495
660
|
setAttachments(inventoryId: string, artifactIds: string[]): Promise<Record<string, unknown>>;
|
|
496
661
|
/** APPEND several artifacts to an inventory's attachments in one call (bulk {@link attachToInventory});
|
|
497
|
-
* same filtering/cap/return as {@link setAttachments}
|
|
662
|
+
* same filtering/cap/return as {@link setAttachments} — including the re-marking of the newly attached
|
|
663
|
+
* artifacts to the inventory's own TLP 2.0 marking. */
|
|
498
664
|
addAttachments(inventoryId: string, artifactIds: string[]): Promise<Record<string, unknown>>;
|
|
499
665
|
/** Toggle an inventory's daily monitoring (= daily enrichment). Routes through the automation endpoint
|
|
500
666
|
* (partial read-modify-write) so assets, attachments, asset groups, AND the daily-report config are
|
|
@@ -535,7 +701,14 @@ declare class InventoryManagerApi {
|
|
|
535
701
|
* The enrichment submit is enrichment compute and **counts toward your usage** (it rides your key to
|
|
536
702
|
* `/v1/inventory-enrich`); reading the inventory and polling do not.
|
|
537
703
|
*
|
|
538
|
-
*
|
|
704
|
+
* The inventory's attached **VEX suppression overlay** (imported with `format: 'vex'`) always rides along
|
|
705
|
+
* as the engine's `vex_overlay`, so findings the VEX marks `not_affected`/`fixed` come back
|
|
706
|
+
* `suppressed_by_vex` (retained + justification, excluded from the actionable counts) instead of being
|
|
707
|
+
* re-reported. Nothing to pass — it is read from the inventory manifest.
|
|
708
|
+
*
|
|
709
|
+
* Resolves to `{ enrichment_id, report }`; `report` is the InventoryEnrichmentResult (per-asset CVEs with
|
|
710
|
+
* CVSS vectors, EPSS percentile, NIST LEV (`lev`), KEV detail, Metasploit / Nuclei, `provenance`; plus `technique_catalog` and
|
|
711
|
+
* `mitigation_catalog`). If the inventory's inventory is empty this short-circuits and
|
|
539
712
|
* resolves to `{ enrichment_id: null, empty: true }` without submitting. Throws `UnexpectedStatus` on a
|
|
540
713
|
* non-2xx (or enrichment error), or `Error` if the enrichment doesn't finish within `timeoutMs`.
|
|
541
714
|
*/
|
|
@@ -559,14 +732,23 @@ declare class InventoryManagerApi {
|
|
|
559
732
|
* compatibility; permissive results carry `attachment_omissions` with an id and reason per skip. */
|
|
560
733
|
strictAttachments?: boolean;
|
|
561
734
|
}): Promise<Record<string, unknown>>;
|
|
562
|
-
/** Fetch the inventory's attached artifacts (≤20) and split them for the engine
|
|
563
|
-
*
|
|
564
|
-
*
|
|
735
|
+
/** Fetch the inventory's attached artifacts (≤20) and split them for the engine: TEXT artifacts become
|
|
736
|
+
* one `texts` entry each, carrying the id and name of the artifact they came from, and BINARY ones
|
|
737
|
+
* (`X-Artifact-Format: file`) become raw `files` entries that name their source artifact too.
|
|
738
|
+
* Attribution is per artifact rather than a whole-run id list — the id is known for the exact block
|
|
739
|
+
* fetched, so nothing has to be inferred from the text later. Resolution is permissive: every skipped
|
|
740
|
+
* attachment is returned in `omissions`; callers that need complete evidence should use
|
|
741
|
+
* `enrichInventory({ strictAttachments: true })`. */
|
|
565
742
|
resolveAttachments(attachmentIds: string[]): Promise<{
|
|
566
|
-
|
|
743
|
+
texts: Array<{
|
|
744
|
+
text: string;
|
|
745
|
+
source_artifact_id: string;
|
|
746
|
+
filename: string;
|
|
747
|
+
}>;
|
|
567
748
|
files: Array<{
|
|
568
749
|
filename: string;
|
|
569
750
|
content_b64: string;
|
|
751
|
+
source_artifact_id: string;
|
|
570
752
|
}>;
|
|
571
753
|
omissions: AttachmentOmission[];
|
|
572
754
|
}>;
|
|
@@ -592,22 +774,38 @@ declare class InventoryManagerApi {
|
|
|
592
774
|
timeoutMs?: number;
|
|
593
775
|
onProgress?: ProgressCallback;
|
|
594
776
|
attachmentsText?: string;
|
|
777
|
+
/** One entry per attached artifact — keeps each block's own attribution, which a single opaque
|
|
778
|
+
* `attachmentsText` blob cannot express. */
|
|
779
|
+
attachmentsTexts?: Array<{
|
|
780
|
+
text: string;
|
|
781
|
+
source_artifact_id?: string | null;
|
|
782
|
+
filename?: string | null;
|
|
783
|
+
}>;
|
|
784
|
+
/** The artifacts an opaque `attachmentsText` blob came from (whole-run provenance). */
|
|
785
|
+
attachedArtifactIds?: string[];
|
|
595
786
|
attachmentsFiles?: Array<{
|
|
596
787
|
filename: string;
|
|
597
788
|
content_b64: string;
|
|
789
|
+
source_artifact_id?: string | null;
|
|
598
790
|
}>;
|
|
791
|
+
/** An OpenVEX 0.2.0 / CSAF 2.0 VEX document (text) — `not_affected`/`fixed` statements for a CVE on a
|
|
792
|
+
* submitted asset's CPE / purl mark that finding `suppressed_by_vex` in the result. */
|
|
793
|
+
vexOverlay?: string;
|
|
599
794
|
}): Promise<Record<string, unknown>>;
|
|
600
795
|
/** Parse a scan / inventory FILE into canonical asset items WITHOUT saving anything (the parse-only twin
|
|
601
|
-
* of `importInventory`). You PICK the `format` — one of json/sbom/csv/nmap/list/grype/trivy/depcheck/nessus/gvm/xlsx
|
|
602
|
-
* (no auto-detect; pass a `Uint8Array` for the binary `xlsx`
|
|
603
|
-
* `{
|
|
796
|
+
* of `importInventory`). You PICK the `format` — one of json/sbom/csv/nmap/list/grype/trivy/depcheck/nessus/gvm/xlsx/vex
|
|
797
|
+
* (no auto-detect; pass a `Uint8Array` for the binary `xlsx`; `vex` is a VEX suppression overlay
|
|
798
|
+
* parse — OpenVEX/CSAF — returning `{ items: [], vex_overlay }`). Resolves
|
|
799
|
+
* `{ format, items, count, inventory_name?, truncated?, dropped? }` (`dropped` — SBOM only — is the
|
|
800
|
+
* dependency edges not retained, #334). Usage-exempt — the building block for `ingestScan`. */
|
|
604
801
|
parseScan(content: string | Uint8Array, format: string): Promise<Record<string, unknown>>;
|
|
605
802
|
/** Scan → briefing in one call: parse the scan FILE (`parseScan`), enrich the discovered assets against
|
|
606
803
|
* the `/v1/inventory-enrich` ranking engine, and assemble a structured briefing. `format` is one of
|
|
607
|
-
* json/sbom/csv/nmap/list/grype/trivy/depcheck/nessus/gvm/xlsx. The parse is usage-exempt; the enrichment **submit counts
|
|
804
|
+
* json/sbom/csv/nmap/list/grype/trivy/depcheck/nessus/gvm/xlsx/vex. The parse is usage-exempt; the enrichment **submit counts
|
|
608
805
|
* toward usage** (one `/v1/inventory-enrich` request). Resolves
|
|
609
|
-
* `{ format, parsed_count, truncated?, enrichment_id, report, recommended_actions }`
|
|
610
|
-
* engine's KEV-first-ranked findings + rollup
|
|
806
|
+
* `{ format, parsed_count, truncated?, enrichment_id, report, recommended_actions, unverified_assets }`
|
|
807
|
+
* (report = the engine's KEV-first-ranked findings + rollup; unverified_assets names the assets whose
|
|
808
|
+
* identity never resolved). An empty parse short-circuits to
|
|
611
809
|
* `{ format, parsed_count: 0, enrichment_id: null, empty: true }`. */
|
|
612
810
|
ingestScan(content: string | Uint8Array, format: string, options?: {
|
|
613
811
|
include?: string[];
|
|
@@ -618,21 +816,23 @@ declare class InventoryManagerApi {
|
|
|
618
816
|
}
|
|
619
817
|
|
|
620
818
|
/**
|
|
621
|
-
* Enricher API — key-authed access to the async
|
|
819
|
+
* Enricher API — key-authed access to the async enrichment engines (submit → poll).
|
|
622
820
|
*
|
|
623
|
-
*
|
|
624
|
-
* artifacts, submits to the engine, polls until done, and
|
|
625
|
-
* the
|
|
821
|
+
* Thin wrappers over the `/v1/artifact-enrich` + `/v1/event-enrich` engine endpoints:
|
|
822
|
+
* `client.enricher.enrich` stages artifacts, submits to the artifact engine, polls until done, and
|
|
823
|
+
* returns the report; `client.enricher.enrichEvent` submits a raw security event to the Event
|
|
824
|
+
* Enricher, polls until done, and returns the per-indicator result + aggregate verdict. There is no
|
|
825
|
+
* save/discard — the engine pair is submit→poll only; persistence is the portal's job, not the API's.
|
|
626
826
|
*
|
|
627
827
|
* Same API key, same base URL, same retry/timeout fetch as every other call. The enrichment submit is
|
|
628
|
-
* enrichment compute and **counts toward your API usage** (it's a `/v1
|
|
828
|
+
* enrichment compute and **counts toward your API usage** (it's a `/v1/*-enrich` request); polling
|
|
629
829
|
* is the engine's own status read. Exposed as `client.enricher` (mirrors the Python `EnricherAPI`).
|
|
630
830
|
*/
|
|
631
831
|
|
|
632
832
|
/** A fetch-like function — the CrawlerClient hands in its retry/timeout wrapper. */
|
|
633
833
|
type EnricherFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
634
834
|
/**
|
|
635
|
-
* Client for the
|
|
835
|
+
* Client for the async enrichment engines (submit→poll lifecycle: artifact + event).
|
|
636
836
|
*
|
|
637
837
|
* Obtained via `client.enricher` — never constructed directly.
|
|
638
838
|
* Every method throws `UnexpectedStatus` on a non-2xx response.
|
|
@@ -646,8 +846,13 @@ declare class EnricherApi {
|
|
|
646
846
|
/**
|
|
647
847
|
* Run an artifact enrichment end-to-end against the /v1 engine: submit → poll → return the report.
|
|
648
848
|
*
|
|
649
|
-
* Stages pasted `text` + base64 `files` (`[{ filename, content_b64 }]`), submits
|
|
650
|
-
* `/v1/artifact-enrich`, polls the job until done, and resolves to the enrichment report.
|
|
849
|
+
* Stages pasted `text` + base64 `files` (`[{ filename, content_b64, source_artifact_id? }]`), submits
|
|
850
|
+
* to `/v1/artifact-enrich`, polls the job until done, and resolves to the enrichment report.
|
|
851
|
+
*
|
|
852
|
+
* `texts` is the per-artifact form of `text` (`[{ text, source_artifact_id?, filename? }]`) — use it
|
|
853
|
+
* when the blocks came from several stored artifacts, so the report attributes each reference to the
|
|
854
|
+
* artifact it appeared in. `attachedArtifactIds` names the artifacts an opaque `text` blob came from;
|
|
855
|
+
* attribution is never inferred from the text itself.
|
|
651
856
|
*
|
|
652
857
|
* `stakeholder` is the optional SSVC stakeholder context applied to every reference when `include`
|
|
653
858
|
* contains `"ssvc"` (`{ method, exposure, human_impact, mission_prevalence, public_wellbeing_impact }`;
|
|
@@ -655,17 +860,31 @@ declare class EnricherApi {
|
|
|
655
860
|
*
|
|
656
861
|
* Counts toward your API usage (it's `/v1/artifact-enrich` compute). Throws `UnexpectedStatus` on a
|
|
657
862
|
* non-2xx (or enrichment error), or `Error` if the enrichment doesn't finish within `timeoutMs`.
|
|
658
|
-
* Resolves to `{ enrichment_id, report }`.
|
|
863
|
+
* Resolves to `{ enrichment_id, report }`. `report` is the ArtifactEnrichmentReport (`report.meta.schema_version`):
|
|
864
|
+
* each reference carries its full record — CVSS vectors, EPSS percentile, NIST LEV (`lev`), CWEs, the CISA KEV record,
|
|
865
|
+
* Metasploit / Nuclei, OSV fixed versions, ATT&CK v18 detection data, knowledge-base profiles, threat actors
|
|
866
|
+
* targeting a country or sector, and `provenance`.
|
|
659
867
|
*/
|
|
660
868
|
enrich(options?: {
|
|
661
869
|
text?: string;
|
|
870
|
+
texts?: Array<{
|
|
871
|
+
text: string;
|
|
872
|
+
source_artifact_id?: string | null;
|
|
873
|
+
filename?: string | null;
|
|
874
|
+
}>;
|
|
662
875
|
files?: Array<{
|
|
663
876
|
filename: string;
|
|
664
877
|
content_b64: string;
|
|
878
|
+
source_artifact_id?: string | null;
|
|
665
879
|
}>;
|
|
880
|
+
attachedArtifactIds?: string[];
|
|
666
881
|
formats?: string[];
|
|
667
882
|
include?: string[];
|
|
668
883
|
stakeholder?: Record<string, unknown>;
|
|
884
|
+
/** TLP 2.0 marking written into the exported formats that carry one (`CLEAR` / `GREEN` / `AMBER` /
|
|
885
|
+
* `AMBER+STRICT` / `RED`; default `AMBER`). An invalid value throws a `RangeError` before the
|
|
886
|
+
* (billable) submit. */
|
|
887
|
+
tlp?: Tlp;
|
|
669
888
|
pollIntervalMs?: number;
|
|
670
889
|
timeoutMs?: number;
|
|
671
890
|
/** Called with the live job (`{ status, progress, events }`, each event carrying the % it reached)
|
|
@@ -680,6 +899,30 @@ declare class EnricherApi {
|
|
|
680
899
|
/** File the saved report into a NEW folder of this name (with `save`). */
|
|
681
900
|
newFolderName?: string | null;
|
|
682
901
|
}): Promise<Record<string, unknown>>;
|
|
902
|
+
/**
|
|
903
|
+
* Run an Event Enrichment end-to-end against the /v1 engine: submit → poll → return the result.
|
|
904
|
+
*
|
|
905
|
+
* Submits a raw security event (a Defender XDR / Sentinel alert, a SIEM/EDR log line, any JSON or
|
|
906
|
+
* text) to `/v1/event-enrich`, polls the job until done, and resolves to
|
|
907
|
+
* `{ enrichment_id, result }` — where `result` is the EventEnrichmentResult (per-indicator
|
|
908
|
+
* findings + the aggregate event threat assessment). CC extracts every indicator server-side.
|
|
909
|
+
* Each CVE indicator carries `kev` and `weaponized` (a Metasploit module exists, which floors its
|
|
910
|
+
* verdict at high); `threat_assessment` counts both as `kev_count` / `weaponized_count`.
|
|
911
|
+
*
|
|
912
|
+
* Counts toward your API usage (it's `/v1/event-enrich` compute). Throws `UnexpectedStatus` on a
|
|
913
|
+
* non-2xx (or enrichment error), or `Error` if the enrichment doesn't finish within `timeoutMs`.
|
|
914
|
+
*/
|
|
915
|
+
enrichEvent(options: {
|
|
916
|
+
/** The raw event — a Defender XDR / Sentinel alert JSON, a log line, or any text (≤200,000 chars). */
|
|
917
|
+
event: string;
|
|
918
|
+
/** Optional caller-side event identifier (≤200 chars), echoed back on the result. */
|
|
919
|
+
eventId?: string;
|
|
920
|
+
pollIntervalMs?: number;
|
|
921
|
+
timeoutMs?: number;
|
|
922
|
+
/** Called with the live job on every poll — render a live bar / stream the per-indicator feed.
|
|
923
|
+
* Polls are billing-exempt. */
|
|
924
|
+
onProgress?: ProgressCallback;
|
|
925
|
+
}): Promise<Record<string, unknown>>;
|
|
683
926
|
}
|
|
684
927
|
|
|
685
928
|
/**
|
|
@@ -698,7 +941,7 @@ declare class EnricherApi {
|
|
|
698
941
|
*
|
|
699
942
|
* const client = new CrawlerClient();
|
|
700
943
|
* const result = await client.enrichCveFull("CVE-2024-3400");
|
|
701
|
-
* console.log(result.cve?.
|
|
944
|
+
* console.log(result.cve?.cvss_v3_score, result.cve?.cvss_v4_score);
|
|
702
945
|
* ```
|
|
703
946
|
*/
|
|
704
947
|
|
|
@@ -775,7 +1018,7 @@ declare class CrawlerClient {
|
|
|
775
1018
|
private readonly _enricher;
|
|
776
1019
|
private readonly _aiReports;
|
|
777
1020
|
constructor(opts?: CrawlerClientOptions);
|
|
778
|
-
/** Underlying Hey API client, scoped to this instance. Use to call any of the
|
|
1021
|
+
/** Underlying Hey API client, scoped to this instance. Use to call any of the 37 `/v1` operations (31 synchronous + 6 async-engine) directly. */
|
|
779
1022
|
get api(): Client;
|
|
780
1023
|
/**
|
|
781
1024
|
* The Artifact Manager API (Artifact Manager) — your stored artifacts, enrichment exports,
|
|
@@ -789,6 +1032,8 @@ declare class CrawlerClient {
|
|
|
789
1032
|
* artifacts + saved enrichment history) over the same key. Its own section at
|
|
790
1033
|
* `/inventory-manager/inventories/*` (outside the `/v1` OpenAPI contract). **Usage-exempt** except
|
|
791
1034
|
* `enrichInventory`'s submit, which is enrichment compute and counts toward your usage.
|
|
1035
|
+
* For full log sources, PoCs, Sigma rules, or D3FEND rows, call `enrichCveFull` with the CVE ID,
|
|
1036
|
+
* `techniques`, the base layer, and its `*_full` token.
|
|
792
1037
|
*/
|
|
793
1038
|
get inventoryManager(): InventoryManagerApi;
|
|
794
1039
|
/**
|
|
@@ -806,46 +1051,92 @@ declare class CrawlerClient {
|
|
|
806
1051
|
/**
|
|
807
1052
|
* Walk the full CVE → CWE → CAPEC → ATT&CK → TIE chain plus MISP/knowledge base/web.
|
|
808
1053
|
*
|
|
1054
|
+
* Returns one page. OSV advisories are paged: while `osv_next_offset` is set, request the next
|
|
1055
|
+
* page with that offset and the response's `osv_snapshot_id`, or stream the whole walk with
|
|
1056
|
+
* {@link iterCveOsvPages}.
|
|
1057
|
+
*
|
|
809
1058
|
* @param cveId CVE identifier (e.g. `CVE-2024-3400`).
|
|
810
|
-
* @param include Override
|
|
1059
|
+
* @param include Override `CVE_FULL_WALK`, which includes stored permissive OSV and Android
|
|
1060
|
+
* bulletin data. Restricted or unknown-licence OSV records require `osv_restricted`, which the
|
|
1061
|
+
* cursor is bound to.
|
|
1062
|
+
* @param options `osvOffset` (from the previous page's `osv_next_offset`) and `osvSnapshotId`
|
|
1063
|
+
* (the previous page's `osv_snapshot_id`; required with a continuation). A continuation answers
|
|
1064
|
+
* 409 `snapshot_expired` when its snapshot is gone and 503 `snapshot_unavailable` when the store is down.
|
|
1065
|
+
*/
|
|
1066
|
+
enrichCveFull(cveId: string, include?: readonly string[], options?: {
|
|
1067
|
+
osvOffset?: number;
|
|
1068
|
+
osvSnapshotId?: string;
|
|
1069
|
+
}): Promise<EnrichCveResponse>;
|
|
1070
|
+
/**
|
|
1071
|
+
* Stream every OSV advisory page of one CVE without an aggregate buffer. The first page is the
|
|
1072
|
+
* complete enrichment; later pages repeat the request with the cursor and carry the next
|
|
1073
|
+
* `osv_advisories` slice. A changed or expired snapshot throws `UnexpectedStatus` (409
|
|
1074
|
+
* `snapshot_expired`) instead of restarting after a yield. The caller owns any collection bound;
|
|
1075
|
+
* `osv_advisories_total` is exact.
|
|
811
1076
|
*/
|
|
812
|
-
|
|
1077
|
+
iterCveOsvPages(cveId: string, include?: readonly string[]): AsyncGenerator<EnrichCveResponse>;
|
|
813
1078
|
/**
|
|
814
|
-
* Enrich an IOC against MISP, link to ATT&CK, and add knowledge base
|
|
1079
|
+
* Enrich an IOC against MISP, link to ATT&CK, and add knowledge base context.
|
|
815
1080
|
*
|
|
816
1081
|
* @param value Indicator value (hash, IP, domain, URL).
|
|
817
1082
|
* @param iocType MISP-style attribute type — `ip-dst`, `ip-src`, `domain`,
|
|
818
1083
|
* `hostname`, `md5`, `sha1`, `sha256`, `url`, etc. Defaults to `ip-dst`.
|
|
819
|
-
* @param include Override
|
|
1084
|
+
* @param include Override `IOC_FULL_WALK`. `network_context` and `listed_on` are defaults;
|
|
1085
|
+
* `domain_context` and `hashlookup` remain explicit includes.
|
|
820
1086
|
*/
|
|
821
1087
|
enrichIocFull(value: string, iocType?: string, include?: readonly string[]): Promise<EnrichIocResponse>;
|
|
822
1088
|
/**
|
|
823
1089
|
* Walk CWE → CAPEC → ATT&CK with TIE predictions.
|
|
824
1090
|
*
|
|
825
|
-
* @param cweId CWE identifier (e.g. `CWE-79`).
|
|
826
|
-
* @param
|
|
1091
|
+
* @param cweId CWE identifier (e.g. `CWE-79`). Supply this or `search`.
|
|
1092
|
+
* @param options Optional `search` keyword (discover weaknesses by name) and `include` override.
|
|
827
1093
|
*/
|
|
828
|
-
enrichCweFull(cweId
|
|
1094
|
+
enrichCweFull(cweId?: string | null, options?: {
|
|
1095
|
+
search?: string;
|
|
1096
|
+
include?: readonly string[];
|
|
1097
|
+
}): Promise<EnrichCweResponse>;
|
|
829
1098
|
/**
|
|
830
1099
|
* Enrich one or more ATT&CK techniques with TIE, adversary attribution,
|
|
831
1100
|
* and Navigator JSON.
|
|
832
1101
|
*
|
|
833
|
-
* @param techniqueIds ATT&CK technique IDs (e.g. `["T1190", "T1059.001"]`).
|
|
1102
|
+
* @param techniqueIds ATT&CK technique IDs (e.g. `["T1190", "T1059.001"]`). Omit it when
|
|
1103
|
+
* looking up by `assetId`.
|
|
834
1104
|
* @param framework ATT&CK matrix variant — `enterprise`, `ics`, or `mobile`.
|
|
835
|
-
* @param include Override the default `TECHNIQUE_FULL` chain.
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
*
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
|
|
1105
|
+
* @param include Override the default `TECHNIQUE_FULL` chain. `fraud` (opt-in) adds the MITRE
|
|
1106
|
+
* F3 fraud techniques whose borrowed ATT&CK ids resolve to each returned technique; the
|
|
1107
|
+
* other opt-ins are `fight` (FiGHT techniques by id), `lolbas` (facts-only binaries),
|
|
1108
|
+
* `sigma`, `lotl` (LOLDrivers plus the facts-only GTFOBins and HijackLibs rows mapped
|
|
1109
|
+
* onto the technique), `atomic_red_team` (Atomic Red Team tests: name, GUID, platforms,
|
|
1110
|
+
* executor and elevation flag, never a command body), `framework_mappings`, `asset_classes`, `log_sources` and
|
|
1111
|
+
* `analytic_details`.
|
|
1112
|
+
|
|
1113
|
+
* @param assetId ICS asset to look up from (e.g. `"A0002"`) — returns the techniques that
|
|
1114
|
+
* asset's classes target. Requires `framework: "ics"` and is mutually exclusive with
|
|
1115
|
+
* `techniqueIds`: it is a selector in its own right, not an added filter.
|
|
1116
|
+
*/
|
|
1117
|
+
enrichTechniqueFull(techniqueIds?: string[], framework?: "enterprise" | "ics" | "mobile", include?: readonly string[], assetId?: string): Promise<EnrichTechniqueResponse>;
|
|
1118
|
+
/**
|
|
1119
|
+
* Return one page of enriched CVEs for a product/version.
|
|
1120
|
+
* For full log sources, PoCs, Sigma rules, or D3FEND rows, call `enrichCveFull` with the CVE ID,
|
|
1121
|
+
* `techniques`, the base layer, and its `*_full` token.
|
|
1122
|
+
*
|
|
1123
|
+
* @param product Product name (e.g. `"http_server"`, `"nginx"`).
|
|
1124
|
+
* @param options Optional version, vendor, include, limit, and offset. The full preset defaults to 2 CVEs per page.
|
|
843
1125
|
*/
|
|
844
1126
|
enrichProductFull(product: string, options?: {
|
|
845
1127
|
version?: string;
|
|
846
1128
|
vendor?: string;
|
|
847
1129
|
include?: readonly string[];
|
|
1130
|
+
limit?: number;
|
|
1131
|
+
offset?: number;
|
|
1132
|
+
snapshotId?: string;
|
|
848
1133
|
}): Promise<EnrichProductResponse>;
|
|
1134
|
+
iterProductCves(product: string, options?: {
|
|
1135
|
+
version?: string;
|
|
1136
|
+
vendor?: string;
|
|
1137
|
+
include?: readonly string[];
|
|
1138
|
+
limit?: number;
|
|
1139
|
+
}): AsyncGenerator<EnrichProductResponse>;
|
|
849
1140
|
/**
|
|
850
1141
|
* Enrich an open-source package — OSV.dev advisories + full CVE enrichment.
|
|
851
1142
|
*
|
|
@@ -861,7 +1152,15 @@ declare class CrawlerClient {
|
|
|
861
1152
|
enrichPackageFull(ecosystem: string, packageName: string, options?: {
|
|
862
1153
|
version?: string;
|
|
863
1154
|
include?: readonly string[];
|
|
1155
|
+
limit?: number;
|
|
1156
|
+
offset?: number;
|
|
1157
|
+
snapshotId?: string;
|
|
864
1158
|
}): Promise<EnrichPackageResponse>;
|
|
1159
|
+
iterPackageAdvisories(ecosystem: string, packageName: string, options?: {
|
|
1160
|
+
version?: string;
|
|
1161
|
+
include?: readonly string[];
|
|
1162
|
+
limit?: number;
|
|
1163
|
+
}): AsyncGenerator<EnrichPackageResponse>;
|
|
865
1164
|
/**
|
|
866
1165
|
* Keyword-search the ATT&CK knowledge base for matching techniques.
|
|
867
1166
|
*
|
|
@@ -907,6 +1206,19 @@ declare class CrawlerClient {
|
|
|
907
1206
|
search?: string;
|
|
908
1207
|
include?: readonly string[];
|
|
909
1208
|
}): Promise<EnrichCapecResponse>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Resolve a CLOAK concealment technique — details and knowledge base context.
|
|
1211
|
+
*
|
|
1212
|
+
* CLOAK objects carry no ATT&CK references, so there is no linked-technique layer:
|
|
1213
|
+
* the response has no `linked_techniques` field at all.
|
|
1214
|
+
*
|
|
1215
|
+
* @param cloakId CLOAK identifier (e.g. `TTP-496`, or a technique slug such as `ta6-te129`).
|
|
1216
|
+
* @param options Optional `search` keyword and `include` override (default `CLOAK_FULL`).
|
|
1217
|
+
*/
|
|
1218
|
+
enrichCloakFull(cloakId?: string, options?: {
|
|
1219
|
+
search?: string;
|
|
1220
|
+
include?: readonly string[];
|
|
1221
|
+
}): Promise<EnrichCloakResponse>;
|
|
910
1222
|
/**
|
|
911
1223
|
* Resolve a D3FEND defensive technique and the offensive techniques it counters.
|
|
912
1224
|
*
|
|
@@ -918,7 +1230,11 @@ declare class CrawlerClient {
|
|
|
918
1230
|
include?: readonly string[];
|
|
919
1231
|
}): Promise<EnrichDefendResponse>;
|
|
920
1232
|
/**
|
|
921
|
-
* Walk a DISARM disinformation technique to its
|
|
1233
|
+
* Walk a DISARM disinformation technique to its family links and context.
|
|
1234
|
+
*
|
|
1235
|
+
* DISARM has no course-of-action objects and no ATT&CK-Enterprise-keyed actors/campaigns, so the
|
|
1236
|
+
* response carries the technique, its DISARM family (`relatedDisarmTechniques`), and the
|
|
1237
|
+
* knowledge-base / web / summary context — nothing else.
|
|
922
1238
|
*
|
|
923
1239
|
* @param techniqueId DISARM technique ID (e.g. `T0086`).
|
|
924
1240
|
* @param options Optional `search` keyword and `include` override (default `DISARM_FULL`).
|
|
@@ -927,6 +1243,21 @@ declare class CrawlerClient {
|
|
|
927
1243
|
search?: string;
|
|
928
1244
|
include?: readonly string[];
|
|
929
1245
|
}): Promise<EnrichDisarmResponse>;
|
|
1246
|
+
/**
|
|
1247
|
+
* Walk a MITRE F3 fraud technique to the ATT&CK techniques it borrows.
|
|
1248
|
+
*
|
|
1249
|
+
* F3 borrows real ATT&CK `T####` ids for the techniques it shares with Enterprise
|
|
1250
|
+
* ATT&CK, so a `T`-shaped id resolves here too. Unlike the other framework walks,
|
|
1251
|
+
* calling with neither an id nor `search` is valid — the server answers 200 with
|
|
1252
|
+
* nothing selected rather than rejecting the request.
|
|
1253
|
+
*
|
|
1254
|
+
* @param f3Id F3 identifier (e.g. `F1031`, `F1025.003`).
|
|
1255
|
+
* @param options Optional `search` keyword and `include` override (default `F3_FULL`).
|
|
1256
|
+
*/
|
|
1257
|
+
enrichF3Full(f3Id?: string, options?: {
|
|
1258
|
+
search?: string;
|
|
1259
|
+
include?: readonly string[];
|
|
1260
|
+
}): Promise<EnrichF3Response>;
|
|
930
1261
|
/**
|
|
931
1262
|
* Profile a threat actor: techniques, tooling, campaigns, exploited CVEs, and targeting.
|
|
932
1263
|
*
|
|
@@ -938,11 +1269,20 @@ declare class CrawlerClient {
|
|
|
938
1269
|
search?: string;
|
|
939
1270
|
framework?: "enterprise" | "ics" | "mobile";
|
|
940
1271
|
include?: readonly string[];
|
|
1272
|
+
limit?: number;
|
|
1273
|
+
offset?: number;
|
|
1274
|
+
snapshotId?: string;
|
|
941
1275
|
}): Promise<EnrichGroupResponse>;
|
|
1276
|
+
iterGroupPages(groupId?: string, options?: {
|
|
1277
|
+
search?: string;
|
|
1278
|
+
framework?: "enterprise" | "ics" | "mobile";
|
|
1279
|
+
include?: readonly string[];
|
|
1280
|
+
limit?: number;
|
|
1281
|
+
}): AsyncGenerator<EnrichGroupResponse>;
|
|
942
1282
|
/**
|
|
943
|
-
* Map a region's
|
|
1283
|
+
* Map a region's profile — details plus knowledge base context.
|
|
944
1284
|
*
|
|
945
|
-
* @param locationId Region identifier (e.g. `
|
|
1285
|
+
* @param locationId Region identifier (e.g. `US`, or a STIX location ID).
|
|
946
1286
|
* @param options Optional `search` keyword and `include` override (default `LOCATION_FULL`).
|
|
947
1287
|
*/
|
|
948
1288
|
enrichLocationFull(locationId?: string, options?: {
|
|
@@ -950,9 +1290,9 @@ declare class CrawlerClient {
|
|
|
950
1290
|
include?: readonly string[];
|
|
951
1291
|
}): Promise<EnrichLocationResponse>;
|
|
952
1292
|
/**
|
|
953
|
-
* Map an industry sector's
|
|
1293
|
+
* Map an industry sector's profile — details plus knowledge base context.
|
|
954
1294
|
*
|
|
955
|
-
* @param sectorId Sector identifier (e.g. `energy`, or
|
|
1295
|
+
* @param sectorId Sector identifier (e.g. `energy`, or a STIX sector ID).
|
|
956
1296
|
* @param options Optional `search` keyword and `include` override (default `SECTOR_FULL`).
|
|
957
1297
|
*/
|
|
958
1298
|
enrichSectorFull(sectorId?: string, options?: {
|
|
@@ -1004,7 +1344,17 @@ declare class CrawlerClient {
|
|
|
1004
1344
|
search?: readonly string[];
|
|
1005
1345
|
framework?: "enterprise" | "ics" | "mobile";
|
|
1006
1346
|
include?: readonly string[];
|
|
1347
|
+
limit?: number;
|
|
1348
|
+
offset?: number;
|
|
1349
|
+
snapshotId?: string;
|
|
1007
1350
|
}): Promise<AssessGroupExposureResponse>;
|
|
1351
|
+
iterGroupExposurePages(options?: {
|
|
1352
|
+
groupIds?: readonly string[];
|
|
1353
|
+
search?: readonly string[];
|
|
1354
|
+
framework?: "enterprise" | "ics" | "mobile";
|
|
1355
|
+
include?: readonly string[];
|
|
1356
|
+
limit?: number;
|
|
1357
|
+
}): AsyncGenerator<AssessGroupExposureResponse>;
|
|
1008
1358
|
/**
|
|
1009
1359
|
* Assess a portfolio of indicators — MISP corroboration, linked techniques, attribution.
|
|
1010
1360
|
*
|
|
@@ -1027,14 +1377,30 @@ declare class CrawlerClient {
|
|
|
1027
1377
|
/**
|
|
1028
1378
|
* Prioritize a set of CVEs — weaponization, exploit chains, and remediation order.
|
|
1029
1379
|
*
|
|
1380
|
+
* Returns one page. OSV advisories are aggregated across `cveIds` and paged: while
|
|
1381
|
+
* `osv_next_offset` is set, request the next page with that offset and the response's
|
|
1382
|
+
* `osv_snapshot_id`, or stream the whole walk with {@link iterVulnerabilityExposureOsvPages}.
|
|
1383
|
+
*
|
|
1030
1384
|
* @param cveIds CVE identifiers to assess.
|
|
1031
|
-
* @param options Optional `include` layers
|
|
1032
|
-
* tunes the decision to your
|
|
1385
|
+
* @param options Optional `include` layers (a continuation must repeat them; `osv_restricted`
|
|
1386
|
+
* is the licence opt-in), an SSVC `stakeholder` profile that tunes the decision to your
|
|
1387
|
+
* deployment, and the `osvOffset` / `osvSnapshotId` cursor from the previous page.
|
|
1033
1388
|
*/
|
|
1034
1389
|
assessVulnerabilityExposure(cveIds: readonly string[], options?: {
|
|
1035
1390
|
include?: readonly string[];
|
|
1036
1391
|
stakeholder?: ArtifactEnrichmentStakeholder;
|
|
1392
|
+
osvOffset?: number;
|
|
1393
|
+
osvSnapshotId?: string;
|
|
1037
1394
|
}): Promise<AssessVulnerabilityExposureResponse>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Stream every OSV advisory page of a vulnerability-exposure assessment without an aggregate
|
|
1397
|
+
* buffer. Same contract as {@link iterCveOsvPages}: the first page is the whole assessment, a
|
|
1398
|
+
* changed or expired snapshot throws instead of restarting, and the caller owns any collection bound.
|
|
1399
|
+
*/
|
|
1400
|
+
iterVulnerabilityExposureOsvPages(cveIds: readonly string[], options?: {
|
|
1401
|
+
include?: readonly string[];
|
|
1402
|
+
stakeholder?: ArtifactEnrichmentStakeholder;
|
|
1403
|
+
}): AsyncGenerator<AssessVulnerabilityExposureResponse>;
|
|
1038
1404
|
/**
|
|
1039
1405
|
* Search the CTI knowledge bases — ATT&CK, CWE, CAPEC, ATLAS, DISARM, and more.
|
|
1040
1406
|
*
|
|
@@ -1051,6 +1417,8 @@ declare class CrawlerClient {
|
|
|
1051
1417
|
page?: number;
|
|
1052
1418
|
deprecated?: boolean;
|
|
1053
1419
|
revoked?: boolean;
|
|
1420
|
+
/** Extra layers. Only `["kb_versions"]` — installed/available revision per source. */
|
|
1421
|
+
include?: readonly string[];
|
|
1054
1422
|
}): Promise<SearchCtiResponse>;
|
|
1055
1423
|
/**
|
|
1056
1424
|
* Search the vulnerability corpus by identifier, mapping, score, or date window.
|
|
@@ -1061,6 +1429,9 @@ declare class CrawlerClient {
|
|
|
1061
1429
|
*
|
|
1062
1430
|
* @param query Free-text query. Omit it to filter purely on the structured fields.
|
|
1063
1431
|
* @param options Any combination of the corpus filters, plus `sort`, `limit`, `page`.
|
|
1432
|
+
* `include` replaces the server defaults: `details`, `statistics`, `cna`, `epss_reports`,
|
|
1433
|
+
* and `kb_rankings` default on. `kb_rankings` keeps the top 100 rows per KB without yearly
|
|
1434
|
+
* trends; `kb_rankings_full` restores all fetched rows and trends.
|
|
1064
1435
|
*/
|
|
1065
1436
|
searchCve(query?: string, options?: {
|
|
1066
1437
|
cveId?: string;
|
|
@@ -1091,26 +1462,50 @@ declare class CrawlerClient {
|
|
|
1091
1462
|
* Search the D3FEND defensive-countermeasure ontology.
|
|
1092
1463
|
*
|
|
1093
1464
|
* @param query Free-text query (e.g. `"network traffic analysis"`).
|
|
1094
|
-
* @param options `d3fendForm` to scope to a tactic/mitigation/artifact, plus `limit`, `page
|
|
1465
|
+
* @param options `d3fendForm` to scope to a tactic/mitigation/artifact, plus `limit`, `page`,
|
|
1466
|
+
* and `include`. `versions` defaults on and attaches each returned technique's revision history.
|
|
1467
|
+
* An explicit include replaces the defaults; pass `[]` to omit all optional layers.
|
|
1095
1468
|
*/
|
|
1096
1469
|
searchD3fend(query: string, options?: {
|
|
1097
1470
|
d3fendForm?: NonNullable<SearchD3FendRequest["d3fend_form"]>;
|
|
1098
1471
|
limit?: number;
|
|
1099
1472
|
page?: number;
|
|
1473
|
+
include?: readonly string[];
|
|
1100
1474
|
}): Promise<SearchD3FendResponse>;
|
|
1101
1475
|
/**
|
|
1102
1476
|
* Search CISA's Known Exploited Vulnerabilities catalog.
|
|
1103
1477
|
*
|
|
1104
1478
|
* An empty call pages the whole catalog; `cveId` checks one CVE's KEV status.
|
|
1105
1479
|
*
|
|
1106
|
-
* @param options `cveId`, `ransomwareStatus`, `limit`, `page`.
|
|
1480
|
+
* @param options `cveId`, `ransomwareStatus`, `limit`, `page`, and `include`. `statistics`
|
|
1481
|
+
* defaults on for deployment-wide corpus coverage. An explicit include replaces the defaults;
|
|
1482
|
+
* pass `[]` to omit all optional layers.
|
|
1107
1483
|
*/
|
|
1108
1484
|
searchKev(options?: {
|
|
1109
1485
|
cveId?: string;
|
|
1110
1486
|
ransomwareStatus?: NonNullable<SearchKevRequest["ransomware_status"]>;
|
|
1111
1487
|
limit?: number;
|
|
1112
1488
|
page?: number;
|
|
1489
|
+
include?: readonly string[];
|
|
1113
1490
|
}): Promise<SearchKevResponse>;
|
|
1491
|
+
/**
|
|
1492
|
+
* Search the seeded CSAF vendor-advisory corpus.
|
|
1493
|
+
*
|
|
1494
|
+
* Filters combine with AND; this is the door for CVE-less advisories (publisher, sector,
|
|
1495
|
+
* product, CPE, TLP). `total` is the unpaginated match count.
|
|
1496
|
+
*/
|
|
1497
|
+
searchCsaf(options?: {
|
|
1498
|
+
cveId?: string;
|
|
1499
|
+
advisoryId?: string;
|
|
1500
|
+
publisher?: string;
|
|
1501
|
+
sector?: string;
|
|
1502
|
+
product?: string;
|
|
1503
|
+
cpe?: string;
|
|
1504
|
+
tlp?: string;
|
|
1505
|
+
sort?: "newest" | "oldest";
|
|
1506
|
+
limit?: number;
|
|
1507
|
+
page?: number;
|
|
1508
|
+
}): Promise<SearchCsafResponse>;
|
|
1114
1509
|
/**
|
|
1115
1510
|
* Hybrid-search the curated security knowledge base.
|
|
1116
1511
|
*
|
|
@@ -1124,11 +1519,20 @@ declare class CrawlerClient {
|
|
|
1124
1519
|
limit?: number;
|
|
1125
1520
|
}): Promise<SearchKnowledgebaseResponse>;
|
|
1126
1521
|
/**
|
|
1127
|
-
* Search MISP events and attributes.
|
|
1522
|
+
* Search our curated MISP (public threat feeds) for events and attributes.
|
|
1523
|
+
* Feed list: https://crimsoncrawler.com/docs/guides/data-sources/#our-curated-misp.
|
|
1128
1524
|
*
|
|
1129
1525
|
* @param options Attribute filters (`value`, `typeAttribute`, `category`, `toIds`),
|
|
1130
1526
|
* event filters (`eventId`, `eventinfo`, `tags`, `threatLevelId`, `published`),
|
|
1131
1527
|
* a `dateFrom`/`dateTo` window, plus `limit` and `page`.
|
|
1528
|
+
* `include` takes any of `"sightings"` (asks MISP for the inline `Sighting` array so each
|
|
1529
|
+
* attribute's `sightings[]`/`sighting_count` and each returned event's sightings are real
|
|
1530
|
+
* counts instead of 0), `"event_reports"` (the analyst-written markdown narratives for the
|
|
1531
|
+
* matched events), `"stats"` (per-event attribute/object/sighting counts), `"tags"` (the
|
|
1532
|
+
* instance's tag vocabulary), `"feeds"` (feed previews), `"objects"` (full event bodies with
|
|
1533
|
+
* resolved references), `"misp_events_full"` (full event bodies), and `"version"`. Events
|
|
1534
|
+
* otherwise return summaries; `misp_events_total` is null when unknown.
|
|
1535
|
+
* Omit `include` for event reports, tags and version; pass `[]` to omit them.
|
|
1132
1536
|
*/
|
|
1133
1537
|
searchMisp(options?: {
|
|
1134
1538
|
value?: string;
|
|
@@ -1142,6 +1546,7 @@ declare class CrawlerClient {
|
|
|
1142
1546
|
published?: boolean;
|
|
1143
1547
|
dateFrom?: string;
|
|
1144
1548
|
dateTo?: string;
|
|
1549
|
+
include?: readonly string[];
|
|
1145
1550
|
limit?: number;
|
|
1146
1551
|
page?: number;
|
|
1147
1552
|
}): Promise<SearchMispResponse>;
|
|
@@ -1164,7 +1569,8 @@ declare class CrawlerClient {
|
|
|
1164
1569
|
* @param vendor Vendor name (e.g. `"microsoft"`).
|
|
1165
1570
|
* @param options Optional `limit` (default 50).
|
|
1166
1571
|
*/
|
|
1167
|
-
searchVendor(vendor
|
|
1572
|
+
searchVendor(vendor?: string | null, options?: {
|
|
1573
|
+
q?: string;
|
|
1168
1574
|
limit?: number;
|
|
1169
1575
|
}): Promise<SearchVendorResponse>;
|
|
1170
1576
|
/**
|
|
@@ -1178,10 +1584,20 @@ declare class CrawlerClient {
|
|
|
1178
1584
|
*/
|
|
1179
1585
|
artifactEnrich(options?: {
|
|
1180
1586
|
text?: string;
|
|
1181
|
-
|
|
1587
|
+
texts?: Array<{
|
|
1588
|
+
text: string;
|
|
1589
|
+
source_artifact_id?: string | null;
|
|
1590
|
+
filename?: string | null;
|
|
1591
|
+
}>;
|
|
1592
|
+
files?: Array<{
|
|
1593
|
+
filename: string;
|
|
1594
|
+
content_b64: string;
|
|
1595
|
+
source_artifact_id?: string | null;
|
|
1596
|
+
}>;
|
|
1182
1597
|
formats?: ArtifactEnrichmentDocRequest["formats"];
|
|
1183
1598
|
include?: readonly string[];
|
|
1184
1599
|
stakeholder?: ArtifactEnrichmentStakeholder;
|
|
1600
|
+
attachedArtifactIds?: string[];
|
|
1185
1601
|
}): Promise<ArtifactEnrichResponse>;
|
|
1186
1602
|
/**
|
|
1187
1603
|
* Read the progress or result of an artifact enrichment.
|
|
@@ -1197,13 +1613,29 @@ declare class CrawlerClient {
|
|
|
1197
1613
|
* fleet-level risk picture.
|
|
1198
1614
|
*
|
|
1199
1615
|
* @param items Assets to enrich, each at minimum `{ product }`.
|
|
1200
|
-
* @param options Optional `attachmentsText
|
|
1201
|
-
*
|
|
1616
|
+
* @param options Optional attachment context — `attachmentsText` (one opaque blob),
|
|
1617
|
+
* `attachmentsTexts` (one `{ text, source_artifact_id?, filename? }` entry per artifact, so
|
|
1618
|
+
* each block keeps its own attribution), `attachedArtifactIds` (the artifacts an opaque
|
|
1619
|
+
* `attachmentsText` came from) and `attachmentsFiles` (raw binary the engine parses) — plus
|
|
1620
|
+
* per-asset CVE `include` layers and `vexOverlay` — an OpenVEX 0.2.0 / CSAF 2.0 VEX
|
|
1621
|
+
* document (text) whose `not_affected`/`fixed` statements mark matching findings
|
|
1622
|
+
* `suppressed_by_vex` (retained + justification, excluded from the actionable counts).
|
|
1202
1623
|
*/
|
|
1203
1624
|
inventoryEnrich(items: readonly InventoryAsset[], options?: {
|
|
1204
1625
|
attachmentsText?: string;
|
|
1205
|
-
|
|
1626
|
+
attachmentsTexts?: Array<{
|
|
1627
|
+
text: string;
|
|
1628
|
+
source_artifact_id?: string | null;
|
|
1629
|
+
filename?: string | null;
|
|
1630
|
+
}>;
|
|
1631
|
+
attachedArtifactIds?: string[];
|
|
1632
|
+
attachmentsFiles?: Array<{
|
|
1633
|
+
filename: string;
|
|
1634
|
+
content_b64: string;
|
|
1635
|
+
source_artifact_id?: string | null;
|
|
1636
|
+
}>;
|
|
1206
1637
|
include?: readonly string[];
|
|
1638
|
+
vexOverlay?: string;
|
|
1207
1639
|
}): Promise<InventoryEnrichResponse>;
|
|
1208
1640
|
/**
|
|
1209
1641
|
* Read the progress or result of an inventory enrichment.
|
|
@@ -1211,8 +1643,32 @@ declare class CrawlerClient {
|
|
|
1211
1643
|
* @param enrichmentId The `enrichment_id` returned by {@link inventoryEnrich}.
|
|
1212
1644
|
*/
|
|
1213
1645
|
inventoryEnrichStatus(enrichmentId: string): Promise<InventoryEnrichStatusResponse>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Submit a raw security event to the async Event Enricher engine.
|
|
1648
|
+
*
|
|
1649
|
+
* Returns immediately with an `enrichment_id` — poll {@link eventEnrichStatus}
|
|
1650
|
+
* for the result (per-indicator findings + the aggregate event threat
|
|
1651
|
+
* assessment), or use {@link enricher}.`enrichEvent` to run the whole lifecycle.
|
|
1652
|
+
* CC extracts every indicator server-side — you do NOT pre-parse the alert.
|
|
1653
|
+
*
|
|
1654
|
+
* @param event The raw event — a Defender XDR / Sentinel alert JSON, a SIEM/EDR
|
|
1655
|
+
* log line, or any text (≤200,000 chars).
|
|
1656
|
+
* @param options.eventId Optional caller-side event identifier (≤200 chars), echoed back on the result.
|
|
1657
|
+
*/
|
|
1658
|
+
eventEnrich(event: string, options?: {
|
|
1659
|
+
eventId?: string;
|
|
1660
|
+
}): Promise<EventEnrichResponse>;
|
|
1661
|
+
/**
|
|
1662
|
+
* Read the progress or result of an event enrichment.
|
|
1663
|
+
*
|
|
1664
|
+
* @param enrichmentId The `enrichment_id` returned by {@link eventEnrich}.
|
|
1665
|
+
*/
|
|
1666
|
+
eventEnrichStatus(enrichmentId: string): Promise<EventEnrichStatusResponse>;
|
|
1214
1667
|
}
|
|
1215
1668
|
|
|
1669
|
+
/** Default retries (3 total attempts). Matches OpenAI/Anthropic SDK defaults. */
|
|
1670
|
+
declare const DEFAULT_MAX_RETRIES = 2;
|
|
1671
|
+
|
|
1216
1672
|
/**
|
|
1217
1673
|
* Exception types for the Crimson Crawler client.
|
|
1218
1674
|
*
|
|
@@ -1246,7 +1702,8 @@ declare class UnexpectedStatus extends CrawlerClientError {
|
|
|
1246
1702
|
* delegates here, using the SDK's `parseScan` + `enrichItems`.
|
|
1247
1703
|
*
|
|
1248
1704
|
* • `assembleBriefing` — PURE (no I/O): turns a `/v1/inventory-enrich` result into a briefing by attaching a
|
|
1249
|
-
* top-N KEV-first `recommended_actions` list (the engine already ranks per-asset findings)
|
|
1705
|
+
* top-N KEV-first `recommended_actions` list (the engine already ranks per-asset findings) plus an
|
|
1706
|
+
* `unverified_assets` list naming the assets whose identity never resolved.
|
|
1250
1707
|
* • `ingestScan` — the orchestration: parse the scan (usage-exempt) → enrich the assets (one billable
|
|
1251
1708
|
* `/v1/inventory-enrich` submit) → assemble. Takes the live `InventoryManagerApi` and uses its
|
|
1252
1709
|
* `parseScan` + `enrichItems`, so the HTTP/key/retry transport stays in the SDK client.
|
|
@@ -1254,14 +1711,16 @@ declare class UnexpectedStatus extends CrawlerClientError {
|
|
|
1254
1711
|
|
|
1255
1712
|
/** Turn a `/v1/inventory-enrich` result into a scan **briefing** — the engine already ranks per-asset
|
|
1256
1713
|
* findings KEV-first, so this just attaches a top-N `recommended_actions` list (highest-priority CVEs
|
|
1257
|
-
* across all assets, KEV first then weaponization, deduped)
|
|
1714
|
+
* across all assets, KEV first then weaponization, deduped) and an `unverified_assets` list (assets whose
|
|
1715
|
+
* identity never resolved — match none/cpe_fuzzy — so an empty finding set means never looked, not clean).
|
|
1716
|
+
* Mirrors the Python `assemble_briefing`. Pure. */
|
|
1258
1717
|
declare function assembleBriefing(report: Record<string, unknown>, meta: {
|
|
1259
1718
|
format: string;
|
|
1260
1719
|
parsedCount: number;
|
|
1261
1720
|
truncated: unknown;
|
|
1262
1721
|
enrichmentId: unknown;
|
|
1263
1722
|
}): Record<string, unknown>;
|
|
1264
|
-
/** Parse a scan FILE (server-side, all
|
|
1723
|
+
/** Parse a scan FILE (server-side, all 12 formats) → enrich the assets against `/v1/inventory-enrich` →
|
|
1265
1724
|
* assemble a briefing. An empty parse short-circuits. Mirrors the Python `ingest_scan`. */
|
|
1266
1725
|
declare function ingestScan(invApi: InventoryManagerApi, content: string | Uint8Array, format: string, options?: {
|
|
1267
1726
|
include?: string[];
|
|
@@ -1280,4 +1739,4 @@ declare function ingestScan(invApi: InventoryManagerApi, content: string | Uint8
|
|
|
1280
1739
|
|
|
1281
1740
|
declare const __version__: string;
|
|
1282
1741
|
|
|
1283
|
-
export { AiReportsApi, ArtifactManagerApi, type ArtifactManagerArtifact, type ArtifactManagerExport, type ArtifactManagerFolder, type ArtifactManagerRating, type ArtifactManagerRawArtifact, type AttachmentOmission, BASE_URL, CrawlerClient, CrawlerClientError, type CrawlerClientOptions, DEFAULT_TIMEOUT_MS, ENV_API_KEY, ENV_BASE_URL, ENV_VERIFY_SSL, EnricherApi, InventoryManagerApi, type InventoryOptions, MissingCredentials, UnexpectedStatus, __version__, assembleBriefing, ingestScan };
|
|
1742
|
+
export { AiReportsApi, ArtifactManagerApi, type ArtifactManagerArtifact, type ArtifactManagerExport, type ArtifactManagerFolder, type ArtifactManagerRating, type ArtifactManagerRawArtifact, type AttachmentOmission, BASE_URL, CrawlerClient, CrawlerClientError, type CrawlerClientOptions, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, ENV_API_KEY, ENV_BASE_URL, ENV_VERIFY_SSL, EnricherApi, InventoryManagerApi, type InventoryOptions, MissingCredentials, TLP_INVALID_MESSAGE, TLP_VALUES, type Tlp, UnexpectedStatus, __version__, assembleBriefing, ingestScan, validateTlp };
|