@crimson-crawler/crimson-crawler-client 4.1.1 → 5.0.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/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 +892 -170
- package/dist/index.d.cts +558 -99
- package/dist/index.d.ts +558 -99
- package/dist/index.js +843 -125
- 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 +8 -5
- package/dist/presets-BMN8jy08.d.cts +0 -110
- package/dist/presets-BMN8jy08.d.ts +0 -110
package/README.md
CHANGED
|
@@ -28,9 +28,7 @@ Turn a CVE into a complete attack briefing with one typed call. ESM and CommonJS
|
|
|
28
28
|
|
|
29
29
|
## Project status
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
A checkout carries the hand-written wrapper without the generated request layer, so run `npm run codegen -- --snapshot-only` once before you build or test it. The published package ships both layers, so installing from npm never needs code generation.
|
|
31
|
+
A repository checkout carries the hand-written wrapper without the generated request layer, so run `npm run codegen -- --snapshot-only` once before you build or test it. The published package ships both layers, so installing from npm never needs code generation.
|
|
34
32
|
|
|
35
33
|
## Install
|
|
36
34
|
|
|
@@ -40,7 +38,7 @@ npm install @crimson-crawler/crimson-crawler-client
|
|
|
40
38
|
pnpm add @crimson-crawler/crimson-crawler-client
|
|
41
39
|
```
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
Published on [npm](https://www.npmjs.com/package/@crimson-crawler/crimson-crawler-client); the commands above install the latest release.
|
|
44
42
|
|
|
45
43
|
Node 22+ is the supported runtime. The default transport uses Node's built-in `fetch`; setting `verifySsl: false` dynamically imports `undici`. Browser and edge runtimes are not tested or supported.
|
|
46
44
|
|
|
@@ -91,14 +89,20 @@ import { CrawlerClient } from "@crimson-crawler/crimson-crawler-client";
|
|
|
91
89
|
const client = new CrawlerClient();
|
|
92
90
|
const result = await client.enrichCveFull("CVE-2024-3400");
|
|
93
91
|
|
|
94
|
-
console.log(result.cve?.
|
|
92
|
+
console.log(result.cve?.cvss_v3_score, result.cve?.cvss_v4_score);
|
|
95
93
|
|
|
96
94
|
for (const t of result.techniques ?? []) {
|
|
97
95
|
console.log(t.technique_id, t.name);
|
|
98
96
|
}
|
|
99
97
|
```
|
|
100
98
|
|
|
101
|
-
Optional chaining (`result.cve?.
|
|
99
|
+
Optional chaining (`result.cve?.cvss_v3_score`) and nullish coalescing (`result.techniques ?? []`) are the recommended patterns. Every layer of an enrichment response is independently optional, since any single upstream lookup may have no data.
|
|
100
|
+
|
|
101
|
+
OSV advisories may span pages. Use `iterCveOsvPages(cveId)` or
|
|
102
|
+
`iterVulnerabilityExposureOsvPages(cveIds)` to stream them without collecting the full walk.
|
|
103
|
+
Pass an explicit `include` containing `osv_restricted` for restricted or unknown-licence records.
|
|
104
|
+
An expired snapshot throws `UnexpectedStatus`; restart the walk rather than appending a new
|
|
105
|
+
snapshot to pages already consumed.
|
|
102
106
|
|
|
103
107
|
## The client
|
|
104
108
|
|
|
@@ -141,27 +145,27 @@ There's no `close()` to call. Reuse a single `CrawlerClient` instance for the li
|
|
|
141
145
|
|
|
142
146
|
## Convenience methods
|
|
143
147
|
|
|
144
|
-
**Every `/v1` operation has a method** —
|
|
148
|
+
**Every `/v1` operation has a method** — 38 of them, plus the `searchTechniques` shortcut. The seven documented in full below cover the highest-traffic patterns; the rest are grouped after them with their signatures. The 17 `enrich*Full` methods call their endpoint with a full-walk `include` preset baked in (pass `include` to override); the others take no preset. Every method returns a promise of a typed response and throws `UnexpectedStatus` on a non-2xx.
|
|
145
149
|
|
|
146
150
|
| Group | Methods |
|
|
147
151
|
|---|---|
|
|
148
|
-
| Full-walk enrichment (
|
|
152
|
+
| Full-walk enrichment (17) | `enrichCveFull` · `enrichIocFull` · `enrichCweFull` · `enrichTechniqueFull` · `enrichProductFull` · `enrichPackageFull` · `enrichCapecFull` · `enrichGroupFull` · `enrichSoftwareFull` · `enrichCampaignFull` · `enrichAtlasFull` · `enrichDisarmFull` · `enrichDefendFull` · `enrichF3Full` · `enrichCloakFull` · `enrichLocationFull` · `enrichSectorFull` |
|
|
149
153
|
| Enrichment, no preset (2) | `enrichBatch` · `enrichPocSource` |
|
|
150
|
-
| Search (
|
|
154
|
+
| Search (9 + 1) | `searchCve` · `searchCti` · `searchCsaf` · `searchKev` · `searchMisp` · `searchKnowledgebase` · `searchVendor` · `searchPoc` · `searchD3fend` · `searchTechniques` |
|
|
151
155
|
| Assessment (4) | `assessTechniqueCoverage` · `assessVulnerabilityExposure` · `assessGroupExposure` · `assessIocPortfolio` |
|
|
152
|
-
| Async engines (
|
|
156
|
+
| Async engines (6) | `artifactEnrich` · `artifactEnrichStatus` · `inventoryEnrich` · `inventoryEnrichStatus` · `eventEnrich` · `eventEnrichStatus` |
|
|
153
157
|
|
|
154
158
|
Names are the exact camelCase of the Python ones, so anything you read in the [Python guide](https://crimsoncrawler.com/docs/clients/python-client/) transfers. One to watch: the wrapper method is **`searchD3fend`** (lowercase `f`), while the generated function it wraps is `searchD3Fend`.
|
|
155
159
|
|
|
156
160
|
#### `enrichCveFull(cveId, include?)`
|
|
157
161
|
|
|
158
|
-
Returns CVE details, EPSS
|
|
162
|
+
Returns CVE details, EPSS, KEV, weaknesses, attack patterns, ATT&CK techniques, TIE predictions and other default-on source layers. MISP and knowledge-base context require explicit includes.
|
|
159
163
|
|
|
160
164
|
```ts
|
|
161
165
|
const client = new CrawlerClient();
|
|
162
166
|
const result = await client.enrichCveFull("CVE-2024-3400");
|
|
163
167
|
|
|
164
|
-
console.log(`CVSS: ${result.cve?.
|
|
168
|
+
console.log(`CVSS v${result.cve?.cvss_v3_version}: ${result.cve?.cvss_v3_score} (${result.cve?.cvss_v3_severity})`);
|
|
165
169
|
console.log(`Description: ${result.cve?.description}`);
|
|
166
170
|
|
|
167
171
|
if (result.epss) console.log(`EPSS: ${result.epss.epss}`);
|
|
@@ -186,7 +190,7 @@ Returns: `Promise<EnrichCveResponse>`.
|
|
|
186
190
|
|
|
187
191
|
#### `enrichIocFull(value, iocType?, include?)`
|
|
188
192
|
|
|
189
|
-
Returns MISP attribute matches, linked ATT&CK techniques,
|
|
193
|
+
Returns MISP attribute matches, linked ATT&CK techniques, defensive context, sightings, warninglists and list/network context for an indicator. Request other layers explicitly.
|
|
190
194
|
|
|
191
195
|
```ts
|
|
192
196
|
const result = await client.enrichIocFull("203.0.113.5", "ip-dst");
|
|
@@ -222,7 +226,7 @@ console.log(`Techniques: ${result.techniques?.length ?? 0}`);
|
|
|
222
226
|
|
|
223
227
|
Returns: `Promise<EnrichCweResponse>`.
|
|
224
228
|
|
|
225
|
-
#### `enrichTechniqueFull(techniqueIds
|
|
229
|
+
#### `enrichTechniqueFull(techniqueIds?, framework?, include?, assetId?)`
|
|
226
230
|
|
|
227
231
|
Returns technique details, TIE predictions, attributed groups, software, campaigns, and a Navigator JSON layer for one or more ATT&CK techniques.
|
|
228
232
|
|
|
@@ -242,25 +246,28 @@ for (const g of result.groups ?? []) {
|
|
|
242
246
|
|
|
243
247
|
| Parameter | Type | Default | Description |
|
|
244
248
|
|---|---|---|---|
|
|
245
|
-
| `techniqueIds` | `string[]` |
|
|
246
|
-
| `framework` | `"enterprise" \| "ics" \| "mobile"` | `"enterprise"` | ATT&CK matrix variant. |
|
|
249
|
+
| `techniqueIds` | `string[]` | optional | ATT&CK technique IDs. Omitted (sent UNSET) when you look up by `assetId`. |
|
|
250
|
+
| `framework` | `"enterprise" \| "ics" \| "mobile"` | `"enterprise"` | ATT&CK matrix variant. `assetId` requires `"ics"`. |
|
|
251
|
+
| `assetId` | `string` | — | ICS asset id (`^A\\d{4}$`) — looks a technique up FROM an asset instead. Mutually exclusive with `techniqueIds` / `techniqueId` / `search` (the API answers 422). The response carries the resolved `asset` plus its real targets in `techniques[]`. |
|
|
247
252
|
| `include` | `readonly string[]` | `presets.TECHNIQUE_FULL` | Override the default include list. |
|
|
248
253
|
|
|
249
254
|
Returns: `Promise<EnrichTechniqueResponse>`.
|
|
250
255
|
|
|
251
256
|
#### `enrichProductFull(product, options?)`
|
|
252
257
|
|
|
253
|
-
|
|
258
|
+
Returns a page of enriched CVEs for a product and version.
|
|
259
|
+
|
|
260
|
+
The pinned Vulmatch bundle route cannot look up CPE identifiers containing `/`, `?`, `#`, `%`, or
|
|
261
|
+
backslash escapes of those characters, including all CPE 2.2 URIs. Affected lookups report
|
|
262
|
+
service `vulnerability-data` and error `unroutable_identifier` in `errors[]` rather than a confirmed empty result; failures
|
|
263
|
+
are not cached. A lossless route is tracked in issue #473.
|
|
254
264
|
|
|
255
265
|
```ts
|
|
256
|
-
const
|
|
266
|
+
for await (const page of client.iterProductCves("http_server", {
|
|
257
267
|
version: "2.4.51",
|
|
258
268
|
vendor: "apache",
|
|
259
|
-
})
|
|
260
|
-
|
|
261
|
-
for (const cve of result.cves ?? []) {
|
|
262
|
-
console.log(`${cve.cve_id}: ${cve.cvss_score} (${cve.cvss_severity})`);
|
|
263
|
-
if (cve.kev?.in_kev) console.log(" in KEV");
|
|
269
|
+
})) {
|
|
270
|
+
for (const row of page.cves ?? []) console.log(row.discovered_cve_id);
|
|
264
271
|
}
|
|
265
272
|
```
|
|
266
273
|
|
|
@@ -270,19 +277,28 @@ for (const cve of result.cves ?? []) {
|
|
|
270
277
|
| `options.version` | `string` | — | Specific version (e.g. `"2.4.51"`). Optional. |
|
|
271
278
|
| `options.vendor` | `string` | — | Vendor name to narrow results (e.g. `"apache"`). Optional. |
|
|
272
279
|
| `options.include` | `readonly string[]` | `presets.PRODUCT_FULL` | Override the default include list. |
|
|
280
|
+
| `options.limit` | `number` | `2` | Maximum CVEs per page, 1–20. The full preset pages smaller than the API default. |
|
|
281
|
+
| `options.offset` | `number` | `0` | Zero-based page offset. |
|
|
282
|
+
| `options.snapshotId` | `string` | — | First page's snapshot ID, required when requesting a later offset. |
|
|
273
283
|
|
|
274
284
|
Returns: `Promise<EnrichProductResponse>`.
|
|
275
285
|
|
|
286
|
+
`cves_discovered` counts the bounded discovery set. `rollups_over` counts the CVEs actually
|
|
287
|
+
enriched, up to `cves_enrichment_limit`; `discovery_truncated` and its reason describe whether
|
|
288
|
+
discovery was incomplete or its completeness is unknown.
|
|
289
|
+
The SDK reconstructs the per-CVE context lists from the response's page-local catalogue.
|
|
290
|
+
Keep page 0's product-level sections; later pages contain CVE rows and paging metadata only.
|
|
291
|
+
Single-page results need no snapshot. Iterators restart once on an expired snapshot.
|
|
292
|
+
|
|
276
293
|
#### `enrichPackageFull(ecosystem, package, opts?)`
|
|
277
294
|
|
|
278
|
-
The package-ecosystem sibling of `enrichProductFull
|
|
295
|
+
The package-ecosystem sibling of `enrichProductFull` reads advisories from the stored OSV generation. Default results include permissive sources only; add `osv_restricted` to an explicit include list for restricted and unknown-licence package and nested CVE advisories. This is a breaking change from the prior live query: default results may shrink.
|
|
279
296
|
|
|
280
|
-
|
|
281
|
-
const result = await client.enrichPackageFull('npm', 'lodash');
|
|
297
|
+
**Breaking OSV licence change:** CVE-linked `osv` returns permissive records only. Requests that previously received restricted or unknown-licence records must add `osv_restricted` to the CVE `include` list alongside any other layers needed. An explicit list replaces the preset. On package enrichment, `osv_restricted` applies to nested CVEs, not the package advisory list. Check source terms before redistribution.
|
|
282
298
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
299
|
+
```ts
|
|
300
|
+
for await (const page of client.iterPackageAdvisories("npm", "lodash")) {
|
|
301
|
+
for (const advisory of page.advisories ?? []) console.log(advisory.id);
|
|
286
302
|
}
|
|
287
303
|
```
|
|
288
304
|
|
|
@@ -292,9 +308,16 @@ for (const cve of result.cves ?? []) {
|
|
|
292
308
|
| `package` | `string` | required | Package name within the ecosystem, e.g. `"lodash"`. |
|
|
293
309
|
| `opts.version` | `string` | — | Specific version (e.g. `"4.0"`). Optional. |
|
|
294
310
|
| `opts.include` | `readonly string[]` | `presets.PACKAGE_FULL` | Override the default include list. |
|
|
311
|
+
| `opts.limit` | `number` | `5` | Maximum advisories and CVEs per page, 1–20. |
|
|
312
|
+
| `opts.offset` | `number` | `0` | Returned `next_offset` for a continuation. |
|
|
313
|
+
| `opts.snapshotId` | `string` | — | Page-zero snapshot ID, required for continuation. |
|
|
295
314
|
|
|
296
315
|
Returns: `Promise<EnrichPackageResponse>`.
|
|
297
316
|
|
|
317
|
+
The method returns one page. `iterPackageAdvisories` streams pages without an aggregate buffer;
|
|
318
|
+
if the snapshot expires or changes after a yield, it throws instead of silently restarting.
|
|
319
|
+
Follow `next_offset`, not `offset + limit`, because byte limits can shorten a page.
|
|
320
|
+
|
|
298
321
|
#### `searchTechniques(keyword, options?)`
|
|
299
322
|
|
|
300
323
|
Keyword-searches the ATT&CK knowledge base and returns matching techniques (attack-patterns).
|
|
@@ -314,7 +337,7 @@ for (const hit of result.results ?? []) {
|
|
|
314
337
|
|
|
315
338
|
Returns: `Promise<SearchCtiResponse>`.
|
|
316
339
|
|
|
317
|
-
#### The other
|
|
340
|
+
#### The other eleven full-walk enrichments
|
|
318
341
|
|
|
319
342
|
Same shape as the six above: a full-walk preset baked in, `include` to override. Each takes an **optional id positional or `options.search`** — pass one, not both — so you can go straight to an id or find the entity by name.
|
|
320
343
|
|
|
@@ -327,14 +350,16 @@ const ml = await client.enrichAtlasFull("AML.T0043");
|
|
|
327
350
|
| Method | Id positional | Options | Returns |
|
|
328
351
|
|---|---|---|---|
|
|
329
352
|
| `enrichCapecFull(capecId?, options?)` | `CAPEC-66` | `search`, `include` | `Promise<EnrichCapecResponse>` |
|
|
330
|
-
| `enrichGroupFull(groupId?, options?)` | `G0016` | `search`, `framework`, `include` | `Promise<EnrichGroupResponse>` |
|
|
353
|
+
| `enrichGroupFull(groupId?, options?)` | `G0016` | `search`, `framework`, `include`, `limit`, `offset`, `snapshotId` | `Promise<EnrichGroupResponse>` |
|
|
331
354
|
| `enrichSoftwareFull(softwareId?, options?)` | `S0154` | `search`, `framework`, `include` | `Promise<EnrichSoftwareResponse>` |
|
|
332
355
|
| `enrichCampaignFull(campaignId?, options?)` | `C0011` | `search`, `framework`, `include` | `Promise<EnrichCampaignResponse>` |
|
|
333
356
|
| `enrichAtlasFull(techniqueId?, options?)` | `AML.T0043` | `search`, `include` | `Promise<EnrichAtlasResponse>` |
|
|
334
357
|
| `enrichDisarmFull(techniqueId?, options?)` | `T0001` | `search`, `include` | `Promise<EnrichDisarmResponse>` |
|
|
335
358
|
| `enrichDefendFull(d3fendId?, options?)` | `D3-NTA` | `search`, `include` | `Promise<EnrichDefendResponse>` |
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
359
|
+
| `enrichF3Full(f3Id?, options?)` | `F1031` | `search`, `include` | `Promise<EnrichF3Response>` |
|
|
360
|
+
| `enrichCloakFull(cloakId?, options?)` | `TTP-496` | `search`, `include` | `Promise<EnrichCloakResponse>` |
|
|
361
|
+
| `enrichLocationFull(locationId?, options?)` | `US` | `search`, `include` | `Promise<EnrichLocationResponse>` |
|
|
362
|
+
| `enrichSectorFull(sectorId?, options?)` | `financial-organizations` | `search`, `include` | `Promise<EnrichSectorResponse>` |
|
|
338
363
|
|
|
339
364
|
`framework` is `"enterprise"` (default), `"ics"`, or `"mobile"`, and only exists where the endpoint supports a matrix variant.
|
|
340
365
|
|
|
@@ -373,9 +398,14 @@ These methods retrieve and analyze public proof-of-concept exploit material. Use
|
|
|
373
398
|
|
|
374
399
|
Returns: `Promise<EnrichPocSourceResponse>`.
|
|
375
400
|
|
|
376
|
-
#### Search (
|
|
401
|
+
#### Search (9 methods)
|
|
377
402
|
|
|
378
|
-
One method per search endpoint. `searchCve`
|
|
403
|
+
One method per search endpoint. `searchCve` defaults to `details`, `statistics`, `cna`, `epss_reports`, and `kb_rankings`; an explicit `include` replaces the defaults. Rankings keep the first 100 rows per knowledge base without yearly trends; `kb_rankings_total` and `kb_rankings_truncated` describe the reduction, and `kb_rankings_full` restores all fetched rows and trends. `searchMisp`, `searchCti`, `searchKev`, and `searchD3fend` also accept `include`. No search method uses a preset. `searchKev` and `searchMisp` take options only.
|
|
404
|
+
|
|
405
|
+
**5.0.0 migration — MISP event bodies:** `searchMisp` returns event summaries by default. Request
|
|
406
|
+
`include: ["misp_events_full"]` for full event bodies; `objects` also returns full bodies and resolves
|
|
407
|
+
object references. An explicit include replaces the defaults (`event_reports`, `tags`, `version`), so
|
|
408
|
+
add those values too if needed. Event pages are not snapshots and can shift when MISP data changes.
|
|
379
409
|
|
|
380
410
|
```ts
|
|
381
411
|
const weaponized = await client.searchCve(undefined, { kevOnly: true, epssMin: 0.9, limit: 20 });
|
|
@@ -386,13 +416,14 @@ const answer = await client.searchKnowledgebase("how do I detect kerberoasting",
|
|
|
386
416
|
| Method | Options | Returns |
|
|
387
417
|
|---|---|---|
|
|
388
418
|
| `searchCve(query?, options?)` | `cveId`, `stixId`, `cweId`, `capecId`, `attackId`, `cpe`, `cpesNotVulnerable`, `createdByRef`, `createdMin`, `createdMax`, `modifiedMin`, `modifiedMax`, `cvssMin`, `cvssV2Min`, `cvssV4Min`, `epssMin`, `epssPercentileMin`, `kevOnly`, `vulnStatus`, `sort`, `include`, `limit`, `page` | `Promise<SearchCveResponse>` |
|
|
389
|
-
| `searchCti(query, options?)` | `sources`, `types`, `limit`, `page`, `deprecated`, `revoked` | `Promise<SearchCtiResponse>` |
|
|
419
|
+
| `searchCti(query, options?)` | `sources`, `types`, `limit`, `page`, `deprecated`, `revoked`, `include` | `Promise<SearchCtiResponse>` |
|
|
390
420
|
| `searchKev(options?)` | `cveId`, `ransomwareStatus`, `limit`, `page` | `Promise<SearchKevResponse>` |
|
|
391
|
-
| `searchMisp(options?)` | `value`, `typeAttribute`, `category`, `toIds`, `eventId`, `eventinfo`, `tags`, `threatLevelId`, `published`, `dateFrom`, `dateTo`, `limit`, `page` | `Promise<SearchMispResponse>` |
|
|
421
|
+
| `searchMisp(options?)` | `value`, `typeAttribute`, `category`, `toIds`, `eventId`, `eventinfo`, `tags`, `threatLevelId`, `published`, `dateFrom`, `dateTo`, `limit`, `page`, `include` | `Promise<SearchMispResponse>` |
|
|
392
422
|
| `searchKnowledgebase(query, options?)` | `collections`, `alpha`, `limit` | `Promise<SearchKnowledgebaseResponse>` |
|
|
393
|
-
| `searchVendor(vendor
|
|
423
|
+
| `searchVendor(vendor?, options?)` | `q`, `limit` — omit `vendor` to list the vendor directory | `Promise<SearchVendorResponse>` |
|
|
394
424
|
| `searchPoc(cveId, options?)` | `limit` | `Promise<SearchPocResponse>` |
|
|
395
|
-
| `searchD3fend(query, options?)` | `d3fendForm`, `limit`, `page` | `Promise<SearchD3FendResponse>` |
|
|
425
|
+
| `searchD3fend(query, options?)` | `d3fendForm`, `limit`, `page`, `include` | `Promise<SearchD3FendResponse>` |
|
|
426
|
+
| `searchCsaf(options?)` | `cveId`, `advisoryId`, `publisher`, `sector`, `product`, `cpe`, `tlp`, `sort`, `limit`, `page` | `Promise<SearchCsafResponse>` |
|
|
396
427
|
|
|
397
428
|
Constrained values are typed unions, so your editor completes them: `vulnStatus`, `sort`, `ransomwareStatus` (`"Known"` / `"Unknown"`), `d3fendForm` (`"tactic"` / `"mitigation"` / `"sub-mitigation"` / `"artifact"`), `collections` (`"main"` / `"large"` / `"user"` / `"red_team"`), and `types` (`"attack-pattern"` / `"intrusion-set"` / `"malware"` / `"tool"` / `"campaign"` / `"weakness"` / `"course-of-action"`).
|
|
398
429
|
|
|
@@ -416,14 +447,19 @@ const portfolio = await client.assessIocPortfolio([
|
|
|
416
447
|
|---|---|---|
|
|
417
448
|
| `assessTechniqueCoverage(techniqueIds, options?)` | `framework`, `include` | `Promise<AssessTechniqueCoverageResponse>` |
|
|
418
449
|
| `assessVulnerabilityExposure(cveIds, options?)` | `stakeholder`, `include` | `Promise<AssessVulnerabilityExposureResponse>` |
|
|
419
|
-
| `assessGroupExposure(options?)` | `groupIds`, `search`, `framework`, `include` | `Promise<AssessGroupExposureResponse>` |
|
|
450
|
+
| `assessGroupExposure(options?)` | `groupIds`, `search`, `framework`, `include`, `limit`, `offset`, `snapshotId` | `Promise<AssessGroupExposureResponse>` |
|
|
420
451
|
| `assessIocPortfolio(indicators, options?)` | `include` | `Promise<AssessIocPortfolioResponse>` |
|
|
421
452
|
|
|
422
453
|
`stakeholder` is the SSVC decision object (`method`, `exposure`, `mission_prevalence`, `human_impact`, `public_wellbeing_impact`) and applies when `include` asks for `ssvc`. `assessGroupExposure` takes `groupIds`, free-text `search` terms, or both.
|
|
423
454
|
|
|
424
|
-
|
|
455
|
+
Group and group-exposure calls return one technique page. Use `iterGroupPages` or
|
|
456
|
+
`iterGroupExposurePages` to collect them. The SDK reconstructs log sources from the page
|
|
457
|
+
catalogue; `aggregate_over` and `aggregate_total` show tactic coverage, and
|
|
458
|
+
`context_techniques_selected` / `context_techniques_limit` disclose bounded context work.
|
|
459
|
+
|
|
460
|
+
#### Async engines (6 methods)
|
|
425
461
|
|
|
426
|
-
The raw submit/status pairs behind the
|
|
462
|
+
The raw submit/status pairs behind the three background enrichment engines. A submit resolves with a job handle immediately (**it counts toward your usage**); the status read is **usage-exempt**, so poll as often as you like. For a one-call version that submits, polls, and resolves with the finished report, use [`client.enricher.enrich`](#enricher-clientenricher) / [`client.enricher.enrichEvent`](#enricher-clientenricher) or `client.inventoryManager.ingestScan`.
|
|
427
463
|
|
|
428
464
|
```ts
|
|
429
465
|
const job = await client.artifactEnrich({ text: "Suspicious login from 10.1.1.1, then CVE-2024-1234 scan" });
|
|
@@ -431,45 +467,54 @@ const status = await client.artifactEnrichStatus(job.enrichment_id);
|
|
|
431
467
|
|
|
432
468
|
const inv = await client.inventoryEnrich([{ product: "nginx", version: "1.24.0" }]);
|
|
433
469
|
const findings = await client.inventoryEnrichStatus(inv.enrichment_id);
|
|
470
|
+
|
|
471
|
+
const ev = await client.eventEnrich("Suspicious login from 10.1.1.1, then CVE-2024-1234 scan", { eventId: "INC-2026-0091" });
|
|
472
|
+
const verdict = await client.eventEnrichStatus(ev.enrichment_id);
|
|
434
473
|
```
|
|
435
474
|
|
|
436
475
|
| Method | Options | Returns |
|
|
437
476
|
|---|---|---|
|
|
438
|
-
| `artifactEnrich(options?)` | `text`, `files`, `formats`, `stakeholder`, `include` | `Promise<ArtifactEnrichResponse>` |
|
|
477
|
+
| `artifactEnrich(options?)` | `text`, `files`, `texts`, `attachedArtifactIds`, `formats`, `stakeholder`, `include` | `Promise<ArtifactEnrichResponse>` |
|
|
439
478
|
| `artifactEnrichStatus(enrichmentId)` | — | `Promise<ArtifactEnrichStatusResponse>` |
|
|
440
|
-
| `inventoryEnrich(items, options?)` | `attachmentsText`, `attachmentsFiles`, `include` | `Promise<InventoryEnrichResponse>` |
|
|
479
|
+
| `inventoryEnrich(items, options?)` | `attachmentsText`, `attachmentsTexts`, `attachmentsFiles`, `attachedArtifactIds`, `include`, `vexOverlay` | `Promise<InventoryEnrichResponse>` |
|
|
441
480
|
| `inventoryEnrichStatus(enrichmentId)` | — | `Promise<InventoryEnrichStatusResponse>` |
|
|
481
|
+
| `eventEnrich(event, options?)` | `eventId` | `Promise<EventEnrichResponse>` |
|
|
482
|
+
| `eventEnrichStatus(enrichmentId)` | — | `Promise<EventEnrichStatusResponse>` |
|
|
442
483
|
|
|
443
|
-
`files` and `attachmentsFiles` are `[{ filename, content_b64 }]`; `items` are `InventoryAsset` objects (`product` is the only required key). `formats` picks the machine exports to build alongside the report (`report`, `json`, `stix`, `vex`, `csaf`, `navigator`, `kev_remediation`, `oscal_poam`, `misp`, `csv`). A submit resolves with `202` and `status: "queued"` plus a `queue_position` when your key already has 3 enrichments running; past 20 in flight it throws `UnexpectedStatus(429)` with `error: "enrichment_queue_full"`.
|
|
484
|
+
`files` and `attachmentsFiles` are `[{ filename, content_b64, source_artifact_id? }]`; `texts` / `attachmentsTexts` are `[{ text, source_artifact_id?, filename? }]` — one row per attached TEXT artifact, so per-artifact provenance survives instead of being flattened into one blob (aggregate caps: 1,000,000 chars for the artifact engine's `text` + `texts[]`, 500,000 for the inventory engine's `attachments_text` + `attachments_texts[]`). `attachedArtifactIds` is the legacy whole-run id list. The inventory manager's `resolveAttachments` is a clean cutover — it resolves to `{ texts, files, omissions }` and the legacy whole-run `text` field is gone, with no alias. `items` are `InventoryAsset` objects (`product` is the only required key). `formats` picks the machine exports to build alongside the report (`report`, `json`, `stix`, `vex`, `csaf`, `navigator`, `kev_remediation`, `oscal_poam`, `misp`, `csv`). `eventEnrich` takes the raw event text (a Defender XDR / Sentinel alert, a SIEM/EDR log line, any JSON or text, ≤200,000 chars) and an optional `eventId` (≤200 chars, echoed back on the result); its `eventEnrichStatus` carries the finished `EventEnrichmentResult` (per-indicator findings + graded aggregate threat assessment). A submit resolves with `202` and `status: "queued"` plus a `queue_position` when your key already has 3 enrichments running; past 20 in flight it throws `UnexpectedStatus(429)` with `error: "enrichment_queue_full"`.
|
|
444
485
|
|
|
445
486
|
## Presets
|
|
446
487
|
|
|
447
488
|
A preset is a named `readonly string[]`: a curated set of `include` values for one of the common workflows. The point is so you don't have to memorize which `include` values are valid for which endpoint, or pick the right depth for your use case every time.
|
|
448
489
|
|
|
449
|
-
The `presets` namespace exports
|
|
490
|
+
The `presets` namespace exports 20 — one full-walk default per enrichment endpoint that accepts `include`, plus three depth variants for the two highest-traffic ones. Names and contents are byte-identical to the Python SDK's:
|
|
450
491
|
|
|
451
492
|
| Preset | Use for | Include values |
|
|
452
493
|
|---|---|---|
|
|
453
|
-
| `CVE_FULL_WALK` | Default for `enrichCveFull`. Full enrichment depth. | `details`, `epss`, `kev`, `
|
|
454
|
-
| `CVE_FAST` | Quick artifact-scan. Score and KEV status, nothing else. | `details`, `epss`, `kev` |
|
|
494
|
+
| `CVE_FULL_WALK` | Default for `enrichCveFull`. Full enrichment depth. | `android_bulletin`, `capec`, `cellular`, `certfr_advisories`, `cisa_campaigns`, `cisa_kev`, `csaf_advisories`, `cvss_bt`, `cwe`, `details`, `detections`, `emb3d`, `epss`, `exploits`, `kev`, `log_sources`, `mitigations`, `nist_controls`, `ot_context`, `poc`, `sigma`, `osv`, `ssvc`, `techniques`, `tie`, `weakness_ranks` |
|
|
495
|
+
| `CVE_FAST` | Quick artifact-scan. Score and KEV status, nothing else. | `details`, `epss`, `kev`, `cisa_kev` |
|
|
455
496
|
| `CVE_NARRATIVE` | Report generation. Full walk plus AI summary and adversary attribution. | full walk + `summary`, `groups`, `campaigns` |
|
|
456
|
-
| `IOC_FULL_WALK` | Default for `enrichIocFull`. | `misp_attributes`, `
|
|
497
|
+
| `IOC_FULL_WALK` | Default for `enrichIocFull`. | `cisa_campaigns`, `defend`, `detections`, `galaxies`, `listed_on`, `log_sources`, `misp_attributes`, `mitigations`, `network_context`, `nist_controls`, `sightings`, `techniques`, `tie`, `warninglist` |
|
|
457
498
|
| `IOC_FAST` | Indicator hits in MISP feeds, nothing else. | `misp_attributes` |
|
|
458
499
|
| `CWE_FULL_WALK` | Default for `enrichCweFull`. | `capecs`, `techniques`, `tie` |
|
|
459
|
-
| `TECHNIQUE_FULL` | Default for `enrichTechniqueFull`.
|
|
460
|
-
| `PRODUCT_FULL` | Default for `enrichProductFull`.
|
|
500
|
+
| `TECHNIQUE_FULL` | Default for `enrichTechniqueFull`. Technique detail and defensive mappings. | `asset_classes`, `atomic_red_team`, `cisa_campaigns`, `defend`, `details`, `detections`, `fight`, `framework_mappings`, `fraud`, `log_sources`, `lolbas`, `lotl`, `mitigations`, `nist_controls`, `sigma`, `tie` |
|
|
501
|
+
| `PRODUCT_FULL` | Default for `enrichProductFull`. | Seeded product layers plus `misp` and `knowledgebase`; see `presets.ts`. |
|
|
461
502
|
| `PACKAGE_FULL` | Default for `enrichPackageFull`. OSV advisories + per-CVE full enrichment. | `details`, `severity`, `affected`, `references`, `epss`, `kev`, `cwe`, `capec`, `techniques`, `tie` |
|
|
462
503
|
| `CAPEC_FULL` | Default for `enrichCapecFull`. Attack pattern → techniques, CVEs, actors. | `details`, `techniques`, `tie`, `cves`, `groups`, `software`, `campaigns`, `navigator` |
|
|
463
|
-
| `GROUP_FULL` | Default for `enrichGroupFull`.
|
|
504
|
+
| `GROUP_FULL` | Default for `enrichGroupFull`. | Group layers including detections, mitigations and NIST controls; see `presets.ts`. |
|
|
464
505
|
| `SOFTWARE_FULL` | Default for `enrichSoftwareFull`. Malware / tool → who uses it and how. | `details`, `techniques`, `tie`, `groups`, `campaigns`, `cves`, `navigator` |
|
|
465
506
|
| `CAMPAIGN_FULL` | Default for `enrichCampaignFull`. | `details`, `techniques`, `tie`, `groups`, `software`, `cves`, `navigator` |
|
|
466
|
-
| `ATLAS_FULL` | Default for `enrichAtlasFull`. Adversarial-ML technique walk. | `details`, `techniques
|
|
467
|
-
| `DISARM_FULL` | Default for `enrichDisarmFull`. Influence-operation technique
|
|
468
|
-
| `
|
|
469
|
-
| `
|
|
470
|
-
| `
|
|
507
|
+
| `ATLAS_FULL` | Default for `enrichAtlasFull`. Adversarial-ML technique walk. | `details`, `techniques` |
|
|
508
|
+
| `DISARM_FULL` | Default for `enrichDisarmFull`. Influence-operation technique. | `details`, `techniques` |
|
|
509
|
+
| `F3_FULL` | Default for `enrichF3Full`. MITRE F3 fraud technique → the ATT&CK techniques it borrows. No adversary graph, so the chain ends at the technique hop. | `details`, `techniques`, `knowledgebase` |
|
|
510
|
+
| `CLOAK_FULL` | Default for `enrichCloakFull`. CLOAK concealment technique — no ATT&CK references, so this set is short by design. | `details`, `knowledgebase` |
|
|
511
|
+
| `DEFEND_FULL` | Default for `enrichDefendFull`. D3FEND has no graph hops, so this set is short by design. | `details`, `techniques`, `knowledgebase` |
|
|
512
|
+
| `LOCATION_FULL` | Default for `enrichLocationFull`. Regional profile walk — the location's own metadata plus knowledge base context. | `details`, `knowledgebase` |
|
|
513
|
+
| `SECTOR_FULL` | Default for `enrichSectorFull`. Industry-sector profile walk — the sector's own metadata plus knowledge base context. | `details`, `knowledgebase` |
|
|
471
514
|
|
|
472
|
-
Every full-walk preset stays inside its endpoint's allowed `include` set (see [Allowed `include` values per endpoint](#allowed-include-values-per-endpoint)) and deliberately leaves out `
|
|
515
|
+
Every full-walk preset stays inside its endpoint's allowed `include` set (see [Allowed `include` values per endpoint](#allowed-include-values-per-endpoint)) and deliberately leaves out `summary` (LLM generation). `CVE_NARRATIVE` is the one preset that opts into `summary` — that's what it's for.
|
|
516
|
+
|
|
517
|
+
Presets omit `osv_restricted` and optional layers such as `criteria`, `metasploit`, `nuclei`, `vendor_advisories` and `distro_advisories`. `cisa_kev` is in the CVE and product presets, but not `PACKAGE_FULL`. An explicit `include` replaces the preset.
|
|
473
518
|
|
|
474
519
|
Three ways to use them:
|
|
475
520
|
|
|
@@ -532,15 +577,29 @@ const matrix = await ws.compareEnrichments([oldEnrichmentId, newEnrichmentId]);
|
|
|
532
577
|
console.log(matrix.counts); // { new: 3, resolved: 1, changed: 2, persistent: 14 }
|
|
533
578
|
```
|
|
534
579
|
|
|
535
|
-
Full surface: `discovery`, `listArtifacts
|
|
580
|
+
Full surface: `discovery`, `listArtifacts` (filters incl. `tlp`), `uploadArtifacts` (batch `tlp`), `getArtifact`,
|
|
536
581
|
`getArtifactRaw` (buffers the raw body as a string, without a JSON re-wrap, up to 10,000,000 bytes),
|
|
537
|
-
`updateArtifact` (rename / star / move), `deleteArtifact`, `copyArtifact`, the bulk helpers
|
|
582
|
+
`updateArtifact` (rename / star / move / set `tlp` — a `tlp`-only PATCH is valid), `deleteArtifact`, `copyArtifact`, the bulk helpers
|
|
538
583
|
(`bulkDelete`, `moveToFolder`, `bulkSetFavorite`, `downloadBundle`), `getRating` / `setRating`,
|
|
539
584
|
`listExports` / `getExport` / `downloadAllExports`, `compareEnrichments`, `saveEnrichment`, and folder CRUD
|
|
540
585
|
(`listFolders`, `createFolder`, `renameFolder`, `deleteFolder`, `downloadFolder`). The Artifact Manager surface lives outside
|
|
541
586
|
the versioned `/v1` OpenAPI contract and evolves independently. Non-2xx throws the
|
|
542
587
|
same `UnexpectedStatus`.
|
|
543
588
|
|
|
589
|
+
Every artifact the library returns carries its own `tlp: Tlp` — the per-artifact TLP 2.0 marking
|
|
590
|
+
(`CLEAR`, `GREEN`, `AMBER`, `AMBER+STRICT`, `RED`); legacy rows read `AMBER`. `listArtifacts({ tlp })`
|
|
591
|
+
filters by it, `uploadArtifacts(…, { tlp })` sets it batch-wide (default `AMBER`), and
|
|
592
|
+
`updateArtifact(id, { tlp })` changes it at any time. `getArtifactRaw` also returns it from the
|
|
593
|
+
`X-Artifact-Tlp` header. An invalid value throws a `RangeError` before any request.
|
|
594
|
+
|
|
595
|
+
`getExport`, `downloadAllExports`, `downloadBundle`, and `downloadFolder` take an optional
|
|
596
|
+
`{ tlp }` — the TLP 2.0 marking stamped into every export format that has a slot for one
|
|
597
|
+
(`CLEAR`, `GREEN`, `AMBER`, `AMBER+STRICT`, `RED`), overriding the artifact's stored marking. Omit it
|
|
598
|
+
and each export is stamped with the **artifact's own stored `tlp`** (the bundle/folder zips use each
|
|
599
|
+
artifact's own). OpenVEX, CSV, and the DISA
|
|
600
|
+
eMASS worksheet carry no marking slot and ignore it. An invalid value throws a `RangeError` before
|
|
601
|
+
any request.
|
|
602
|
+
|
|
544
603
|
### Inventory Manager (`client.inventoryManager`)
|
|
545
604
|
|
|
546
605
|
`client.inventoryManager.ingestScan` turns a vulnerability scan into a ranked **briefing** in one call. It
|
|
@@ -558,7 +617,7 @@ for (const a of briefing.recommended_actions as Array<Record<string, unknown>>)
|
|
|
558
617
|
// briefing.report is the full /v1/inventory-enrich result (per-asset findings + rollup)
|
|
559
618
|
```
|
|
560
619
|
|
|
561
|
-
`format` is one of `json` / `sbom` / `csv` / `nmap` / `list` / `grype` / `trivy` / `depcheck` / `nessus` / `gvm` / `xlsx`
|
|
620
|
+
`format` is one of `json` / `sbom` / `csv` / `nmap` / `list` / `grype` / `trivy` / `depcheck` / `nessus` / `gvm` / `xlsx` / `vex`
|
|
562
621
|
(you pick it; there is no auto-detection). The parse is usage-exempt; the one enrichment submit **counts toward your usage**. Need
|
|
563
622
|
just the parsed assets? `client.inventoryManager.parseScan(content, format)` returns `{format, items, count}`
|
|
564
623
|
without enriching. (Same workflow the `ccc ingest` CLI wraps.)
|
|
@@ -576,10 +635,18 @@ submit rather than analyze incomplete attachment evidence.
|
|
|
576
635
|
Beyond ingest, `client.inventoryManager` covers the full inventory surface — CRUD, `enrichInventory`,
|
|
577
636
|
`saveEnrichment` (file a finished enrichment into the inventory's history), `listEnrichments`,
|
|
578
637
|
**`compareEnrichments`** (a CVE-matched difference matrix across 2–12 of an inventory's saved enrichments),
|
|
638
|
+
**`getHistory`** / **`iterHistory`** (the inventory's change history — every edit, attach, TLP change, setting, saved enrichment and report, newest first; filter by `types`, `q`, `since`/`until`, `actor`; `getHistory` returns one page with `next_cursor`, `iterHistory` is an async iterator that follows it),
|
|
579
639
|
`importInventory` / `exportInventory`, multi-source import (`parseMulti` / `importMulti`), the safe asset
|
|
580
|
-
editors (`replaceAssets` / `addAssets` / `applyAssetFix`
|
|
640
|
+
editors (`replaceAssets` / `addAssets` / `applyAssetFix` — the fix rewrites every asset carrying the
|
|
641
|
+
product, or just one host's when you pass `group`), `setFavorite`, attachments, and daily automation
|
|
581
642
|
(`getAutomation` / `setAutomation`).
|
|
582
643
|
|
|
644
|
+
`exportInventory` takes an optional `{ tlp }` — the TLP 2.0 marking stamped into every asset-inventory
|
|
645
|
+
format that has a slot for one (`cyclonedx`, `spdx`, `spdx2`, `workbook`; `CLEAR`, `GREEN`, `AMBER`,
|
|
646
|
+
`AMBER+STRICT`, `RED`), overriding the inventory's stored marking. Omit it to stamp the inventory's own
|
|
647
|
+
stored `tlp`. `json`, `csv`, and `list` have no marking slot and ignore it. An
|
|
648
|
+
invalid value throws a `RangeError` before any request.
|
|
649
|
+
|
|
583
650
|
### Report Generator (`client.aiReports`)
|
|
584
651
|
|
|
585
652
|
`client.aiReports` is the Report Generator at `/ai-reports/*` — generate grounded, cite-or-refuse
|
|
@@ -602,31 +669,56 @@ Full surface: `discovery`, `listTemplates`, `listReports`, `getReport`, `getRepo
|
|
|
602
669
|
the raw HTML string up to 10,000,000 bytes; it does not return a stream. Responses are plain objects;
|
|
603
670
|
non-2xx throws the same `UnexpectedStatus`.
|
|
604
671
|
|
|
672
|
+
`exportReport` also takes an optional `{ tlp }` (same five values) stamped into the
|
|
673
|
+
exported document, overriding the report's stored marking; omit it to stamp the report's own stored
|
|
674
|
+
`tlp`. An invalid value throws a `RangeError` before any request.
|
|
675
|
+
|
|
676
|
+
`createDraft` and `generateReport` take an optional `{ tlp }` too: the marking stored on the new report,
|
|
677
|
+
as given. Omit it and the report starts from your default report TLP (the Report Generator's Settings,
|
|
678
|
+
`AMBER` until you set one), raised to the most restrictive marking among its sources. The draft
|
|
679
|
+
response carries the stored `tlp`.
|
|
680
|
+
|
|
605
681
|
### Enricher (`client.enricher`)
|
|
606
682
|
|
|
607
683
|
`client.enricher.enrich` is a thin submit→poll convenience over the async `/v1/artifact-enrich` engine —
|
|
608
684
|
it stages a security artifact (pasted text + uploaded files), submits, polls until done, and resolves to
|
|
609
|
-
the completed report (`{ enrichment_id, report }`).
|
|
610
|
-
|
|
685
|
+
the completed report (`{ enrichment_id, report }`). `client.enricher.enrichEvent` is the sibling
|
|
686
|
+
convenience over the async `/v1/event-enrich` engine: it submits a raw security event (`event` — a
|
|
687
|
+
Defender XDR / Sentinel alert, a SIEM/EDR log line, any JSON or text; ≤200,000 chars — plus an optional
|
|
688
|
+
`eventId` ≤200 chars), polls until done, and resolves to `{ enrichment_id, result }`, where `result` is
|
|
689
|
+
the `EventEnrichmentResult` (per-indicator findings + graded aggregate threat assessment). The **submit
|
|
690
|
+
counts toward your usage**; the poll is exempt. For `enrich`, pass `save: true` to also file the
|
|
691
|
+
finished report into your Artifact Manager library afterward.
|
|
611
692
|
`timeoutMs` is a hard end-to-end polling deadline: status requests, response reads, `onProgress`
|
|
612
693
|
callbacks, and sleeps all share the same remaining budget. `pollIntervalMs` and `timeoutMs` must be
|
|
613
694
|
finite and non-negative.
|
|
614
695
|
|
|
696
|
+
`enrich` also accepts `tlp` in its options — the TLP 2.0 marking stamped into each exported format
|
|
697
|
+
that carries one (`CLEAR`, `GREEN`, `AMBER`, `AMBER+STRICT`, `RED`; default `AMBER`). OpenVEX, CSV,
|
|
698
|
+
and the DISA eMASS worksheet have no slot and ignore it; an invalid value throws a `RangeError` before
|
|
699
|
+
the (billable) submit.
|
|
700
|
+
|
|
615
701
|
```ts
|
|
616
702
|
const result = await client.enricher.enrich({
|
|
617
703
|
text: "CVE-2024-3400 observed in ...",
|
|
618
704
|
save: true,
|
|
619
705
|
});
|
|
620
706
|
console.log(result.enrichment_id);
|
|
707
|
+
|
|
708
|
+
const event = await client.enricher.enrichEvent({
|
|
709
|
+
event: '{"AlertName": "…", "Severity": "High", "IOC": {"Type": "IP", "Value": "1.2.3.4"}}',
|
|
710
|
+
eventId: "INC-2026-0091",
|
|
711
|
+
});
|
|
712
|
+
console.log((event.result as { threat_assessment: { verdict: string } }).threat_assessment.verdict);
|
|
621
713
|
```
|
|
622
714
|
|
|
623
715
|
## Depth control (`include`)
|
|
624
716
|
|
|
625
|
-
The
|
|
717
|
+
The 17 single-entity enrichment endpoints, `searchCve`, `searchKev`, `searchMisp`, `searchCti`, `searchD3fend`, and all four assessment endpoints accept an `include: readonly string[]` parameter that controls how deep the walk goes. `enrichPocSource`, `enrichBatch` (its items carry their own), and the other four search endpoints (`knowledgebase`, `poc`, `vendor`, `csaf`) do not — send `include` there and it is ignored as an unknown field (named in the `X-Ignored-Fields` response header), not rejected. The 17 `enrich*Full` methods bake in a full-walk preset (see [Presets](#presets)); pass `include` to override. `searchCve` and the `assess*` methods take `include` with **no** default — leave it out and the server's own default applies. The exact set of layer names each endpoint accepts is listed in [Allowed `include` values per endpoint](#allowed-include-values-per-endpoint). Invalid values return HTTP 422 with the allowed list in `error.detail`.
|
|
626
718
|
|
|
627
719
|
## Beyond the convenience surface
|
|
628
720
|
|
|
629
|
-
There is no gap to cover: **every one of the
|
|
721
|
+
There is no gap to cover: **every one of the 38 `/v1` operations has a named method** on `CrawlerClient`. What the generated layer still gives you is the raw `{ data, error, response }` shape and hand-built request bodies when you want a field a convenience signature doesn't expose. Pass `client.api` to the endpoint function:
|
|
630
722
|
|
|
631
723
|
```ts
|
|
632
724
|
import { CrawlerClient } from "@crimson-crawler/crimson-crawler-client";
|
|
@@ -645,7 +737,7 @@ const { data, error } = await searchCve({
|
|
|
645
737
|
|
|
646
738
|
### Endpoint catalog
|
|
647
739
|
|
|
648
|
-
#### Enrichment (
|
|
740
|
+
#### Enrichment (19 endpoints)
|
|
649
741
|
|
|
650
742
|
| Function | Imported from | What it returns |
|
|
651
743
|
|---|---|---|
|
|
@@ -653,32 +745,35 @@ const { data, error } = await searchCve({
|
|
|
653
745
|
| `enrichIoc` | `_generated/sdk.gen` | IOC → MISP events, linked techniques, threat assessment |
|
|
654
746
|
| `enrichCwe` | `_generated/sdk.gen` | CWE → CAPEC patterns, ATT&CK techniques, TIE predictions |
|
|
655
747
|
| `enrichCapec` | `_generated/sdk.gen` | CAPEC → linked techniques and weaknesses |
|
|
748
|
+
| `enrichAtlas` | `_generated/sdk.gen` | Adversarial ML technique enrichment |
|
|
656
749
|
| `enrichTechnique` | `_generated/sdk.gen` | ATT&CK technique → groups, software, campaigns, Navigator JSON |
|
|
657
750
|
| `enrichProduct` | `_generated/sdk.gen` | Product/version → affected CVEs, KEV, exploit signals |
|
|
658
751
|
| `enrichPackage` | `_generated/sdk.gen` | Package/ecosystem (OSV.dev) → advisories + per-CVE enrichment |
|
|
659
752
|
| `enrichGroup` | `_generated/sdk.gen` | Threat actor → techniques, software, campaigns |
|
|
660
753
|
| `enrichSoftware` | `_generated/sdk.gen` | Malware/tool → techniques, attribution |
|
|
661
754
|
| `enrichCampaign` | `_generated/sdk.gen` | Campaign → groups, techniques, timeline |
|
|
662
|
-
| `
|
|
663
|
-
| `enrichDisarm` | `_generated/sdk.gen` | Disinformation countermeasures |
|
|
755
|
+
| `enrichDisarm` | `_generated/sdk.gen` | Disinformation technique enrichment, incl. its DISARM family |
|
|
664
756
|
| `enrichDefend` | `_generated/sdk.gen` | D3FEND defensive technique enrichment |
|
|
757
|
+
| `enrichF3` | `_generated/sdk.gen` | MITRE F3 fraud technique → the ATT&CK Enterprise techniques it borrows |
|
|
758
|
+
| `enrichCloak` | `_generated/sdk.gen` | CLOAK concealment technique → knowledge base context |
|
|
665
759
|
| `enrichLocation` | `_generated/sdk.gen` | Regional threat picture |
|
|
666
760
|
| `enrichSector` | `_generated/sdk.gen` | Industry threat picture |
|
|
667
761
|
| `enrichPocSource` | `_generated/sdk.gen` | LLM-summarized analysis of PoC repositories |
|
|
668
762
|
| `enrichBatch` | `_generated/sdk.gen` | Up to 50 mixed enrich items, each with its own `include` |
|
|
669
763
|
|
|
670
|
-
#### Search (
|
|
764
|
+
#### Search (9 endpoints)
|
|
671
765
|
|
|
672
766
|
| Function | Imported from | What it does |
|
|
673
767
|
|---|---|---|
|
|
674
768
|
| `searchCve` | `_generated/sdk.gen` | Filter CVEs by CWE, CPE, CVSS, EPSS, KEV, dates |
|
|
769
|
+
| `searchMisp` | `_generated/sdk.gen` | Events from [our curated MISP](https://crimsoncrawler.com/docs/guides/data-sources/#our-curated-misp) by indicator or event info |
|
|
675
770
|
| `searchCti` | `_generated/sdk.gen` | Cross-knowledge-base search (ATT&CK, CWE, CAPEC, ATLAS, DISARM) |
|
|
676
771
|
| `searchKev` | `_generated/sdk.gen` | Known Exploited Vulnerabilities catalog |
|
|
677
|
-
| `searchMisp` | `_generated/sdk.gen` | Threat intel events by indicator or event info |
|
|
678
772
|
| `searchKnowledgebase` | `_generated/sdk.gen` | Natural-language semantic search over ingested OSINT |
|
|
679
773
|
| `searchVendor` | `_generated/sdk.gen` | Vendor product lookup with CPE identifiers |
|
|
680
774
|
| `searchPoc` | `_generated/sdk.gen` | Proof-of-concept exploit search for a CVE |
|
|
681
775
|
| `searchD3Fend` | `_generated/sdk.gen` | D3FEND defensive technique search |
|
|
776
|
+
| `searchCsaf` | `_generated/sdk.gen` | CSAF vendor-advisory search (CVE, advisory id, publisher, sector, product, CPE, TLP), including CVE-less advisories |
|
|
682
777
|
|
|
683
778
|
#### Assessment (4 endpoints)
|
|
684
779
|
|
|
@@ -689,7 +784,7 @@ const { data, error } = await searchCve({
|
|
|
689
784
|
| `assessGroupExposure` | `_generated/sdk.gen` | Combined threat surface for threat-actor groups |
|
|
690
785
|
| `assessIocPortfolio` | `_generated/sdk.gen` | Multi-indicator threat analysis |
|
|
691
786
|
|
|
692
|
-
#### Async engines (
|
|
787
|
+
#### Async engines (6 endpoints)
|
|
693
788
|
|
|
694
789
|
| Function | Imported from | What it does |
|
|
695
790
|
|---|---|---|
|
|
@@ -697,46 +792,55 @@ const { data, error } = await searchCve({
|
|
|
697
792
|
| `artifactEnrichStatus` | `_generated/sdk.gen` | Per-stage progress, then the finished report (usage-exempt) |
|
|
698
793
|
| `inventoryEnrich` | `_generated/sdk.gen` | Submit an asset inventory for background enrichment → `202` + `enrichment_id` |
|
|
699
794
|
| `inventoryEnrichStatus` | `_generated/sdk.gen` | Per-stage progress, then the finished findings (usage-exempt) |
|
|
795
|
+
| `eventEnrich` | `_generated/sdk.gen` | Submit a raw security event for background enrichment → `202` + `enrichment_id` |
|
|
796
|
+
| `eventEnrichStatus` | `_generated/sdk.gen` | Per-stage progress, then the finished `EventEnrichmentResult` (usage-exempt) |
|
|
700
797
|
|
|
701
798
|
### Allowed `include` values per endpoint
|
|
702
799
|
|
|
703
|
-
Each endpoint accepts its own set of `include` layer names. Pass any subset. Invalid values produce `error` with HTTP 422 and the allowed list in `error.detail
|
|
800
|
+
Each endpoint accepts its own set of `include` layer names. Pass any subset. Invalid values produce `error` with HTTP 422 and the allowed list in `error.detail` — but only on endpoints that declare `include`: send it to one that does not and it is ignored as an unknown field (named in the `X-Ignored-Fields` response header), not rejected.
|
|
704
801
|
|
|
705
802
|
**Enrichment**
|
|
706
803
|
|
|
707
804
|
| Endpoint | Allowed `include` values |
|
|
708
805
|
|---|---|
|
|
709
|
-
| `enrichCve` | `affected_products`, `campaigns`, `capec`, `cwe`, `defend`, `details`, `detections`, `epss`, `exploits`, `groups`, `inferred_chain`, `kev`, `knowledgebase`, `misp`, `mitigations`, `navigator`, `nist_controls`, `osv`, `poc`, `poc_source`, `
|
|
710
|
-
| `enrichProduct` | `affected_products`, `campaigns`, `capec`, `cwe`, `defend`, `details`, `detections`, `epss`, `exploits`, `groups`, `kev`, `knowledgebase`, `misp`, `mitigations`, `navigator`, `nist_controls`, `osv`, `poc`, `risk_summary`, `software`, `ssvc`, `summary`, `techniques`, `tie`, `
|
|
711
|
-
| `enrichPackage` | `affected`, `affected_products`, `campaigns`, `capec`, `cwe`, `defend`, `details`, `detections`, `epss`, `exploits`, `groups`, `inferred_chain`, `kev`, `knowledgebase`, `misp`, `mitigations`, `navigator`, `nist_controls`, `osv`, `poc`, `poc_source`, `references`, `
|
|
712
|
-
| `enrichCwe` | `campaigns`, `capecs`, `cves`, `defend`, `details`, `detections`, `groups`, `knowledgebase`, `mitigations`, `navigator`, `nist_controls`, `software`, `summary`, `techniques`, `tie`, `
|
|
713
|
-
| `enrichCapec`
|
|
714
|
-
| `
|
|
715
|
-
| `
|
|
716
|
-
| `
|
|
717
|
-
| `
|
|
718
|
-
| `
|
|
719
|
-
| `
|
|
720
|
-
| `
|
|
721
|
-
| `
|
|
722
|
-
| `
|
|
806
|
+
| `enrichCve` | `affected_chipsets`, `affected_products`, `android_bulletin`, `campaigns`, `capec`, `capec_full`, `cellular`, `cellular_core`, `certfr_advisories`, `certfr_advisories_full`, `cisa_campaigns`, `cisa_kev`, `criteria`, `csaf_advisories`, `csaf_advisories_full`, `cvss_bt`, `cwe`, `defend`, `defend_full`, `details`, `detections`, `distro_advisories`, `emb3d`, `epss`, `euvd`, `exploits`, `groups`, `inferred_chain`, `jvn`, `kev`, `knowledgebase`, `log_sources`, `log_sources_full`, `metasploit`, `misp`, `mitigations`, `navigator`, `nist_controls`, `nuclei`, `osv`, `osv_restricted`, `ot_context`, `ot_vendor_advisories`, `poc`, `poc_full`, `poc_source`, `sigma`, `sigma_full`, `similar_cves`, `software`, `ssvc`, `summary`, `techniques`, `tie`, `timeline`, `vendor_advisories`, `versions`, `vince`, `vulnrichment`, `weakness_ranks` |
|
|
807
|
+
| `enrichProduct` | `affected_products`, `android_bulletin`, `campaigns`, `capec`, `capec_full`, `cellular`, `cellular_core`, `certfr_advisories`, `certfr_advisories_full`, `cisa_campaigns`, `cisa_kev`, `csaf_advisories`, `csaf_advisories_full`, `cvss_bt`, `cwe`, `defend`, `details`, `detections`, `emb3d`, `epss`, `exploits`, `groups`, `jvn`, `kev`, `knowledgebase`, `lifecycle`, `log_sources`, `metasploit`, `misp`, `mitigations`, `navigator`, `nist_controls`, `nuclei`, `osv`, `osv_restricted`, `ot_context`, `ot_vendor_advisories`, `poc`, `risk_summary`, `sigma`, `software`, `ssvc`, `summary`, `techniques`, `tie`, `vulnrichment`, `weakness_ranks` |
|
|
808
|
+
| `enrichPackage` | `affected`, `affected_chipsets`, `affected_products`, `campaigns`, `capec`, `capec_full`, `cellular_core`, `certfr_advisories`, `certfr_advisories_full`, `cisa_campaigns`, `cisa_kev`, `criteria`, `csaf_advisories`, `csaf_advisories_full`, `cvss_bt`, `cwe`, `defend`, `defend_full`, `details`, `detections`, `emb3d`, `epss`, `exploits`, `groups`, `inferred_chain`, `jvn`, `kev`, `knowledgebase`, `log_sources`, `log_sources_full`, `metasploit`, `misp`, `mitigations`, `navigator`, `nist_controls`, `nuclei`, `osv`, `osv_restricted`, `ot_context`, `ot_vendor_advisories`, `poc`, `poc_full`, `poc_source`, `references`, `severity`, `sigma`, `sigma_full`, `similar_cves`, `software`, `ssvc`, `summary`, `techniques`, `tie`, `timeline`, `vendor_advisories`, `versions`, `vulnrichment`, `weakness_ranks` |
|
|
809
|
+
| `enrichCwe` | `campaigns`, `capecs`, `cves`, `defend`, `defend_full`, `details`, `detections`, `groups`, `knowledgebase`, `log_sources`, `log_sources_full`, `mitigations`, `navigator`, `nist_controls`, `software`, `summary`, `techniques`, `tie`, `versions` |
|
|
810
|
+
| `enrichCapec` | `campaigns`, `cves`, `defend`, `defend_full`, `details`, `detections`, `groups`, `knowledgebase`, `log_sources`, `log_sources_full`, `mitigations`, `navigator`, `nist_controls`, `software`, `summary`, `techniques`, `tie`, `versions` |
|
|
811
|
+
| `enrichAtlas` | `details`, `knowledgebase`, `mitigations`, `summary`, `techniques`, `versions` |
|
|
812
|
+
| `enrichTechnique` | `analytic_details`, `asset_classes`, `atomic_red_team`, `campaigns`, `cisa_campaigns`, `cves`, `defend`, `defend_full`, `details`, `detections`, `fight`, `framework_mappings`, `fraud`, `groups`, `knowledgebase`, `log_sources`, `log_sources_full`, `lolbas`, `lotl`, `misp`, `mitigations`, `navigator`, `nist_controls`, `sigma`, `sigma_full`, `software`, `summary`, `tie`, `versions` |
|
|
813
|
+
| `enrichIoc` | `analytic_details`, `campaigns`, `cisa_campaigns`, `cves`, `defend`, `defend_full`, `detections`, `domain_context`, `galaxies`, `galaxy_clusters_full`, `groups`, `hashlookup`, `inferred_chain`, `knowledgebase`, `listed_on`, `log_sources`, `log_sources_full`, `misp_attributes`, `mitigations`, `navigator`, `network_context`, `nist_controls`, `poc`, `poc_full`, `sightings`, `software`, `summary`, `techniques`, `tie`, `warninglist` |
|
|
814
|
+
| `enrichGroup` | `campaigns`, `cves`, `defend`, `defend_full`, `details`, `detections`, `knowledgebase`, `log_sources`, `log_sources_full`, `misp`, `mitigations`, `navigator`, `nist_controls`, `software`, `summary`, `techniques`, `tie`, `versions` |
|
|
815
|
+
| `enrichSoftware` | `campaigns`, `cves`, `defend`, `defend_full`, `details`, `detections`, `groups`, `knowledgebase`, `log_sources`, `log_sources_full`, `misp`, `mitigations`, `navigator`, `nist_controls`, `summary`, `techniques`, `tie`, `versions` |
|
|
816
|
+
| `enrichCampaign` | `cves`, `defend`, `defend_full`, `details`, `detections`, `groups`, `knowledgebase`, `log_sources`, `log_sources_full`, `mitigations`, `navigator`, `nist_controls`, `software`, `summary`, `techniques`, `tie`, `versions` |
|
|
817
|
+
| `enrichDisarm` | `details`, `knowledgebase`, `summary`, `techniques`, `versions` |
|
|
818
|
+
| `enrichLocation` | `details`, `knowledgebase`, `summary`, `versions` |
|
|
819
|
+
| `enrichSector` | `details`, `knowledgebase`, `summary`, `versions` |
|
|
820
|
+
| `enrichDefend` | `details`, `knowledgebase`, `summary`, `techniques`, `versions` |
|
|
821
|
+
| `enrichF3` | `details`, `knowledgebase`, `summary`, `techniques`, `versions` |
|
|
822
|
+
| `enrichCloak` | `details`, `knowledgebase`, `summary`, `versions` |
|
|
723
823
|
| `enrichPocSource` | _no `include` parameter — pass `repo_url` only_ |
|
|
724
824
|
|
|
725
825
|
**Search**
|
|
726
826
|
|
|
727
827
|
| Endpoint | Allowed `include` values |
|
|
728
828
|
|---|---|
|
|
729
|
-
| `searchCve` | `details` |
|
|
829
|
+
| `searchCve` | `cna`, `details`, `epss_reports`, `kb_rankings`, `kb_rankings_full`, `statistics` |
|
|
830
|
+
| `searchKev` | `statistics` — the deployment-wide corpus coverage block, on by default; pass `include: []` to omit it. |
|
|
831
|
+
| `searchMisp` | `event_reports`, `tags`, `version` default on; `feeds`, `misp_events_full`, `objects`, `sightings`, `stats` are opt-in. Pass `include: []` to omit the defaults. |
|
|
832
|
+
| `searchCti` | `kb_versions` |
|
|
833
|
+
| `searchD3fend` | `versions` — on by default; pass `include: []` to omit it. |
|
|
730
834
|
| All other `search*` endpoints | _no `include` parameter — filter via the request body fields_ |
|
|
731
835
|
|
|
732
836
|
**Assessment**
|
|
733
837
|
|
|
734
838
|
| Endpoint | Allowed `include` values |
|
|
735
839
|
|---|---|
|
|
736
|
-
| `assessTechniqueCoverage` | `coverage_score`, `cves`, `defend`, `detections`, `mitigations`, `navigator`, `nist_controls`, `summary`, `tie` |
|
|
737
|
-
| `assessVulnerabilityExposure` | `defend`, `exploit_chain`, `exploits`, `navigator`, `nist_controls`, `osv`, `prioritized_remediation`, `remediation_plan`, `ssvc`, `summary`, `techniques`, `tie` |
|
|
738
|
-
| `assessGroupExposure` | `cves`, `defend`, `details`, `
|
|
739
|
-
| `assessIocPortfolio` | `campaigns`, `defend`, `detections`, `galaxies`, `groups`, `misp_attributes`, `mitigations`, `nist_controls`, `sightings`, `software`, `summary`, `techniques`, `tie`, `warninglist` |
|
|
840
|
+
| `assessTechniqueCoverage` | `coverage_score`, `cves`, `defend`, `defend_full`, `detections`, `log_sources`, `log_sources_full`, `mitigations`, `navigator`, `nist_controls`, `summary`, `tie`, `versions` |
|
|
841
|
+
| `assessVulnerabilityExposure` | `defend`, `defend_full`, `exploit_chain`, `exploits`, `log_sources`, `log_sources_full`, `navigator`, `nist_controls`, `osv`, `osv_restricted`, `prioritized_remediation`, `remediation_plan`, `ssvc`, `summary`, `techniques`, `tie`, `versions` |
|
|
842
|
+
| `assessGroupExposure` | `cves`, `defend`, `defend_full`, `details`, `log_sources`, `log_sources_full`, `navigator`, `nist_controls`, `summary`, `techniques`, `tie`, `versions` |
|
|
843
|
+
| `assessIocPortfolio` | `campaigns`, `defend`, `defend_full`, `detections`, `galaxies`, `groups`, `log_sources`, `log_sources_full`, `misp_attributes`, `misp_attributes_full`, `misp_events_full`, `mitigations`, `nist_controls`, `sightings`, `software`, `summary`, `techniques`, `tie`, `versions`, `warninglist` |
|
|
740
844
|
|
|
741
845
|
### Calling pattern
|
|
742
846
|
|
|
@@ -817,7 +921,7 @@ Every layer of an enrichment response is independently optional. If a layer wasn
|
|
|
817
921
|
|
|
818
922
|
```ts
|
|
819
923
|
// Defensive scalar access
|
|
820
|
-
const cvss = result.cve?.
|
|
924
|
+
const cvss = result.cve?.cvss_v3_score;
|
|
821
925
|
|
|
822
926
|
// Defensive list iteration
|
|
823
927
|
for (const t of result.techniques ?? []) { /* ... */ }
|
|
@@ -892,7 +996,7 @@ Node 22+ is the supported runtime. Requests use the built-in `fetch` by default.
|
|
|
892
996
|
|---|---|---|
|
|
893
997
|
| `CrawlerClient` | class | Main client class |
|
|
894
998
|
| `CrawlerClientOptions` | interface | Constructor options |
|
|
895
|
-
| `presets` | namespace |
|
|
999
|
+
| `presets` | namespace | 20 named `include` lists |
|
|
896
1000
|
| `CrawlerClientError` | class | Base for everything this package raises |
|
|
897
1001
|
| `MissingCredentials` | class | Constructor missing API key |
|
|
898
1002
|
| `UnexpectedStatus` | class | Non-success or unparseable response |
|